terça-feira, 5 de junho de 2012

Grid Control - Target Databases Size Report

After going through all the MGMT$ views in the sysman schema, I finally found out how to get the size of all monitored targets (oracle databases) in a single table (I was only given access to GC and not any DB).
And after that, how to create a report based on that query in Grid Control (10g).
So here are the steps to create a report and the query for the report. 


Basically you go to reports, click create, add a "table from sql" element then you edit the element and paste the sql statement and with that and one or two more slight touches (names and so forth), you are good to go.
And the query is:
select host_name,target_name, 
ROUND(sum(tablespace_size)/1024/1024/1024,1) totalGB,
round(sum(tablespace_used_size)/1024/1024/1024,1) usedGB,
round((sum(tablespace_used_size))/(sum(tablespace_size))*100,1) usedPerc
From MGMT$DB_TABLESPACES
group by host_name,target_name order by 5 desc


This gives you the host and target name, the total GB allocated, the used GB, and the used percentage.

Sem comentários:

Enviar um comentário