www.sagecomputing.com.au www.sagecomputing.com.au Performance Tuning in Oracle 10g Performance Tuning in Oracle 10g Part 2 Part 2 Penny Cookson - Managing Director SAGE Computing Services SAGE Computing Services Customised Oracle Training Workshops Customised Oracle Training Workshops and Consulting and Consulting www.sagecomputing.com.au www.sagecomputing.com.au
73
Embed
Performance Tuning in Oracle 10g Part 2 - SAGE Computing Services
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
www.sagecomputing.com.auwww.sagecomputing.com.au
Performance Tuning in Oracle 10gPerformance Tuning in Oracle 10gPart 2Part 2
Penny Cookson - Managing Director
SAGE Computing ServicesSAGE Computing ServicesCustomised Oracle Training WorkshopsCustomised Oracle Training Workshops
and Consultingand Consultingwww.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
AgendaAgenda
• System Statistics• Using wait events – Tuning I/O• Common tuning problems – examples• Using ADDM
www.sagecomputing.com.auwww.sagecomputing.com.au
System Statistics
www.sagecomputing.com.auwww.sagecomputing.com.au
Cost ModelCost Model
Prior to Oracle 9iNumber of I/OsEstimates of index blocks in memory OPTIMIZER_INDEX_CACHINGEstimates of cost of index scanOPTIMZER_INDEX_COST_ADJ
Oracle 9iI/O plus CPU costing if system statistics gathered
Oracle 10gCPU and I/OSystem statistics or defaults
www.sagecomputing.com.auwww.sagecomputing.com.au
System StatisticsSystem Statistics
CPUSPEEDNW Millions of CPU cycles per second
IOSEEKTIM Noworkload estimate of IO seek time
IOTFRSPEED Noworkload estimate of IO transfer time
SREADTIM Single block read time (milliseconds)
MREADTIM Multi block read time (milliseconds)
CPUSPEED Millions of CPU cycles per second
MBRC Average number of blocks in multiblock read
MAXTHR Maximum I/O throughput (parallel)
SLAVETHR Average slave I/O throughput (parallel)
www.sagecomputing.com.auwww.sagecomputing.com.au
Gathering System StatisticsGathering System Statistics
0 Other1 Application2 Configuration3 Administrative4 Concurrency5 Commit6 Idle7 Network8 User I/O9 System I/O
10 Scheduler11 Cluster
www.sagecomputing.com.auwww.sagecomputing.com.au
Wait Event ClassesWait Event Classes
Application Includes locking problemsConfiguration Database configuration problemsAdministrative Caused by database administrationConcurrency Contention for buffers and latchesCommit log file synchronisationIdle Waiting for something to doNetwork Network delaysUser I/O Disk read / write waits by users,
SMON and MMONSystem I/O Disk read/ write waits by background
process except SMON and MMONScheduler Resource manager waitsCluster RAC waitsOther Other insignificant waits
www.sagecomputing.com.auwww.sagecomputing.com.au
What Class is Causing What Class is Causing WaitsWaits
Example Example –– Sequential ReadsSequential Reads
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
Tuning Tuning –– Sequential ReadsSequential Reads
Abnormally high wait level may be an index that should not be used
For table accessFor nested loop join
CheckStatistics on the index are currentOptimiser mode is not FIRST_ROWSColumn has a histogram if data is skewedThere is not an old SQL*ProfileBind peeking
Abnormally high levels may be a full scan of large tableCheck
Statistics on the table and indexes are currentSystem statistics are gatheredColumn has a histogram if data is skewedThere is not an old SQL*ProfileBind peeking
If all this is OK – tune the SQL
www.sagecomputing.com.auwww.sagecomputing.com.au
Bind PeekingBind Peeking
Values of bind variable inspected on hard parseSubsequent executions use the same planIf selective value first, subsequent executions may use innapropriate indexIf non selective value first, subsequent executions may full scan Set _optim_peek_user_binds to FALSE
www.sagecomputing.com.auwww.sagecomputing.com.au
Tuning Tuning –– I/OI/O
Minimise I/ODistribute I/OTune sortsTune buffer cacheUse KEEP buffer pool for
small scans on commonly used tables tables with sequential reads and commonly used data
Use RECYCLE buffer pool forrandom access to large tables
Wait for a specific buffer that someone else is usingAnother session may be reading the buffer inAnother session may have the block pinned in the bufferIndex hot spotsTable insert hot spots
Wait to write to the log buffer I/O to the log file is not keeping up with write requests to the bufferMove log files to faster drivesIncrease log buffer
Wait class = System I/OLGWR waiting to write to redo log filesMay occur in conjunction with log file synclog file syncMove redo log files to faster diskDon’t overdo number of redo group membersReduce amount of redo
Automatic Database Diagnostic MonitorPerforms self diagnosisRun for each AWR snapshot (hourly)Aim is to reduce DB timeIdentify bottlenecksMake recommendations
ConfigurationChanges to init parametersChanges to file sizes
Hardware changes
www.sagecomputing.com.auwww.sagecomputing.com.au
Accessed through Enterprise Accessed through Enterprise ManagerManager
View ADDM output for up to 7 days
www.sagecomputing.com.auwww.sagecomputing.com.au
Accessed through Enterprise Accessed through Enterprise ManagerManager
View ADDM output for a snapshot
www.sagecomputing.com.auwww.sagecomputing.com.au
ADDM AnalysisADDM Analysis
Perform analysis between two snapshotsNo shutdown between snapshots
Run from Enterprise ManagerRun using @$ORACLE_HOME/rdbms/admin/addmrpt.sqlRun using DBMS_ADVISORProduces report
TextHTML
www.sagecomputing.com.auwww.sagecomputing.com.au
ADDM AnalysisADDM Analysis
Results in the following viewsDBA_ADVISOR_TASKSDBA_ADVISOR_LOGDBA_ADVISOR_RECOMMENDATIONSDBA_ADVISOR_FINDINGS
www.sagecomputing.com.auwww.sagecomputing.com.au
DBA_ADVISOR_FINDINGSDBA_ADVISOR_FINDINGS
Top 10 findingsSELECT type, messageFROM (SELECT type, message, count(*) num
FROM dba_advisor_findingsGROUP BY type, messageORDER BY num desc)
WHERE rownum < 10
TYPE MESSAGE ------------ ---------------------------------------------------------------------------------------SYMPTOM Wait class "User I/O" was consuming significant database time. INFORMATION There was no significant database activity to run the ADDM. PROBLEM SQL statements consuming significant database time were found. PROBLEM Wait event "class slave wait" in wait class "Other" was consuming significant database SYMPTOM Wait class "Other" was consuming significant database time. PROBLEM PL/SQL execution consumed significant database time. SYMPTOM The throughput of the I/O subsystem was significantly lower than expected. PROBLEM Individual database segments responsible for significant user I/O wait were found. PROBLEM Time spent on the CPU by the instance was responsible for a substantial part of databas
www.sagecomputing.com.auwww.sagecomputing.com.au
www.sagecomputing.com.auwww.sagecomputing.com.au
Thank You For Your Attention
Any Questions?
SAGE Computing ServicesSAGE Computing ServicesCustomised Oracle Training WorkshopsCustomised Oracle Training Workshops
and Consultingand Consultingwww.sagecomputing.com.auwww.sagecomputing.com.au