Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com Enqueue Waits : Locks Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com.

Similar presentations


Presentation on theme: "Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com Enqueue Waits : Locks Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com."— Presentation transcript:

1 Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com
Enqueue Waits : Locks Kyle Hailey

2 Locks Covered in this Section
Part I : Intro Lock Name(type) and Mode Finding waiter and blocker Finding Object Part II : User TM – table modification TX – Transaction locks UL – user lock Part III : Internal CI – Cross Instance HW – High Water RO – Reusable Object Copyright 2006 Kyle Hailey

3 Part I : Intro Waiter Blocker Lock Type Object blocking on
To Solve we need: Waiter Blocker Lock Type type mode Object blocking on Missing : blocking SQL Possibly with log miner Lock seems easy Compared to latches, buffer busy waits etc Copyright 2006 Kyle Hailey

4 Solving – Data Sources V$active_session_history or
In “real time” can also use v$lock v$session (v$session_wait) dba_blockers dba_waiters ?/rdbms/admin/utllockt.sql Copyright 2006 Kyle Hailey

5 v$active_session_history
Fields in ASH for lock analysis and solution: Waiter SESSION_ID SESSION_SERIAL# USER_ID Object CURRENT_OBJ# CURRENT_FILE# CURRENT_BLOCK# SQL Waiting SQL_ID Blocker BLOCKING_SESSION BLOCKING_SESSION_STATUS BLOCKING_SESSION_SERIAL# Lock Type and Mode Event = Type (name) P = Type | Mode Missing: SQL Blocking not reliably possible, Maybe by dumping REDO Copyright 2006 Kyle Hailey

6 Lock Name and Mode Name: 5458 Mode: 0006 P1 P1RAW ---------- --------
Select parameter1 from v$event_name where name=‘enqueue’; Parameter1 Name|mode Select p1, p1raw from v$session where event like 'enq%'; P P1RAW Name: 5458 Mode: 0006 Hex Decimal ASCII 54 = = “T” 58 = = “X” Lock = TX 6 Copyright 2006 Kyle Hailey

7 Type and Mode SELECT chr(bitand(p1,-16777216)/16777215)||
chr(bitand(p1, )/65535) Type, mod(p1,16) lmode from v$session_wait where event=‘enqueue’; TY LMODE TX bitand(p1, 65536) "Mode"

8 Lock Names (types) 9i 10g One Wait : “enqueue” 208 enqueue waits
Specific to each type of enqueue enq: HW - contention Configuration enq: SQ - contention Configuration enq: SS - contention Configuration enq: ST - contention Configuration enq: TM - contention Application enq: TW - contention Administrative enq: TX - allocate ITL entry Configuration enq: TX - index contention Concurrency enq: TX - row lock contention Application enq: TX – contention Application Copyright 2006 Kyle Hailey

9 Lock Modes # Type Name --- ------- ---------------------------
1 Null Null 2 SS Sub share 3 SX Sub exclusive 4 S Share 5 SSX Share/sub exclusive 6 X Exclusive Copyright 2006 Kyle Hailey

10 P1 = name | mode P1 (parameter1) same for all locks PARAMETER1
select distinct parameter1 from v$event_name where name like 'enq:%' PARAMETER1 name|mode select event, mod(p1,16) as "mode" from v$active_session_history where event like 'enq:%‘; TX if P1 = then mode = 4 if P1 = then mode = 6 EVENT mode enq: TX - allocate ITL entry 4 enq: TX - row lock contention 6 enq: TX - row lock contention 4 Copyright 2006 Kyle Hailey

11 OEM 10g if P1 = 1415053318 then mode = 6 Then it is a data block
row lock Copyright 2006 Kyle Hailey

12 Querying ASH select substr(event,0,20) lock_name,
ash.session_id waiter, mod(ash.p1,16) lmode, ash.p p2, ash.p p3, o.object_name object, o.object_type otype, CURRENT_FILE# filen, CURRENT_BLOCK# blockn, ash.SQL_ID waiting_sql, BLOCKING_SESSION blocker --,ash.xid from v$active_session_history ash, all_objects o where event like 'enq: %' and o.object_id (+)= ash.CURRENT_OBJ# / col event for a22 col block_type for a18 col objn for a18 col otype for a10 col fn for 99 col sid for 9999 col bsid for 9999 col lm for 99 col p3 for 99999 col blockn for 99999 select to_char(sample_time,'HH:MI') st, substr(event,0,20) event, ash.session_id sid, mod(ash.p1,16) lm, ash.p2, ash.p3, nvl(o.object_name,ash.current_obj#) objn, substr(o.object_type,0,10) otype, CURRENT_FILE# fn, CURRENT_BLOCK# blockn, ash.SQL_ID, BLOCKING_SESSION bsid --,ash.xid from v$active_session_history ash, all_objects o where event like 'enq: TX %' and o.object_id (+)= ash.CURRENT_OBJ# and sample_time > sysdate - &1/(60*24) Order by sample_time / Copyright 2006 Kyle Hailey

13 Part II : User Locks TX – Transaction Lock TM – Table Modification
Mode 6: Modifying same row Mode 4: several reasons TM – Table Modification Mode 4: Unindexed Foreign Key UL – User Lock Copyright 2006 Kyle Hailey

14 TX Lock Session B Wait for Tx To commit Undo Segment Table Toto
Header Wait for Tx To commit update toto set name = ‘ADAMS’ where id = 1; Undo Segment Table Toto Data Block Header Data Block Header Transaction 1 Session a update toto set name = ‘SMITH’ where id = 1; Row 1 Delete from toto where id = 2; Delete from toto where id = 9; Copyright 2006 Kyle Hailey

15 Transaction Locks (TX)
TX = Transaction = Wait on UNDO Mode 6 (exclusive) modification of a row lock Mode 4 (share) Index block spilt Unique Index Key enforcement Foreign key enforcement ITL space waits Bitmap chunk conflicts Alter tablespace … read only; Free Lists slot waits Possible with two phase commit Copyright 2006 Kyle Hailey

16 Transaction Locks (TX)
Mode 4, new Events: enq: TX - allocate ITL entry Wait on an ITL slot enq: TX - index contention Index block split enq: TX - row lock contention Mode 6 – classic row lock Mode 4 - pk violation, fk violation, bitmap chunk wait enq: TX – contention Wait for a data file extension, Alter tbs read only Copyright 2006 Kyle Hailey

17 enq: TX - row lock contention
Mode 6, row in data block User 1 SQL> delete from toto where id = 1; User 2 SQL> delete from toto where id =1; Table Value ID foo 1 Copyright 2006 Kyle Hailey

18 enq: TX - row lock contention
if P1 = then mode = 6 Then it is a data block row lock Copyright 2006 Kyle Hailey

19 TX – Mode 4 if P1 = 1415053316 then mode = 4
Not same data but conflicts Copyright 2006 Kyle Hailey

20 enq: TX - row lock contention
Mode 4, happens for 3 reasons Unique key contention Foreign Key contention Bitmap index contention (others?) Copyright 2006 Kyle Hailey

21 enq: TX - row lock contention
Mode 4 , unique index User 1 create table p(n number); create unique index p_i on p(n); insert into p values(2); User 2 insert into p values(2); PK Table create table p(n number); create unique index p_i on p(n); insert into p values(3); ID ID Value 2 2 ? 2 ? Copyright 2006 Kyle Hailey

22 enq: TX - row lock contention
Mode 4, foreign key User 1 create table parent ( id number primary key); create table child ( id number references parent, name varchar2(20)); insert into parent values (2); User 2 insert into child values (2,88); PK Parent Child ID ID Value ID Name 2 ? 2 ? 2 Copyright 2006 Kyle Hailey

23 enq: TX - row lock contention
Mode 4 Bitmaps are compressed Changes to the same bitmap cause locks Value Start Rowid End Bitmap 1 2 Copyright 2006 Kyle Hailey

24 enq: TX - row lock contention
Session 1 create table t1 ( n1 number(4), n2 number(4)); insert into t1 select 1, rownum from all_objects where rownum <= 400; commit; create bitmap index i1 on t1(n1); Different rows but same key value Subject: Bitmap Indexes and Deadlocks: Deadlocks on Insert Statements Doc ID: Note: Type: TROUBLESHOOTING Last Revision Date: 18-MAY-2004 Status: PUBLISHED PURPOSE The purpose of this article is to explain the occurrence of deadlocks when the only DML activity is insert statements against a table with a bitmap index SCOPE & APPLICATION Database administrators and Application developers involved in application design. BITMAP INDEXES: THE HIDDEN DEADLOCK THREAT The "Oracle8i Designing and Tuning for Performance" guide explains the limitations of bitmap indexes as this: Extract of documentation: "DML and DDL statements, such as UPDATE, DELETE, DROP TABLE, affect bitmap indexes the same way they do traditional indexes: the consistency model is the same. A compressed bitmap for a key value is made up of one or more bitmap segments, each of which is at most half a block in size (but may be smaller). The locking granularity is one such bitmap segment. This may affect performance in environments where many transactions make simultaneous updates. If numerous DML operations have caused increased index size and decreasing performance for queries, then you can use the ALTER INDEX ... REBUILD statement to compact the index and restore efficient performance. A B*-tree index entry contains a single rowid. Therefore, when the index entry is locked, a single row is locked. With bitmap indexes, an entry can potentially contain a range of rowids. When a bitmap index entry is locked, the entire range of rowids is locked. The number of rowids in this range affects concurrency. As the number of rowids increases in a bitmap segment, concurrency decreases. Locking issues affect DML operations, and may affect heavy OLTP environments. Locking issues do not, however, affect query performance. As with other types of indexes, updating bitmap indexes is a costly operation. Nonetheless, for bulk inserts and updates where many rows are inserted or many updates are made in a single statement, performance with bitmap indexes can be better than with regular B*-tree indexes." ************** What is not mentioned is the fact that the same architectural feature that locks a range of rowid's also means that its possible to get a deadlock within the bitmap when updating rows in the underlying table. This deadlock is not in the table itself, as one might suspect, but rather in the bitmap index blocks. This kind of deadlock is easily diagnosable by the deadlock trace file, which has an entry that looks like the example below: The following deadlock is not an ORACLE error. It is a deadlock due to user error in the design of an application or from issuing incorrect ad-hoc SQL. The following information may aid in determining the deadlock: Deadlock graph: Blocker(s) Waiter(s) Resource Name process session holds waits process session holds waits TX d2a X S TX-000a d6d X S session 37: DID C session 35: DID F session 35: DID F session 37: DID C Rows waited on: Session 35: no row Session 37: no row The piece of information that leads us to a bitmap deadlock is the "no row" value in the session information. If we had encountered a deadlock in the underlying table, the Session line would give us row information so that we could track down the exact point of failure. Without a row, it would seem that we are at a dead end. Even more mysterious is when we get this deadlock on inserts, where we are inserting only new rows and therefore it would seem impossible to get a deadlock. No one should be requesting a row that someone else holds locked. There are no solutions to this kind of problems, except not using bitmap indexes when having an application where you can't control when the DML are issued against the tables with bitmap indexes. Bitmaps are normally intended for datawarehouse applications that are loading data via batches and that users are only querying. The following testcase can be used to see the results of this type of problem. We will create a table called CAR_TYPE, which holds information about cars, including the car's color. We will build a bitmap index on the COLOR column. After doing so, we will populate the table with data. After the initial insert, we will open two sessions of the same user, and run simultaneous inserts into the CAR_TYPE table. TESTCASE: ===================================== create table car_type ( make varchar2(20), model varchar2(20), color varchar2(20), VIN number(15) primary key, year number(4)); create bitmap index car_type_bm_idx on car_type(color); create sequence car_type_seq start with 35001 increment by 1 nocache nocycle; declare v_CarMake varchar2(20) := 'Audi'; v_CarModel varchar(20) := 'Quattro'; v_CarColor varchar(20) := 'Gold'; v_CarVin binary_integer :=1; begin loop insert into car_type (make,model,color,VIN,year) values (v_CarMake, v_CarModel, v_CarColor, v_CarVin, '2002'); v_CarVin := v_CarVin + 1; exit when v_CarVin > 5000; end loop; end; / commit; v_CarMake varchar2(20) := 'Toyota'; v_CarModel varchar(20) := 'Camry'; v_CarColor varchar(20) := 'Red'; v_CarVin binary_integer :=5001; exit when v_CarVin > 10000; v_CarColor varchar(20) := 'Blue'; v_CarVin binary_integer :=10001; exit when v_CarVin > 15000; v_CarColor varchar(20) := 'Silver'; v_CarVin binary_integer :=15001; exit when v_CarVin > 20000; v_CarColor varchar(20) := 'Green'; v_CarVin binary_integer :=20001; exit when v_CarVin > 25000; v_CarColor varchar(20) := 'Black'; v_CarVin binary_integer :=25001; exit when v_CarVin > 30000; v_CarColor varchar(20) := 'White'; v_CarVin binary_integer :=30001; exit when v_CarVin > 35000; =============================== After this initial creation, cut the following script into a .sql file, and then execute it simultaneously from two sessions: insert into car_type values ( 'Toyota','Camry','White',car_type_seq.nextval,'2002'); 'Toyota','Camry','Red',car_type_seq.nextval,'2002'); 'Toyota','Camry','Silver',car_type_seq.nextval,'2002'); 'Audi','Quatro','Black',car_type_seq.nextval,'2002'); 'Audi','Quatro','Gold',car_type_seq.nextval,'2002'); 'Audi','Quatro','Blue',car_type_seq.nextval,'2002'); 'Audi','Quatro','Green',car_type_seq.nextval,'2002'); ======================================== The result will be occasional deadlock errors: * ERROR at line 1: ORA-00060: deadlock detected while waiting for resource The trace file will show the tell-tale 'No Row' message: Session 11: no row Session 10: no row RELATED DOCUMENTS Oracle8i Designing and Tuning for Performance Release 2 (8.1.6) Part Number A . update t1 set n1 = 2 where n2 = 12; Session 2 update t1 set n1 = 2 where n2 = 13; Copyright 2006 Kyle Hailey

25 enq: TX - row lock contention
Bitmaps are compressed Changes to the same bitmap chunk cause locks Value Start Rowid End Bitmap 1 200.0 204.7 205.0 210.3 2 205.6 block row Copyright 2006 Kyle Hailey

26 enq: TX - row lock contention
Value Start Rowid End Bitmap 1 200.0 204.7 2 205.0 210.3 3 205.6 Session 1 Session 2 Update id=12 set value 2 Update id=13 set value 2 Copyright 2006 Kyle Hailey

27 Summary: TX 4 from ASH Copyright 2006 Kyle Hailey 27
uniq index ST EVENT SID LM P2 P3 OBJ OTYPE FN BLOCKN SQL_ID BSID :39 enq: TX - row lock c bjvx94vnxtxgv 158 FK ( ) 10:41 enq: TX - row lock c CHILD TABLE ahm7c9rupbz9r 1 bitmap 10:41 enq: TX - row lock c I1 INDEX 0 0 azav296xxqcjx 144 Copyright 2006 Kyle Hailey 27

28 enq: TX - allocate ITL entry
Transaction 1 Info Data Block Header Data Block Header Transaction 2 Info ITL Data Copyright 2006 Kyle Hailey

29 enq: TX - allocate ITL entry
Data Block Header Transaction 1 Data Transaction 2 Row 1 Row 2 Row 3 Transaction 3 Copyright 2006 Kyle Hailey

30 enq: TX - allocate ITL entry
create table itl ( id number, data varchar2(20) ) pctfree 0 initrans 1 ; insert into itl select rownum,'a' from all_objects where rownum < 2000; commit; session 1: update itl set data=data where id=1; session 2: update itl set data=data where id=2; session 3: update itl set data=data where id=3; session 4: update itl set data=data where id=4; session 5: update itl set data=data where id=5; Copyright 2006 Kyle Hailey

31 enq: TX - contention Altering tablespace read only with open transaction Example Session 1 – start transaction, don’t commit Session 2 – alter tablespace read only Data File Extension – waiter waiting for another session to extend file Index Block Split – waiter waiting for another session to split the block Copyright 2006 Kyle Hailey

32 TX Further Investigation
select event, sql_id, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o where event like 'enq: TX%' and o.obj# (+)= ash.current_obj# order by sample_time EVENT SQL_ID OBJ FILE# BLOCK# enq: TX - row lock contention ahm7c9rupbz9r FOO enq: TX - row lock contention bjvx94vnxtxgv FOO Copyright 2006 Kyle Hailey

33 TX Further Investigation
Who is the blocker: V$active_session_history : BLOCKING_SESSION BLOCKING_SESSION_STATUS BLOCKING_SESSION_SERIAL# select to_char(sample_time,'HH:MI') st, substr(event,0,20) event, ash.session_id sid, mod(ash.p1,16) lm, ash.p2, ash.p3, nvl(o.object_name,ash.current_obj#) objn, substr(o.object_type,0,10) otype, CURRENT_FILE# fn, CURRENT_BLOCK# blockn, ash.SQL_ID, BLOCKING_SESSION bsid from v$active_session_history ash, all_objects o where event like 'enq: TX - %' and o.object_id (+)= ash.CURRENT_OBJ# --and sample_time > sysdate - 40/(60*24) Order by sample_time / No Guarentee of finding blocker SQL Copyright 2006 Kyle Hailey

34 enq: TM - contention TX locks have a corresponding TM lock
TM locks the structure from change Parameter1 = object id LOCK Parmeter1 Parmeter2(ID1) Parameter3(ID2) enq: TM name|mode object # table/partition Copyright 2006 Kyle Hailey

35 enq: TM - contention Exclusive Row Level Lock User 1 User 2
create table parent ( id number primary key); create table child ( id number references parent, name varchar2(20)); insert into parent values (1); insert into parent values (2); commit; delete from parent where id=2; User 2 insert into child values (1,2); Copyright 2006 Kyle Hailey

36 enq: TM - contention PK Parent Child ID ID Value ID Name 1 1 1 X 2 X 2
Session 1 Insert into Child ID=1 Session 2 Delete from Parent where ID=2 : Enqueue TM 4 Session 2 doesn’t know the value Session 1 inserted Session 2 only knows there is an outstanding change Copyright 2006 Kyle Hailey

37 enq: TM – contention Solution
PK Parent Child Index ID ID Value ID ID Name 1 1 2 Foreign Key Session 1: Insert into Child ID=1 Session 2: Delete from Parent ID=2 OK – can verify quickly in the child index Copyright 2006 Kyle Hailey

38 TM Further Investigation
select event, sql_id, mod(p1,16) as "mode", p2|| ' ' || o.name obj from v$active_session_history ash, obj$ o where event like 'enq: TM%' and o.obj# (+)= ash.p2 order by sample_time; EVENT SQL_ID mode OBJ enq: TM - contention zw36yw3fq4yy CHILD Copyright 2006 Kyle Hailey

39 UL Locks User-defined Locks dbms_lock
Wait Event Parameter2 Parameter3 enq: UL - contention id dbms_lock.allocate_unique(v_lockname, v_lockhandle); dbms_lock.request(v_lockhandle, p_ltype); dbms_lock.release(v_lockhandle); Copyright 2006 Kyle Hailey

40 Internal Locks CI – Cross Instance HW – High Water
KO – fast object checkpoint RO – Reuse Object SQ – Sequence Lock ST – Space Transaction Copyright 2006 Kyle Hailey

41 enq: CI - contention Cross Instance not OPS lock.
invoke actions in background processes checkpoints log switches instance is shut down Used to invoke specific actions in background processes on a specific instance or all instances. Examples include checkpoint, log switch, shutting down, identifying or re-identifying datafiles, etc. All in all, there are a small number (10’s) of predefined cross-instance call types. Not an Oracle Parallel Server lock. The name of this lock is misleading because it doesn't deal with distributed transactions. Rather, the CI lock is used to invoke specific actions in background processes on a specific instance or all instances. Examples would include checkpoints, log switches, or when the instance is shut down. Copyright 2006 Kyle Hailey

42 CI – Cross Instance Id1 Meaning (parameter2) Id2 Meaning (parameter3)
0 Flush buffers for reuse as new class 1 LGWR checkpointing and Hot Backup 2 DBWR synchronization of SGA with control file 3 Log file add/drop/rename notification 4 Write buffer for CR read 5 Test Call 6 Invalidate KCK cache in all instances 7 Alter rollback segment optimal 8 Signal Query Servers/coordinator 9 Create Remote Parallel Query Server 10 Set Global Partitions 11 Stop Disk Writes 12 Drop Sort Segments 13 Release unused space from Sort Segments 14 Instance Recovery for Parallel operation Group 15 Validate parallel slave Lock Value 16 Check Transaction State Objects Id2 Meaning (parameter3) 1 Pass in Parameters 2 Invoke the call in background process 3 Foreground has not returned yet 4 Used to allocate the CI call 5 Used to queue up interested clients Copyright 2006 Kyle Hailey

43 CI Locks select substr(sql_text,0,20) sql_text, p2,p3,
CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o, v$sqltext sql where event like 'enq: CI%' and o.obj# (+)= ash.current_obj# and sql.sql_id (+)= ash.sql_id order by sample_time; col event for a20 col obj for a12 col p2 for 9999 col p3 for col file# for 99999 col block# for select substr(sql_text,0,20) sql_text, --event, --sql_id, --p1, p2,p3, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o, v$sqltext sql where event like 'enq: CI%' and o.obj# (+)= ash.current_obj# and sql.sql_id (+)= ash.sql_id order by sample_time; SQL_TEXT P P3 OBJ FILE# BLOCK# INSERT INTO TOTO1 VA TOTO Copyright 2006 Kyle Hailey

44 CI Locks If p2=1 and p3=5, then contention on blocks being
SQL_TEXT P2 P3 alter table XXXXX drop partition YYYYY P2 = 1 " LGWR checkpointing and Hot Backup " P3 = 5. "Used to queue up interested clients" If p2=1 and p3=5, then contention on blocks being checkpointed, try raising fast_start_mttr_target col event for a20 col obj for a12 col p2 for 9999 col p3 for col file# for 99999 col block# for select substr(sql_text,0,20) sql_text, --event, --sql_id, --p1, p2,p3, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o, v$sqltext sql where event like 'enq: CI%' and o.obj# (+)= ash.current_obj# and sql.sql_id (+)= ash.sql_id order by sample_time; alter system set fast_start_mttr_target=600 scope=both; Copyright 2006 Kyle Hailey

45 enq: HW - contention Table Header Session 1 Session 2 Data Session 3
Wait Event Parameter2 Parameter3 enq: HW - contention table space # block Session 1 Header Table Session 2 Data Session 3 enq: HW - contention High Water Mark Empty Copyright 2006 Kyle Hailey

46 HW Use Freelists Hidden Parameter ASSM
Cause a jump in High Water Mark by freelists * _bump_highwater_mark_count Hidden Parameter _bump_highwater_mark_count alter session set "_bump_highwater_mark_count"=100; Not supported ASSM Automatic segment space management column parameter format a30 column value format a10 select a.ksppinm parameter, c.ksppstvl value from x$ksppi a, x$ksppcv b, x$ksppsv c where a.indx = b.indx and a.indx = c.indx and substr(ksppinm,1,11)='_bump_highw' order by a.ksppinm; Copyright 2006 Kyle Hailey

47 HW Further Investigation
select event, sql_id, CURRENT_OBJ# || ' ' || name obj ,CURRENT_FILE# file# ,CURRENT_BLOCK# block# from v$active_session_history ash, obj$ o where event like 'enq: HW%' and o.obj# (+)= ash.current_obj# order by sample_time; EVENT SQL_ID OBJ FILE# BLOCK# enq: HW - contention 49ch3jfkncnsp T1_I Copyright 2006 Kyle Hailey

48 enq: KO - fast object checkpoint
Used when checking the cache for blocks from a table for PQO direct read Copyright 2006 Kyle Hailey

49 enq: RO - fast object reuse
Drop or Truncate a table Wait for DBWR to clean cache Solution Tune DBWR using smaller MTTR Use GTT Truncate/drop less often

50 Other Resources @?/rdbms/admin/utllockt
WAITING_SESSION LOCK_TYPE MODE_REQUESTED MODE_HELD LOCK_ID1 LOCK_ID2 None Transaction Share Exclusive Copyright 2006 Kyle Hailey

51 Blocking Sessions Copyright 2006 Kyle Hailey

52 Summary : Internal Locks
CI – Cross Instance HW – High Water Look at object and SQL use ASSM, freelists, pre-allocate extents KO – fast object checkpoint PQO RO – reusable object Reduce cache, tune DBWR, use GTT SQ – Sequence Lock logon/logoff problem ST - Space Transaction only one per database used for space allocations uet, fet Find object use LMT Copyright 2006 Kyle Hailey


Download ppt "Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com Enqueue Waits : Locks Kyle Hailey http://perfvision.com/ftp/emea2010 kylelf@gmail.com."

Similar presentations


Ads by Google