Availability Report


set serveroutput on
set echo off
set feedback off

exec availabilityreport(2013,10,'ORACLE','PARTIAL')
set linesize 1000
set pagesize 2000

select substr(a.systemname,1,10) systemname ,to_char(a.startdate,'dd-mm-yy hh24:mi')||' -' Startdate 
,to_char(a.enddate,'hh24:mi') endtime , trunc(a.durationsec/60,2) dur_min, substr(b.exp,1,20) ,decode (a.restart,'Y','Restart DB ',' ') Restart , a.explanation from 
system_status_log a , reasontypecode b
where a.systemname in ( select systemname from SYSTEM_STATUS_LOG_GROUP where groupname='ORACLE' )
and a.startdate between to_date ( '01-10-2013','dd-mm-yyyy') and to_date ('01-01-2013','dd-mm-yyyy' )
and a.availability ='N' and
a.reasontype = b.reasontype
 order by startdate;

select substr(a.systemname,1,10) systemname ,to_char(a.startdate,'dd-mm-yy hh24:mi')||' -' Startdate 
,to_char(a.enddate,'hh24:mi') endtime , trunc(a.durationsec/60,2) dur_min, substr(b.exp,1,20) ,decode (a.restart,'Y','Restart DB ',' ') Restart , a.explanation from 
system_status_log a , reasontypecode b
where a.systemname in ( select systemname from SYSTEM_STATUS_LOG_GROUP where groupname='ORACLE' )
and a.startdate between to_date ( '01-10-2013','dd-mm-yyyy') and to_date ('01-01-2013','dd-mm-yyyy' )
and a.availability ='A' and a.reasontype not in ('I') 
and a.reasontype = b.reasontype
 order by startdate;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: