关于log的一些脚本

查询日志切换的频率(最近7天)RAC 和非RAC通用

select a.thread#,b.recid,to_char(b.first_time,'yyyy-mm-dd hh:mi:ss') start_time,a.recid,

to_char(a.first_time,'yyyy-mm-dd hh:mi:ss') end_time,round(((a.first_time-b.first_time)*25)*60,2) minutes from

v$log_history a,v$log_history b where a.recid=b.recid+1 and sysdate-a.first_time<8 and a.thread#=b.thread#

order by a.thread#, a.first_time ;

查询最近7天日志文件的度量

select b.destination "Destination", trunc(completion_time) completion_time,sum(blocks*block_size/1024/1024) "Total_Size(Gb)" from v$archived_log a,v$archive_dest b
where a.dest_id=b.dest_id and sysdate-completion_time<8 group by trunc(completion_time),b.destination;

查询未被删除的归档日志总量

select sum(blocks*block_size/1024/1024/1024)"Total_Size(Gb)" from v$archived_log where deleted='NO';

查询实例启动以来生成的总的归档日志总量

select sum(blocks*block_size/1024/1024/1024) "Total_Size(Gb)" from v$archived_log where deleted='YES';

查询每个归档目的地生成的归档日志总量

select dest_id,sum(blocks*block_size/1024/1024/1024)"Total_Size(Gb)" from v$archived_log where deleted='NO' group by dest_id;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值