A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

Daily Archive Generation Script

1 min read

Daily Archivelog Generation and size:

with daily_summary as
(
select trunc(COMPLETION_TIME,'DD') Day, thread#,
round(sum(BLOCKSBLOCK_SIZE)/1048576) MB,count() Archives_Generated
from v$archived_log
where dest_id=1
group by trunc(COMPLETION_TIME,'DD'),thread#
)
select round(sum(mb)/(max(day) - min(day))) AVG_DAILY_MB from daily_summary;

ARCHIVELOG GENERATION ON DAILY BASIS COUNT

select to_char(COMPLETION_TIME,'DD-MON-YYYY'),count(*)
from v$archived_log group by to_char(COMPLETION_TIME,'DD-MON-YYYY')
order by to_char(COMPLETION_TIME,'DD-MON-YYYY');

OR---

select count(*)
from v$archived_log
where trunc(completion_time)=trunc(sysdate);