OEM Query
I am working on a query to display the last 30 days of uptime for our databases. This is the query:
select availability_status, target_name, target_type, end_time - start_time from (select availability_status, target_name, target_type,
nvl(end_timestamp, sysdate) end_time,
case when start_timestamp < sysdate -31 then sysdate -31
else start_timestamp end start_time
from MGMT$AVAILABILITY_HISTORY
where nvl(end_timestamp, sysdate) > sysdate -31
and target_name ='FSPERF11')
I get the results below:
AVAILABILITY_STATUS | TARGET_NAME | TARGET_TYPE | END_TIME-START_TIME |
---|---|---|---|
Agent Down | FSPERF11 | oracle_database | 0.006 |
Target Down | FSPERF11 |