Tuning StatsPack

177
Dale Roberts 10/25/22 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI E-mail: [email protected] Statspack Statspack

Transcript of Tuning StatsPack

Page 1: Tuning StatsPack

Dale Roberts05/03/23 1

Department of Computer and Information Science,School of Science, IUPUI

Dale Roberts, LecturerComputer Science, IUPUIE-mail: [email protected]

StatspackStatspack

Page 2: Tuning StatsPack

Dale Roberts2

Statspack, AWR Tuning & Block TuningStatspack, AWR Tuning & Block Tuning SOUG – 2007; Tampa, FloridaSOUG – 2007; Tampa, Florida

Rich Niemiec, TUSCRich Niemiec, TUSC(Thanks: Jay Rossiter, John Kennedy, Julie Wong, Arsalan (Thanks: Jay Rossiter, John Kennedy, Julie Wong, Arsalan

Farooq, Benoit Dageville, Tom Kyte, Brad Brown & Joe Trezzo)Farooq, Benoit Dageville, Tom Kyte, Brad Brown & Joe Trezzo)

Page 3: Tuning StatsPack

Dale Roberts3

Audience KnowledgeAudience Knowledge

Oracle8Oracle8ii Experience ? Experience ?Oracle9Oracle9ii Experience ? Experience ?Oracle9Oracle9ii RAC Experience? RAC Experience?Oracle10Oracle10gg Experience? Experience?

GoalsGoalsOverview of Tuning Statspack/AWROverview of Tuning Statspack/AWRFocus on a few nice features of Oracle 10Focus on a few nice features of Oracle 10g g

Non-GoalsNon-GoalsLearn ALL aspects of Tuning OracleLearn ALL aspects of Tuning Oracle

Page 4: Tuning StatsPack

Dale Roberts4

OverviewOverview

Statspack, Tools & Scripts that you can still Statspack, Tools & Scripts that you can still useuse

Top WaitsTop WaitsLoad ProfileLoad ProfileLatch WaitsLatch WaitsTop SQLTop SQLInstance ActivityInstance ActivityFile I/OFile I/O

The Future OEM & ADDMThe Future OEM & ADDMHelpful V$/X$Helpful V$/X$SummarySummary

Page 5: Tuning StatsPack

Dale Roberts5

Tuning in GeneralTuning in General

Both an Art and a ScienceBoth an Art and a ScienceExceptions often rule the day…Not a “one size fits all”Exceptions often rule the day…Not a “one size fits all”Hardware & Architecture must be right for your Hardware & Architecture must be right for your application or difficult to succeed.application or difficult to succeed.Statspack & Enterprise Manager (also 3Statspack & Enterprise Manager (also 3rdrd party party products) are best for simple tuning and ongoing products) are best for simple tuning and ongoing maintenance. maintenance. V$/X$ are best for drilling deep into problemsV$/X$ are best for drilling deep into problems

Enterprise Manager 10g will radically change things.Enterprise Manager 10g will radically change things.

Page 6: Tuning StatsPack

Dale Roberts6

Statspack - Still nice; Statspack - Still nice; Some new 10g featuresSome new 10g features

Page 7: Tuning StatsPack

Dale Roberts7

Statspack – Check Statspack – Check RegularlyRegularly

1.      Top 5 wait events1.      Top 5 wait events2.      Load Profile2.      Load Profile3.      Instance Efficiency Hit Ratios3.      Instance Efficiency Hit Ratios4.      Wait Events / 4.      Wait Events / Wait Event HistogramsWait Event Histograms5.      Latch Waits 5.      Latch Waits 6.      Top SQL6.      Top SQL7.      Instance Activity / 7.      Instance Activity / Time Model Stats / O/S StatsTime Model Stats / O/S Stats8.      File I/O / 8.      File I/O / File Read Histogram / Undo StatsFile Read Histogram / Undo Stats9.      Memory Allocation9.      Memory Allocation10.    Undo10.    Undo

Page 8: Tuning StatsPack

Dale Roberts8

Statspack – Miscellaneous Statspack – Miscellaneous notesnotes

SQL> @spcreateSQL> @spcreate (system/manager as SYSDBA) (system/manager as SYSDBA) <1m<1mSQL> alter user PERFSTAT account lock; (also SQL> alter user PERFSTAT account lock; (also unlock)unlock)

SQL> EXECUTE STATSPACK.MODIFY_STATSPACK_PARAMETER – SQL> EXECUTE STATSPACK.MODIFY_STATSPACK_PARAMETER – (i_snap_level=>5, i_buffer_gets_th=>100000, - (i_snap_level=>5, i_buffer_gets_th=>100000, - i_modify_parameter=>'true');i_modify_parameter=>'true');

SQL> execute STATSPACK.SNAP; (do this for start/end) PL/SQL SQL> execute STATSPACK.SNAP; (do this for start/end) PL/SQL procedure successfully completed.procedure successfully completed.(spauto.sql – Setup a snap on the hour every hour)(spauto.sql – Setup a snap on the hour every hour)

SQL> @ORACLE_HOME/rdbms/admin/spreport (also sprepsql)SQL> @ORACLE_HOME/rdbms/admin/spreport (also sprepsql)

Page 9: Tuning StatsPack

Dale Roberts9

Statspack – Header Statspack – Header InformationInformation

DB Name DB Id Instance Inst Num Release Cluster HostDB Name DB Id Instance Inst Num Release Cluster Host------------ ----------- ------------ -------- ----------- -------- ---------------- ----------- ------------ -------- ----------- -------- ----ORA92 968233682 P10 1 9.2.0.4.0 NO RJN1ORA92 968233682 P10 1 9.2.0.4.0 NO RJN1   Snap Id Snap Time Sessions Curs/Sess CommentSnap Id Snap Time Sessions Curs/Sess Comment --------- ------------------ -------- --------- --------------------- ------------------ -------- --------- ------------Begin Snap: 458 28-Nov-03 00:15:00 814 179.1Begin Snap: 458 28-Nov-03 00:15:00 814 179.1 End Snap: 505 28-Nov-03 23:45:00 816 211.4End Snap: 505 28-Nov-03 23:45:00 816 211.4 Elapsed: 1,410.00 (mins)Elapsed: 1,410.00 (mins)  Cache Sizes (end)Cache Sizes (end)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Buffer Cache: 32,773M Std Block Size: 8KBuffer Cache: 32,773M Std Block Size: 8K Shared Pool Size: 2,048M Log Buffer: 1,024KShared Pool Size: 2,048M Log Buffer: 1,024K  

Page 10: Tuning StatsPack

Dale Roberts10

Statspack – Header Statspack – Header InformationInformation

DB Name DB Id Instance Inst Num Release DB Name DB Id Instance Inst Num Release RACRAC Host Host------------ ----------- ------------ -------- ----------- --- ---------------------- ----------- ------------ -------- ----------- --- ----------ORCL 1050469182 orcl 1 10.1.0.2.0 NO RJNMOBILE5ORCL 1050469182 orcl 1 10.1.0.2.0 NO RJNMOBILE5   Snap Id Snap Time Sessions Curs/Sess CommentSnap Id Snap Time Sessions Curs/Sess Comment --------- ------------------ -------- --------- --------------------- ------------------ -------- --------- ------------Begin Snap: 1 12-Apr-04 11:36:02 14 5.4Begin Snap: 1 12-Apr-04 11:36:02 14 5.4 End Snap: 2 12-Apr-04 12:25:32 18 5.6End Snap: 2 12-Apr-04 12:25:32 18 5.6 Elapsed: 49.50 (mins)Elapsed: 49.50 (mins)  Cache Sizes (end)Cache Sizes (end)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Buffer Cache: 24M Std Block Size: 8KBuffer Cache: 24M Std Block Size: 8K Shared Pool Size: 80M Log Buffer: 256KShared Pool Size: 80M Log Buffer: 256K

Page 11: Tuning StatsPack

Dale Roberts11

Statspack – Header Statspack – Header InformationInformation

Ensure that you’re running for the right Ensure that you’re running for the right instance.instance.Check the start/end timesCheck the start/end timesCheck the cache sizes Check the cache sizes

Could have been changed during the runCould have been changed during the runLast page will tell you more on starting/ending values of Last page will tell you more on starting/ending values of initialization parametersinitialization parameters

Page 12: Tuning StatsPack

Dale Roberts12

Statspack – Load ProfileStatspack – Load Profile

Load ProfileLoad Profile~~~~~~~~~~~~ Per Second Per Transaction~~~~~~~~~~~~ Per Second Per Transaction --------------- ------------------------------ --------------- Redo size: 1,409,245.79 36,596.21Redo size: 1,409,245.79 36,596.21 Logical reads: 157,472.47 4,089.35Logical reads: 157,472.47 4,089.35 Block changes: 4,061.85 105.48Block changes: 4,061.85 105.48 Physical reads: 5,965.05 154.90Physical reads: 5,965.05 154.90 Physical writes: 587.76 15.26Physical writes: 587.76 15.26 User calls: 5,922.08 153.79User calls: 5,922.08 153.79 Parses: 92.11 2.39Parses: 92.11 2.39 Hard parses: 0.17 0.00Hard parses: 0.17 0.00 Sorts: 93.88 2.44Sorts: 93.88 2.44 Logons: 0.25 0.01Logons: 0.25 0.01 Executes: 5,686.76 147.68Executes: 5,686.76 147.68 Transactions: 38.51Transactions: 38.51   % Blocks changed per Read: 2.58 Recursive Call %: 2.38% Blocks changed per Read: 2.58 Recursive Call %: 2.38 Rollback per transaction %: 1.22 Rows per Sort: 114.10Rollback per transaction %: 1.22 Rows per Sort: 114.10

Page 13: Tuning StatsPack

Dale Roberts13

AWR – Load ProfileAWR – Load Profile

Page 14: Tuning StatsPack

Dale Roberts14

Statspack – Instance Statspack – Instance EfficiencyEfficiency

Instance Efficiency Percentages (Target 100%)Instance Efficiency Percentages (Target 100%)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Buffer Nowait %: 99.08 Redo NoWait %: 99.86Buffer Nowait %: 99.08 Redo NoWait %: 99.86 Buffer Hit %: 96.39 In-memory Sort %: 99.95Buffer Hit %: 96.39 In-memory Sort %: 99.95 Library Hit %: 100.00 Soft Parse %: 99.82Library Hit %: 100.00 Soft Parse %: 99.82 Execute to Parse %: 98.38 Latch Hit %: 99.64Execute to Parse %: 98.38 Latch Hit %: 99.64Parse CPU to Parse Elapsd %: 85.11 % Non-Parse CPU: 99.86Parse CPU to Parse Elapsd %: 85.11 % Non-Parse CPU: 99.86  

Page 15: Tuning StatsPack

Dale Roberts15

Statspack - Instance Statspack - Instance Efficiency Efficiency

Things to look for… Things to look for…

Buffer NoWait %Buffer NoWait % of less than 99 percent. This of less than 99 percent. This is ratio of hits on a request for a specific is ratio of hits on a request for a specific buffer where the buffer was immediately buffer where the buffer was immediately available in memory. If the ratio is low, then available in memory. If the ratio is low, then could be a (hot) block(s) being contended for could be a (hot) block(s) being contended for that should be found in the Buffer Wait that should be found in the Buffer Wait Section.Section.

Page 16: Tuning StatsPack

Dale Roberts16

Statspack - Instance Statspack - Instance Efficiency Efficiency

Things to look for… Things to look for…

Buffer Hit %Buffer Hit % of less than 95 percent. This is the ratio of less than 95 percent. This is the ratio of hits on a request for a specific buffer and the of hits on a request for a specific buffer and the buffer was in memory instead of needing to do a buffer was in memory instead of needing to do a physical I/O. physical I/O.

When this varies greatly one day to the next, further When this varies greatly one day to the next, further investigation should be done as to the cause.investigation should be done as to the cause.If you have unselective indexes that are frequently accessed, it If you have unselective indexes that are frequently accessed, it will drive your hit ratio higher, which can be misleading will drive your hit ratio higher, which can be misleading indication of good performance. indication of good performance. When you effectively tune your SQL and have effective indexes When you effectively tune your SQL and have effective indexes on your entire system, this issue is not encountered as on your entire system, this issue is not encountered as frequently and the hit ratio is a better performance indicator.frequently and the hit ratio is a better performance indicator.

Page 17: Tuning StatsPack

Dale Roberts17

Statspack - Instance Statspack - Instance Efficiency Efficiency

Things to look for… Things to look for…

Library Hit %Library Hit % of less than 95 percent. A lower of less than 95 percent. A lower library hit ratio usually indicates that SQL is being library hit ratio usually indicates that SQL is being pushed out of the shared pool early (could be due pushed out of the shared pool early (could be due to a shared pool that is too small). to a shared pool that is too small).

A lower ratio could also indicate that bind variables are not A lower ratio could also indicate that bind variables are not used or some other issue is causing SQL not to be reused (in used or some other issue is causing SQL not to be reused (in which case a smaller shared pool may only be a band-aid which case a smaller shared pool may only be a band-aid that will potentially fix a library latch problem which may that will potentially fix a library latch problem which may result). result). You must fix the problem (use bind variables or You must fix the problem (use bind variables or CURSOR_SHARING) and then appropriately size the shared CURSOR_SHARING) and then appropriately size the shared pool. I’ll discuss this further when we get to latch issues.pool. I’ll discuss this further when we get to latch issues.

Page 18: Tuning StatsPack

Dale Roberts18

Statspack - Instance Statspack - Instance Efficiency Efficiency

Things to look for… Things to look for…

In-Memory Sort %In-Memory Sort % of less than 95 percent in of less than 95 percent in OLTP. In an OLTP system, you really don’t OLTP. In an OLTP system, you really don’t want to do disk sorts. Setting the want to do disk sorts. Setting the PGA_AGGREGATE_TARGET (or PGA_AGGREGATE_TARGET (or SORT_AREA_SIZE) initialization parameter SORT_AREA_SIZE) initialization parameter effectively will eliminate this problem.effectively will eliminate this problem.Latch Hit %Latch Hit % of less than 99 percent is usually a of less than 99 percent is usually a big problem. Finding the specific latch will big problem. Finding the specific latch will lead you to solving this issue. More in the lead you to solving this issue. More in the Latch Wait section.Latch Wait section.

Page 19: Tuning StatsPack

Dale Roberts19

AWR - Instance Efficiency AWR - Instance Efficiency

Page 20: Tuning StatsPack

Dale Roberts20

What are you Waiting on?What are you Waiting on?

Page 21: Tuning StatsPack

Dale Roberts21

Statspack – Top Wait Statspack – Top Wait EventsEvents

Top 5 Timed EventsTop 5 Timed Events~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

% Total% TotalEvent Waits Time (s) Ela TimeEvent Waits Time (s) Ela Time--------------------------- ------------ ----------- ----------------------------------- ------------ ----------- --------db file sequential read 399,394,399 2,562,115 52.26db file sequential read 399,394,399 2,562,115 52.26CPU time 960,825 19.60CPU time 960,825 19.60buffer busy waits 122,302,412 540,757 11.03buffer busy waits 122,302,412 540,757 11.03PL/SQL lock timer 4,077 243,056 4.96PL/SQL lock timer 4,077 243,056 4.96log file switch log file switch 188,701 187,648 3.83 188,701 187,648 3.83(checkpoint incomplete)(checkpoint incomplete)

Page 22: Tuning StatsPack

Dale Roberts22

Statspack - Top Wait EventsStatspack - Top Wait EventsThings to look for… Things to look for…

Wait ProblemWait Problem Potential FixPotential FixSequential Read Sequential Read Indicates many index reads – Indicates many index reads –

tune the tune the code (especially joins); Faster I/Ocode (especially joins); Faster I/OScattered Read Scattered Read Indicates many full table scans – Indicates many full table scans –

tune tune the code; cache small tables; Faster I/Othe code; cache small tables; Faster I/OFree Buffer Free Buffer Increase the DB_CACHE_SIZE; Increase the DB_CACHE_SIZE;

shorten the checkpoint; tune the code to shorten the checkpoint; tune the code to get get less dirty blocks, faster I/O,less dirty blocks, faster I/O,use multiple DBWR’s. use multiple DBWR’s.

Buffer Busy Buffer Busy Segment HeaderSegment Header – Add freelists (if – Add freelists (if inserts) inserts) or freelist groups (esp. RAC). Use or freelist groups (esp. RAC). Use ASSM.ASSM.

Page 23: Tuning StatsPack

Dale Roberts23

Statspack - Top Wait EventsStatspack - Top Wait EventsThings to look for… Things to look for…

Wait ProblemWait Problem Potential FixPotential FixBuffer Busy Buffer Busy Data BlockData Block – Separate ‘hot’ data; – Separate ‘hot’ data;

potentiallypotentiallyuse reverse key indexes; fix queries to use reverse key indexes; fix queries to reduce the blocks popularity, use reduce the blocks popularity, use smaller blocks, I/O, Increase initrans smaller blocks, I/O, Increase initrans and/or and/or maxtrans (this one’s debatable) maxtrans (this one’s debatable) Reduce records per block.Reduce records per block.

Buffer Busy Buffer Busy Undo HeaderUndo Header – Add rollback segments – Add rollback segments or increase size of segment area (auto undo)or increase size of segment area (auto undo)

Buffer Busy Buffer Busy Undo blockUndo block – Commit more (not too – Commit more (not too much) Larger rollback segments/area. much) Larger rollback segments/area. Try to fix Try to fix the SQL.the SQL.

Page 24: Tuning StatsPack

Dale Roberts24

Statspack - Top Wait EventsStatspack - Top Wait EventsThings to look for… Things to look for…

Wait ProblemWait Problem Potential FixPotential FixEnqueue - STEnqueue - ST Use LMT’s or pre-allocate large Use LMT’s or pre-allocate large

extents extents Enqueue - HWEnqueue - HW Pre-allocate extents above HW (high Pre-allocate extents above HW (high

water water mark.)mark.)Enqueue – TXEnqueue – TX Increase initrans and/or maxtrans Increase initrans and/or maxtrans

(TX4) (TX4) on (transaction) the table or index. Fix on (transaction) the table or index. Fix locking issues if TX6. Bitmap (TX4) &locking issues if TX6. Bitmap (TX4) &Duplicates in Index (TX4).Duplicates in Index (TX4).

Enqueue - TMEnqueue - TM Index foreign keys; Check application Index foreign keys; Check application (trans. mgmt.)(trans. mgmt.) locking of tables. DML Locks.locking of tables. DML Locks.

Page 25: Tuning StatsPack

Dale Roberts25

Transactions Moving through Oracle: ITL &

Undo Blocks

Why INITRANS Matter!Why INITRANS Matter!

Page 26: Tuning StatsPack

Dale Roberts26

User 1 – Updates Row# 1&2User 1 – Updates Row# 1&2User 2 updates Row 3User 2 updates Row 3

User1 updates a row with an User1 updates a row with an insert/update/delete – an ITL insert/update/delete – an ITL is opened and xid tracks it is opened and xid tracks it in the data block.in the data block.The xid ties to the UNDO The xid ties to the UNDO header block which ties to header block which ties to the UNDO data block for the UNDO data block for undo.undo.If user2 wants to query the If user2 wants to query the row, they create a clone and row, they create a clone and rollback the transaction rollback the transaction going to the undo header going to the undo header and undo block.and undo block.If user3 wants to update If user3 wants to update same row (they wait). If same row (they wait). If user 3 wants to update user 3 wants to update different row then they open different row then they open a second ITL with an xid that a second ITL with an xid that maps to an undo header that maps to an undo header that maps to an undo block.maps to an undo block.

Cache Layer

2Transaction LayerXID 01XID 02

2 Row 3

1 Row 1 1 Row 2

Lock Byte

ITL 1ITL 2

User1Request

User3Request

XID 02 ITL 2

Row 32 Row 3

Page 27: Tuning StatsPack

Dale Roberts27

Row Level LocksRow Level Locks(C

hain

Lat

ch)

n

1

3

Cache Buffers

Buffer Header

HashBuckets

LRU Lists LRU Write List

DBWrite

1

2

3

Log

Buf

fersUser

Request

Sha

red

Poo

l SGA

Buffer Cache

2

Cache Layer

2Transaction LayerXID 01XID 02

2 Row 3

1 Row 1 1 Row 2

Lock Byte

ITL 1ITL 2

XID 01 ITL 1

Itl Xid Uba Flag Lck …0x01 0x0005.02a.0000028c 0x008000af.026b.01 ---- 1 …

usn#

0x02a 0x028c

RBU Header 5wrap#

Data Blockslot#

XID0X005.02a.0000028c

Transaction Identifiers

Page 28: Tuning StatsPack

Dale Roberts28

Block Dumps – Top Section / ITLBlock Dumps – Top Section / ITL

Itl Xid Uba Flag Lck Scn/Fsc

0x01 0x0004.010.00000fba 0x0080003d.08b5.10 ---- 4 fsc 0x009d.00000000

0x02 0x0004.016.00000fae 0x008000cc.08af.34 C--- 0 scn 0x0000.003deb5b

ITL – 2 Interested Transaction Lists

Transaction IDUndo#.slot#.wrap#(Undo#,slot#,seq#)

UBA:File.block(Undo dba).sequence.recordUndo block address where last change is recorded.

Rows Locked: 4 rows deleted for this xid in this block.

Page 29: Tuning StatsPack

Dale Roberts29

AWR – ITL Issues AWR – ITL Issues

Page 30: Tuning StatsPack

Dale Roberts30

Statspack - Top Wait EventsStatspack - Top Wait EventsThings to look for… Things to look for…

Wait ProblemWait Problem Potential FixPotential FixLatch FreeLatch Free Investigate the detail (Covered Investigate the detail (Covered

later)later)Log Buffer SpaceLog Buffer Space Increase the Log Buffer; Faster Increase the Log Buffer; Faster

disks disks for the Redo Logsfor the Redo LogsLog File SwitchLog File Switch Archive destination slow or full; Archive destination slow or full;

Add Add more or larger Redo Logsmore or larger Redo LogsLog file syncLog file sync Commit more records at a Commit more records at a

time; Faster time; Faster Redo Log disks; Redo Log disks; Raw devicesRaw devices

Page 31: Tuning StatsPack

Dale Roberts31

Statspack - Top Wait EventsStatspack - Top Wait EventsThings to look for… Things to look for…

Wait ProblemWait Problem Potential FixPotential FixCBC LatchesCBC Latches Cache Buffers Chains Latches – Cache Buffers Chains Latches –

ReduceReducethe length of the hash chain (less the length of the hash chain (less copies) by reducing block’s popularity.copies) by reducing block’s popularity.Increase the latches by increasing Increase the latches by increasing buffers. Use Oracle SQ generator.buffers. Use Oracle SQ generator.

LRU Chain LatchLRU Chain Latch This latch protects the LRU list This latch protects the LRU list when when a user needs the latch to scan the LRUa user needs the latch to scan the LRUchain for a buffer. When a dirty bufferchain for a buffer. When a dirty bufferis encountered it is linked to the is encountered it is linked to the LRU-W. When adding, moving, orLRU-W. When adding, moving, orremoving a buffer this latch is needed.removing a buffer this latch is needed.

Page 32: Tuning StatsPack

Dale Roberts32

Decoding the Decoding the Hot/Cold RegionsHot/Cold Regions

(fyi only)(fyi only)

Page 33: Tuning StatsPack

Dale Roberts33

The percent of buffers in the hot The percent of buffers in the hot regionregion

A look at pointers in the LRUA look at pointers in the LRU

Managed as FIFO

_db_percent_hot_default = 50 The percent of buffers in the

hot region

LRU Lists_db_percent_hot_default = 70 (too high?)

The percent of buffers in the hot region

Managed as LRU/MRULRU Lists

Page 34: Tuning StatsPack

Dale Roberts34

A look at pointers in the LRUA look at pointers in the LRU

Managed as FIFOManaged as LRU/MRU

BlockFrom Disk

If Touch Count > 2 when Oracle islooking for free buffer or doing DBWR then pointer to MRU (hot).

Page 35: Tuning StatsPack

Dale Roberts35

Altering the Hot/Cold LRUAltering the Hot/Cold LRUReally advanced tuning!Really advanced tuning!

1. _db_percent_hot_default (50) – The percent of buffers in the hot region. 1. _db_percent_hot_default (50) – The percent of buffers in the hot region. 2. _db_aging_touch_time* (3) – Seconds that must pass to increment 2. _db_aging_touch_time* (3) – Seconds that must pass to increment

touch count again. (Higher - less LRU movement)touch count again. (Higher - less LRU movement)3. _db_aging_hot_criteria (2) – Threshold to move a buffer to the MRU 3. _db_aging_hot_criteria (2) – Threshold to move a buffer to the MRU

(hot) end of LRU chain.(hot) end of LRU chain.4. _db_aging_stay_count (0) – **Touch count reset to this when moved to 4. _db_aging_stay_count (0) – **Touch count reset to this when moved to

MRU (hot) end. Set=0 even if it was 200 previously!MRU (hot) end. Set=0 even if it was 200 previously!5. _db_aging_cool_count (1) – Touch count reset to this when moved to 5. _db_aging_cool_count (1) – Touch count reset to this when moved to

LRU (cold) end. Set=1 even if it was 200 previously! LRU (cold) end. Set=1 even if it was 200 previously!

Setting parameter 1 (above) lower, we increase hanging on to older Setting parameter 1 (above) lower, we increase hanging on to older buffers and setting it higher will cause a flush sooner. (*Error in buffers and setting it higher will cause a flush sooner. (*Error in description)description)

Page 36: Tuning StatsPack

Dale Roberts36

Altering the Hot/Cold LRUAltering the Hot/Cold LRUReally advanced tuning!Really advanced tuning!

6. _db_aging_freeze_cr (FALSE) – Setting this to TRUE will make 6. _db_aging_freeze_cr (FALSE) – Setting this to TRUE will make cr (consistent read) buffers too cold to keep in the cache.cr (consistent read) buffers too cold to keep in the cache.

7. _db_percent_hot_keep (0) – Percent of keep buffers 7. _db_percent_hot_keep (0) – Percent of keep buffers considered hot (in hot region). Old LRU algorithm!considered hot (in hot region). Old LRU algorithm!

8. _db_percent_hot_recycle (0) – Percent of recycle buffers 8. _db_percent_hot_recycle (0) – Percent of recycle buffers considered hot (in hot region). Old LRU algorithm!considered hot (in hot region). Old LRU algorithm!

** If ** If _db_aging_stay_count_db_aging_stay_count => => _db_aging_hot_criteria_db_aging_hot_criteria then touch then touch count is set to ½ it’s current count instead of setting it to the count is set to ½ it’s current count instead of setting it to the _db_aging_stay_count when moved to the hot end of LRU._db_aging_stay_count when moved to the hot end of LRU.

- FTS, FFIS (multi-block) are put on the cold end of the LRU.- FTS, FFIS (multi-block) are put on the cold end of the LRU.

Page 37: Tuning StatsPack

Dale Roberts37

Additional LRU’s / Faster!!Additional LRU’s / Faster!!

LRULRU Main block replacement listMain block replacement listLRU-WLRU-W Old dirty buffers and reco/tempOld dirty buffers and reco/tempLRU-PLRU-P Ping Buffer list / RACPing Buffer list / RACLRU-XOLRU-XO Buffers to be written for drop/truncateBuffers to be written for drop/truncateLRU-XRLRU-XR Buffers to be written for reuse Buffers to be written for reuse rangerangeThread CKPTThread CKPT Thread Checkpoint QueueThread Checkpoint QueueFile CKPTFile CKPT File Checkpoint QueueFile Checkpoint QueueReco CKPTReco CKPT Reco CheckpointReco CheckpointLRU-MAIN & LRU-AUX help LRULRU-MAIN & LRU-AUX help LRU

Page 38: Tuning StatsPack

Dale Roberts38

Locally Managed Locally Managed Tablespaces- LMTTablespaces- LMT

Manage space locally using bitmapsManage space locally using bitmapsBenefitsBenefits

no tablespace fragmentation issuesno tablespace fragmentation issuesbetter performance handling on large segments better performance handling on large segments lower contention for central resources, e.g., no ST lower contention for central resources, e.g., no ST enqueue contentionenqueue contentionfewer recursive callsfewer recursive calls

ImplementationImplementationspecify “EXTENT MANAGEMENT LOCAL” clause specify “EXTENT MANAGEMENT LOCAL” clause during tablespace creationduring tablespace creationin-place migrationin-place migration

Page 39: Tuning StatsPack

Dale Roberts39

Automatic Segment Space Automatic Segment Space Management (ASSM)Management (ASSM)

Automatic intra-object space managementAutomatic intra-object space managementBenefits – Benefits –

Eliminates Rollback Segment ManagementEliminates Rollback Segment Managementsimplified administration (simplified administration (no more FREELISTS, FREELIST no more FREELISTS, FREELIST GROUPS, PCTUSEDGROUPS, PCTUSED))improved space utilization & concurrencyimproved space utilization & concurrencyenhanced performanceenhanced performance

Can set undo retention timeCan set undo retention timeIf set to longest running query time, no more “Snapshot too old”!If set to longest running query time, no more “Snapshot too old”!

ImplementationImplementationspecify “SEGMENT SPACE MANAGEMENT AUTO” clause during specify “SEGMENT SPACE MANAGEMENT AUTO” clause during tablespace creationtablespace creation

Page 40: Tuning StatsPack

Dale Roberts40

10g Only – Wait Event Histogram10g Only – Wait Event Histogram(Breaks down the wait detail)(Breaks down the wait detail)

Wait Event Histogram DB/Inst: ORCL/orcl Snaps: 1-2Wait Event Histogram DB/Inst: ORCL/orcl Snaps: 1-2-> ordered by event (idle events last)-> ordered by event (idle events last)  EventEvent---------------------------------------------------------------------------------------------------- 0 - 1 ms 1 - 4 ms 4 - 8 ms 8 - 16 ms 16 - 32 ms 32+ ms0 - 1 ms 1 - 4 ms 4 - 8 ms 8 - 16 ms 16 - 32 ms 32+ ms------------ ------------ ------------ ------------ ------------ ------------------------ ------------ ------------ ------------ ------------ ------------enq: HW - contentionenq: HW - contention 243 74 73 60 55 197243 74 73 60 55 197enq: TX - contentionenq: TX - contention 6 3 0 0 0 616 3 0 0 0 61latch freelatch free 657 2 0 0 0 0657 2 0 0 0 0latch: In memory undo latchlatch: In memory undo latch 3 3 1 1 0 03 3 1 1 0 0latch: cache buffers chainslatch: cache buffers chains 89 7 14 68 1 089 7 14 68 1 0latch: redo allocationlatch: redo allocation 35 56 25 3 0 035 56 25 3 0 0

Page 41: Tuning StatsPack

Dale Roberts41

10g– Enqueues Spelled Out 10g– Enqueues Spelled Out Enqueue activity DB/Inst: ORCL/orcl Snaps: 1-2Enqueue activity DB/Inst: ORCL/orcl Snaps: 1-2-> Enqueue stats gathered prior to 10g should not be compared with 10g data-> Enqueue stats gathered prior to 10g should not be compared with 10g data  Enqueue Type (Request Reason)Enqueue Type (Request Reason)------------------------------------------------------------------------------------------------------------------------------------------------------------ Requests Succ Gets Failed Gets Waits Wt Time (s) Av Wt Time(ms)Requests Succ Gets Failed Gets Waits Wt Time (s) Av Wt Time(ms)------------ ------------ ----------- ----------- ------------ -------------------------- ------------ ----------- ----------- ------------ --------------HW-Segment High Water MarkHW-Segment High Water Mark 5,264 5,245 19 552 168 304.965,264 5,245 19 552 168 304.96TX-TransactionTX-Transaction 1,330 1,330 0 61 77 1,255.211,330 1,330 0 61 77 1,255.21CF-Controlfile TransactionCF-Controlfile Transaction 4,400 4,298 102 159 43 271.144,400 4,298 102 159 43 271.14CI-Cross-Instance Call InvocationCI-Cross-Instance Call Invocation 460 460 0 4 1 157.75460 460 0 4 1 157.75US-Undo SegmentUS-Undo Segment 1,021 1,021 0 7 0 60.141,021 1,021 0 7 0 60.14FB-Format BlockFB-Format Block 3,655 3,655 0 1 0 60.003,655 3,655 0 1 0 60.00 --------------------------------------------------------------------------------------------------------------------------

Page 42: Tuning StatsPack

Dale Roberts42

Statspack – Top 25Statspack – Top 25

Tuning the top 25 buffer get and top 25 Tuning the top 25 buffer get and top 25 physical get queries has yielded system physical get queries has yielded system performance gains of anywhere from 5 percent performance gains of anywhere from 5 percent to 5000 percent. to 5000 percent. The SQL section of the statspack report tells The SQL section of the statspack report tells you which queries to potentially tune first. you which queries to potentially tune first. The top 10 of your SQL statements should not The top 10 of your SQL statements should not be more than 10 percent of your buffer gets or be more than 10 percent of your buffer gets or disk reads.disk reads.

Page 43: Tuning StatsPack

Dale Roberts43

Statspack – Top SQLStatspack – Top SQL

Buffer Gets Executions Gets per Exec %Total Time(s) Time Buffer Gets Executions Gets per Exec %Total Time(s) Time (s) Hash Value(s) Hash Value

--------------- ------------ -------------- ------ ------- ----------------------- ------------ -------------- ------ ------- -------- 627,226,570 117 5,360,910.9 4.7 9627.09 10367.04627,226,570 117 5,360,910.9 4.7 9627.09 10367.04Module: JDBC Thin ClientModule: JDBC Thin ClientSELECT * FROM (select d1.tablespace_name, d1.owner, d1.segment_tSELECT * FROM (select d1.tablespace_name, d1.owner, d1.segment_type, d1.segment_name, d1.header_file, d1.extents, d1.bytes, d1.bype, d1.segment_name, d1.header_file, d1.extents, d1.bytes, d1.blocks, d1.max_extents , d1.next_extent from sys.dba_segments d1locks, d1.max_extents , d1.next_extent from sys.dba_segments d1where d1.segment_type != 'CACHE' and tablespace_name not in (swhere d1.segment_type != 'CACHE' and tablespace_name not in (select distinct tablespace_name from sys.dba_rollback_segs) ordeelect distinct tablespace_name from sys.dba_rollback_segs) orde   409,240,446 175,418 2,332.9 3.1 ####### 59430.83409,240,446 175,418 2,332.9 3.1 ####### 59430.83Module: ? @sap10ci (TNS V1-V3)Module: ? @sap10ci (TNS V1-V3)SELECT "TABNAME" , "VARKEY" , "DATALN" , "VARDATA" FROM "KAPOL"SELECT "TABNAME" , "VARKEY" , "DATALN" , "VARDATA" FROM "KAPOL"WHERE "TABNAME" = :A0 AND "VARKEY" LIKE :A1 ORDER BY "TABNAME" ,WHERE "TABNAME" = :A0 AND "VARKEY" LIKE :A1 ORDER BY "TABNAME" , "VARKEY""VARKEY"

Page 44: Tuning StatsPack

Dale Roberts44

AWR – Top SQLAWR – Top SQL

Page 45: Tuning StatsPack

Dale Roberts45

Statspack - Latch WaitsStatspack - Latch Waits

Latch FreeLatch Free – Latches are low-level queueing – Latches are low-level queueing mechanisms (they’re accurately referred to as mechanisms (they’re accurately referred to as mutually exclusion mechanisms) used to protect mutually exclusion mechanisms) used to protect shared memory structures in the System Global shared memory structures in the System Global Area (SGA). Area (SGA). Latches are like locks on memory that are very Latches are like locks on memory that are very quickly obtained and released. quickly obtained and released. Latches are used to prevent concurrent access to a Latches are used to prevent concurrent access to a shared memory structure. shared memory structure. If the latch is not available, a latch free miss is If the latch is not available, a latch free miss is recorded. recorded.

Page 46: Tuning StatsPack

Dale Roberts46

Statspack - Latch WaitsStatspack - Latch Waits

Latch FreeLatch Free – –Most latch problems are related to:Most latch problems are related to:

The failure to use bind variables (library cache latch)The failure to use bind variables (library cache latch)Redo generation issues (redo allocation latch)Redo generation issues (redo allocation latch)Buffer cache contention issues (cache buffers lru chain) Buffer cache contention issues (cache buffers lru chain) Hot blocks in the buffer cache (cache buffers chains). Hot blocks in the buffer cache (cache buffers chains).

There are also latch waits related to bugs; There are also latch waits related to bugs; check MetaLink for bug reports if you suspect check MetaLink for bug reports if you suspect this is the case (oracle.com/support). this is the case (oracle.com/support). When latch miss ratios are greater than 0.5 When latch miss ratios are greater than 0.5 percent, you should investigate the issue. percent, you should investigate the issue.

Page 47: Tuning StatsPack

Dale Roberts47

Statspack - Latch WaitsStatspack - Latch Waits

Latch Activity for DB: ORA9I Instance: ora9i Snaps: 1 -2Latch Activity for DB: ORA9I Instance: ora9i Snaps: 1 -2

Pct Avg Wait Pct Avg Wait PctPct

Get Get Slps Time NoWait NoWaitGet Get Slps Time NoWait NoWaitLatch Requests Miss /Miss (s) Requests MissLatch Requests Miss /Miss (s) Requests Miss------------------------ -------------- ------ ------ ------ ------------ ------------------------------ -------------- ------ ------ ------ ------------ ------KCL freelist latch 4,924 0.0 0KCL freelist latch 4,924 0.0 0cache buffer handles 968,992 0.0 0.0 0cache buffer handles 968,992 0.0 0.0 0cache buffers chains 761,708,539 0.0 0.4 21,519,841 0.0cache buffers chains 761,708,539 0.0 0.4 21,519,841 0.0cache buffers lru chain 8,111,269 0.1 0.8 19,834,466 0.1cache buffers lru chain 8,111,269 0.1 0.8 19,834,466 0.1library cache 67,602,665 2.2 2.0 213,590 0.8library cache 67,602,665 2.2 2.0 213,590 0.8redo allocation 12,446,986 0.2 0.0 0redo allocation 12,446,986 0.2 0.0 0redo copy 320 0.0 10,335,430 0.1redo copy 320 0.0 10,335,430 0.1user lock 1,973 0.3 1.2 0user lock 1,973 0.3 1.2 0

Page 48: Tuning StatsPack

Dale Roberts48

Statspack - Latch WaitsStatspack - Latch Waits

Latch Sleep breakdown for DB: Latch Sleep breakdown for DB: -> ordered by misses desc-> ordered by misses desc Get Spin &Get Spin &Latch Name Requests Misses Sleeps Sleeps 1->4Latch Name Requests Misses Sleeps Sleeps 1->4-------------------------- -------------- ----------- ----------- -------------------------------------- -------------- ----------- ----------- ------------library cache 67,602,665 1,474,032 2,935,368 199143/28003library cache 67,602,665 1,474,032 2,935,368 199143/28003 6/582413/4126/582413/412 440/0440/0cache buffers chains 761,708,539 192,942 83,559 110054/82239cache buffers chains 761,708,539 192,942 83,559 110054/82239 /628/21/0/628/21/0redo allocation 12,446,986 25,444 1,135 24310/1133/1redo allocation 12,446,986 25,444 1,135 24310/1133/1 /0/0/0/0cache buffers lru chain 8,111,269 6,285 4,933 1378/4881/26cache buffers lru chain 8,111,269 6,285 4,933 1378/4881/26 /0/0/0/0process allocation 177 7 7 0/7/0/0/0process allocation 177 7 7 0/7/0/0/0 --------------------------------------------------------------------------------------------------------------------------

Note that 10g only has “Spin & Sleeps 1-3+”Note that 10g only has “Spin & Sleeps 1-3+”

Page 49: Tuning StatsPack

Dale Roberts49

Statspack - Latch WaitsStatspack - Latch Waits

Latches that are Latches that are willing to waitwilling to wait try to acquire a latch. If none are try to acquire a latch. If none are available, it will spin and then request the latch again. It will available, it will spin and then request the latch again. It will continue to do this up to the _SPIN_COUNT initialization continue to do this up to the _SPIN_COUNT initialization parameter (note that spinning costs CPU). parameter (note that spinning costs CPU). If it can’t get a latch after spinning up to the _SPIN_COUNT, it If it can’t get a latch after spinning up to the _SPIN_COUNT, it will go to sleep. It will wake up after one centisecond (one will go to sleep. It will wake up after one centisecond (one hundredth of a second). It will do this twice. hundredth of a second). It will do this twice. It will then start this process again, spinning up to the It will then start this process again, spinning up to the _SPIN_COUNT and then sleeping for twice as long (two _SPIN_COUNT and then sleeping for twice as long (two centiseconds). After doing this again it will double again. So the centiseconds). After doing this again it will double again. So the pattern is 1,1,2,2,4,4 etc. It will do this until it gets the latchpattern is 1,1,2,2,4,4 etc. It will do this until it gets the latchEvery time the latch sleeps, it will creates a latch sleep wait. An Every time the latch sleeps, it will creates a latch sleep wait. An example of a “willing to wait” latch is a library cache latch. example of a “willing to wait” latch is a library cache latch.

Page 50: Tuning StatsPack

Dale Roberts50

Statspack - Latch WaitsStatspack - Latch Waits

Some latches are Some latches are “not willing to wait.”“not willing to wait.” This type of latch This type of latch does not wait for the latch to become available. does not wait for the latch to become available. They immediately time out and retry to obtain the latch. They immediately time out and retry to obtain the latch. A A redo copy latch is an exampleredo copy latch is an example of a “not willing to wait” of a “not willing to wait” latch. latch. A not willing to wait latch will generate information for A not willing to wait latch will generate information for the immediate_gets and the immediate_misses columns the immediate_gets and the immediate_misses columns of the V$LATCH view and also in the statspack report. of the V$LATCH view and also in the statspack report. The hit ratio for these latches should also approach 99% The hit ratio for these latches should also approach 99% and the misses should never fall below 1 percent misses.and the misses should never fall below 1 percent misses.

Page 51: Tuning StatsPack

Dale Roberts51

Statspack - Latch WaitsStatspack - Latch Waits

GetsGets - - The number of times a willing to wait request The number of times a willing to wait request for a latch was requested and it was available.for a latch was requested and it was available. MissesMisses - - The number of times a willing to wait request The number of times a willing to wait request for latch was initially requested but was not available.for latch was initially requested but was not available. SleepsSleeps - - The number of a willing to wait request for a The number of a willing to wait request for a latch failed over and over until the spin count was latch failed over and over until the spin count was exceeded and the process went to sleep. The number exceeded and the process went to sleep. The number of sleeps may be higher than the misses. Processes of sleeps may be higher than the misses. Processes may sleep multiple times before obtaining the latch.may sleep multiple times before obtaining the latch. NoWait MissesNoWait Misses - - The number of times immediate (not The number of times immediate (not willing to wait) request for a latch was unsuccessful.willing to wait) request for a latch was unsuccessful.

Page 52: Tuning StatsPack

Dale Roberts52

Statspack - Latch WaitsStatspack - Latch Waits Things to look for… Things to look for…

Latch ProblemLatch Problem Potential FixPotential FixLibrary Cache Library Cache Use bind variables; adjust the Use bind variables; adjust the

shared_pool_size shared_pool_size Shared PoolShared Pool Use bind variables; adjust the Use bind variables; adjust the

shared_pool_size shared_pool_size Redo allocationRedo allocation Minimize redo generation and Minimize redo generation and avoid avoid

unnecessary commitsunnecessary commitsRedo copyRedo copy Increase the Increase the _log_simultaneous_copies _log_simultaneous_copies Row cache objectsRow cache objects Increase the Shared PoolIncrease the Shared Pool

Page 53: Tuning StatsPack

Dale Roberts53

Use Bind Variables / Latch Use Bind Variables / Latch IssuesIssues

If you don’t use bind variables in your application code you If you don’t use bind variables in your application code you usually end up with latch contention with the usually end up with latch contention with the shared_poolshared_pool and and library cachelibrary cache latches. latches.This latch wait time can be reduced by changing just the top This latch wait time can be reduced by changing just the top couple of executed statements that were using literal SQL couple of executed statements that were using literal SQL instead of bind variables.instead of bind variables.Oracle 8i Release 2 (8.1.6) has an auto-conversion of literals Oracle 8i Release 2 (8.1.6) has an auto-conversion of literals into bind variables… Oracle9i extends this slightly…into bind variables… Oracle9i extends this slightly…

CURSOR_SHARING=FORCE (Default is CURSOR_SHARING=FORCE (Default is EXACT; 8iR2)EXACT; 8iR2)

Page 54: Tuning StatsPack

Dale Roberts54

Cursor Sharing - 8.1.6+Cursor Sharing - 8.1.6+

If v$sqlarea looks like this:If v$sqlarea looks like this:select empno from rich778 where empno =451572select empno from rich778 where empno =451572select empno from rich778 where empno =451573select empno from rich778 where empno =451573select empno from rich778 where empno =451574select empno from rich778 where empno =451574select empno from rich778 where empno =451575select empno from rich778 where empno =451575select empno from rich778 where empno =451576select empno from rich778 where empno =451576

Use cursor_sharing=force (sqlarea goes to this):Use cursor_sharing=force (sqlarea goes to this):select empno from rich778 where empno =:SYS_B_0select empno from rich778 where empno =:SYS_B_0

Page 55: Tuning StatsPack

Dale Roberts55

Statspack – Instance Statspack – Instance Activity Activity

Terminology… Terminology…

StatisticStatistic DescriptionDescriptionSession Logical Reads Session Logical Reads All reads cached in memory. All reads cached in memory.

Includes both Includes both consistent gets and also the db block consistent gets and also the db block gets. gets.

Consistent Gets Consistent Gets These are the reads of a block that are in These are the reads of a block that are in the the cache. They are NOT to be confused with cache. They are NOT to be confused with consistent read (cr) version of a block in the consistent read (cr) version of a block in the buffer buffer cache (usually the current version is read).cache (usually the current version is read).

Db block getsDb block gets These are block gotten to be changed. MUSTThese are block gotten to be changed. MUSTbe the CURRENT block and not a cr block. be the CURRENT block and not a cr block.

Db block changes Db block changes These are the db block gets (above) that These are the db block gets (above) that were actually changed. were actually changed.

Physical ReadsPhysical Reads Blocks not read from the cache. Either Blocks not read from the cache. Either from from disk, disk cache or O/S cache; there are also disk, disk cache or O/S cache; there are also physical reads direct which bypass cache using physical reads direct which bypass cache using Parallel Parallel Query (not in hit ratios). Query (not in hit ratios).

Page 56: Tuning StatsPack

Dale Roberts56

Statspack – Instance Statspack – Instance ActivityActivity

Statistic Total per Second per TransStatistic Total per Second per Trans--------------------------------- ------------------ -------------- ------------------------------------------- ------------------ -------------- ----------branch node splits 7,162 0.1 0.0branch node splits 7,162 0.1 0.0consistent gets 12,931,850,777 152,858.8 3,969.5consistent gets 12,931,850,777 152,858.8 3,969.5current blocks converted for CR 75,709 0.9 0.0current blocks converted for CR 75,709 0.9 0.0db block changes 343,632,442 4,061.9 105.5db block changes 343,632,442 4,061.9 105.5db block gets 390,323,754 4,613.8 119.8db block gets 390,323,754 4,613.8 119.8hot buffers moved to head of LRU 197,262,394 2,331.7 60.6hot buffers moved to head of LRU 197,262,394 2,331.7 60.6leaf node 90-10 splits 26,429 0.3 0.0leaf node 90-10 splits 26,429 0.3 0.0leaf node splits 840,436 9.9 0.3leaf node splits 840,436 9.9 0.3logons cumulative 21,369 0.3 0.0logons cumulative 21,369 0.3 0.0physical reads 504,643,275 5,965.1 154.9physical reads 504,643,275 5,965.1 154.9physical writes 49,724,268 587.8 15.3physical writes 49,724,268 587.8 15.3session logical reads 13,322,170,917 157,472.5 4,089.4session logical reads 13,322,170,917 157,472.5 4,089.4sorts (disk) 4,132 0.1 0.0sorts (disk) 4,132 0.1 0.0sorts (memory) 7,938,085 93.8 2.4sorts (memory) 7,938,085 93.8 2.4sorts (rows) 906,207,041 10,711.7 278.2sorts (rows) 906,207,041 10,711.7 278.2table fetch continued row 25,506,365 301.5 7.8table fetch continued row 25,506,365 301.5 7.8table scans (long tables) 111 0.0 0.0table scans (long tables) 111 0.0 0.0table scans (short tables) 1,543,085 18.2 0.5table scans (short tables) 1,543,085 18.2 0.5

Page 57: Tuning StatsPack

Dale Roberts57

Statspack – Time Model Statspack – Time Model StatsStats

Time Model System Stats DB/Inst: ORCL/orcl Snaps: 1-2Time Model System Stats DB/Inst: ORCL/orcl Snaps: 1-2-> Total Time in Database calls 5560.5s (or 5560475336us)-> Total Time in Database calls 5560.5s (or 5560475336us)  Statistic Time (s) % of DB TimeStatistic Time (s) % of DB Time----------------------------------- -------------------- ----------------------------------------------- -------------------- ------------DB CPU 119.1 2.1DB CPU 119.1 2.1DB time 5,560.5DB time 5,560.5Java execution elapsed time 0.1 .0Java execution elapsed time 0.1 .0PL/SQL compilation elapsed time 0.4 .0PL/SQL compilation elapsed time 0.4 .0PL/SQL execution elapsed time 0.2 .0PL/SQL execution elapsed time 0.2 .0background cpu time 16.4 .3background cpu time 16.4 .3background elapsed time 2,097.6 37.7background elapsed time 2,097.6 37.7connection management call elapsed 1.2 .0connection management call elapsed 1.2 .0failed parse elapsed time 0.2 .0failed parse elapsed time 0.2 .0hard parse (sharing criteria) elaps 0.0 .0hard parse (sharing criteria) elaps 0.0 .0hard parse elapsed time 13.3 .2hard parse elapsed time 13.3 .2parse time elapsed 14.1 .3parse time elapsed 14.1 .3sql execute elapsed time 5,556.3 99.9sql execute elapsed time 5,556.3 99.9 --------------------------------------------------------------------------------------------------------------------------

Page 58: Tuning StatsPack

Dale Roberts58

Statspack – Time Model Statspack – Time Model StatsStats

Page 59: Tuning StatsPack

Dale Roberts59

Statspack – O/S StatisticsStatspack – O/S Statistics

OS Statistics DB/Inst: ORCL/orcl Snaps: 1-2OS Statistics DB/Inst: ORCL/orcl Snaps: 1-2  Statistic Total per SecondStatistic Total per Second------------------------- ---------------------- ------------------------------------------- ---------------------- ------------------AVG_IN_BYTES 37,371,904 12,583AVG_IN_BYTES 37,371,904 12,583AVG_OUT_BYTES 1,179,648 397AVG_OUT_BYTES 1,179,648 397IN_BYTES 37,371,904 12,583IN_BYTES 37,371,904 12,583OUT_BYTES 1,179,648 397OUT_BYTES 1,179,648 397AVG_BUSY_TICKS 24,326AVG_BUSY_TICKS 24,326AVG_IDLE_TICKS 272,598AVG_IDLE_TICKS 272,598AVG_SYS_TICKS 9,483AVG_SYS_TICKS 9,483AVG_USER_TICKS 14,843AVG_USER_TICKS 14,843BUSY_TICKS 24,326BUSY_TICKS 24,326IDLE_TICKS 272,598IDLE_TICKS 272,598SYS_TICKS 9,483SYS_TICKS 9,483USER_TICKS 14,843USER_TICKS 14,843NUM_CPUS 1NUM_CPUS 1 --------------------------------------------------------------------------------------------------------------------

Page 60: Tuning StatsPack

Dale Roberts60

Statspack – Undo StatsStatspack – Undo Stats

Undo Segment Stats DB/Inst: ORCL/orcl Snaps: 1-2Undo Segment Stats DB/Inst: ORCL/orcl Snaps: 1-2-> ordered by Time desc-> ordered by Time desc   Undo Num Max Qry Max Tx Snap OutOf uS/uR/uU/Undo Num Max Qry Max Tx Snap OutOf uS/uR/uU/End Time Blocks Trans Len (s) Concy TooOld Space eS/eR/eUEnd Time Blocks Trans Len (s) Concy TooOld Space eS/eR/eU------------ ----------- ------------ ------- ------- ------ ----- ----------------------- ----------- ------------ ------- ------- ------ ----- -----------12-Apr 12:19 31,664 243 818 5 0 0 0/0/0/32/2812-Apr 12:19 31,664 243 818 5 0 0 0/0/0/32/28 0/00/012-Apr 12:09 27,248 357 210 5 0 0 0/0/0/55/5712-Apr 12:09 27,248 357 210 5 0 0 0/0/0/55/57 6/06/012-Apr 11:59 16,403 276 171 5 0 0 0/0/0/28/1512-Apr 11:59 16,403 276 171 5 0 0 0/0/0/28/15 2/02/012-Apr 11:49 3,602 327 0 5 0 0 0/0/0/8/16/12-Apr 11:49 3,602 327 0 5 0 0 0/0/0/8/16/ 0012-Apr 11:39 469 2,946 0 4 0 0 0/0/0/0/0/012-Apr 11:39 469 2,946 0 4 0 0 0/0/0/0/0/0

Page 61: Tuning StatsPack

Dale Roberts61

Statspack – File I/OStatspack – File I/O

TablespaceTablespace------------------------------------------------------------ Av Av Av Av Buffer Av BufAv Av Av Av Buffer Av Buf Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms)-------------- ------- ------ ------- ------------ -------- ---------- -------------------- ------- ------ ------- ------------ -------- ---------- ------PSAPSTABIPSAPSTABI 14,441,749 171 7.9 1.0 521,275 6 1,234,608 6.214,441,749 171 7.9 1.0 521,275 6 1,234,608 6.2PSAPVBAPDPSAPVBAPD 13,639,443 161 6.2 1.7 10,057 0 2,672,470 4.213,639,443 161 6.2 1.7 10,057 0 2,672,470 4.2PSAPEDIIPSAPEDII 11,992,418 142 5.3 1.0 83,757 1 4,115,714 4.411,992,418 142 5.3 1.0 83,757 1 4,115,714 4.4PSAPEDIDPSAPEDID 10,617,042 125 8.1 1.0 64,866 1 3,728,009 6.410,617,042 125 8.1 1.0 64,866 1 3,728,009 6.4PSAPROLLPSAPROLL 998,328 12 13.2 1.0 8,321,252 98 285,060 65.7998,328 12 13.2 1.0 8,321,252 98 285,060 65.7

Reads should be below 14msReads should be below 14ms

Page 62: Tuning StatsPack

Dale Roberts62

AWR – File I/OAWR – File I/O

Page 63: Tuning StatsPack

Dale Roberts63

Statspack – File Read Statspack – File Read HistogramHistogram

File Read Histogram Stats DB/Inst: ORCL/orcl Snaps: 1-2File Read Histogram Stats DB/Inst: ORCL/orcl Snaps: 1-2->Number of single block reads in each time range->Number of single block reads in each time range->ordered by Tablespace, File->ordered by Tablespace, File  Tablespace FilenameTablespace Filename------------------------ --------------------------------------------------------------- --------------------------------------- 0 - 4 ms 4 - 8 ms 8 - 16 ms 0 - 4 ms 4 - 8 ms 8 - 16 ms 16 - 32 ms16 - 32 ms 32+ ms32+ ms------------ ------------ ------------ ------------ ------------------------ ------------ ------------ ------------ ------------USERS C:\ORACLE\ORADATA\ORCL\USERS01.DBFUSERS C:\ORACLE\ORADATA\ORCL\USERS01.DBF 560 2,225 1,452 560 2,225 1,452 4,0894,089 8,3738,373  SYSAUX C:\ORACLE\ORADATA\ORCL\SYSAUX01.DBFSYSAUX C:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF 123 40 242 123 40 242 357357 405405  SYSTEM C:\ORACLE\ORADATA\ORCL\SYSTEM01.DBFSYSTEM C:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF 100 51 223 100 51 223 207207 367367

Page 64: Tuning StatsPack

Dale Roberts64

Statspack – Check Statspack – Check RegularlyRegularly

1.      Top 5 wait events1.      Top 5 wait events2.      Load Profile2.      Load Profile3.      Instance Efficiency Hit Ratios3.      Instance Efficiency Hit Ratios4.      Wait Events / 4.      Wait Events / Wait Event HistogramsWait Event Histograms5.      Latch Waits 5.      Latch Waits 6.      Top SQL6.      Top SQL7.      Instance Activity / 7.      Instance Activity / Time Model Stats / O/S StatsTime Model Stats / O/S Stats8.      File I/O / 8.      File I/O / File Read Histogram / Undo StatsFile Read Histogram / Undo Stats9.      Memory Allocation9.      Memory Allocation10.    Undo10.    Undo

Page 65: Tuning StatsPack

Dale Roberts65

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI Only)Using STATSPACK Reports (FYI Only)

The STATSPACK report shows statistics ONLY for the The STATSPACK report shows statistics ONLY for the node or instance on which it was run.node or instance on which it was run.

Run Run statspack.snapstatspack.snap procedure and procedure and spreport.sql spreport.sql script on each node you want to monitor to compare to script on each node you want to monitor to compare to other instances.other instances.

Single-instance tuning should be performed before Single-instance tuning should be performed before attempting to tune the processes that communicate via the attempting to tune the processes that communicate via the cluster interconnect.cluster interconnect.

Page 66: Tuning StatsPack

Dale Roberts66

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI Only)Using STATSPACK Reports (FYI Only)

Top 5 Timed EventsTop 5 Timed Events

Top 5 Timed EventsTop 5 Timed Events~~~~~~~~~~~~~~~~~~ % Total~~~~~~~~~~~~~~~~~~ % TotalEvent Waits Time (s) Ela TimeEvent Waits Time (s) Ela Time-------------------------------------------- ------------ ----------- ---------------------------------------------------- ------------ ----------- --------global cache cr request 820 154 72.50global cache cr request 820 154 72.50CPU time 54 25.34CPU time 54 25.34global cache null to x 478 1 .52global cache null to x 478 1 .52control file sequential read 600 1 .52control file sequential read 600 1 .52control file parallel write 141 1 .28control file parallel write 141 1 .28

--------------------------------------------------------------------------------------------------------------------------

Exceeds CPU time, therefore needs investigation.

CPU time (processing time)

should be the predominant event

• Transfer times excessive from other instances in the cluster to this instance.• Could be due to network problems or buffer cache sizing issues.

Page 67: Tuning StatsPack

Dale Roberts67

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI Only)Using STATSPACK Reports (FYI Only)

Network changes were madeNetwork changes were made An index was addedAn index was added STATSPACK report now looks like this:STATSPACK report now looks like this:

Top 5 Timed EventsTop 5 Timed Events~~~~~~~~~~~~~~~~~~ % Total~~~~~~~~~~~~~~~~~~ % TotalEvent Waits Time (s) Ela TimeEvent Waits Time (s) Ela Time-------------------------------------------- ------------ ----------- ---------------------------------------------------- ------------ ----------- --------CPU time 99 64.87CPU time 99 64.87global cache null to x 1,655 28 18.43global cache null to x 1,655 28 18.43enqueue 46 8 5.12enqueue 46 8 5.12global cache busy 104 7 4.73global cache busy 104 7 4.73DFS lock handle 38 2 1.64DFS lock handle 38 2 1.64

CPU time is now the predominant event

Page 68: Tuning StatsPack

Dale Roberts

RAC ArchitectureRAC ArchitectureShared Data ModelShared Data Model

Shared Disk DatabaseShared Disk Database

Shared Memory/Global Area

shared shared SQLSQL

log log bufferbuffer

. . .. . .Shared Memory/Global Area

shared shared SQLSQL

log log bufferbuffer

Shared Memory/Global Area

shared shared SQLSQL

log log bufferbuffer

Shared Memory/Global Area

shared shared SQLSQL

log log bufferbuffer

GES&GCSGES&GCS GES&GCSGES&GCS GES&GCSGES&GCS GES&GCSGES&GCS

Page 69: Tuning StatsPack

Dale Roberts69

Real Applications Clusters - Cache Fusion

1. User1 queries data

2. User2 queries same data - via interconnect with no disc I/O

3. User1 updates a row of data and commits4. User2 wants to update same block of data – 10g keeps data concurrency via interconnect

UNIX/Win2000 Node2

RAM

Disk Array

User1 User2

inter

connect

RAM

UNIX/Win2000 Node1

10G

10G

Page 70: Tuning StatsPack

Dale Roberts70

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI)Using STATSPACK Reports (FYI)

Workload characteristics for this instance:Workload characteristics for this instance:Cluster Statistics for DB: DB2 Instance: INST1Cluster Statistics for DB: DB2 Instance: INST1  Global Cache Service - Workload CharacteristicsGlobal Cache Service - Workload Characteristics----------------------------------------------------------------------------------------------Ave global cache get time (ms): Ave global cache get time (ms): Ave global cache convert time (ms): Ave global cache convert time (ms): Ave build time for CR block (ms): Ave build time for CR block (ms): Ave flush time for CR block (ms): Ave flush time for CR block (ms): Ave send time for CR block (ms): Ave send time for CR block (ms): Ave time to process CR block request (ms): Ave time to process CR block request (ms): Ave receive time for CR block (ms): Ave receive time for CR block (ms): Ave pin time for current block (ms): Ave pin time for current block (ms): Ave flush time for current block (ms): Ave flush time for current block (ms): Ave send time for current block (ms): Ave send time for current block (ms): Ave time to process current block request (ms): Ave time to process current block request (ms): Ave receive time for current block (ms): Ave receive time for current block (ms): Global cache hit ratio: Global cache hit ratio: Ratio of current block defers: Ratio of current block defers: % of messages sent for buffer gets: % of messages sent for buffer gets: % of remote buffer gets: % of remote buffer gets: Ratio of I/O for coherence: Ratio of I/O for coherence: Ratio of local vs remote work: Ratio of local vs remote work: Ratio of fusion vs physical writes: Ratio of fusion vs physical writes:

  8.216.5  1.5 6.0 0.9 8.518.313.7 3.9 0.818.417.4 2.5 0.2 2.2 1.6 2.9 0.5 0.0

Solved after network and index changes.

  3.1 3.2  0.2 0.0 1.0 1.317.2 0.2 0.0 0.9 1.1 3.1 1.7 0.0 1.4 1.1 8.7 0.6 0.0

Page 71: Tuning StatsPack

Dale Roberts71

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI Only)Using STATSPACK Reports (FYI Only)

Global Enqueue Services (GES) control the inter-instance Global Enqueue Services (GES) control the inter-instance locks in Oracle 9i RAC.locks in Oracle 9i RAC.The STATSPACK report contains a special section for The STATSPACK report contains a special section for these statistics.these statistics.

Global Enqueue Service StatisticsGlobal Enqueue Service Statistics------------------------------------------------------------------Ave global lock get time (ms): 0.9Ave global lock get time (ms): 0.9Ave global lock convert time (ms): 1.3Ave global lock convert time (ms): 1.3Ratio of global lock gets vs global lock releases: 1.1Ratio of global lock gets vs global lock releases: 1.1

Page 72: Tuning StatsPack

Dale Roberts72

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using STATSPACK Reports (FYI Only)Using STATSPACK Reports (FYI Only)

Guidelines for GES Statistics:Guidelines for GES Statistics:All times should be < 15msAll times should be < 15msRatio of global lock gets vs global lock releases should be near Ratio of global lock gets vs global lock releases should be near 1.01.0

High values could indicate possible network or memory High values could indicate possible network or memory problemsproblemsCould also be caused by application locking issuesCould also be caused by application locking issuesMay need to review the enqueue section of STATSPACK May need to review the enqueue section of STATSPACK report for further analysis.report for further analysis.

Complete Presentation by Oracle’s Rich Niemiec’s at: http://www.oracleracsig.org

Page 73: Tuning StatsPack

Dale Roberts73

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using AWR Reports (FYI Only)Using AWR Reports (FYI Only)

Page 74: Tuning StatsPack

Dale Roberts74

Tuning the RAC Cluster InterconnectTuning the RAC Cluster Interconnect Using AWR Reports (FYI Only)Using AWR Reports (FYI Only)

Page 75: Tuning StatsPack

Dale Roberts75

Host and Hardware

The Future…The Future…Enterprise Manager 10g for the Enterprise Manager 10g for the

GridGrid

DatabaseOracle9iAS

Storage

Network and Load Balancer

Applications

AdministrationMonitoring

ProvisioningSecurity

EnterpriseManager

Page 76: Tuning StatsPack

Dale Roberts76

The Future ….The Future ….Manage end to endManage end to end

StorageStoragePoolPool

Storage VirtualizationStorage Virtualization

ServerServerPoolPool

Processor VirtualizationProcessor VirtualizationService FrameworkService Framework

Web ServicesWeb Services

Intranet

Internet

Data ManagementData Management

Page 77: Tuning StatsPack

Dale Roberts77

AwareAwareSelf-monitoringSelf-monitoring

ProactiveProactiveAutomatic tasksAutomatic tasksProactive alertsProactive alerts

IntelligentIntelligentSelf-diagnosingSelf-diagnosingSelf-tuningSelf-tuning

WorkloadRepository

Alerts &Advisories

AutomaticTasks

Oracle 10Oracle 10gg Database DatabaseSelf-Managing Intelligent InfrastructureSelf-Managing Intelligent Infrastructure

Page 78: Tuning StatsPack

Dale Roberts78

Monitor All TargetsMonitor All Targets

Monitor Targets… are they up?

Target Alerts

Page 79: Tuning StatsPack

Dale Roberts79

Database PerformanceDatabase Performance

Pick Items for the Group

Create a Prod DB’s Group

Page 80: Tuning StatsPack

Dale Roberts80

Database PerformanceDatabase Performance

Alert Issues

Major Waits

Page 81: Tuning StatsPack

Dale Roberts81

Database PerformanceDatabase Performance

Monitor Database

We have a CPU issue!

Page 82: Tuning StatsPack

Dale Roberts82

Database PerformanceDatabase Performance

Monitor Perform.

We have a Concurr. issue!

Page 83: Tuning StatsPack

Dale Roberts83

Grid Services -Grid Services -Automatic Workload Automatic Workload

ManagementManagement

Top Services

Top Modules

Complete Presentation by Oracle’s Erik Peterson at: Complete Presentation by Oracle’s Erik Peterson at: http://www.oracleracsig.orghttp://www.oracleracsig.org

Page 84: Tuning StatsPack

Dale Roberts84

10g RAC Enhancements10g RAC EnhancementsGRID ControlGRID Control

Allows for RAC instance startup, shutdownAllows for RAC instance startup, shutdownAllows for RAC instance creationAllows for RAC instance creationAllows for resource reallocation based on SLAsAllows for resource reallocation based on SLAsAllows for automatic provisioning when used with RAC, Allows for automatic provisioning when used with RAC, ASM and Linux ASM and Linux

Page 85: Tuning StatsPack

Dale Roberts85

App. Server PerformanceApp. Server Performance

Memory

CPU

Web Cache Hits

Page 86: Tuning StatsPack

Dale Roberts86

View the Web ApplicationView the Web Application

Page Response Time Detail

Page 87: Tuning StatsPack

Dale Roberts87

URL Response TimesURL Response Times

WebPage Response Time all URL’s

Page 88: Tuning StatsPack

Dale Roberts88

Middle Tier PerformanceMiddle Tier Performance

WebPage Detail Response Time all URL’s

Splits Time into Parts

Page 89: Tuning StatsPack

Dale Roberts89

Host PerformanceHost Performance

Side by Side Compare

Page 90: Tuning StatsPack

Dale Roberts90

Drill into Top SQL for worst time period

Get Help!

ADDM SQL Tuning AdvisorADDM SQL Tuning Advisor

Page 91: Tuning StatsPack

Dale Roberts91

Using SQL Tuning Sets

Tuning Results for this job

Suggests using a profileFor this SQL

Page 92: Tuning StatsPack

Dale Roberts92

Ora

cle9

iAS

OracleDatabase

Ora

cle9

iAS

Ora

cle

E-B

us S

uite

End Users Apps and Mid-Tier Servers

Database Hosts Storage

Availability Monitoring Topology

3rd P

arty

App

Ser

ver

Network

Beacon running availability transaction

Beacon running availability transaction

ChicagoSales Office

TorontoSales Office

TokyoSales Office

Beacon running availability transaction

Beacon running availability transaction

Headquarters

Page 93: Tuning StatsPack

Dale Roberts93

33rdrd party – Indepth Oracle party – Indepth Oracle

Page 94: Tuning StatsPack

Dale Roberts94

Investigate Reaction To ChangesInvestigate Reaction To Changes

Page 95: Tuning StatsPack

Dale Roberts95

Identify SolutionsIdentify Solutions

Page 96: Tuning StatsPack

Dale Roberts96

Verify SolutionVerify Solution

Page 97: Tuning StatsPack

Dale Roberts97

Verify ImprovementsVerify Improvements

Page 98: Tuning StatsPack

Dale Roberts98

Rank FindingsRank Findings

Page 99: Tuning StatsPack

Dale Roberts99

Provide Expert AdviceProvide Expert Advice

Page 100: Tuning StatsPack

Dale Roberts100

Block DumpsBlock Dumps

Page 101: Tuning StatsPack

Dale Roberts101

Last Resort - Block DumpsLast Resort - Block Dumps

select select file_id, block_id, blocksfile_id, block_id, blocksfrom from dba_extentsdba_extentswhere where segment_name = 'EMP'segment_name = 'EMP'and and owner = 'SCOTT';owner = 'SCOTT';

FILE_ID FILE_ID BLOCK_ID BLOCKSBLOCK_ID BLOCKS----------- ----------- --------------- ------------ --------------- ------------

1 1 50465 350465 3

Page 102: Tuning StatsPack

Dale Roberts102

Last Resort - Block DumpsLast Resort - Block Dumps

ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50465ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50465//

ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50466ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50466//

ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50467ALTER SYSTEM DUMP DATAFILE 5 BLOCK 50467//

Or…Or…

ALTER SYSTEM DUMP DATAFILE 5 BLOCK MIN ALTER SYSTEM DUMP DATAFILE 5 BLOCK MIN 50465 BLOCK MAX 50467; 50465 BLOCK MAX 50467;

(Puts output in user_dump_dest)(Puts output in user_dump_dest)

Page 103: Tuning StatsPack

Dale Roberts103

Block Dump:Block Dump:Data SectionData Section

Page 104: Tuning StatsPack

Dale Roberts104

Last Resort - Block DumpsLast Resort - Block Dumps

select select * * from from empempwhere where ename = 'MILLER';ename = 'MILLER';

EMPNO ENAME JOB MGR HIREDATE SAL COMM EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNODEPTNO

---------- -------------- ------------ --------- ------------------- -------- ---------- -------------- ------------ --------- ------------------- -------- ----------- ------------------------- --------------

7934 MILLER CLERK 7782 23-JAN-82 1300 7934 MILLER CLERK 7782 23-JAN-82 1300 1010

Page 105: Tuning StatsPack

Dale Roberts105

Block Dumps – output from udumpBlock Dumps – output from udump

tab 0, row 13, @0x1b0btab 0, row 13, @0x1b0btl: 39 fb: --H-FL-- lb: 0x0 cc: 8tl: 39 fb: --H-FL-- lb: 0x0 cc: 8col 0: [ 3] c2 50 23col 0: [ 3] c2 50 23col 1: [ 6] 4d 49 4c 4c 45 52col 1: [ 6] 4d 49 4c 4c 45 52col 2: [ 5] 43 4c 45 52 4bcol 2: [ 5] 43 4c 45 52 4bcol 3: [ 3] c2 4e 53col 3: [ 3] c2 4e 53col 4: [ 7] 77 b6 01 17 01 01 01col 4: [ 7] 77 b6 01 17 01 01 01col 5: [ 2] c2 0ecol 5: [ 2] c2 0ecol 6: *NULL*col 6: *NULL*col 7: [ 2] c1 0bcol 7: [ 2] c1 0b……

Page 106: Tuning StatsPack

Dale Roberts106

Block Dumps – Data SectionBlock Dumps – Data Section

DUMP OUTPUT - EMPNO:DUMP OUTPUT - EMPNO:col 0: [ 3] c2 50 23col 0: [ 3] c2 50 23

Hex to Decimal: Col0 = EMPNO = 7934

50 (Hex) = 80 (Decimal) – 1 = 7923 (Hex) = 35 (Decimal) – 1 = 34c2: Number in the thousands (c2 is

exponent)

Page 107: Tuning StatsPack

Dale Roberts107

Block Dumps – Data SectionBlock Dumps – Data Section

DUMP OUTPUT - ENAME:DUMP OUTPUT - ENAME:

col 1: [ 6] 4d 49 4c 4c 45 52col 1: [ 6] 4d 49 4c 4c 45 52

Hex to Character: Col1 = ENAME = MILLER

4d (Hex) = M (Character)49 (Hex) = I (Character)4c (Hex) = L (Character)4c (Hex) = L (Character)45 (Hex) = E (Character)52 (Hex) = R (Character)

Page 108: Tuning StatsPack

Dale Roberts108

Transactions Moving through Oracle: ITL &

Undo Blocks

Page 109: Tuning StatsPack

Dale Roberts

(Cha

in L

atch

)

n

1

2

3

Buffer HeadersBuffer Headers

Buffer Header

HashBuckets

Working with Hash Buckets

And Buffer Headers (not buffers)

• Users asks for a specific data block address.• This is hashed with a hashing algorithm and placed in the hash bucket that it hashes to.• It walks the hash chain using the cache buffers chain latch to find the block that it needs (curr or cr).• There can be many versions of each block

Page 110: Tuning StatsPack

Dale Roberts110

_DB_BLOCK_HASH_BUCKETS_DB_BLOCK_HASH_BUCKETS and hashing data block and hashing data block

addressesaddresses

Example: _DB_BLOCK_HASH_BUCKETSExample: _DB_BLOCK_HASH_BUCKETS(shouldn’t have to change this in Oracle9i or 10g)(shouldn’t have to change this in Oracle9i or 10g)

Buffer hash table (x$bh) has all buffer headers for all db_block Buffer hash table (x$bh) has all buffer headers for all db_block buffers.buffers.Buffer header ties to memory base address of the buffer.Buffer header ties to memory base address of the buffer.Buckets usually set to Prime(2*db_block_buffers)Buckets usually set to Prime(2*db_block_buffers)A prime number is often used to avoid hashing anomaliesA prime number is often used to avoid hashing anomaliesObjects dba (class) is hashed to a hash bucket on the hash chainObjects dba (class) is hashed to a hash bucket on the hash chainGet enough hash buckets (_db_block_hash_buckets)Get enough hash buckets (_db_block_hash_buckets)Blocks assigned to a hash bucket and onto the hash chainBlocks assigned to a hash bucket and onto the hash chainCould have multiple blocks hashed to same chain (if both hot-Could have multiple blocks hashed to same chain (if both hot-issues)issues)Can have multiple versions of a block on same chainCan have multiple versions of a block on same chainWhen block is replaced (based on LRU chain) new block comes in When block is replaced (based on LRU chain) new block comes in and could be (probably will be) hashed to a different hash chain.and could be (probably will be) hashed to a different hash chain.

Page 111: Tuning StatsPack

Dale Roberts111

Query all buffer headers (state):Query all buffer headers (state):

col status for a6col status for a6select state,select state, decode(state, 0, 'FREE', decode(state, 0, 'FREE', /* not currently is use *//* not currently is use */ 1, 'XCUR', 1, 'XCUR', /* held exclusive by this instance *//* held exclusive by this instance */ 2, 'SCUR', 2, 'SCUR', /* held shared by this instance *//* held shared by this instance */ 3, 'CR', 3, 'CR', /* only valid for consistent read *//* only valid for consistent read */ 4, 'READ', 4, 'READ', /* is being read from disk *//* is being read from disk */ 5, 'MREC', 5, 'MREC', /* in media recovery mode *//* in media recovery mode */ 6, 'IREC‘, 6, 'IREC‘, /* in instance(crash) recovery mode *//* in instance(crash) recovery mode */

7, ‘WRITE’,7, ‘WRITE’, /* being written *//* being written */8, ‘PIN’) status, count(*)8, ‘PIN’) status, count(*) /* pinned */ /* pinned */

from x$bhfrom x$bhgroup by state;group by state;

STATE STATUS COUNT(*)STATE STATUS COUNT(*)------------ ------------- ----------------------------- ------------- ----------------- 1 XCUR 20011 XCUR 2001 3 CR 33 CR 3

Page 112: Tuning StatsPack

Dale Roberts112

EMP1 is Block#: 56650EMP1 is Block#: 56650(all rows are in this block)(all rows are in this block)

select rowid,empno,select rowid,empno, dbms_rowid.rowid_relative_fno(rowid) fileno,dbms_rowid.rowid_relative_fno(rowid) fileno, dbms_rowid.rowid_block_number(rowid) blockno,dbms_rowid.rowid_block_number(rowid) blockno, dbms_rowid.rowid_row_number(rowid) rowno, rownum,dbms_rowid.rowid_row_number(rowid) rowno, rownum, rpad(to_char(dbms_rowid.rowid_block_number(rowid), 'FM0xxxxxxx') || '.' ||rpad(to_char(dbms_rowid.rowid_block_number(rowid), 'FM0xxxxxxx') || '.' || to_char(dbms_rowid.rowid_row_number (rowid), 'FM0xxx' ) || '.' ||to_char(dbms_rowid.rowid_row_number (rowid), 'FM0xxx' ) || '.' || to_char(dbms_rowid.rowid_relative_fno(rowid), 'FM0xxx' ), 18) myridto_char(dbms_rowid.rowid_relative_fno(rowid), 'FM0xxx' ), 18) myridfrom emp1;from emp1;ROWID EMPNO FILENO BLOCKNO ROWNO ROWNUMROWID EMPNO FILENO BLOCKNO ROWNO ROWNUM------------------ ---------- ---------- ---------- ---------- ---------------------------- ---------- ---------- ---------- ---------- ----------MYRIDMYRID------------------------------------AAAM4cAABAAAN1KAAA 7369 1 56650 0 1AAAM4cAABAAAN1KAAA 7369 1 56650 0 10000dd4a.0000.00010000dd4a.0000.0001

AAAM4cAABAAAN1KAAB 7499 1 56650 1 2AAAM4cAABAAAN1KAAB 7499 1 56650 1 20000dd4a.0001.00010000dd4a.0001.0001…………AAAM4cAABAAAN1KAAN 7934 1 56650 13 14AAAM4cAABAAAN1KAAN 7934 1 56650 13 140000dd4a.000d.00010000dd4a.000d.0001

14 rows selected.14 rows selected.

Page 113: Tuning StatsPack

Dale Roberts113

Let’s watch the EMP1 buffer Let’s watch the EMP1 buffer headerheader

(So far it’s clean and only 1 (So far it’s clean and only 1 copy)copy)

select select lrba_seq, state, dbarfil, dbablk, tch, flag, hscn_bas,cr_scn_bas,lrba_seq, state, dbarfil, dbablk, tch, flag, hscn_bas,cr_scn_bas,decode(bitand(flag,1), 0, 'N', 'Y') dirty, decode(bitand(flag,1), 0, 'N', 'Y') dirty, /* Dirty bit *//* Dirty bit */decode(bitand(flag,16), 0, 'N', 'Y') temp, decode(bitand(flag,16), 0, 'N', 'Y') temp, /* temporary bit *//* temporary bit */decode(bitand(flag,1536), 0, 'N', 'Y') ping, /* ping (to shared or null) bit */decode(bitand(flag,1536), 0, 'N', 'Y') ping, /* ping (to shared or null) bit */decode(bitand(flag,16384), 0, 'N', 'Y') stale, decode(bitand(flag,16384), 0, 'N', 'Y') stale, /* stale bit *//* stale bit */decode(bitand(flag,65536), 0, 'N', 'Y') direct, decode(bitand(flag,65536), 0, 'N', 'Y') direct, /* direct access bit *//* direct access bit */decode(bitand(flag,1048576), 0, 'N', 'Y') new decode(bitand(flag,1048576), 0, 'N', 'Y') new /* new bit *//* new bit */

from from x$bhx$bhwhere where dbablk = 56650dbablk = 56650order by dbablk;order by dbablk;

LRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BASLRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BAS---------- ---------- ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ---------- ---------- ----------CR_SCN_BAS D T P S D NCR_SCN_BAS D T P S D N---------- - - - - - ----------- - - - - - - 0 1 1 56650 0 35659776 42949672950 1 1 56650 0 35659776 4294967295 0 N N N N N N0 N N N N N N

Page 114: Tuning StatsPack

Dale Roberts

Log

Buf

fers

(Cha

in L

atch

)

n

1

2

3S

hare

d P

ool SGASGA

Cache BuffersCache BuffersBuffer Cache

Buffer Header

HashBuckets

Only ONE block on the Hash Chain!

Page 115: Tuning StatsPack

Dale Roberts115

Let’s watch the EMP1 buffer Let’s watch the EMP1 buffer headerheader

(Delete a row)(Delete a row)

delete from emp1delete from emp1where comm = 0;where comm = 0;

one row deleted.one row deleted.

Page 116: Tuning StatsPack

Dale Roberts116

Let’s watch the EMP1 buffer Let’s watch the EMP1 buffer headerheader

(Make some changes 2 copies)(Make some changes 2 copies)

select select lrba_seq, state, dbarfil, dbablk, tch, flag, hscn_bas,cr_scn_bas,lrba_seq, state, dbarfil, dbablk, tch, flag, hscn_bas,cr_scn_bas,decode(bitand(flag,1), 0, 'N', 'Y') dirty, decode(bitand(flag,1), 0, 'N', 'Y') dirty, /* Dirty bit *//* Dirty bit */decode(bitand(flag,16), 0, 'N', 'Y') temp, decode(bitand(flag,16), 0, 'N', 'Y') temp, /* temporary bit *//* temporary bit */decode(bitand(flag,1536), 0, 'N', 'Y') ping, /* ping (to shared or null) bit */decode(bitand(flag,1536), 0, 'N', 'Y') ping, /* ping (to shared or null) bit */decode(bitand(flag,16384), 0, 'N', 'Y') stale, decode(bitand(flag,16384), 0, 'N', 'Y') stale, /* stale bit *//* stale bit */decode(bitand(flag,65536), 0, 'N', 'Y') direct, decode(bitand(flag,65536), 0, 'N', 'Y') direct, /* direct access bit *//* direct access bit */decode(bitand(flag,1048576), 0, 'N', 'Y') new decode(bitand(flag,1048576), 0, 'N', 'Y') new /* new bit *//* new bit */

from from x$bhx$bhwhere where dbablk = 56650dbablk = 56650order by dbablk;order by dbablk;

LRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BASLRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BAS---------- ---------- ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ---------- ---------- ----------CR_SCN_BAS D T P S D NCR_SCN_BAS D T P S D N---------- - - - - - ----------- - - - - - - 0 1 1 56650 1 8200 42949672950 1 1 56650 1 8200 4294967295 0 N N N N N N0 N N N N N N

0 3 1 56650 2 524288 00 3 1 56650 2 524288 0 4347881 N N N N N N4347881 N N N N N N

Page 117: Tuning StatsPack

Dale Roberts

Log

Buf

fers

(Cha

in L

atch

)

n

1

2

3S

hare

d P

ool SGASGA

Cache BuffersCache BuffersBuffer Cache

Buffer Header

HashBuckets

Hash Chain is now TWO! One is a CR and the other is Current.

Page 118: Tuning StatsPack

Dale Roberts118

V$Transaction now has our recordV$Transaction now has our record(created when transactions have (created when transactions have

undo)undo)

SELECT t.addr, t.xidusn USN, t.xidslot SLOT, t.xidsqn SQL, t.status, SELECT t.addr, t.xidusn USN, t.xidslot SLOT, t.xidsqn SQL, t.status, t.used_ublk UBLK, t.used_urec UREC, t.log_io LOG, t.used_ublk UBLK, t.used_urec UREC, t.log_io LOG, t.phy_io PHY, t.cr_get, t.cr_change CR_CHAt.phy_io PHY, t.cr_get, t.cr_change CR_CHA

FROM FROM v$transaction t, v$session s v$transaction t, v$session s WHERE t.addr = s.taddr; WHERE t.addr = s.taddr;

ADDR USN SLOT SQL STATUS UBLKADDR USN SLOT SQL STATUS UBLK-------- ---------- ---------- ---------- ---------------- ------------------ ---------- ---------- ---------- ---------------- ---------- UREC LOG PHY CR_GET CR_CHAUREC LOG PHY CR_GET CR_CHA---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ----------69E50E5C 5 42 652 ACTIVE 169E50E5C 5 42 652 ACTIVE 1 1 3 0 3 01 3 0 3 0

USN is the Undo Segment Number (rollback segment ID)USN is the Undo Segment Number (rollback segment ID)SLOT is the slot number in the rollback segment’s transaction table. SLOT is the slot number in the rollback segment’s transaction table. SQN (Wrap) is the sequence number for the transaction. SQN (Wrap) is the sequence number for the transaction. USN+SLOT+SQN are the three values that uniquely identifies a transaction XIDUSN+SLOT+SQN are the three values that uniquely identifies a transaction XID

Page 119: Tuning StatsPack

Dale Roberts119

Dump the blockDump the block

Dump the blockDump the block Itl Xid Uba Flag Lck Itl Xid Uba Flag Lck

Scn/FscScn/Fsc0x01 0x0005.02a.0000028c 0x008000af.02b6.01 ---- 1 fsc 0x01 0x0005.02a.0000028c 0x008000af.02b6.01 ---- 1 fsc

0x0029.000000000x0029.000000000x02 0x0004.016.00000fae 0x008000cc.08af.34 C--- 0 scn 0x02 0x0004.016.00000fae 0x008000cc.08af.34 C--- 0 scn

0x0000.003deb5b0x0000.003deb5bITL – 2 Interested Transaction Lists

Transaction IDUndo 5 = 5 (decimal)Slot 2a = 42 (decimal)SEQ 28C = 652

UBA:File.block.sequence.recordUndo block address where last change is recorded.

The row I deleted is still locked; fsc is 0x29 = 41 bytes

Committed Transaction

Page 120: Tuning StatsPack

Dale Roberts120

Insert in 3 other sessions & drive Insert in 3 other sessions & drive x$bh up to the max of 6 versions x$bh up to the max of 6 versions

of blockof block

LRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BASLRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BAS---------- ---------- ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ---------- ---------- ----------CR_SCN_BAS D T P S D NCR_SCN_BAS D T P S D N---------- - - - - - ----------- - - - - - - 0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350120 N N N N N N4350120 N N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350105 N N N N N N4350105 N N N N N N

365 1 1 56650 7 33562633 4350121365 1 1 56650 7 33562633 4350121 0 Y N N N N N0 Y N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350103 N N N N N N4350103 N N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350089 N N N N N N4350089 N N N N N N

0 3 1 56650 1 524288 00 3 1 56650 1 524288 0 4350087 N N N N N N4350087 N N N N N N

Page 121: Tuning StatsPack

Dale Roberts

Log

Buf

fers

(Cha

in L

atch

)

n

1

2

3S

hare

d P

ool SGASGA

Cache BuffersCache BuffersBuffer Cache

Buffer Header

HashBuckets

Hash Chain is now SIX long! Five CR and the one Current.

Page 122: Tuning StatsPack

Dale Roberts122

Why only 6 versions of a Why only 6 versions of a Block?Block?

select select a.ksppinm, b.ksppstvl, b.ksppstdf, a.ksppdesca.ksppinm, b.ksppstvl, b.ksppstdf, a.ksppdescfrom from x$ksppi a, x$ksppcv bx$ksppi a, x$ksppcv bwhere where a.indx = b.indxa.indx = b.indxand and substr(ksppinm,1,1) = '_'substr(ksppinm,1,1) = '_'and and ksppinm like '%&1%'ksppinm like '%&1%'order by order by ksppinm;ksppinm;

KSPPINMKSPPINM--------------------------------------------------------------------------------------------------------------------------------------------------------------KSPPSTVLKSPPSTVL--------------------------------------------------------------------------------------------------------------------------------------------------------------KSPPSTDFKSPPSTDF------------------KSPPDESCKSPPDESC--------------------------------------------------------------------------------------------------------------------------------------------------------------_db_block_max_cr_dba_db_block_max_cr_dba66TRUETRUEMaximum Allowed Number of CR buffers per dbaMaximum Allowed Number of CR buffers per dba

Page 123: Tuning StatsPack

Dale Roberts123

What happens after we roll What happens after we roll everything back – x$bh Still an everything back – x$bh Still an

LRBA:LRBA:

LRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BASLRBA_SEQ STATE DBARFIL DBABLK TCH FLAG HSCN_BAS---------- ---------- ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ---------- ---------- ----------CR_SCN_BAS D T P S D NCR_SCN_BAS D T P S D N---------- - - - - - ----------- - - - - - - 0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350120 N N N N N N4350120 N N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350105 N N N N N N4350105 N N N N N N

365 1 1 56650 11 35659777 4350702365 1 1 56650 11 35659777 4350702 0 Y N N N N N0 Y N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350103 N N N N N N4350103 N N N N N N

0 3 1 56650 1 524416 00 3 1 56650 1 524416 0 4350089 N N N N N N4350089 N N N N N N

0 3 1 56650 1 524288 00 3 1 56650 1 524288 0 4350087 N N N N N N4350087 N N N N N N

6 rows selected.6 rows selected.

Page 124: Tuning StatsPack

Dale Roberts124

Let’s check V$TRANSACTION & Let’s check V$TRANSACTION & match it up to ITL (no need to match it up to ITL (no need to

dump) dump)

select select xidusn, xidslot, xidsqn, ubafil, ubablk, ubasqn, xidusn, xidslot, xidsqn, ubafil, ubablk, ubasqn, ubarecubarec

from from v$transaction t, v$session sv$transaction t, v$session swhere where t.ses_addr = s.saddr;t.ses_addr = s.saddr; XIDUSN XIDSLOT XIDSQN UBAFIL UBABLK UBASQN UBARECXIDUSN XIDSLOT XIDSQN UBAFIL UBABLK UBASQN UBAREC---------- ---------- ---------- ---------- ---------- ---------- -------------------- ---------- ---------- ---------- ---------- ---------- ---------- 4 42 4863 2 851 2718 84 42 4863 2 851 2718 8 5 14 667 2 1458 713 255 14 667 2 1458 713 25

4.42.4863 = 4.2a.12ff4.42.4863 = 4.2a.12ff 2.851.2718.8 = 800353.a9e.82.851.2718.8 = 800353.a9e.85.14.667 = 5.e.29b5.14.667 = 5.e.29b 2.1458.713.25 = 8005b2.2c9.192.1458.713.25 = 8005b2.2c9.19

Itl Xid Uba Flag Lck Scn/FscItl Xid Uba Flag Lck Scn/Fsc0x02 0x0004.02a.000012ff 0x00800353.0a9e.08 ---- 2 fsc 0x0003.000000000x02 0x0004.02a.000012ff 0x00800353.0a9e.08 ---- 2 fsc 0x0003.000000000x03 0x0005.00e.0000029b 0x008005b2.02c9.19 ---- 14 fsc 0x0000.000000000x03 0x0005.00e.0000029b 0x008005b2.02c9.19 ---- 14 fsc 0x0000.00000000

Page 125: Tuning StatsPack

Dale Roberts125

Row Level LocksRow Level Locks(C

hain

Lat

ch)

n

1

3

Cache Buffers

Buffer Header

HashBuckets

LRU Lists LRU Write List

DBWrite

1

2

3

Log

Buf

fersUser

Request

Sha

red

Poo

l SGA

Buffer Cache

2

Cache Layer

2Transaction LayerXID 01XID 02

2 Row 3

1 Row 1 1 Row 2

Lock Byte

ITL 1ITL 2

XID 01 ITL 1

Itl Xid Uba Flag Lck …0x01 0x0005.02a.0000028c 0x008000af.026b.01 ---- 1 …

usn#

0x02a 0x028c

RBU Header 5wrap#

Data Blockslot#

XID0X005.02a.0000028c

Transaction Identifiers

Page 126: Tuning StatsPack

Dale Roberts126

Helpful V$/X$ QueriesHelpful V$/X$ Queries(FYI Only)(FYI Only)

Page 127: Tuning StatsPack

Dale Roberts127

V$ Views over the yearsV$ Views over the years

VersionVersion V$ ViewsV$ Views X$ TablesX$ Tables 6 6 23 23 ? (35) ? (35) 7 7 72 72 1261268.08.0 132132 2002008.18.1 185185 2712719.09.0 227227 352352

9.29.2 259259 39439410.1.0210.1.02 340 340 (+31%)(+31%) 543 543 (+38%)(+38%)

Page 128: Tuning StatsPack

Dale Roberts128

Listing of V$ ViewsListing of V$ Views

select select name name from from v$fixed_tablev$fixed_tablewhere where name like 'GV%'name like 'GV%'order by order by name;name;

NAMENAME------------------------------------------------------------------

GV$ACCESSGV$ACCESSGV$ACTIVE_INSTANCESGV$ACTIVE_INSTANCESGV$ACTIVE_SESS_POOL_MTHGV$ACTIVE_SESS_POOL_MTHGV$AQ1GV$AQ1GV$ARCHIVE…GV$ARCHIVE…

Page 129: Tuning StatsPack

Dale Roberts129

Need GV$ - Instance IDNeed GV$ - Instance ID

select inst_id, (1 - (sum(decode(name, 'physical select inst_id, (1 - (sum(decode(name, 'physical reads',value,0)) /reads',value,0)) /

(sum(decode(name, 'db block gets',value,0)) +(sum(decode(name, 'db block gets',value,0)) + sum(decode(name, 'consistent gets',value,0))))) * sum(decode(name, 'consistent gets',value,0))))) *

100 “Hit Ratio"100 “Hit Ratio"from v$sysstat;from v$sysstat;  INST_ID Hit RatioINST_ID Hit Ratio-------------- -------------------------------- ------------------ 1 90.58176991 90.5817699

Page 130: Tuning StatsPack

Dale Roberts130

Need GV$ - Instance IDNeed GV$ - Instance ID

select inst_id, (1 - (sum(decode(name, 'physical select inst_id, (1 - (sum(decode(name, 'physical reads',value,0)) /reads',value,0)) /

(sum(decode(name, 'db block gets',value,0)) +(sum(decode(name, 'db block gets',value,0)) + sum(decode(name, 'consistent gets',value,0))))) * 100 sum(decode(name, 'consistent gets',value,0))))) * 100

“Hit Ratio"“Hit Ratio"from gv$sysstatfrom gv$sysstatgroup by inst_id;group by inst_id;  INST_ID Hit RatioINST_ID Hit Ratio-------------- -------------------------------- ------------------ 1 90.58176991 90.5817699 2 96.20345372 96.2034537

Page 131: Tuning StatsPack

Dale Roberts131

X$ used to create V$X$ used to create V$

select * select * from v$fixed_view_definitionfrom v$fixed_view_definitionwhere view_name = where view_name =

'GV$INDEXED_FIXED_COLUMN’;'GV$INDEXED_FIXED_COLUMN’; VIEW_NAME VIEW_NAME VIEW_DEFINITIONVIEW_DEFINITIONgv$indexed_fixed_column gv$indexed_fixed_column select c.inst_id, select c.inst_id,

kqftanam, kqftanam, kqfcoidx, kqfconam,kqfcoipokqfcoidx, kqfconam,kqfcoipo from X$kqfco c, X$kqftatfrom X$kqfco c, X$kqftat where t.indx = c.kqfcotabwhere t.indx = c.kqfcotab and kqfcoidx != 0and kqfcoidx != 0

Page 132: Tuning StatsPack

Dale Roberts132

Listing of X$ TablesListing of X$ Tables

select select namenamefrom from v$fixed_tablev$fixed_tablewhere where name like 'X%'name like 'X%'order by order by name;name;

NAMENAME------------------------------------------------------------------

X$ACTIVECKPTX$ACTIVECKPTX$BHX$BHX$BUFQMX$BUFQMX$CKPTBUFX$CKPTBUFX$CLASS_STAT…X$CLASS_STAT…

Page 133: Tuning StatsPack

Dale Roberts133

Listing of X$ IndexesListing of X$ Indexes (419 in 10g; 326 in 9i) (419 in 10g; 326 in 9i)

select select table_name, index_number, column_name table_name, index_number, column_name from from gv$indexed_fixed_columngv$indexed_fixed_columnorder by order by table_name, index_number, column_name, table_name, index_number, column_name,

column_position;column_position; TABLE_NAME INDEX_NUMBER COLUMN_NAMETABLE_NAME INDEX_NUMBER COLUMN_NAME------------------------------ ------------------------------ ------------------------------ ------------------------------

------------------------------------------------------------X$CLASS_STAT 1 ADDRX$CLASS_STAT 1 ADDRX$CLASS_STAT 2 INDXX$CLASS_STAT 2 INDXX$DUAL 1 ADDRX$DUAL 1 ADDRX$DUAL 2 INDX … X$DUAL 2 INDX …

Page 134: Tuning StatsPack

Dale Roberts134

V$ - System InformationV$ - System Information

SQL> select * from v$version;SQL> select * from v$version;

BANNERBANNER------------------------------------------------------------------------------------------------------------------------------Oracle Database 10g Enterprise Edition Release Oracle Database 10g Enterprise Edition Release

10.1.0.2.0 – Prod10.1.0.2.0 – ProdPL/SQL Release 10.1.0.2.0 –ProductionPL/SQL Release 10.1.0.2.0 –ProductionCORE 10.1.0.2.0 ProductionCORE 10.1.0.2.0 ProductionTNS for 32-bit Windows: Version 10.1.0.2.0 – ProductionTNS for 32-bit Windows: Version 10.1.0.2.0 – ProductionNLSRTL Version 10.1.0.2.0 – ProductionNLSRTL Version 10.1.0.2.0 – Production

Page 135: Tuning StatsPack

Dale Roberts135

V$ - System InformationV$ - System Information

select * select * from v$option;from v$option;

PARAMETER VALUEPARAMETER VALUE----------------------------------- ------------------------------------------------ -------------

Partitioning TRUEPartitioning TRUEObjects TRUEObjects TRUEReal Application Clusters FALSEReal Application Clusters FALSEAdvanced Replication TRUEAdvanced Replication TRUEBit-Mapped Indexes TRUEBit-Mapped Indexes TRUE

……

Page 136: Tuning StatsPack

Dale Roberts136

Great V$ - V$SESSION_WAITGreat V$ - V$SESSION_WAIT(waiting right now)(waiting right now)

select event, sum(decode(wait_time,0,1,0)) “Waiting Now",select event, sum(decode(wait_time,0,1,0)) “Waiting Now", sum(decode(wait_time,0,0,1)) “Previous Waits", sum(decode(wait_time,0,0,1)) “Previous Waits", count(*) “Total”count(*) “Total”from v$session_waitfrom v$session_waitgroup by eventgroup by eventorder by count(*);order by count(*);

WAIT_TIME = 0 means that it’s waitingWAIT_TIME = 0 means that it’s waitingWAIT_TIME > 0 means that it previously waited this many WAIT_TIME > 0 means that it previously waited this many

ms ms

Page 137: Tuning StatsPack

Dale Roberts137

Great V$ - V$SESSION_WAIT Great V$ - V$SESSION_WAIT

EVENT EVENT Waiting NowWaiting Now Previous Waits Total Previous Waits Total------------------------------------------------------ -------------------------------------- --------------------- ---------------------

------------------------db file sequential read db file sequential read 0 0 11 1 1db file scattered readdb file scattered read 2 2 0 2 0 2latch freelatch free 0 1 0 1 1 1enqueueenqueue 2 2 0 0 2 2SQL*Net message from clientSQL*Net message from client 0 0 254 254

480 480 ……

Page 138: Tuning StatsPack

Dale Roberts138

V$SESSION_WAITV$SESSION_WAITFinding Current Specific waitsFinding Current Specific waits

Buffer Busy Waits or Write Complete Waits Events: Buffer Busy Waits or Write Complete Waits Events: SELECT SELECT /*+ ordered */ sid, event, owner, /*+ ordered */ sid, event, owner,

segment_name, segment_name, segment_type,p1,p2,p3segment_type,p1,p2,p3

FROM FROM v$session_wait sw, dba_extents dev$session_wait sw, dba_extents deWHERE WHERE de.file_id = sw.p1de.file_id = sw.p1AND AND sw.p2 between de.block_id sw.p2 between de.block_id

and de.block_id+de.blocks – 1and de.block_id+de.blocks – 1AND AND (event = 'buffer busy waits' (event = 'buffer busy waits' OR event = 'write complete waits')OR event = 'write complete waits')AND AND p1 IS NOT nullp1 IS NOT nullORDER BY event,sid;ORDER BY event,sid;

Page 139: Tuning StatsPack

Dale Roberts139

V$EVENT_NAME V$EVENT_NAME Finding P1, P2, P3Finding P1, P2, P3

col name for a20col name for a20col p1 for a10 col p1 for a10 col p2 for a10col p2 for a10col p3 for a10col p3 for a10select select event#,name,parameter1 p1,parameter2 p2,parameter3 event#,name,parameter1 p1,parameter2 p2,parameter3

p3p3from from v$event_namev$event_namewhere name in ('buffer busy waits', 'write complete waits')where name in ('buffer busy waits', 'write complete waits') EVENT# NAME P1 P2 P3EVENT# NAME P1 P2 P3------------- -------------------- ---------- ---------- ----------------------- -------------------- ---------- ---------- ---------- 143 write complete waits file# block#143 write complete waits file# block# 145 buffer busy waits file# block# id145 buffer busy waits file# block# id

Page 140: Tuning StatsPack

Dale Roberts140

V$ - V$SESSION_WAIT_HISTORYV$ - V$SESSION_WAIT_HISTORY(Last 10 waits for session)(Last 10 waits for session)

Buffer Busy Waits or Write Complete Waits Events: Buffer Busy Waits or Write Complete Waits Events: SELECT SELECT /*+ ordered */ sid, event, owner, segment_name, /*+ ordered */ sid, event, owner, segment_name,

segment_type,p1,p2,p3segment_type,p1,p2,p3FROM FROM v$session_wait_history sw, dba_extents dev$session_wait_history sw, dba_extents deWHERE WHERE de.file_id = sw.p1de.file_id = sw.p1AND AND sw.p2 between de.block_id sw.p2 between de.block_id

and de.block_id+de.blocks – 1and de.block_id+de.blocks – 1AND AND (event = 'buffer busy waits' (event = 'buffer busy waits' OR event = 'write complete waits')OR event = 'write complete waits')AND AND p1 IS NOT nullp1 IS NOT nullORDER BY event,sid;ORDER BY event,sid;

Page 141: Tuning StatsPack

Dale Roberts141

Great V$ - V$SESSION_EVENTGreat V$ - V$SESSION_EVENT(waiting since the session started)(waiting since the session started)

select sid, event, total_waits, select sid, event, total_waits, time_waited, event_idtime_waited, event_id

from v$session_eventfrom v$session_eventwhere time_waited > 0where time_waited > 0order by time_waitedorder by time_waited;;   SID EVENT TOTAL_WAITS

TIME_WAITED ---------- ------------------------------ ----------- ----------- 159 process startup 2 1 167 latch: redo allocation 4 1 168 log buffer space 2 3 166 control file single write 5 4…

Page 142: Tuning StatsPack

Dale Roberts142

V$ - V$SESSION_WAIT_CLASSV$ - V$SESSION_WAIT_CLASS(session waits by WAIT CLASS)(session waits by WAIT CLASS)

select wait_class, total_waitsselect wait_class, total_waitsfrom v$system_wait_class;from v$system_wait_class;SID WAIT_CLASS SID WAIT_CLASS TOTAL_WAITS TOTAL_WAITS ------- -------------------------------------------- -------------------- ------- -------------------------------------------- -------------------- 147 Idle 6582 147 Idle 6582 150 Idle 138 150 Idle 138 153 Application153 Application 10 10 153 Administrative 1 153 Administrative 1 153 Idle 47 153 Idle 47 153 Network 153 Network 48 48 153 User I/O 153 User I/O 4 4 153 System I/O 153 System I/O 33 33

Page 143: Tuning StatsPack

Dale Roberts143

Great V$ - V$SYSTEM_EVENTGreat V$ - V$SYSTEM_EVENT(waits since the instance started)(waits since the instance started)

EVENT TOTAL_WAITS TIME_WAITEDEVENT TOTAL_WAITS TIME_WAITED------------------------------ ----------- ----------------------------------------- ----------- -----------latch: session allocation 5644 1latch: session allocation 5644 1latch: redo allocation 4 1latch: redo allocation 4 1latch: cache buffers chains 4 3latch: cache buffers chains 4 3enq: TX - index contention 1 3enq: TX - index contention 1 3direct path write temp 57 6direct path write temp 57 6row cache lock 1 7 row cache lock 1 7 ……

select sid, event, total_waits, time_waited, event_id

from v$system_eventwhere time_waited > 0order by time_waited; 

Page 144: Tuning StatsPack

Dale Roberts144

V$ - V$SYSTEM_WAIT_CLASSV$ - V$SYSTEM_WAIT_CLASS(system waits by WAIT CLASS)(system waits by WAIT CLASS)

select wait_class, total_waitsselect wait_class, total_waitsfrom v$system_wait_class;from v$system_wait_class;WAIT_CLASS WAIT_CLASS TOTAL_WAITS TOTAL_WAITS -------------------------------------------- -------------------- -------------------------------------------- -------------------- Other 545472 Other 545472 Application 105 Application 105 Configuration 92 Configuration 92 Administrative 1 Administrative 1 Concurrency 30 Concurrency 30 Commit 793 Commit 793 Idle 186169 Idle 186169 Network 385 Network 385 User I/O 16017 User I/O 16017 System I/O 25478 System I/O 25478

Page 145: Tuning StatsPack

Dale Roberts145

Great V$ - V$OPEN_CURSORGreat V$ - V$OPEN_CURSOR(Added sql_id in 10g)(Added sql_id in 10g)

select sid, count(*)select sid, count(*) select sid, sql_id, count(*) select sid, sql_id, count(*) from v$open_cursorfrom v$open_cursor from v$open_cursorfrom v$open_cursorgroup by sidgroup by sid group by sid, sql_idgroup by sid, sql_idhaving count(*) > 300having count(*) > 300 order by count(*);order by count(*);order by count(*) desc;order by count(*) desc;

SID SID COUNT(*) COUNT(*) SID SID COUNT(*) COUNT(*) SQL_IDSQL_ID----------- --------------------------- ---------------- ----------- ---------------- --------------------------------- ---------------- ---------------------- 11 45011 450 11 2 9tdqgnq7gd5cf 11 2 9tdqgnq7gd5cf 8 3208 320 11 11 1 a1xgtxssv5rrp 1 a1xgtxssv5rrp 9 3019 301 11 11 1 attwbvtyu8x5c 1 attwbvtyu8x5c

Page 146: Tuning StatsPack

Dale Roberts146

V$ - Top 10 as % of AllV$ - Top 10 as % of All

select sum(pct_bufgets) percent select sum(pct_bufgets) percent from (select rank() over ( order by buffer_gets desc ) from (select rank() over ( order by buffer_gets desc )

as rank_bufgets,as rank_bufgets, to_char(100 * ratio_to_report(buffer_gets) over to_char(100 * ratio_to_report(buffer_gets) over (), (),

'999.99') pct_bufgets'999.99') pct_bufgetsfrom v$sqlarea )from v$sqlarea )where rank_bufgets < 11;where rank_bufgets < 11;

PERCENTPERCENT------------------------ 97.0797.07

Page 147: Tuning StatsPack

Dale Roberts147

Great V$ - V$SQLAREA or V$SQLGreat V$ - V$SQLAREA or V$SQL

User1:User1:SQL> conn system/managerSQL> conn system/managerSQL> create table emp as select * from scott.emp;SQL> create table emp as select * from scott.emp;SQL> lock table emp in exclusive mode;SQL> lock table emp in exclusive mode;

User 2:User 2:SQL> conn system/managerSQL> conn system/managerSQL> lock table emp in exclusive mode;SQL> lock table emp in exclusive mode;

User 3:User 3:SQL> connect scott/tigerSQL> connect scott/tigerSQL> lock table emp in SQL> lock table emp in

Page 148: Tuning StatsPack

Dale Roberts148

Great V$ - V$SQLAREA or V$SQLGreat V$ - V$SQLAREA or V$SQL

select sql_text, users_executing, executions, select sql_text, users_executing, executions, users_openingusers_opening

from v$sqlareafrom v$sqlareawhere sql_text like 'lock table emp%‘;where sql_text like 'lock table emp%‘;

SQL_TEXT SQL_TEXT USERS_EXEC EXEC USERS_OPEN USERS_EXEC EXEC USERS_OPEN

------------------------------------------ ----------------- ----------- ------------------------------------------ ----------------- ----------- --------------------------------

lock table emp in exclusive mode 1 2 lock table emp in exclusive mode 1 2 3 3

Page 149: Tuning StatsPack

Dale Roberts149

Great V$ - V$SQLAREA or V$SQLGreat V$ - V$SQLAREA or V$SQL

select sql_text, users_executing, executions, users_openingselect sql_text, users_executing, executions, users_openingfrom v$sqlfrom v$sqlwhere sql_text like 'lock table emp%‘;where sql_text like 'lock table emp%‘;

SQL_TEXT SQL_TEXT USERS_EXEC EXEC USERS_OPEN USERS_EXEC EXEC USERS_OPEN

------------------------------------------ ----------------- ---------- ----------------------------------------------------------- ----------------- ---------- -----------------lock table emp in exclusive mode 1 1 2lock table emp in exclusive mode 1 1 2lock table emp in exclusive mode 0 1 1lock table emp in exclusive mode 0 1 1

Page 150: Tuning StatsPack

Dale Roberts150

V$ - What Users are doing…V$ - What Users are doing…

selectselect a.sid, a.username, s.sql_texta.sid, a.username, s.sql_textfrom from v$session a, v$sqltext sv$session a, v$sqltext swhere a.sql_address where a.sql_address = s.address= s.addressand and a.sql_hash_value = s.hash_valuea.sql_hash_value = s.hash_valueorder order by a.username, a.sid, s.piece;by a.username, a.sid, s.piece;

SID USERNAME SQL_TEXTSID USERNAME SQL_TEXT------ ------------------- ------------------------------------------ ------------------- ------------------------------------

11 PLSQL_USER update s_employee set salary = 10000 11 PLSQL_USER update s_employee set salary = 10000 9 SYS select a.sid, a.username, s.sql_text 9 SYS select a.sid, a.username, s.sql_text 9 SYS from v$session a, v$sqltext 9 SYS from v$session a, v$sqltext 9 SYS where a.sql_address = s.address 9 SYS where a.sql_address = s.address (…partial output listing) (…partial output listing)

Page 151: Tuning StatsPack

Dale Roberts151

Great V$ - Great V$ - V$SEGMENT_STATISTICSV$SEGMENT_STATISTICS

select object_name, statistic_name, valueselect object_name, statistic_name, valuefrom v$segment_statisticsfrom v$segment_statisticswhere value > 100000where value > 100000order by value;order by value;

OBJECT_NAMEOBJECT_NAME STATISTIC_NAME STATISTIC_NAME VALUEVALUE-------------------------------------------------------- ------------------------------------- ---------------------------------------------------- ---------------ORDERS ORDERS space allocatedspace allocated 96551 96551ORDERS ORDERS space allocatedspace allocated 134181 134181ORDERSORDERS logical readslogical reads 140976 140976ORDER_LINESORDER_LINES db block changes db block changes 183600 183600

Page 152: Tuning StatsPack

Dale Roberts152

AWR – Segments by AWR – Segments by Buffer Busy WaitsBuffer Busy Waits

Page 153: Tuning StatsPack

Dale Roberts153

AWR – Segments by Logical AWR – Segments by Logical ReadsReads

Page 154: Tuning StatsPack

Dale Roberts154

X$ - % of Current Redo X$ - % of Current Redo FilledFilled

SELECT SELECT ROUND((cpodr_bno/lesiz),2)*100||'%' ROUND((cpodr_bno/lesiz),2)*100||'%' PctCurLogFullPctCurLogFull

FROM FROM X$kcccp a, X$kccle bX$kcccp a, X$kccle bWHERE WHERE a.cpodr_seq = b.leseq;a.cpodr_seq = b.leseq;

PCTCURLOGFULLPCTCURLOGFULL----------------------------------------------------------------------------------97%97%

Page 155: Tuning StatsPack

Dale Roberts155

X$ - % of Current Redo X$ - % of Current Redo FilledFilled

alter system switch logfile;alter system switch logfile; System altered.System altered.

SELECT SELECT ROUND((cpodr_bno/lesiz),2)*100||'%' ROUND((cpodr_bno/lesiz),2)*100||'%' PctCurLogFullPctCurLogFull

FROM FROM X$kcccp a, X$kccle bX$kcccp a, X$kccle bWHERE WHERE a.cpodr_seq = b.leseq;a.cpodr_seq = b.leseq;

PCTCURLOGFULLPCTCURLOGFULL----------------------------------------------------------------------------------0%0%

Page 156: Tuning StatsPack

Dale Roberts156

V$ - V$FILE_HISTOGRAMV$ - V$FILE_HISTOGRAM

select * from v$file_histogram;select * from v$file_histogram;  

FILE# SINGLEBLKRDTIM_MILLI SINGLEBLKRDS FILE# SINGLEBLKRDTIM_MILLI SINGLEBLKRDS ---------- -------------------- ------------ ---------- -------------------- ------------ 1 1 900 1 1 900 1 2 120 1 2 120 1 4 131 1 4 131 1 8 359 1 8 359 1 16 1072 1 16 1072 1 32 1752 1 32 1752 …… 2 1 3 2 1 3 2 2 1 2 2 1 2 4 2 2 4 2 2 8 17 2 8 17

Page 157: Tuning StatsPack

Dale Roberts157

Grid Control – 10gR2; Grid Control – 10gR2; Run the AWR Report Run the AWR Report

Page 158: Tuning StatsPack

Dale Roberts158

If Time Permits… the Future!If Time Permits… the Future!

Page 159: Tuning StatsPack

Dale Roberts159

64-Bit advancement of64-Bit advancement ofDirectly addressable memoryDirectly addressable memory

Address DirectAddress Direct Indirect/ExtendedIndirect/Extended4 Bit:4 Bit:16 16 (640)(640)8 Bit:8 Bit:256 256 (65,536) (65,536) 16 Bit:16 Bit: 65,536 65,536 (1,048,576)(1,048,576) 32 Bit:32 Bit: 4,294,967,296 4,294,967,296 64 Bit:64 Bit: 18,446,744,073,709,551,616 18,446,744,073,709,551,616

When the hardware physically implements the theoretical When the hardware physically implements the theoretical possibilities of 64-Bit, things will dramatically changepossibilities of 64-Bit, things will dramatically change……. . ……moving from 32 bit to 64 bit will be like moving from 4 bit to 32 moving from 32 bit to 64 bit will be like moving from 4 bit to 32 bit or like moving from 1971 to 2000 overnight. bit or like moving from 1971 to 2000 overnight.

Page 160: Tuning StatsPack

Dale Roberts

You could stack documents from the Earth so high they would pass Pluto!

Stack single sheets (2K worth of text on each) about 4.8B miles high to get 16E!!

64bit allows Directly Addressing 16 Exabytes of Memory

Page 161: Tuning StatsPack

Dale Roberts

BrainBrain ComputerComputerIndividual maintains a ~250M capacity

Stores/processes ~ 2G in a lifetime

With over 6.5 Billion people in the world, total memory of world is 1.5P, total processed is 13 Exabytes

Laptops ~256M in memory capacity

Stores/processes 40G in its lifetime, then buy new one

1.5+ Petabytes can be accessed and managed by one computer with today’s technology (internet is 8P)

Human Brain vs. Computer

Page 162: Tuning StatsPack

Dale Roberts

BrainBrain ComputerComputer10T-1P of operations per second based on retina/neuron synapse speed (Moravec).

Based on Brain power in Watts consumption, the brain performs 100T – 100P operations per second.

Fastest computer is IBM at 70.2 Teraflops (Blue / Gene L)

Computer is about equal on the low end of the brain and could be 1000 times slower on the high end of brain estimates.

Human Brain vs. Computer

Page 163: Tuning StatsPack

Dale Roberts

BrainBrain ComputerComputer

Problem: We forget a lot of what we see and learn.

Solution: Drugs that improve memory or technology that plugs into the brain.

Problem: Information overload

Solution: Use the computer to aggregate things and use the brain for final decisions.

Problem: Data Density limits or Superparamagnetic effect (SPE).

Solution: Electron Microscope writing on stainless steel in a vacuum.

Problem: More memory gets farther from the CPU & Limits to CPU speed

Solution: Chip multiplexing & multi-core CPUs

Human Brain vs. Computer

Page 164: Tuning StatsPack

Dale Roberts164

What we covered:What we covered:

Statspack, Tools & Scripts that you can still Statspack, Tools & Scripts that you can still useuse

Top WaitsTop WaitsLoad ProfileLoad ProfileLatch WaitsLatch WaitsTop SQLTop SQLInstance ActivityInstance ActivityFile I/OFile I/O

The Future OEM & ADDMThe Future OEM & ADDMHelpful V$/X$Helpful V$/X$SummarySummary

Page 165: Tuning StatsPack

Dale Roberts165

www.tusc.comwww.tusc.comOracle9i Oracle9i Performance Tuning Performance Tuning Tips & Techniques; Tips & Techniques; Richard J. Niemiec; Richard J. Niemiec; Oracle Press (May Oracle Press (May 2003)2003)Oracle 10g Tuning Oracle 10g Tuning (Early 2007)(Early 2007)

“If you are going through hell, keep going” - Churchill

For More InformationFor More Information

Page 166: Tuning StatsPack

Dale Roberts

“The strength of the team is each individual member…the strength of each member is the team.”

--Phil Jackson

The Oracle User Groups are part of your team!

Page 167: Tuning StatsPack

Dale Roberts167

ReferencesReferences

Oracle9i Performance Tuning Tips & Techniques,Oracle9i Performance Tuning Tips & Techniques, Rich Niemiec Rich NiemiecThe Self-managing Database: Automatic Performance The Self-managing Database: Automatic Performance Diagnosis;Diagnosis; Karl Dias & Mark Ramacher, Oracle Corporation Karl Dias & Mark Ramacher, Oracle Corporation EM Grid Control 10g;EM Grid Control 10g; otn.oracle.com, Oracle Corporation otn.oracle.com, Oracle CorporationOracle Enterprise Manager 10g: Making the Grid a RealityOracle Enterprise Manager 10g: Making the Grid a Reality; Jay ; Jay Rossiter, Oracle CorporationRossiter, Oracle CorporationThe Self-Managing Database: Guided Application and SQL The Self-Managing Database: Guided Application and SQL Tuning;Tuning; Benoit Dageville, Oracle CorporationBenoit Dageville, Oracle CorporationThe New Enterprise Manager: End to End Performance The New Enterprise Manager: End to End Performance Management of OracleManagement of Oracle; Julie Wong & Arsalan Farooq, ; Julie Wong & Arsalan Farooq, Oracle Oracle CorporationCorporationEnterprise Manager : Scalable Oracle ManagementEnterprise Manager : Scalable Oracle Management; John ; John Kennedy, Oracle CorporationKennedy, Oracle Corporation

Page 168: Tuning StatsPack

Dale Roberts168

ReferencesReferences

Oracle Database 10g Performance OverviewOracle Database 10g Performance Overview; Herv; Hervéé Lejeune, Oracle CorporationLejeune, Oracle CorporationOracle 10g; Penny Avril,Oracle 10g; Penny Avril,, Oracle Corporation, Oracle CorporationForrester Reports, Inc., TechStrategy ResearchForrester Reports, Inc., TechStrategy Research, April , April 2002, Organic IT2002, Organic ITInternals of Real Application ClusterInternals of Real Application Cluster, Madhu Tumma, , Madhu Tumma, Credit Suisse First BostonCredit Suisse First BostonOracle9i RAC; Real Application Clusters Configuration Oracle9i RAC; Real Application Clusters Configuration and Internals,and Internals, Mike Ault & Madhu Tumma Mike Ault & Madhu TummaOracle Tuning Presentation, Oracle CorporationOracle Tuning Presentation, Oracle Corporation

Page 169: Tuning StatsPack

Dale Roberts169

ReferencesReferences

www.tusc.com, www.oracle.com, www.ixora.com, www.tusc.com, www.oracle.com, www.ixora.com, www.laoug.org, www.ioug.org, technet.oracle.comwww.laoug.org, www.ioug.org, technet.oracle.comOracle PL/SQL Tips and Techniques, Joseph P. Trezzo; Oracle PL/SQL Tips and Techniques, Joseph P. Trezzo; Oracle PressOracle PressOracle9i Web Development, Bradley D. Brown; Oracle Oracle9i Web Development, Bradley D. Brown; Oracle PressPressSpecial thanks to Steve Adams, Mike Ault, Brad Special thanks to Steve Adams, Mike Ault, Brad Brown, Don Burleson, Kevin Gilpin, Herve Lejeune, Brown, Don Burleson, Kevin Gilpin, Herve Lejeune, Randy Swanson and Joe Trezzo.Randy Swanson and Joe Trezzo.Landauer 1986. T.K. Landauer; “How much do people Landauer 1986. T.K. Landauer; “How much do people remember? Some estimates of the quantity of remember? Some estimates of the quantity of information in long-term memory,” Cognitive information in long-term memory,” Cognitive Science ,10 (4) pp. 477-493.Science ,10 (4) pp. 477-493.Ralph Merkle, Energy limits to the computational Ralph Merkle, Energy limits to the computational power of the human brainpower of the human brain

Page 170: Tuning StatsPack

Dale Roberts170

ReferencesReferencesOracle Database 10Oracle Database 10g Ag Automated Featuresutomated Features , Mike , Mike Ault, TUSCAult, TUSCOracle Database 10Oracle Database 10gg New Features, Mike Ault, New Features, Mike Ault, Daniel Liu, Madhu Tumma, Rampant Technical Daniel Liu, Madhu Tumma, Rampant Technical Press, 2003, www.rampant.ccPress, 2003, www.rampant.ccOracle Database 10Oracle Database 10gg - The World's First Self- - The World's First Self-Managing, Grid-Ready Database Arrives, Kelli Managing, Grid-Ready Database Arrives, Kelli Wiseth, Oracle Technology Network, 2003, Wiseth, Oracle Technology Network, 2003, otn.oracle.comotn.oracle.com

Page 171: Tuning StatsPack

Dale Roberts171

ReferencesReferences

Oracle 10g; Penny Avril, Principal Database Product Oracle 10g; Penny Avril, Principal Database Product Manager, Server Technologies, Oracle CorporationManager, Server Technologies, Oracle CorporationTo Infinity and Beyond, Brad Brown, TUSCTo Infinity and Beyond, Brad Brown, TUSCForrester Reports, Inc., TechStrategy Research, April Forrester Reports, Inc., TechStrategy Research, April 2002, Organic IT2002, Organic ITInternals of Real Application ClusterInternals of Real Application Cluster, Madhu Tumma, , Madhu Tumma, Credit Suisse First BostonCredit Suisse First BostonOracle9i RAC; Real Application Clusters Configuration Oracle9i RAC; Real Application Clusters Configuration and Internals,and Internals, Mike Ault & Madhu Tumma Mike Ault & Madhu TummaOracle9i Performance Tuning Tips & Techniques,Oracle9i Performance Tuning Tips & Techniques, Richard J. NiemiecRichard J. Niemiec

Page 172: Tuning StatsPack

Dale Roberts172

ReferencesReferencesOracle 10g documentationOracle 10g documentationOracle 9i RAC class & instructor’s commentsOracle 9i RAC class & instructor’s commentsOracle 9i Concepts manualOracle 9i Concepts manual http://geocities.com/pulliamrick/http://geocities.com/pulliamrick/Tips for Tuning Oracle9i RAC on LinuxTips for Tuning Oracle9i RAC on Linux, Kurt , Kurt Engeleiter, Van Okamura, OracleEngeleiter, Van Okamura, Oracle  Leveraging Oracle9i RAC on Intel-based Leveraging Oracle9i RAC on Intel-based servers to build an “Adaptive Architectureservers to build an “Adaptive Architecture, , Stephen White, Cap Gemini Ernst & Young, Dr Stephen White, Cap Gemini Ernst & Young, Dr Don Mowbray, Oracle, Werner Schueler, IntelDon Mowbray, Oracle, Werner Schueler, Intel

Page 173: Tuning StatsPack

Dale Roberts173

ReferencesReferencesRunning YOUR Applications on Real Application Running YOUR Applications on Real Application Clusters (RAC); RAC Deployment Best Practices,Clusters (RAC); RAC Deployment Best Practices, Kirk McGowan, Oracle CorporationKirk McGowan, Oracle CorporationThe Present, The Future but not Science Fiction; The Present, The Future but not Science Fiction; Real Application Clusters Development,Real Application Clusters Development, Angelo Angelo Pruscino, OraclePruscino, OracleBuilding the Adaptive Enterprise; Adaptive Building the Adaptive Enterprise; Adaptive Architecture and OracleArchitecture and Oracle, , Malcolm Carnegie, Cap Malcolm Carnegie, Cap Gemini Ernst & YoungGemini Ernst & YoungInternals of Real Application ClusterInternals of Real Application Cluster, Madhu , Madhu Tumma, Credit Suisse First Boston Tumma, Credit Suisse First Boston Creating Business Prosperity in a Challenging Creating Business Prosperity in a Challenging Environment, Jeff HenleyEnvironment, Jeff Henley

Page 174: Tuning StatsPack

Dale Roberts174

ReferencesReferencesReal Application Clusters, Real Customers Real Real Application Clusters, Real Customers Real Results,Results, Erik Peterson, Technical Manager, RAC, Erik Peterson, Technical Manager, RAC, Oracle Corp.Oracle Corp.Deploying a Highly Manageable Oracle9i Real Deploying a Highly Manageable Oracle9i Real Applications DatabaseApplications Database, Bill Kehoe, Oracle, Bill Kehoe, Oracle  Getting the most out of your database,Getting the most out of your database, Andy Andy Mendelsohn, SVP Server Technologies, Oracle Mendelsohn, SVP Server Technologies, Oracle Corporation Corporation Oracle9iAS Clusters: Solutions for Scalability and Oracle9iAS Clusters: Solutions for Scalability and Availability, Chet Fryjoff, Product Manager, Oracle Availability, Chet Fryjoff, Product Manager, Oracle CorporationCorporationOracle RAC and Linux in the real enterprise,Oracle RAC and Linux in the real enterprise, Mark Mark Clark, Director, Merrill Lynch Europe PLC, Global Clark, Director, Merrill Lynch Europe PLC, Global Database TechnologiesDatabase Technologies

Page 175: Tuning StatsPack

Dale Roberts175

TUSC ServicesTUSC Services

Oracle Technical SolutionsOracle Technical SolutionsFull-Life Cycle Development ProjectsFull-Life Cycle Development ProjectsEnterprise ArchitectureEnterprise ArchitectureDatabase ServicesDatabase Services

Oracle Application SolutionsOracle Application SolutionsOracle Applications Implementations/Upgrades Oracle Applications Implementations/Upgrades Oracle Applications TuningOracle Applications Tuning

Managed ServicesManaged Services24x7x365 Remote Monitoring & Management24x7x365 Remote Monitoring & ManagementFunctional & Technical SupportFunctional & Technical Support

Training & MentoringTraining & MentoringOracle Authorized ResellerOracle Authorized Reseller

Page 176: Tuning StatsPack

Dale Roberts176

Copyright InformationCopyright Information

Neither TUSC nor the author guarantee this Neither TUSC nor the author guarantee this document to be error-free. Please provide document to be error-free. Please provide comments/questions to [email protected]/questions to [email protected] © 2007. This document cannot be TUSC © 2007. This document cannot be reproduced without expressed written consent reproduced without expressed written consent from an officer of TUSC, but the DOUG may from an officer of TUSC, but the DOUG may reproduce or copy this for conference use.reproduce or copy this for conference use.

Contact InformationContact InformationRich Niemiec: Rich Niemiec: [email protected] [email protected]

www.tusc.comwww.tusc.com

Page 177: Tuning StatsPack

Dale Roberts05/03/23 177

AcknowledgementsAcknowledgementswww.tusc.comwww.tusc.com