O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
Buffer Cache Waits
In This Section1. latch: cache buffers chains2.   latch: cache buffers lru chain3.   Free Buffer Wait4.   Buffer Busy Wait...
Oracle Memory Structures                    SGARAM :      Log    Library BufferMachine    Buffer Cache Cache              ...
Buffer Cache Access Buffer Cache Management   Locating Free blocks   Finding data blocks   Managing LRU lists   Clean...
Is Block in cache?   Now you have a file# and block#   How do you know if a block is cached?   Shadow   Process           ...
Buffer Cache Find a block by: 1) Hash of           What is a hash value     Data file #      What are Buckets             ...
Double Linked ListsAddress    03C38F60   03C39000   03C39478Next       03C39000   03C39478Previous              03C38F60  ...
Hashing Function Simple hash could be a Mod function    1 mod 4 = 1    2 mod 4 = 2    3 mod 4 = 3    4 mod 4 = 0    ...
Hash Bucket Fill        Data Block        Header             Hash Block’s                                file#            ...
Latches Protect Bucket Contentslatches   Hash Buffer                Data Blocks          bucket Headers   Buffer Headers c...
X$bh  Describes Contents of Buffer HeadersSQL> desc x$bh Name            Type          ADDR ------------ --------        ...
X$BH describes Headers      latches   Hash Buffer        Data Blocks                bucket Headers      HLADDR            ...
To Find a Blocklatches Hash        Buffer           Data Blocks        bucket      Headers                                ...
Cache Buffers Chains           latches Hash      Block                   Buckets                             Headers      ...
Examples 1. Look up Table      S1     S2     S3       S4                                  t1              t2              ...
CBC SolutionsFind SQL ( Why is application hitting the block so hard? )    Nested loops, possibly           Hash Partiti...
Which SQLselect    count(*),    sql_idfrom v$active_session_history ashwhere event      like latch: cache buffers chainsgr...
CBC: OEM
CBC: ADDM            Problem            SQL Statement              Solution?
Finding the Hot Block:X$BH.TCH Updated when block read Updated by no more than 1 every 3 seconds Can be used to find “h...
CBC – Further Investigationselect * from v$event_namewhere name = latch: cache buffers chains    EVENT#       NAME        ...
CBC – Real Timeselect  count(*),  lpad(replace(to_char(p1,XXXXXXXXX), ,0),16,0) laddrfrom v$active_session_historywhere ev...
Putting into one Query select       name, file#, dbablk, obj, tch, hladdr        This can be misleading, as from x$bh bh  ...
Hot Block via Tanel Poder                            Loop 100,000                            times                        ...
Consistent Read Blocks    Current          Consistent    Block            Read              &    (XCUR)    Undo   (CR)    ...
CBC: Consistent Read Blocks                Hash      Block        latches Buckets   Headers s5                            ...
Consistent Read Copiesselect      count(*)    , name    , file#    , dbablk               CNT NAME          FILE#   DBABLK...
CBC : Solution Find the SQL causing the problem      Change Application Logic Eliminate hot spots                      ...
Block Pinninglatches   Hash Buffer      Data Blocks          bucket Headers
Free Buffer WaitFinding a Free Block If the data block isn’t in cache    Geta free block and header in the buffer cache ...
Finding a Free BlockWhen a session reads a blockInto the bufffer cache how doesit find a FREE spot? Shadow                ...
Finding a Free Blocklatches   Hash Buffer           Data Blocks          bucket Headers     1. Arrange the Buffer Headers ...
Cache Buffers LRU                    = entry in x$bh
X$bh Describes Buffer Headers  SQL> desc x$bh   Name                         Type   ----------------------    ---------  ...
LRU Chain ADDR      03C38F60   03C39000   03C39478NXT_HASH 03C39000     03C38F60PRV_HASH              03C38F60   03C39000N...
Cache Buffers LRU list
Cache Buffers LRU list           LRU Chain of Buffer HeadersBuffer Cache
Cache Buffers LRU Latch                      Buffer Headers MRU                             LRU latch              LRU “Ho...
Session Searching for Free Blocks  MRU               Buffer Headers                 LRU    1. Go to the LRU end of data bl...
Free Buffer Wait Solutions Tune by   Increase  data blocks   Try to tune DBWR       ASYNC          If no ASYNC use I/...
Session Finding a Free Block                         LRU Latch MRU                                                  LRU Ho...
DBWR taking Dirty Blocks off MRU               Buffer Headers LRU       LRU                             latch Dirty List o...
Cache Buffers LRU Latch MRU                                                   LRU                                Mid-Point...
Solution: Multiple SetsSet 1                           LRU Latch 1Set 2                                LRU Latch 2   _db_b...
Test Case 8 Sessions reading separate tables Tables were too big to hold in cache cache option set on each table Resu...
simulator lru latch
CBC – Further Investigation select * from v$event_name where name = latch free                           PARAMETER1 PARAME...
db_cache_adviceAlter system set db_cache_advice=off;                                 Group “other” is                     ...
Cache Buffers LRU Latch : Solution Other  Increase Size of Buffer Cache  Using multiple cache buffers     Keep,   recyc...
write complete waits Usually happens in tandem with free buffer Tune by      Increase data block cache Happens because...
Write Complete Waits             LRUDirty List of Buffer Headers LRUW        Session              DBWR
Buffer Busy Waits User 1 tries to change a buffer header User 2 has buffer header “locked” (pinned)    0    1    2    3 ...
10g Buffer Busy Waits   Mainly, on 10g (There are a few other cases )     BLOCK CLASS=data block (and some segment header...
Other Class Types : Segment header       When also seeing “data block” on the same object and the object is of OTYPE=   ...
How to get Class NameP3 = class#, how do we get class name?      select rownum n,ws.class                                 ...
Joining ASH with v$waitstatselect     o.object_name obj,     o.object_type otype,     ash.SQL_ID,     w.classfrom v$active...
Example: Lack of Free List                                                 4 Sessions running                             ...
Example: BBW with Insert Concurrent inserts will insert into the same block   Each   session has to wait for the previou...
Solution1: Free Lists                         4 Sessions running                            Insert into toto              ...
Solution2: ASSM Header    Level   Level        Level    Level   Level and       2       1            1        1       1 Le...
Tablespace Types : ASSMselect     tablespace_name,     extent_management LOCAL,     allocation_type EXTENTS,   TABLESPACE_...
BBW: ASSM Consider using Freelists instead of ASSM Normally waits on ASSM blocks should be too  small to warrant using F...
BBW on Index  Use Reverse Key indexes        Breaks   Index scans  Hash Partition Index        More   IOs per index ac...
BBW on IndexSolutions1. Hash Partitions 2. Reverse Keys
BBW on Index : ADDM Recs              Also consider “reversing” the key
BBW: File Header  Querying ASH, make sure        P1=current_file#        P2=current_block#  If not, use p1, p2 and not...
Temporary File #’sSQL> select file# from v$datafile;  FILE#                     Wait Temporary File#’s =    1             ...
BBW : File HeaderTime    P1    P2 OBJN OTYPE FN BLOCKN BLOCK_TYPE11:44 202      2 TOTO TABLE       1   60218 file header b...
Buffer Exterminate Buffer cache dynamically resized    Alter system set db_cache_size=50M; V$SGA_DYNAMIC_COMPONENTS disp...
Summary Buffer Cache Waits  1. latch: cache buffers chains - find SQL       Eliminate hot spots  1. latch: cache buffers ...
Próximos SlideShares
Carregando em…5
×

Oracle 10g Performance: chapter 06 buffer cache

2.924 visualizações

Publicada em

Publicada em: Educação
  • Login to see the comments

Oracle 10g Performance: chapter 06 buffer cache

  1. 1. Buffer Cache Waits
  2. 2. In This Section1. latch: cache buffers chains2. latch: cache buffers lru chain3. Free Buffer Wait4. Buffer Busy Wait5. Write Complete Wait6. Buffer Exterminate
  3. 3. Oracle Memory Structures SGARAM : Log Library BufferMachine Buffer Cache Cache Buffer CacheMemory Log Buffer DBWRLGWR User1 User3 User2 REDO Log Files Data Files
  4. 4. Buffer Cache Access Buffer Cache Management  Locating Free blocks  Finding data blocks  Managing LRU lists  Cleaning Dirty Blocks Buffer Cache management can cause contention  Different from IO ( reading blocks of disk )
  5. 5. Is Block in cache? Now you have a file# and block# How do you know if a block is cached? Shadow Process ? Do you search all the blocks? Could be 1000s of blocks to search. Buffer caches are in the multi Gig
  6. 6. Buffer Cache Find a block by: 1) Hash of What is a hash value Data file # What are Buckets What is the linked list? Block# 2) Result = Bucket # 3) Search linked list for that bucket #
  7. 7. Double Linked ListsAddress 03C38F60 03C39000 03C39478Next 03C39000 03C39478Previous 03C38F60 03C39000
  8. 8. Hashing Function Simple hash could be a Mod function  1 mod 4 = 1  2 mod 4 = 2  3 mod 4 = 3  4 mod 4 = 0  5 mod 4 = 1  6 mod 4 = 2  7 mod 4 = 3  8 mod 4 = 0 Using “mod 4” as a hash function creates 4 “buckets” to store things
  9. 9. Hash Bucket Fill Data Block Header Hash Block’s file# block #’s 0 Result in a bucket# ? Put Block in bucket 1 ? Hash Block’s 1 file# 2 ? 437 block #’s 3 ? (1+437) mod 4 = 2 After a while the buckets become populated with blocks
  10. 10. Latches Protect Bucket Contentslatches Hash Buffer Data Blocks bucket Headers Buffer Headers contents described by X$BH
  11. 11. X$bh  Describes Contents of Buffer HeadersSQL> desc x$bh Name Type ADDR ------------ -------- DBARFIL ADDR RAW(4) DBABLK DBARFIL NUMBER OBJ DBABLK NUMBER HLADDR OBJ NUMBER NXT_HASH HLADDR RAW(4) PRV_HASH NXT_HASH RAW(4) … PRV_HASH RAW(4) A each buffer header contains… much more Information about the data block It points to and the previous and next Buffer header in a linked list
  12. 12. X$BH describes Headers latches Hash Buffer Data Blocks bucket Headers HLADDR ADDR ADDR NXT_HASHx$bh PRV_HASH ADDR DBARFIL DBABLK OBJ DBARFIL HLADDR NXT_HASH DBABLK PRV_HASH OBJ
  13. 13. To Find a Blocklatches Hash Buffer Data Blocks bucket Headers Shadow Process 2 3 4 511. Hash the block address22. Get Bucket latch33. Look for header44. Found, read block in cache55. Not Found Read block off disk
  14. 14. Cache Buffers Chains latches Hash Block Buckets Headers Data Blocks s5 s4 s3 Cache Buffer Chain s2 s1Sessions Contention if too many accesses on a bucket
  15. 15. Examples 1. Look up Table S1 S2 S3 S4 t1 t2 Index_t2 2. Nested Loops Select t1.val, t2.val from t1, t2 where t1.c1 = {value} and t2.id = t1.id;
  16. 16. CBC SolutionsFind SQL ( Why is application hitting the block so hard? )  Nested loops, possibly  Hash Partition  Uses Hash Join  Hash clusters  Look up tables (“select language from lang_table where ...”)  Change application  Use plsql function  Spread data out to reduce contention (pctfree=99)  Select from dual  Possibly use x$dualHow do you find the SQL?
  17. 17. Which SQLselect count(*), sql_idfrom v$active_session_history ashwhere event like latch: cache buffers chainsgroup by sql_idorder by count(*)/ CNT SQL_ID 84 a09r4dwjpv01q
  18. 18. CBC: OEM
  19. 19. CBC: ADDM Problem SQL Statement Solution?
  20. 20. Finding the Hot Block:X$BH.TCH Updated when block read Updated by no more than 1 every 3 seconds Can be used to find “hot” blocks Note: set back to zero when block cycles through the buffer cache
  21. 21. CBC – Further Investigationselect * from v$event_namewhere name = latch: cache buffers chains EVENT# NAME 58 latch: cache buffers chains PARAMETER1 PARAMETER2 PARAMETER3 address number tries NOTE: _db_block_hash_buckets = # of hash buckets _db_block_hash_latches= # of hash latches
  22. 22. CBC – Real Timeselect count(*), lpad(replace(to_char(p1,XXXXXXXXX), ,0),16,0) laddrfrom v$active_session_historywhere event=latch: cache buffers chains COUNT(*) LADDRgroup by p1; 4933 00000004D8108330select o.name, bh.dbarfil, bh.dbablk, bh.tchfrom x$bh bh, obj$ owhere tch > 100 and hladdr=00000004D8108330 NAME DBARFIL DBABLK TCH and o.obj#=bh.objorder by tch EMP_CLUSTER 4 394 120
  23. 23. Putting into one Query select name, file#, dbablk, obj, tch, hladdr This can be misleading, as from x$bh bh TCH gets set to 0 ever rap , obj$ o around the LRU and it only where o.obj#(+)=bh.obj and gets updated once every 3 hladdr in seconds, so in this case DUAL ( was my problem table not select ltrim(to_char(p1,XXXXXXXXXX) ) MGMT_EMD_PING from v$active_session_history where event like latch: cache% NAME FILE# DBABLK OBJ TCH HLADDR group by p1 ------------- ----- ------ ------ --- -------- having count(*) > 5 BBW_INDEX 1 110997 66051 17 6BD91180 ) IDL_UB1$ 1 54837 73 18 6BDB8A80 and tch > 5 VIEW$ 1 6885 63 20 6BD91180 order by tch VIEW$ 1 6886 63 24 6BDB8A80 DUAL 1 2082 258 32 6BDB8A80 DUAL 1 2081 258 32 6BD91180 MGMT_EMD_PING 3 26479 50312 272 6BDB8A80
  24. 24. Hot Block via Tanel Poder Loop 100,000 times Latch Holders Event names Sessions
  25. 25. Consistent Read Blocks Current Consistent Block Read & (XCUR) Undo (CR) Both have same file# and block# and hash to same bucket s1 s2 Update Select
  26. 26. CBC: Consistent Read Blocks Hash Block latches Buckets Headers s5 Cache Buffer Chains4s3 Max length : _db_block_max_cr_dba = 6s2 (in 10g)s1 Contention: Too Many Buffers in Bucket
  27. 27. Consistent Read Copiesselect count(*) , name , file# , dbablk CNT NAME FILE# DBABLK HLADDR , hladdrfrom x$bh bh 14 MYDUAL 1 93170 2C9F4B20 , obj$ owhere o.obj#(+)=bh.obj and hladdr in( select ltrim(to_char(p1,XXXXXXXXXX) ) from v$active_session_history where event like latch: cache% group by p1)group by name,file#, dbablk, hladdrhaving count(*) > 1order by count(*);
  28. 28. CBC : Solution Find the SQL causing the problem  Change Application Logic Eliminate hot spots select ash.sql_id,  Look up tables count(*),  Uses pl/sql functions sql_text  Minimize data per block (pctfree=99) from v$active_session_history ash,  Possibly using x$dual instead of dual v$sqlstats sql  Oracle added fast dual in 10g , as long as the where field “dummy” isn’t accessed uses fast dual event=latch: cache buffers chains  Index Nested loops and sql.sql_id(+)=ash.sql_id  Hash join group by ash.sql_id, sql_text;  Hash partition index  Hash Cluster Updates, inserts , select for update on blocks while reading those blocks  Cause multiple copies
  29. 29. Block Pinninglatches Hash Buffer Data Blocks bucket Headers
  30. 30. Free Buffer WaitFinding a Free Block If the data block isn’t in cache  Geta free block and header in the buffer cache  Read it off disk  Update the free header  Read the block into the buffer cacheNeed Free Block to Read in New Data Block Tune by  Increase data blocks  Try to tune DBWR
  31. 31. Finding a Free BlockWhen a session reads a blockInto the bufffer cache how doesit find a FREE spot? Shadow Process
  32. 32. Finding a Free Blocklatches Hash Buffer Data Blocks bucket Headers 1. Arrange the Buffer Headers into an LRU List 2. Scan LRU for a free block
  33. 33. Cache Buffers LRU = entry in x$bh
  34. 34. X$bh Describes Buffer Headers SQL> desc x$bh Name Type ---------------------- --------- ADDR RAW(4) DBARFIL NUMBER DBABLK NUMBER OBJ NUMBER HLADDR HLADDR Cache RAW(4) RAW(4) NXT_HASH NXT_HASH buffer RAW(4) RAW(4) PRV_HASH PRV_HASH chains RAW(4) RAW(4) NXT_REPL RAW(4) LRU PRV_REPL RAW(4)
  35. 35. LRU Chain ADDR 03C38F60 03C39000 03C39478NXT_HASH 03C39000 03C38F60PRV_HASH 03C38F60 03C39000NXT_REPL 03C39478 03C38638 03C385F4PRV_REPL 03C38514 03C38620 03C38554
  36. 36. Cache Buffers LRU list
  37. 37. Cache Buffers LRU list LRU Chain of Buffer HeadersBuffer Cache
  38. 38. Cache Buffers LRU Latch Buffer Headers MRU LRU latch LRU “Hot” “Cold” LRU = Least Recently Used MRU = Most Recently UsedOne LRU Latch protects the linked list during changes to the list
  39. 39. Session Searching for Free Blocks MRU Buffer Headers LRU 1. Go to the LRU end of data blocks 2. Look for first non-dirty block 3. If search too many post DBWR to make free Session 4. Free Buffer wait Shadow
  40. 40. Free Buffer Wait Solutions Tune by  Increase data blocks  Try to tune DBWR  ASYNC  If no ASYNC use I/O Slaves (dbwr_io_slaves)  Multiple DBWR (db_writer_processes)  Direct I/O Tune Inefficient SQL  requesting large # of blocks
  41. 41. Session Finding a Free Block LRU Latch MRU LRU Hot End Mid-Point Find Free Insert Header Insertion Block Release LRU Latch Get LRU LatchNote: FTS read in at the cold end session CR copies as well
  42. 42. DBWR taking Dirty Blocks off MRU Buffer Headers LRU LRU latch Dirty List of Buffer Headers LRUW LRU latch also covers DBWR list of dirty blocs DBWR
  43. 43. Cache Buffers LRU Latch MRU LRU Mid-Point Insertion Oracle Tracks the touch count of blocks. As the block is pushed to the LRU end, if it’s touch count is 3 or more, it’s promoted to the MRU end
  44. 44. Solution: Multiple SetsSet 1 LRU Latch 1Set 2 LRU Latch 2 _db_block_lru_latches = 8 10gR2 with cpu_count = 2 X$KCBWDS – set descriptor
  45. 45. Test Case 8 Sessions reading separate tables Tables were too big to hold in cache cache option set on each table Result : lots of buffer cache churn Expected to get “latch: cache buffer chains LRU”
  46. 46. simulator lru latch
  47. 47. CBC – Further Investigation select * from v$event_name where name = latch free PARAMETER1 PARAMETER2 PARAMETER3 address number triesselect p2, count(*)from v$active_session_historywhere event=latch free P2 COUNT(*)group by p2 ---------- ---------- 127 3556select * from v$latchname where latch#=127 LATCH# NAME 127 simulator lru latch
  48. 48. db_cache_adviceAlter system set db_cache_advice=off; Group “other” is very small compared to I/O wait time – not a problem
  49. 49. Cache Buffers LRU Latch : Solution Other  Increase Size of Buffer Cache  Using multiple cache buffers  Keep, recycle  Possibly increase _db_block_lru_latches  Not supported
  50. 50. write complete waits Usually happens in tandem with free buffer Tune by  Increase data block cache Happens because shadow wants to access blocks that are currently being written to disk by DBWR also seen it happen when there is a lot of write to sort the waits are on block 2 of the temp tablespace file
  51. 51. Write Complete Waits LRUDirty List of Buffer Headers LRUW Session DBWR
  52. 52. Buffer Busy Waits User 1 tries to change a buffer header User 2 has buffer header “locked” (pinned) 0 1 2 3 User2 User1
  53. 53. 10g Buffer Busy Waits Mainly, on 10g (There are a few other cases ) BLOCK CLASS=data block (and some segment header) Object Type = INDEX Object Type = TABLEIndicates DML contention To verify use P3. P3 = Block Class (on 8.1.6-9iR2 was BBW type)
  54. 54. Other Class Types : Segment header  When also seeing “data block” on the same object and the object is of OTYPE= “TABLE” then confirms that the TABLE needs to use free lists or ASSM. File Header Block  Most likely extent allocation problems, look at extent size on tablespace and increase the extent size Free lists  Add free list groups Undo header  Not enough UNDO segments, if using old RBS then switch to AUM  “alter system set undo_management=auto scope=spfile;” 1st level bmb  Contention on ASSM bitmap blocks, might do better using freelists. Undo block  Hot spot in UNDO, application issue
  55. 55. How to get Class NameP3 = class#, how do we get class name? select rownum n,ws.class from v$waitstat; select * from v$event_name N CLASS where name = buffer busy waits 1 data block 2 sort block NAME NAME P1 P1 P2 P2 P3 P3 3 save undo block buffer busy waits file# block# class# buffer busy waits file# block# class# 4 segment header 5 save undo header 6 free list 7 extent map Note: Before 10g, P3 was BBW type 8 1st level bmb 9 2nd level bmb If P3 in 100,110,120,130 then read 10 3rd level bmb 11 bitmap block Now “read by other session” 12 bitmap index block 13 file header block Else Write, P3 in 200,210,220,230, 14 unused 231 15 system undo header 16 system undo block 17 undo header
  56. 56. Joining ASH with v$waitstatselect o.object_name obj, o.object_type otype, ash.SQL_ID, w.classfrom v$active_session_history ash, ( select rownum class#, class from v$waitstat ) w, all_objects owhere event=buffer busy waits and w.class#(+)=ash.p3 and o.object_id (+)= ash.CURRENT_OBJ#Order by sample_time;OBJ OTYPE SQL_ID CLASSTOTO1 TABLE 8gz51m9hg5yuf data blockTOTO1 TABLE 8gz51m9hg5yuf data blockTOTO1 TABLE 8gz51m9hg5yuf segment headerTOTO1 TABLE 8gz51m9hg5yuf data block
  57. 57. Example: Lack of Free List 4 Sessions running Insert into toto1 values (null, ‘a’); Commit; S1 S2 S3 S4 OBJN OTYPE FILEN BLOCKN SQL_ID BLOCK_TYPE 54962 TOTO1 TABLE 16 45012 8gz51m9hg5yuf data block 54962 TOTO1 TABLE 16 161 8gz51m9hg5yuf segment header
  58. 58. Example: BBW with Insert Concurrent inserts will insert into the same block  Each session has to wait for the previous session to finish it’s write  Usually pretty fast  Contention builds on highly concurrent applications Lack of Free Lists Not Using ASSM (Automatic Segment Space Management)
  59. 59. Solution1: Free Lists 4 Sessions running Insert into toto values (null, ‘a’); S1 S2 S3 S4 Commit;
  60. 60. Solution2: ASSM Header Level Level Level Level Level and 2 1 1 1 1 Level 3 BMB BMB BMB BMB BMB BMB S1 S2 S3 S4
  61. 61. Tablespace Types : ASSMselect tablespace_name, extent_management LOCAL, allocation_type EXTENTS, TABLESPACE_NAME LOCAL segment_space_management ASSM, EXTENTS ASSM initial_extent SYSTEM LOCAL SYSTEM MANUALfrom dba_tablespaces LOCAL UNDOTBS1 SYSTEM MANUAL SYSAUX LOCAL SYSTEM AUTO TEMP LOCAL UNIFORM MANUAL USERS create tablespace data2 SYSTEM LOCAL AUTO EXAMPLE LOCAL SYSTEM AUTO datafile /d3/kyle/data2_01.dbf DATA LOCAL SYSTEM MANUAL size 200M segment space management auto;
  62. 62. BBW: ASSM Consider using Freelists instead of ASSM Normally waits on ASSM blocks should be too small to warrant using Freelists ASSM is easier, automatically managed
  63. 63. BBW on Index  Use Reverse Key indexes  Breaks Index scans  Hash Partition Index  More IOs per index accessOBJN OTYPE FILEN BLOCKN SQL_ID BLOCK_TYPEBBW_INDEX_INDEX 1 113599 97dgthz60u28d data block 1Index Session 1 Increasing index key creates a hot Session 2 spot on the leading index leaf Session 3
  64. 64. BBW on IndexSolutions1. Hash Partitions 2. Reverse Keys
  65. 65. BBW on Index : ADDM Recs Also consider “reversing” the key
  66. 66. BBW: File Header  Querying ASH, make sure  P1=current_file#  P2=current_block#  If not, use p1, p2 and not current_object#Time P1 P2 OBJN OTYPE FN BLOCKN BLOCK_TYPE11:44 202 2 -1 0 0 file header block11:44 202 2 TOTO TABLE 1 60218 file header block11:44 202 2 TOTO TABLE 1 60218 file header block11:44 202 2 TOTO TABLE 1 60218 file header block11:44 202 2 TOTO TABLE 1 60218 file header blockSELECT A.OBJECT_ID FROM ALL_OBJECTS A,( SELECT * FROM ALL_OBJECTS WHERE ROWNUM < 1000) BORDER BY A.OBJECT_NAME
  67. 67. Temporary File #’sSQL> select file# from v$datafile; FILE# Wait Temporary File#’s = 1 Db_files + file# 2 3 4 SQL> show parameters db_files 5 NAME VALUE 6 7 db_files 200 8SQL> select file# from v$tempfile; FILE# 2 1 File# 202 = v$tempfile 2 Copyright 2006 Kyle Hailey
  68. 68. BBW : File HeaderTime P1 P2 OBJN OTYPE FN BLOCKN BLOCK_TYPE11:44 202 2 TOTO TABLE 1 60218 file header block ADDM doesn’t say muchSolution is make initial and next extent larger in Temp Table Space
  69. 69. Buffer Exterminate Buffer cache dynamically resized Alter system set db_cache_size=50M; V$SGA_DYNAMIC_COMPONENTS displays information about the dynamic SGA components. This view summarizes information based on all completed SGA resize operations since instance startup. V$SGA_CURRENT_RESIZE_OPS displays information about SGA resize operations which are currently in progress. An operation can be a grow or a shrink of a dynamic SGA component. V$SGA_DYNAMIC_FREE_MEMORY displays information about the amount of SGA memory available for future dynamic SGA resize operations.
  70. 70. Summary Buffer Cache Waits 1. latch: cache buffers chains - find SQL  Eliminate hot spots 1. latch: cache buffers lru chain – increase sets 2. Free Buffer Wait - increase cache size 3. Buffer Busy Wait  Index : alleviate hot spots, partition  Table: add free lists or use ASSM  File Segment Header : looked at high extent allocations 1. Write Complete Waits - increase cache size

×