RE: How to find the locking "event"

  • From: <post.ethan@xxxxxxxxx>
  • To: <lyallbarbour@xxxxxxxxxxxxxxx>, "'oracle-l'" <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 23 Oct 2018 11:14:30 -0500

Threw a few views and a few SQLs out there that have always worked for me in 
giving me just about everything I needed to know. Have not tested in a couple 
years but worked on Oracle 12 at one point. Most of them probably found here 
directly or indirectly over the years. 

 

https://gist.github.com/ethanpost/8004370dcfa7a6a6516f5bed0c18db74

 

Some digging in gv$session_event may also give you what you need if your 
licensed.

 

Ethan Post

https://www.linkedin.com/in/ethanraypost/

https://arclogicsoftware.com

https://twitter.com/poststop

 

 

 

 

From: oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx> On Behalf 
Of Lyall Barbour
Sent: Tuesday, October 23, 2018 10:48 AM
To: oracle-l <oracle-l@xxxxxxxxxxxxx>
Subject: How to find the locking "event"

 

Hello,

  Debugging Off-the-shelf applications.  Best part of my job...

 

Oracle 12.1.0.2 - Multitenant 

SLES 11 SP4

 

  I have found that an INSERT is having to wait a ton on TX: Row Lock 
Contention from an intense Document Management application bought, installed 
and configured about a year and a half ago - Open Text.

  Here's my lock/block query that's been the most useful to this point:

 

SELECT o.object_name, t.start_time, sysdate, s.sid, s.status
   , s.machine, s.sql_id
   , to_char(s.logon_time,'DD/MON/YY HH24:MI:SS') logon_time
FROM v$transaction t, v$session s, v$locked_object l, dba_objects o, 
dba_blockers b
WHERE s.saddr = t.ses_addr
and s.sid = l.session_id
and l.object_id = o.object_id
and s.sid = b.holding_session
ORDER BY start_time;

 

the results of the query find that one blocking session has an open Transaction 
for about 15 to 30 seconds, with locks on 15 tables.   Other sessions are 
waiting to insert into one of those tables and really bogging down the system.

 

How do i find the syntax/code that the blocking session ran to lock those 15 
objects, in the first place?

 

OBJECT_NAME                    START_TIME           SYSDATE                     
 SID STATUS   MACHINE                                                          
SQL_ID        LOGON_TIME                 
------------------------------ -------------------- --------------------- 
---------- -------- 
---------------------------------------------------------------- ------------- 
---------------------------
DTREEACL                       10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxx                                                 
 fppmu8hcw3y1d 18/OCT/18 22:41:25         
DTREECORE                      10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
LLATTRDATA                     10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxx                                                 
 fppmu8hcw3y1d 18/OCT/18 22:41:25         
LLATTRBLOBDATA                 10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
DTREEMULTILINGUAL              10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxx                                                 
 fppmu8hcw3y1d 18/OCT/18 22:41:25         
DSUGGESTWORDSPENDING           10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
NOTIFYEVENTS                   10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxxx                                                
  fppmu8hcw3y1d 18/OCT/18 22:41:25         
WEBNODESMETA_EN_US             10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
DBROWSEANCESTORSCORE           10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxxxx                                               
   fppmu8hcw3y1d 18/OCT/18 22:41:25         
DTREEANCESTORS                 10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxx                                                 
 fppmu8hcw3y1d 18/OCT/18 22:41:25         
DFACET_OWNER                   10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
DFACET_OBJECTTYPE              10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
DFACET_MODIFYDATE              10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxxx                                                 
 fppmu8hcw3y1d 18/OCT/18 22:41:25         
DFACET_ATTR_2V4D_R             10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25         
DTREENOTIFY                    10/23/18 11:34:56    23-OCT-18 11.35.23 AM       
 668 INACTIVE NGIC\xxxxxxxxxxx                                                  
fppmu8hcw3y1d 18/OCT/18 22:41:25

 

TIA

 

Lyall Barbour

-- //www.freelists.org/webpage/oracle-l ;

Other related posts: