如何查看oracle的锁是哪条sql语句引起的8876e7eb

 

如何查看oracle的锁是sql语句引起的

 

1、查看引起锁的session_id

 sync4j启动的进程

select * from v$locked_object where os_user_name='sync4j'

找到seesion_ID=139

 

2、找到引起的sql语句
SELECT a.username,
a.machine,
a.program,
a.sid,
a.serial#,
a.status,
c.piece,
c.sql_text
FROM v$session a,
v$sqltext c
WHERE a.sid =
139
and a.sql_address=c.address(+)
ORDER BY c.piece

v$sqltext就是引起锁的sql语句了

你可能感兴趣的:(oracle)