oracle管理

--查找事物锁

select * from v$lock where type='TX';

--查找 session

select * from v$session where sid=3016;

--查按时间段查找执行的sqlID

select count(1) from V$ACTIVE_SESSION_HISTORY t1 where t1.SESSION_ID=3016 and t1.SAMPLE_TIME>to_date('2011-06-02 08:50:00','yyyy-mm-dd hh24:mi:ss') and t1.SAMPLE_TIME<=to_date('2011-06-02 09:10:00','yyyy-mm-dd hh24:mi:ss');

--按时间段根据sessionID查找执行的SQL

select to_char(t.SAMPLE_TIME,'yyyy-mm-dd hh24:mi:ss'),t1.sql_text,t1.sql_fulltext,t1.sql_id from V$ACTIVE_SESSION_HISTORY t,v$sql t1 where t.SESSION_ID=3016 and t.sql_id=t1.SQL_ID and t.SAMPLE_TIME>to_date('2011-06-02 08:50:00','yyyy-mm-dd hh24:mi:ss') and t.SAMPLE_TIME<=to_date('2011-06-02 09:20:00','yyyy-mm-dd hh24:mi:ss');

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值