oracle10g enqTX - contention等待事件

  • Upload
    mq-sfs

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

  • 8/10/2019 oracle10g enqTX - contention

    1/3

    DBNAME oracle10g enq:TX contention

    10genqueue TX41. enq:TX row lock contention2. enq:TX index contention3. enq:TX ITL4. enq:TX contention4transaction contention,enq:TX contentionsessionDMLsesstablespace XXX read only,session 1:SQL> select sid from v$mystat where rownum select table_name,tablespace_name from user_tables where table_name='INFO';TABLE_NAME TABLESPACE_NAME INFO USERSSQL> update info set note=upper(note);35SQL> ()

    session 2:SQL> select sid from v$mystat where rownum alter tablespace users read only;session 1userssession 2session 3:SQL> select sid,event,p1,p2,p3 from v$session_wait where sid=148; SID EVENT

    P1 P2 P3

    148 enq: TX contention1415053316 65563 166session 2enq: TX contentionp1,p2,p3SQL> SELECT name, parameter1, parameter2, parameter3 from v$event_name wherename = 'enq: TX contention';NAME PARAMETER1 PARAMETER2 PARAMETER3 enq: TX contention name|mode usn

  • 8/10/2019 oracle10g enqTX - contention

    2/3

    148 TX Sharesession 2SQL> select sid from v$session where taddr in 2 (select b.addr from v$session_wait a,v$transaction b 3 where a.event='enq: TX contention' and trunc(a.p2/power(2,16)) = xidusn 4 and (bitand(a.p2,to_number('ffff','xxxx'))+0) = xidslot and a.p3 = xidsqn); SID 145session 2session 1session 21session 2SQL> select sid,id1,id2,trunc(id1/power(2,16))rbs,bitand(id1,to_number('ffff','xxxx'))+0 slot,id2 seq,lmode,request,type fromv$lock where type = 'TX' and sid=&sid; sid : 148- 2: from v$lock where type = 'TX' and sid=&sid 2: from v$lock where type = 'TX' and sid=148 SID ID1 ID2 RBS SLOT SEQ LMODEREQUEST TY 148 65563 166 1 27 166 0

    4 TX 148 196646 168 3 38 168 6

    0 TX1484(share)ID1ID2v$session_waitp2,p3SQL> select sid,event,p1,p2,p3 from v$session_wait where sid=148; SID EVENT

    P1 P2 P3

    148 enq: TX contention1415053316 65563 1662(ID1,ID2)SQL> select sid,trunc(id1/power(2,16))rbs,bitand(id1,to_number('ffff','xxxx'))+0 slot,id2 seq,lmode,request from v$lock where type='TX' and id1=&id1 and id2=&id2; id1 : 65563 id2 : 166- 2: from v$lock where type='TX' and id1=&id1 and id2=&id2 2: from v$lock where type='TX' and id1=65563 and id2=166 SID RBS SLOT SEQ LMODE REQUEST 148 1 27 166 0 4

    145 1 27 166 6 0148share145exclusivesession 2RACnode 1sessionSQL> conn test/testConnected.SQL> select sid from v$mystat where rownum < 2; SID 617

  • 8/10/2019 oracle10g enqTX - contention

    3/3

    SQL> insert into info values (1);1 row created.node 2session:SQL> alter tablespace test read only;nodeSQL> select c.inst_id,c.sidfrom gv$session_wait a,gv$transaction b, gv$session cwhere a.event='enq: TX contention'and trunc(a.p2/power(2,16)) = b.xidusnand (bitand(a.p2,to_number('ffff','xxxx'))+0) = b.xidslotand a.p3 = b.xidsqnand c.taddr = b.addr; INST_ID SID 1 617