sql>col username for a20 sql> col osuser for a20 sql> col machine for a20 sql> l 1 select sid,serial#,username,osuser,machine,to_char(logon_time,'yyyy/mm/dd hh24:mi:ss') logontime 2* from v$session where paddr in ( select addr from v$process where spid ='&spid') sql> / enter value for spid: 20552 ----------- 阻塞其他会话的oracle进程
old 2: from v$session where paddr in ( select addr from v$process where spid ='&spid') new 2: from v$session where paddr in ( select addr from v$process where spid ='20552')
sql> / enter value for spid: 22580 ----------- 被阻塞的oracle进程
old 2: from v$session where paddr in ( select addr from v$process where spid ='&spid') new 2: from v$session where paddr in ( select addr from v$process where spid ='22580')
接下来,再着重看看sid 为37的会话在library cache中请求和持有对象锁的详细信息: sql> col kglnaobj for a30 sql> col user_name for a10 sql> l 1 select inst_id,user_name,kglnaobj,kgllksnm,kgllkuse,kgllkses,kgllkmod,kgllkreq 2* from x$kgllk where kgllksnm = 37 sql> /
sql> set linesize 2000 sql> l 1 select inst_id,user_name,kglnaobj,kgllksnm,kgllkuse,kgllkses,kgllkmod,kgllkreq,kgllkpns,kgllkhdl 2* from x$kgllk where kgllksnm in (30,37) order by kgllksnm,kglnaobj sql> /