<pre name="code" class="sql">SQL> select sid, id1, ctime from v$lock where type in ('TM', 'TX');
SID ID1 CTIME
---------- ---------- ----------
23 76239 6
23 327693 6
SQL> select sql_text, to_char(c.LAST_LOAD_TIME,'hh24:mi:ss') from v$sqlarea c where sql_text like '%delete%from%t100';
SQL_TEXT TO_CHAR(
------------------------------ --------
delete from t100 23:56:05
SQL> select to_char(sysdate,'hh24:mi:ss' ),ctime,to_char(sysdate- ctime/24/60/60,'HH24:MI:SS') from v$lock where type in ('TM', 'TX');
TO_CHAR( CTIME TO_CHAR(
-------- ---------- --------
23:56:23 17 23:56:06
23:56:23 17 23:56:06
只需要激活游标的时间<=行锁开始的时间即可
select c.sql_text,
a.*,
b.object_name,
to_date(to_char(sysdate - a.ctime / 24 / 60 / 60, 'HH24:MI:SS'),
'HH24:MI:SS
查看持有行锁的SQL
最新推荐文章于 2023-06-25 19:27:28 发布