--查每天产生归档日志大小
alter session set nls_date_format='yyyy.mm.dd hh24:mi:ss';
select trunc(completion_time) as ARC_DATE,
count(*) as COUNT,
round((sum(blocks * block_size) / 1024 / 1024), 2) as ARC_MB
from v$archived_log
group by trunc(completion_time)
order by trunc(completion_time) desc;
--查最近一周每天的归档日志生成量
alter session set nls_date_format='yyyy.mm.dd hh24:mi:ss';
select logtime,
count(*),
round(sum(blocks * block_size) / 1024 / 1024) size_mb
from (select trunc(first_time, 'dd') as logtime, a.blocks, a.block_size
from v$archived_log a
where a.dest_id = 1
and a.first_time > trunc(sysdate - 7))
group by logtime
order by logtime desc;
--查每小时产生归档日志大小
alter session set nls_date_format='yyyy.mm.dd hh24:mi:ss';
select logtime,
count(*),
round(sum(blocks * block_size) / 1024 / 1024) size_mb
from (select trunc(first_time, 'hh') as logtime, a.blocks, a.block_size
from v$archived_log a
where a.dest_id = 1
and a.first_time > trunc(sysdate))
group by logtime
order by logtime desc;
--查询当天每小时各个实例归档日志生成量
alter session set nls_date_format='yyyy.mm.dd hh24:mi:ss';
select thread#,
logtime,
count(*),
round(sum(blocks * block_size) / 1024 / 1024) size_mb
from (select a.thread#,
trunc(first_time, 'hh') as logtime,
a.blocks,
a.block_size
from v$archived_log a
where a.dest_id = 1
and a.first_time > trunc(sysdate))
group by thread#, logtime
order by thread#, logtime desc;
--查询最近一周每天各个实例归档日志生成量
alter session set nls_date_format='yyyy.mm.dd hh24:mi:ss';
select thread#,
logtime,
count(*),
round(sum(blocks * block_size) / 1024 / 1024) size_mb
from (select thread#,
trunc(first_time, 'dd') as logtime,
a.blocks,
a.block_size
from v$archived_log a
where a.dest_id = 1
and a.first_time > trunc(sysdate - 7))
group by thread#, logtime
order by thread#, logtime desc;
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




