Basic operations of lock table in Oracle

Time:2019-12-1

Query lock table


select object_name,machine,s.sid,s.serial# 
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid ;

Kill the watch(killing in the process)


alter system kill session '543,9206';

 

If you can’t kill it, you can check this to get the SPID(give the obtained SPID to the authorized network administrator, and he will kill you. This belongs to external killing. After killing this pl / SQL, you need to log in again.)


select a.spid,b.sid,b.serial#,b.username 
from v$process a,v$session b 
where a.addr=b.paddr 
and b.status='KILLED';

Query the Sid’s SPID to verify whether the above query is correct


select b.spid,a.osuser,b.program 
from v$session a,v$process b 
where a.paddr=b.addr 
and a.sid=543 

These are all the related knowledge points in this introduction. Thank you for your learning and support for developepaer.