Analysis using the Oracle SQL lock

      Oracle provides a script called utllockt.sql, it will give the lock a tree waiting for showing a lock held by the influence of other sessions session. With this script, you can see what a session is waiting for a lock, which session to hold these locks. The script is located at $ ORACLE_HOME / rdbms / admin directory. Here is a sample script execution utllockt.sql:

SQL> @$ORACLE_HOME/rdbmsa/admin/utllockt.sql
Waiting session Type Mode requested Mode Held    Lock Id1
--------------- ---- -------------- ------------- ---------
682            None None          None          0
 363            TX  Share (S)      Exclusive (X)

      utllockt.sql script display system waits for locks and lock their session waiting for the output tree. ID if a session is immediately beneath another session, said he is waiting for the session. Session ID The left side of the page is all of the sessions are waiting for the session.

      In the above example, the leftmost session ID (682) is waiting for the session to session 363, the display information of each session is given the right lock information it is waiting. Although the session 682 holds a lock, but did not display any information (None) in the lock information column, because it does not wait for any locks. While it requests a session shared display 363 (S) lock, and is waiting for the session 682 on release exclusive table row (X) lock.

Guess you like

Origin www.linuxidc.com/Linux/2019-09/160606.htm