ORACLE常用监控语句(未完待续)

--查询日志的切换频率
select  t1.RECID as srecid
       ,t2.RECID as erecid
       ,t1.FIRST_TIME as stime
       ,t2.FIRST_TIME as etime
       ,round((t2.FIRST_TIME-t1.FIRST_TIME)*1440,2) as minutes
from v$log_history t1,v$log_history t2
where t1.RECID+1=t2.RECID and /*选择时间段*/t1.FIRST_TIME between trunc(sysdate)/*起始*/ and sysdate/*终止*/
order by t1.RECID desc

 

--查看经常发生dml操作的表
select t1.OWNER,t1.OBJECT_NAME,t1.OBJECT_TYPE,t2.db_block_changes_total
from dba_objects t1
join (
      select obj#,sum(db_block_changes_total) db_block_changes_total
      from dba_hist_seg_stat
      group by obj#
) t2
on t1.OBJECT_ID=t2.obj#
where t1.OBJECT_TYPE='TABLE'
order by db_block_changes_total desc

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值