Check who Use the same record you want to delete

Just Run the Below Script and after this kill the session :

  select owner||’.’||object_name obj
 ,oracle_username||’ (‘||s.status||’)’ oruser
 ,os_user_name osuser
 ,machine computer
 ,l.process unix
 ,’||s.sid||’,’||s.serial#||’ ss
 ,r.name rs
 ,to_char(s.logon_time,’yyyy/mm/dd hh24:mi:ss’) time
 from       v$locked_object l
 ,dba_objects o
 ,v$session s
 ,v$transaction t
 ,v$rollname r
 where l.object_id = o.object_id
and s.sid=l.session_id
and s.taddr=t.addr
and t.xidusn=r.usn
order by osuser, ss, obj ;

To kill the session : 

Alter System kill Session ‘Sid,Serail#’ immediate ;

Thank you
Osama mustafa

One thought on “Check who Use the same record you want to delete

  1. this topic Would be, Check who Use the same table you want to delete,this above query Display Tables not the particular recordthank-you

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.