-- =======================================================================
-- Informa quantidade archive gerado por dia / hora
-- =======================================================================
set pages 1000
col Day for a10
col MB for 99999999
select
trunc(COMPLETION_TIME,'DD') Day,
thread#,
count(*) Archives_Generated,
round(sum(BLOCKS*BLOCK_SIZE)/1048576) MB
from v$archived_log
where trunc(COMPLETION_TIME,'DD') >= sysdate - 30
group by trunc(COMPLETION_TIME,'DD'),thread# order by 1;
-- Archivelog generation on a daily basis:
select
trunc(COMPLETION_TIME,'DD') Day,
thread#,
round(sum(BLOCKS*BLOCK_SIZE)/1048576) MB,
round((sum(BLOCKS*BLOCK_SIZE)/1048576)/1024) GB,
count(*) Archives_Generated
from v$archived_log
group by trunc(COMPLETION_TIME,'DD'),thread# order by 1;
-- Archive log generation on an hourly basis:
select
trunc(COMPLETION_TIME,'HH') Hour, thread# ,
round(sum(BLOCKS*BLOCK_SIZE)/1048576) MB,
round(sum(BLOCKS*BLOCK_SIZE)/1048576)/1024 GB,
count(*) Archives
from v$archived_log
group by trunc(COMPLETION_TIME,'HH'),thread# order by 1 ;