Sunday, November 8, 2015

How much Archives generated Today with Switches - Script

you can modify the below script by modifying sysdate -1,-2,-3 .. etc for the number of days you want.



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 "todays_size_gb",
        count (*) as "number_of_switches_today"
  from  v$archived_log
  where dest_id = 1
    and first_time >= sysdate - 1;


No comments:

Post a Comment