GATHER_STATS_JOB is causing library cache lock events (blocking)

Hi,
I am running an Oracle 10g (2.0.3) RAC configuration on a Solaris 5.10 SPARC-64 box, and a couple of days ago I started to receive blocking alert due a library cache lock even caused by the scheduled GATHER_STATS_JOB. Is there any way to identify which is the table/object that is not being able to be process by the GATHER_STATS_JOB?
Regards,
Alberto

I found this on metalink:
How to find the blocker
a. find the p1raw value of the 'library cache pin', e.g.
select sid, event, p1raw from v$session_wait where event = 'library cache pin';
SID EVENT P1RAW
150 library cache pin 288822D4
select * from dba_kgllock where kgllkreq > 0;
KGLLKUSE KGLLKHDL KGLLKMOD KGLLKREQ KGLL
2CB1F978 288822D4 0 3 Pin
b. find the locked object via x$kglob, e.g.
select kglnaown, kglnaobj from x$kglob where kglhdadr = '288822D4';
KGLNAOWN KGLNAOBJ
SYS DUMMY

Similar Messages

  • Library cache lock wait event

    Hi,
    I am experience hanging in my database. I am using 10.2.0.3 on Solaris 5.10.
    I am having automatic processes that drop the schema and recreate the schema and upload the new data. Since the last few days i am facing in hanging while dropping the schema. I checked and found "Library cache lock" event that caused other processes also in the hanged state. I am trying to find out the reason but not able to crack.
    Can some one advice me?
    Thanks

    Hi,
    There exists an concurrency problem with respect to the object - resource utilization.
    - One client can prevent other clients from accessing the same object
    - The client can maintain a dependency for a long time (for example, no other client can change the object)
    check the from v$session_wait (query taken from the http://www.dba-oracle.com/m_library_cache_pin.htm - for your reference)
    select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
    4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
    7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
    11, 'PACKAGE BODY', 12, 'TRIGGER',
    13, 'TYPE', 14, 'TYPE BODY',
    19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
    22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
    28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
    32, 'INDEXTYPE', 33, 'OPERATOR',
    34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
    40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
    42, 'MATERIALIZED VIEW',
    43, 'DIMENSION',
    44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
    48, 'CONSUMER GROUP',
    51, 'SUBSCRIPTION', 52, 'LOCATION',
    55, 'XML SCHEMA', 56, 'JAVA DATA',
    57, 'SECURITY PROFILE', 59, 'RULE',
    62, 'EVALUATION CONTEXT',
    'UNDEFINED') object_type,
    lob.KGLNAOBJ object_name,
    pn.KGLPNMOD lock_mode_held,
    pn.KGLPNREQ lock_mode_requested,
    ses.sid,
    ses.serial#,
    ses.username
    FROM
    x$kglpn pn,
    v$session ses,
    x$kglob lob,
    v$session_wait vsw
    WHERE
    pn.KGLPNUSE = ses.saddr and
    pn.KGLPNHDL = lob.KGLHDADR
    and lob.kglhdadr = vsw.p1raw
    and vsw.event = 'library cache pin'
    order by lock_mode_held desc
    Resolution might - you need to check the time it takes (the script to drop the schema) and it loads - either doing from parallel sessions or in serial order. I doubt it, till the schema get dropped completely it should not be accessible to any other applications - either objects too, that makes the rise to concurrency Issue with respect to library cache waits - the other sessions are trying access the object.
    - Pavan Kumar N
    - ORACLE 9i/10g - OCP
    http://www.oracleinternals.blogspot.com

  • Kill a session that is holding library cache lock!!

    Hi, all.
    What will happen if I kill a session that is holding library cache lock??
    Currently, the session is pending with library cache lock.
    I cannot see any locks in v$lock.
    If I kill the session, will oracle release the library cache lock??
    Thanks and Regards.

    What output do you get from the following script?
    liblock.sql:
    select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
                          4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
                          7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
                          11, 'PACKAGE BODY', 12, 'TRIGGER',
                          13, 'TYPE', 14, 'TYPE BODY',
                          19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
                          22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
                          28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
                          32, 'INDEXTYPE', 33, 'OPERATOR',
                          34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
                          40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
                          42, 'MATERIALIZED VIEW',
                          43, 'DIMENSION',
                          44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
                          48, 'CONSUMER GROUP',
                          51, 'SUBSCRIPTION', 52, 'LOCATION',
                          55, 'XML SCHEMA', 56, 'JAVA DATA',
                          57, 'SECURITY PROFILE', 59, 'RULE',
                          62, 'EVALUATION CONTEXT',
                         'UNDEFINED') object_type,
           lob.KGLNAOBJ object_name,
           lk.KGLLKMOD lock_mode_held,
           lk.KGLLKREQ lock_mode_requested,
           ses.sid,
           ses.serial#,
           ses.username
      FROM
           x$kgllk lk,
           v$session ses,
           x$kglob lob,
           v$session_wait vsw
      WHERE
       lk.KGLLKUSE = ses.saddr and
       lk.KGLLKHDL = lob.KGLHDADR
       and lob.kglhdadr = vsw.p1raw
       and vsw.event = 'library cache lock'
    order by lock_mode_held desc
    /It should provide a locking graph of all sessions that are blocked on the 'library cache lock' event, and what sessions are the blockers.
    Hope that helps,
    -Mark
    PS It needs to run as SYSDBA, due to the X$KGLLK reference.

  • How to interprete P* value of v$session in 10g??( event=library cache lock)

    Hi, all.
    The database is 2 node RAC (10.2.0.2.0) on 32-bit windows 2003 EE SP1.
    One session on Node 2 is waiting for "library cache lock" to be released
    for "178874" seconds.
    The detail for the session is as follows:
    SID : 444
    TYPE : USER
    PROGRAM : ORACLE.EXE(J001)
    MODULE : EM_PING
    EVENT : library cache lock ▲
    WAIT_CLASS : Concurrency
    P1TEXT : handle address ▲
    P1 : 1206060532 ▲
    P1RAW : 47E305F4 ▲
    P2TEXT : lock address ▲
    P2 : 1108075084 ▲
    P2RAW : 420BE24C ▲
    P3TEXT : 100*mode+namespace ▲
    P3 : 301 ▲
    P3RAW : 0000012D ▲
    WAIT_IN_SECONDS : 178874
    BLOCKING_SESSION : <-- NONE
    There is no blocking session in v$lock.
    Could you teach me how to interprete P* value of v$session in case of "library cache lock"??
    Thanks and Regards.

    Dear user449027.
    Thanks for your reply.
    column wevent format a20
    column bevent format a20
    select
    waiter.sid waiter,
    waiter.p1raw wlockp1,
    waiter.event wevent,
    blocker_event.sid blocker,
    blocker_event.event bevent
    from
    x$kglpn p,
    gv$session blocker_session,
    gv$session_wait waiter,
    gv$session_wait blocker_event
    where
    p.kglpnuse=blocker_session.saddr and
    p.kglpnhdl=waiter.p1raw and
    (waiter.event like 'library cache lock' ) and
    blocker_event.sid=blocker_session.sid
    order by
    waiter.p1raw,waiter.sid
    returns NO rows.
    The database is 2 Node RAC db.
    Do both instances share "x$kglpn"??
    On Node2, sid=444 session is waiting for library cache lock.
    I issued the following script.
    select kglnaobj, kgllkreq
    from x$kgllk x , v$session s
    where s.saddr = x.kgllkses
    and x.kgllkhdl=s.p1raw
    and s.sid = 444;
    KGLNAOBJ KGLLKREQ
    MGMT_JOB_EXEC_SUMMARY 2
    The owner of MGMT_JOB_EXEC_SUMMARY is sysman.
    And MGMT_JOB_EXEC_SUMMARY is valid.
    I issued "DESC MGMT_JOB_EXEC_SUMMARY".
    "DESC MGMT_JOB_EXEC_SUMMARY" hangs.
    The sid=444 session is waiting for almost 2 days.
    I stopped dbconsole and emagent.
    Thanks and Regards.

  • Oracle RAC 9i LMD library cache lock top wait event

    We are experiencing the library cache lock as our top wait event. Even thought the box is currently idle, The Global Enqueue Service Daemon (LMD) is taking up CPU cycles. The background process is also logging to trace "skgxpdocon: warning outstanding accept handle count has reached new high water mark 245000".
    Any help would be appreciated.
    Thanks

    There is a new patch for this - check out p4673610 on metalink. We have also experience the problem in 9.2.0.8.

  • How to detect the object or session in a database with library cache lock

    Hi Everyone,
    We've been experiencing frequent and high time waits for this event: library cache lock.
    - What causes this?
    - Is there a way to detect the object being locked?
    (this doesnt show up in V$LOCK)
    - Is there a way to detect the session that is causing the lock? aka blocking session?
    (I can detect the objects being blocked, they show up in v$session)
    thanks,

    Similar post is here, maybe that helps already:
    library cache lock
    And You can read this as well:
    http://www.ixora.com.au/q+a/0101/19235723.htm

  • Library cache lock in statspack report

    Hi,
    We have some production issues on my database from long back. So i had taken snapshot and applied in one of analyzer tool.
    In the TOP 5 Events they mentioned that library cache lock is 94.46 % , i am afraiding by seeing this number. And in there analyzing report they didn't populate the recommendations.
    Please suggest me why the library cache lock showing 94.46%.
    And i am also adding the other statistics as well.
    Please go though and suggest me into right way.
    Top 5 Events
    Event     Percentage of Total Timed Events
    library cache lock      94.46%
    PX Deq: Table Q Normal      1.51%
    db file sequential read      1.23%
    direct path read      1.06%
    PX Deq Credit: send blkd      .55%
    Wait Events
    Event     Waits     Wait Time (s)     Avg Wait (ms)     Waits/txn
    library cache lock      45,777     137,044.09     2994     10.6
    PX Deq: Table Q Normal      1,263,860     2,196.88     2     292.2
    db file sequential read      80,826     1,780.39     22     18.7
    direct path read      244,968     1,543.45     6     56.6
    PX Deq Credit: send blkd      3,200,312     794.01     0     739.8
    PX Deq: Execute Reply      529     570.82     1079     0.1
    db file scattered read      42,356     524.47     12     9.8
    library cache pin      93     286.44     3080     0.0
    PX qref latch      96     90.05     938     0.0
    log file sync      4,685     71.9     15     1.1
    Instance Activity Stats
    Statistic     Total     per Second     per Trans
    SQL*Net roundtrips to/from client     277,935     975.2     64.3
    consistent gets      8,112,050     28,463.3     1,875.2
    db block changes      446,986     1,568.4     103.3
    execute count      31,369     110.1     7.3
    parse count (hard)      65     0.2     0.0
    parse count (total)      30,083     105.6     7.0
    physical reads      3,041,562     10,672.2     703.1
    physical reads direct      2,624,892     9,210.2     606.8
    physical writes      151,245     530.7     35.0
    physical writes direct      77,161     270.7     17.8
    redo writes      4,933     17.3     1.1
    session cursor cache hits      17,868     62.7     4.1
    sorts (disk)      2     0.0     0.0
    sorts (memory)      2,006     7.0     0.5
    table fetch continued row      72,024     252.7     16.7
    table scans (long tables)      323     1.1     0.1
    table scans (short tables)      3,371     11.8     0.8
    8 Recommendations:

    You need to figure out what session is holding the blocking library cache lock.
    Here's a script that will help you do that:
    select decode(lob.kglobtyp, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
    4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
    7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
    11, 'PACKAGE BODY', 12, 'TRIGGER',
    13, 'TYPE', 14, 'TYPE BODY',
    19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
    22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
    28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
    32, 'INDEXTYPE', 33, 'OPERATOR',
    34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
    40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
    42, 'MATERIALIZED VIEW',
    43, 'DIMENSION',
    44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
    48, 'CONSUMER GROUP',
    51, 'SUBSCRIPTION', 52, 'LOCATION',
    55, 'XML SCHEMA', 56, 'JAVA DATA',
    57, 'SECURITY PROFILE', 59, 'RULE',
    62, 'EVALUATION CONTEXT',
    'UNDEFINED') object_type,
    lob.KGLNAOBJ object_name,
    lk.KGLLKMOD lock_mode_held, lk.KGLLKREQ lock_mode_requested,
    ses.sid,
    ses.serial#,
    ses.username
    FROM
    x$kgllk lk,
    v$session ses,
    x$kglob lob,
    v$session_wait vsw
    WHERE
    lk.KGLLKUSE = ses.saddr and
    lk.KGLLKHDL = lob.KGLHDADR
    and lob.kglhdadr = vsw.p1raw
    and vsw.event = 'library cache lock'
    order by lock_mode_held desc
    -Mark

  • Sessions hangs with library cache lock

    Der all,
    11.1.0.7 rac on solaris 10
    Our workflow session yesterday hanged on a particular step the session was waiting on a library cache lock (by using query select event,p1,p2 from v$session where sid=<my_sid>;)
    when I checked the blocking session , using the note 122793.1 and http://oracle-study-notes.blogspot.com/2009/05/resolving-library-cache-lock-issue.html and http://oracle-study-notes.blogspot.com/2009/05/find-session-holding-library-cache-lock.html .
    I found that
    SQL> SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
      2   WHERE SADDR in
      3    (SELECT KGLLKSES FROM X$KGLLK LOCK_A
      4     WHERE KGLLKREQ > 0
      5       AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
                     WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
      6    7                   AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
      8                   AND KGLLKREQ = 0)
      9    );
    Enter value for saddr_of_blking_sess: 0000000770E494E0
    old   6:                  WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
    new   6:                  WHERE KGLLKSES = '0000000770E494E0'
      SID USERNAME        TERMINAL   PROGRAM
      817 SYS             UNKNOWN    oracle@tabsdb07
                                      (J002)
      828 SYS             UNKNOWN    oracle@tabsdb07
                                      (J001)after killing the session, the library cache locks still remained.when I ran trace on the session
    select /*+ all_rows ordered */ A.rowid, :1, :2, :3
    from
    "DBMRPT"."DBM_BIAUTO_SUSP" A , "DBMRPT"."DBM_CDR_FILE_HEAD" B where(
      "A"."CDR_TYPE" is not null and "A"."FILE_ID" is not null) and(
      "B"."CDR_TYPE" (+)= "A"."CDR_TYPE" and "B"."FILE_ID" (+)= "A"."FILE_ID")
      and( "B"."CDR_TYPE" is null or "B"."FILE_ID" is null)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.01          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.01          0          0          0           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS   (recursive depth: 3)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      row cache lock                                  5        0.00          0.00
      db file sequential read                   295932636        0.07       5066.63
      gc cr grant 2-way                          727813        0.02        233.95
      latch: gc element                              80        0.00          0.00
      latch: gcs resource hash                      870        0.00          0.00
      latch free                                      2        0.00          0.00
      gc remaster                                     9        2.00         12.91
      gcs drm freeze in enter server mode             9        0.54          2.08
      latch: object queue header operation           66        0.00          0.05
      latch: cache buffers chains                    15        0.03          0.20
      resmgr:internal state change                   63        0.10          5.30
      latch: cache buffers lru chain               1260        0.00          0.01
    ********************************************************************************Please guide
    Kai
    all this time sql_id for the session remanined in the sql :
    ALTER TABLE DBMRPT.DBM_BIAUTO_SUSP ENABLE CONSTRAINT DBS1_DCFH_FK ..

    hi..
    Go through [http://orainternals.wordpress.com/2009/06/02/library-cache-lock-and-library-cache-pin-waits/]
    Anand

  • High wait on Library Cache Lock while doing ALTER TABLE EXCHANGE PARTITION

    We are observing a very high wait time on "Library cache lock" while performing Exchange partition.
    Here we go
    ALTER TABLE PSALESREG EXCHANGE PARTITION P123
    WITH TABLE PBKPSALESREF WITHOUT VALIDATION
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.11 *6684.73* 2 9 2 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.11 6684.73 2 9 2 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    library cache lock 2274 3.12 *6681.32*
    Is it a bug? is anyone there who experienced the same issue?
    Rgds

    Maurice Muller wrote:
    Hi,
    As far as I remember a exchange partition can only be done when no other query is accessing the table.
    So you should check if any other queries are executed against the table PSALESREG while you do the exchange partition. Maurice,
    queries won't block the exchange operation but continue to read from the "original", exchanged segment; this "cross-DDL" read consistency is a feature that has been introduced a long time ago.
    But any kind of (long-running) DML should effectively prevent the exchange operation. Still I would assume that this shouldn't show up as "library cache lock", but you would get an "ORA-00054: resource busy" error.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • A killed session is still waiting for "library cache lock" for hours

    Hello everybody
    Today on my environment I killed a session while compiling a procedure that was taking too much time. Now, after more than a couple of hours that session is still there waiting for "library cache lock". I really can't understand why it's taking that much. Can anyone give me some hints about this. I already read the docs to find something to explain this case but I haven't been able to find the source of this lock.
    Down here I past a description of what that procedure has been doing.
    Processing ...
    SELECT saddr, SID, command,taddr,lockwait,status,action
    FROM v$session
    WHERE SID = 636
    Query finished, retrieving results...
          SADDR      SID     COMMAND         TADDR      LOCKWAIT   STATUS              ACTION
    C00000023C7A2438     636        24 C000000238FB1650          KILLED   Main session      
    1 row(s) retrieved
    Processing ...
    SELECT *
    FROM v$session_wait
    WHERE SID = 636
    Query finished, retrieving results...
    SID SEQ# EVENT               P1TEXT         P1                   P1RAW            P2TEXT       P2                   P2RAW            P3TEXT             P3  P3RAW            WAIT_CLASS_ID  WAIT_CLASS#   WAIT_CLASS   WAIT_TIME SECONDS_IN_WAIT  STATE
    636 247  library cache lock  handle address 13835058063333980008 C0000001DFECF768 lock address 13835058064378433728 C00000021E2E10C0 100*mode+namespace 301 000000000000012D 3875070507     4             Concurrency  38        6089            WAITED KNOWN TIME
    1 row(s) retrieved
    Processing ...
    select *
    from v$session_event
    where sid = 636
    Query finished, retrieving results...
    SID EVENT                         TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT MAX_WAIT TIME_WAITED_MICRO   EVENT_ID WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS
    636 db file sequential read                 3              0           4          1,5        3             44994 2652584166    1740759767           8  User I/O  
    636 library cache lock                     58             57       16737       288,56      293         167366653  916468430    3875070507           4  Concurrency
    636 SQL*Net message to client              94              0           0            0        0                46 2067390145    2000153315           7  Network   
    636 SQL*Net more data to client            25              0           0            0        0               294  554161347    2000153315           7  Network   
    636 SQL*Net message from client            94              0        2848         30,3     2246          28480966 1421975091    2723168908           6  Idle      
    636 SQL*Net more data from client          28              0           0         0,02        0              4471 3530226808    2000153315           7  Network   
    636 SQL*Net break/reset to client           2              0           0         0,01        0               194 1963888671    4217450380           1  Application
    7 row(s) retrieved                            Thanks
    Bye Alessandro
    Edited by: Alessandro Rossi on 11-nov-2008 11.37

    Alessandro Rossi wrote:
    At the end I decided to kill the server process and now everything goes fine. i don't know why but the problem seems associated to the client application used to compile the procedure, because every time the developer tried to compile it using plslqldeveloper 7.14 through "edit-procedure" from his host the behavior was always like I just described before while the compilation of that procedure with other tools or from other hosts runs just fine.
    Actually I haven't been able to find the reason for this, there was no view, among the ones I queried, telling me who was holding the resources, other than the blocked session, and it seems very hard that such a behavior may depend on the client tool used.
    Thanks anywayAlessandro,
    you may want to check the settings of this particular PL/SQL Developer installation. If I remember correctly then there are several settings in PL/SQL Developer related to how the tool connects to the database and compiles objects, e.g. "Safe compilation (using temporary compilation object)", "Background compilation", "Multi-Session" support etc. that might lead to situations where the tool could block itself for instance.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • 先library cache pin还是先library cache lock??

    Question from Oracler:
    session1 给test 建主键
    session2 select test 出现library cache lock
    session3 select test 出现library cache pin
    不是说先获得library cache lock再library cache pin吗
    session1以exclusive模式获得 library cache lock
    session2 以shared模式请求 library cache lock ,session1未释放,所以session2 wait
    那session3 什么解释呢????

    as maclean answer:
    SQL> select * from V$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    session A  SQL> alter table maclean add a10 char(2000) default 'maclean';
    session B:  select 1 from maclean where rownum=1;      ==> hang here !
    session C:  select 1 from maclean where rownum=1;   ==> SAME SQL, hang here !
    SQL> select event from v$session where event like 'library%';
    EVENT
    library cache lock
    library cache pin
    session 4:
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    SQL> oradebug tracefile_name;
    /s01/admin/G10R21/udump/g10r21_ora_6208.trc
        SO: 0x84f5b4a8, type: 4, owner: 0x84e5d4f8, flag: INIT/-/-/0x00
        (session) sid: 142 trans: (nil), creator: 0x84e5d4f8, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0010-00000027, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/1, ospid: 6159, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache lock' blocking sess=0x(nil) seq=23 wait_time=0 seconds since wait started=17
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
        Dumping Session Wait History
         for 'library cache lock' count=1 wait_time=2149666
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930643
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930300
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930715
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2930545
                    handle address=7c3a5560, lock address=8003b350, 100*mode+namespace=c9
         for 'library cache lock' count=1 wait_time=2929985
    session 142 is  B  waiting for library cache lock
    the lock handle address is 7c3a5560
            SO: 0x8003b350, type: 53, owner: 0x84f98ba0, flag: INIT/-/-/0x00
            LIBRARY OBJECT LOCK: lock=8003b350 handle=7c3a5560 request=S
            call pin=(nil) session pin=(nil) hpc=0005 hlc=0000
            htl=0x8003b3d0[0x7d034330,0x7d034330] htb=0x7d034330 ssga=0x7e9f2168
            user=84f5b4a8 session=84f5b4a8 count=0 flags=RES/[0010] savepoint=0x1f9
            LIBRARY OBJECT HANDLE: handle=7c3a5560 mutex=0x7c3a5690(0)
            name=SYS.MACLEAN
            hash=458787ae49fd6f284ccb04a892b38231 timestamp=02-09-2012 21:32:36
            namespace=TABL flags=KGHP/TIM/SML/[02000000]
            kkkk-dddd-llll=0000-0701-0701 lock=X pin=X latch#=3 hpc=0006 hlc=0004
            lwt=0x7c3a5608[0x8003b380,0x8003b380] ltm=0x7c3a5618[0x7c3a5618,0x7c3a5618]
            pwt=0x7c3a55d0[0x7c3a55d0,0x7c3a55d0] ptm=0x7c3a55e0[0x7c3a55e0,0x7c3a55e0]
            ref=0x7c3a5638[0x7c3a5638,0x7c3a5638] lnd=0x7c3a5650[0x7bf75a18,0x7bf90650]
              LIBRARY OBJECT: object=7c1dec60
              type=TABL flags=EXS/LOC/UPD[0905] pflags=[0000] status=VALD load=0
              DATA BLOCKS:
              data#     heap  pointer    status pins change whr
                  0 7c3a54a0 7c1ded78 I/P/A/-/-    0 NONE   00
                  8 7c1de7f0 7e33ed48 I/P/A/-/-    1 UPDATE 00
                  9 7c1de8c0 7bf109e8 I/P/A/-/-    1 NONE   00
                 10 7c1de948 7bf10600 I/P/A/-/-    1 NONE   00
    关于session B的 library cache lock , 其原因是 add column 的session A 以 X mode lock SYS.MACLEAN, X mode pin  SYS.MACLEAN 且不释放, 所以session B的 library cache lock不用多解释
    session C:
        SO: 0x84f5dd18, type: 4, owner: 0x84e5dce0, flag: INIT/-/-/0x00
        (session) sid: 144 trans: (nil), creator: 0x84e5dce0, flag: (41) USR/- BSY/-/-/-/-/-
                  DID: 0001-0011-0000000A, short-term DID: 0000-0000-00000000
                  txn branch: (nil)
                  oct: 3, prv: 0, sql: 0x7bf10088, psql: 0x7bf582f0, user: 0/SYS
        O/S info: user: oracle, term: pts/2, ospid: 6183, machine: vrh8.oracle.com
                  program: [email protected] (TNS V1-V3)
        application name: [email protected] (TNS V1-V3), hash value=0
        waiting for 'library cache pin' blocking sess=0x(nil) seq=19 wait_time=0 seconds since wait started=17
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
        Dumping Session Wait History
         for 'library cache pin' count=1 wait_time=2568684
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930677
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2929805
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2931420
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
         for 'library cache pin' count=1 wait_time=2930258
                    handle address=7bf46e40, pin address=7f03f890, 100*mode+namespace=c8
    session 144 is session C , waiting for library cache pin
    handle address 7bf46e40=>  指向 一个 child cursor namespace=CRSR, 而这个child cursor已经被 session B pin住了:
          SO: 0x7f03f890, type: 54, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT PIN: pin=7f03f890 handle=7bf46e40 request=S lock=0
          user=84f5dd18 session=84f5dd18 count=0 mask=0000 savepoint=0x3f flags=[00]
          SO: 0x7ec4cc80, type: 53, owner: 0x84f5dd18, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7ec4cc80 handle=7bf46e40 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7ec4cd00[0x7e449348,0x80c35108] htb=0x80c35108 ssga=0x80c34ff0
          user=84f5dd18 session=84f5dd18 count=1 flags=[0000] savepoint=0x0
          LIBRARY OBJECT HANDLE: handle=7bf46e40 mutex=0x7bf46f70(0)
          namespace=CRSR flags=RON/KGHP/PN0/[10010000]
          kkkk-dddd-llll=0000-0001-0000 lock=N pin=X latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf46ee8[0x7bf46ee8,0x7bf46ee8] ltm=0x7bf46ef8[0x7bf46ef8,0x7bf46ef8]
          pwt=0x7bf46eb0[0x7f03f8c0,0x7f03f8c0] ptm=0x7bf46ec0[0x7bf46ec0,0x7bf46ec0]
          ref=0x7bf46f18[0x7bf7bfe0,0x7bf7bfe0] lnd=0x7bf46f30[0x7bf46f30,0x7bf46f30]
            LIBRARY OBJECT: object=7bf29018
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            READ ONLY DEPENDENCIES: count=1 size=16
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf20060 7bf28ba8 I/P/A/-/-    0 NONE   00
                6 7bf77a20 7bf776f8 I/P/A/-/-    1 NONE   00
    我们可以找到 上面这个child cursor 的 parent cursor :
          SO: 0x7d03b620, type: 53, owner: 0x84f5b4a8, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=7d03b620 handle=7bf10088 mode=N
          call pin=(nil) session pin=(nil) hpc=0000 hlc=0000
          htl=0x7d03b6a0[0x7d034030,0x7c03c9f8] htb=0x7d034030 ssga=0x7e9f2168
          user=84f5b4a8 session=84f5b4a8 count=1 flags=[0000] savepoint=0x1f7
          LIBRARY OBJECT HANDLE: handle=7bf10088 mutex=0x7bf101b8(0)
          name=select 1 from maclean where rownum=1
          hash=324793c639b13d0954bd5421eaed6701 timestamp=03-08-2012 02:29:24
          namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/SML/DBN/[12010044]
          kkkk-dddd-llll=0001-0001-0001 lock=N pin=0 latch#=3 hpc=0004 hlc=0004
          lwt=0x7bf10130[0x7bf10130,0x7bf10130] ltm=0x7bf10140[0x7bf10140,0x7bf10140]
          pwt=0x7bf100f8[0x7bf100f8,0x7bf100f8] ptm=0x7bf10108[0x7bf10108,0x7bf10108]
          ref=0x7bf10160[0x7bf10160,0x7bf10160] lnd=0x7bf10178[0x82f4f2f8,0x7bf4d608]
            LIBRARY OBJECT: object=7bf7c8a8
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 7bf7c370  7bf7bfe0 7bf46e40                           => 只有一个child  handle 7bf46e40                          
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 7bf2a428 7bf7c9c0 I/P/A/-/-    0 NONE   00即在session B parse SQL "select 1 from maclean where rownum=1" 的时候, 会生成一个child cursor 并 X mode pin住这个child cursor , 而session C 同时发起 一样的SQL语句 "select 1 from maclean where rownum=1" 时 需要 share 这个child cursor , 即以 S mode pin 这个child cursor , 但是session B 还没有完成 optimize 没有生成完整的child cursor , 需要等待 session A 释放 library cache lock才能 完成, 所以 session C 要等 session B build child cursor , 此时session C等" library cache pin" ;
    如果 session C 执行的是不一样的SQL,那么 session C 不share 同一个child cursor , session C 会wait for library cache lock.
    since 10.2.0.3 "_kks_use_mutex_pin"=TRUE or 11g 开始 使用mutex 保护cursor pin ,所以 session C 若执行 与session B 一样的SQL,那么 wiat for cursor pin S on X
    SQL> select * from V$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    session A:
    SQL> alter table test add t11 char(2000) default 'maclean';
    session B:
    SQL> select * from test where rownum=1;
    session C:
    SQL> select * from test where rownum=1;
    SQL> select event from v$session where wait_class='Concurrency';
    EVENT
    cursor: pin S wait on X
    library cache lock
    SQL> oradebug setmypid;
    Statement processed.
    SQL> oradebug dump systemstate 266;
    Statement processed.
    session C:
    SO: 0x9e2256b8, type: 4, owner: 0x9e59a1c0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e59a1c0, name=session, file=ksu.h LINE:12624, pg=0
    (session) sid: 179 ser: 41307 trans: (nil), creator: 0x9e59a1c0
    flags: (0x41) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40009) -/-/INC
    DID: , short-term DID:
    txn branch: (nil)
    oct: 3, prv: 0, sql: 0x956e18b8, psql: 0x956e18b8, user: 0/SYS
    ksuxds FALSE at location: 0
    service name: SYS$USERS
    client details:
    O/S info: user: oracle, term: pts/3, ospid: 26823
    machine: vrh1.oracle.com program: [email protected] (TNS V1-V3)
    application name: [email protected] (TNS V1-V3), hash value=1481565533
    Current Wait Stack:
    0: waiting for 'cursor: pin S wait on X'
    idn=0xe76d0d8c, value=0xca00000000, where=0x500000000
    wait_id=17 seq_num=18 snap_id=1
    wait times: snap=12.671273 sec, exc=12.671273 sec, total=12.671273 sec
    wait times: max=infinite, heur=12.671273 sec
    wait counts: calls=1148 os=1148
    in_wait=1 iflags=0x15b2
    There is at least one session blocking this session.
    Dumping 1 direct blocker(s):
    inst: 1, sid: 202, ser: 15511
    Dumping final blocker:
    inst: 1, sid: 9, ser: 1
    Wait State:
    fixed_waits=0 flags=0x22 boundary=(nil)/-1
    idn=0xe76d0d8c=> 这个是mutex的标示
    KGX Atomic Operation Log 0x94aa8ca8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper GET_SHRD
    Cursor Pin uid 179 efd 0 whr 5 slp 1148
    opr=2 pso=0x8b5a8c48 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0
    这个mutex的 oper是 GET_SHRD 即 pin S 它指向 0x93d4bbb8 是一个child cursor
    以下是parent cursor:
    SO: 0x957fa9d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa9d8 Handle=0x956e18b8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1 Flags=CNB/[0001] SavepointNum=4f5864b8
    LibraryHandle: Address=0x956e18b8 Hash=e76d0d8c LockMode=N PinMode=0 LoadLockMode=0 Status=VALD
    ObjectName: Name=select * from test where rownum=1
    FullHashValue=7e277fabf95d7c80e8924ed6e76d0d8c Namespace=SQL AREA(00) Type=CURSOR(00) Identifier=3882683788 OwnerIdn=0
    Statistics: InvalidationCount=1 ExecutionCount=2 LoadCount=3 ActiveLocks=2 TotalLockCount=4 TotalPinCount=1
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=1 BucketInUse=3 HandleInUse=3 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x956e1968(0, 2, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/TIM/PN0/DBN/[10012841]
    WaitersLists:
    Lock=0x956e1948[0x956e1948,0x956e1948]
    Pin=0x956e1928[0x956e1928,0x956e1928]
    LoadLock=0x956e19a0[0x956e19a0,0x956e19a0]
    Timestamp: Current=03-08-2012 02:45:45
    HandleReference: Address=0x956e1a78 Handle=(nil) Flags=[00]
    LibraryObject: Address=0x8a327fa8 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    ChildTable: size='16'
    Child: id='0' Table=0x8a328e58 Reference=0x8a3288b8 Handle=0x956db988
    Child: id='1' Table=0x8a328e58 Reference=0x8a328b80 Handle=0x93d4bbb8
    NamespaceDump:
    Parent Cursor: sql_id=fj4kfuvmqu3cc parent=0x8a328048 maxchild=2 plk=y ppn=n
    但是很可惜 0x93d4bbb8 这个 child cursor 被 session B pin住了:
    SO: 0x957fa8d8, type: 78, owner: 0x9e1e0ea0, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
    proc=0x9e593da0, name=LIBRARY OBJECT LOCK, file=kgl.h LINE:8547, pg=0
    LibraryObjectLock: Address=0x957fa8d8 Handle=0x93d4bbb8 Mode=N CanBeBrokenCount=1 Incarnation=1 ExecutionCount=0
    ClusterLock=0x8f1945f8 Context=0x7fd379518308 User=0x9e1e0ea0 Session=0x9e1e0ea0 ReferenceCount=1
    Flags=CBK/[0020] SavepointNum=0
    LibraryHandle: Address=0x93d4bbb8 Hash=0 LockMode=N PinMode=X LoadLockMode=0 Status=VALD
    Name: Namespace=SQL AREA(00) Type=CURSOR(00)
    Statistics: InvalidationCount=0 ExecutionCount=0 LoadCount=1 ActiveLocks=2 TotalLockCount=2 TotalPinCount=3
    Counters: BrokenCount=1 RevocablePointer=1 KeepDependency=0 BucketInUse=0 HandleInUse=0 HandleReferenceCount=0
    Concurrency: DependencyMutex=0x93d4bc68(0, 0, 0, 0) Mutex=0x956e19e8(0, 45, 0, 0)
    Flags=RON/PIN/PN0/EXP/CHD/[10012111]
    WaitersLists:
    Lock=0x93d4bc48[0x93d4bc48,0x93d4bc48]
    Pin=0x93d4bc28[0x93d4bc28,0x93d4bc28]
    LoadLock=0x93d4bca0[0x93d4bca0,0x93d4bca0]
    LibraryObject: Address=0x939a30b0 HeapMask=0000-0001-0001-0000 Flags=EXS[0000] Flags2=[0000] PublicFlags=[0000]
    DataBlocks:
    Block: #='0' name=KGLH0^e76d0d8c pins=0 Change=NONE
    Heap=0x93d1a808 Pointer=0x939a3150 Extent=0x939a3030 Flags=I/-/P/A/-/-
    FreedLocation=0 Alloc=1.546875 Size=4.000000 LoadTime=4385736620
    Block: #='6' name=SQLA^e76d0d8c pins=0 Change=NONE
    Heap=0x8a328a20 Pointer=0x935e0348 Extent=0x935df6f0 Flags=I/-/P/A/-/E
    FreedLocation=0 Alloc=0.000000 Size=0.000000 LoadTime=0
    NamespaceDump:
    Child Cursor: Heap0=0x939a3150 Heap6=0x935e0348 Heap0 Load Time=03-08-2012 02:50:16 Heap6 Load
    PinMode=X
    保持这个 X mode pin的是另外一个 mutex , 这个mutex的 oper是 LONG_EXCL
    Time=03-08-2012 02:50:16 ----------------------------------------
    KGX Atomic Operation Log 0x8f1945f8
    Mutex 0x8a328978(202, 0) idn e76d0d8c oper LONG_EXCL
    Cursor Pin uid 202 efd 0 whr 1 slp 0
    opr=3 pso=0x957fa8d8 flg=0
    pcs=0x8a3288e0 nxt=(nil) flg=35 cld=1 hd=0x93d4bbb8 par=0x8a328048
    ct=1 hsh=0 unp=(nil) unn=0 hvl=8a328ef0 nhv=1 ses=0x9e1e0ea0
    hep=0x8a328978 flg=80 ld=1 ob=0x939a30b0 ptr=0x935e0348 fex=0x935df6f0

  • A lot of  'library cache lock'

    Hi there,
    My database has a lot of contention in 'library cache lock', more than 90% of all events.
    I'm trying to find the query that is waiting for this event, but the sql_id in v$session not exist in v$sql.
    SQL> select sql_id, count(*)
    2 from gv$session
    3 where EVENT ='library cache lock'
    4 group by sql_id;
    SQL_ID COUNT(*)
    4gd6b1r53yt88 49
    47
    SQL> select *
    2 from gv$sql
    3 where sql_id = '4gd6b1r53yt88';
    no rows selected
    The oracle version is 10.2.0.3 RAC.
    Can somebody help me?
    Thanks,
    Everson

    Hi rjaf
    Following this post, I got the table SYS.KOTTD$.
    I think this is some kind of Oracle internal problem, but I don't know what.

  • Unknown SQL eating CPU time and library cache locks

    Hello everyone,
    we are seeing a lot of activity when opening new connections to the database from PHP web server and the time is being spent on a SQL which in Enterprise manager is reported as UNKNOWN and selecting the GV$SQL view for this sql_id yields nothing, the SQL is not there. We do not have any logon triggers.
    I was wondering, if I know this SQL_ID (it's "c5brdpybgqss6"), can I see what it actually does? Can I trace it somehow?
    Our environment is:
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    With the Real Application Clusters option
    Two RAC instances, running RedHat ES 5 64bit
    Clients are PHP, using oci8, using Instant Client 11.1.0.7
    Thanks for any ideas how to further analyze this,
    Michal.

    Unfortunately no, it is NULL (see below). I tried metalink, but I don't know what to search for. I'll probably have to file a ticket with the support.
    select username, sid, serial#, status, sql_id, prev_sql_id, event, seconds_in_wait
    from gv$session
    where sql_id='c5brdpybgqss6'
    order by username, sid, serial#;
    USERNAME SID SERIAL# STATUS SQL_ID PREV_SQL_ID EVENT SECONDS_IN_WAIT
    IMWC2 945 64434 ACTIVE c5brdpybgqss6 latch: shared pool 5
    IMWC2 1020 38821 ACTIVE c5brdpybgqss6 library cache lock 2
    973 7519 ACTIVE c5brdpybgqss6 class slave wait 0
    992 20 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1004 5 ACTIVE c5brdpybgqss6 EMON slave idle wait 5
    1006 1195 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1014 2635 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1020 2755 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1026 3967 ACTIVE c5brdpybgqss6 EMON slave idle wait 2
    1027 3039 ACTIVE c5brdpybgqss6 EMON slave idle wait 2
    1042 805 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1044 481 ACTIVE c5brdpybgqss6 EMON slave idle wait 3
    1046 300 ACTIVE c5brdpybgqss6 EMON slave idle wait 1
    1053 2 ACTIVE c5brdpybgqss6 Streams AQ: waiting for time management or cleanup tasks 209637
    1055 8 ACTIVE c5brdpybgqss6 Streams AQ: emn coordinator idle wait 4
    1056 10 ACTIVE c5brdpybgqss6 Streams AQ: emn coordinator idle wait 0
    1059 6 ACTIVE c5brdpybgqss6 Streams AQ: waiting for time management or cleanup tasks 0

  • Library cache locks

    Hi,
    There were some locks acquired in our production database by two sessions. On investigation we found that one session was waiting for library cache lock and another for transaction enque lock. No entries were made into the alert log. We waited for 45 minutes and killed the first session. We are facing this problem for the third time
    Details of first session
    Lock type: library cache lock
    recent sql:
    Begin PKNBPREINSERT.PKNBPREINSERT_Submit(Result=>:1,hdcbovcvgpremiummethod=>:2,hdvbank_hdvcheck_chekyorn=>:3,hdvbacstpid_ref=>:4,hdnwfpldiid_ref=>:5,txtnumcvgterm=>:6,hdcbovplan=>:7,hdnnumofrows=>:8,cbovreason_desc=>:9,hdnumopt_id_ref=>:10,txtnumbaaccountno=>:11,hdvnfooption_type=>:12,txtdtcdrecddate=>:13,txtnumcvgfaceamt=>:14,result_msgs=>:15,txtpeothercomment=>:16,txtnumcontract_id_ref=>:17,lblvnfodopdivopt=>:18,hdndeleteflag=>:19,hdnumnfoopt_ref=>:20,hdnumbank_check_id_ref=>:21,hdcbovcvgpremiummode=>:22,txtvcontract_id_code=>:23,hdncbovpol_type=>:24,cboannuityoption=>:25,limit_yorn=>:26,txtotherscomments=>:27,hdlblvdopdivopt=>:28,hdnuserid=>:29,hdvopt_chekyorn=>:30,txtvbabankname=>:31,txtnumbenefitid=>:32,cbovcvgpremiummethod=>:33,hdnoptmedflag=>:34,txtdtcc_procdt=>:35,cbonumcvgpremiumterm=>:36,hdnincdocid_code=>:37,hdnumnfoopt_id_ref=>:38,chknumcvgjcaseindicator=>:39,txtnumproposalno=>:40,txtnumplanbenefitid=>:41,chknumcvgadvprm_ind_yorn=>:42,hdnnumofoptrows=>:43,txtdtcvgeffectdat
    Details of second session
    Lock type:transaction enqueue lock
    Mode wanted: exclusive
    recent sql:
    update tab$ set ts#=:2,file#=:3,block#=:4,bobj#=decode(:5,0,null,:5),tab#=decode(:6,0,null,:6),intcols=:7,kernelcols=:8,clucols=decode(:9,0,null,:9),audit$=:10,flags=:11,pctfree$=:12,pctused$=:13,initrans=:14,maxtrans=:15,rowcnt=:16,blkcnt=:17,empcnt=:18,avgspc=:19,chncnt=:20,avgrln=:21,analyzetime=:22,samplesize=:23,cols=:24,property=:25,degree=decode(:26,1,null,:26),instances=decode(:27,1,null,:27),dataobj#=:28,avgspc_flb=:29,flbcnt=:30,trigflag=:31,spare1=:32,spare2=decode(:33,0,null,:33),spare4=:34,spare3=:35
    where obj#=:1
    Awaiting your response
    Regards,
    sudhir.

    Per Metalink Note 122793.1
    SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
    WHERE SADDR in
      (SELECT KGLLKSES FROM X$KGLLK LOCK_A
       WHERE KGLLKREQ = 0
         AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
                     WHERE KGLLKSES = 'saddr_from_v$session' /* BLOCKED SESSION */
                     AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
                     AND KGLLKREQ > 0)
      );

  • Library Cache Locks in 10g

    Hi,
    This is a question for Oracle 10g database -
    Does anyone know of a foolproof way of finding the session that is blocking another session with 'library cache lock'?
    It needs to work for RAC and non-RAC and the quicker the better :-)
    Thanks,
    Kevin

    Per Metalink Note 122793.1
    SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
    WHERE SADDR in
      (SELECT KGLLKSES FROM X$KGLLK LOCK_A
       WHERE KGLLKREQ = 0
         AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
                     WHERE KGLLKSES = 'saddr_from_v$session' /* BLOCKED SESSION */
                     AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
                     AND KGLLKREQ > 0)
      );

Maybe you are looking for