DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Tuesday, August 25, 2015

Script to find no of archives generated per day.



Query to find no of archives generated per day.

set pagesize 10000 linesize 10000
set feedback 0
column date format a18

select  to_char(first_time, 'YYYY-MM-DD Dy') as "date",
        round( sum((blocks + 1) * block_size)
          / 1024 / 1024 / 1024) as "size_gb",
        count (*) as "number_of_switches_per_day"
  from  v$archived_log
  where dest_id = 1
  group by to_char(first_time,'YYYY-MM-DD Dy')
  order by to_char(first_time,'YYYY-MM-DD Dy');

select  round(sum((blocks + 1) * block_size)
              / 1024 / 1024 / 1024) as "weekly_size_gb",
        count (*) as "number_of_switches_per_week"
  from  v$archived_log
  where dest_id = 1
    and first_time >= sysdate - 7;

No comments: