Академический Документы
Профессиональный Документы
Культура Документы
Speaker Qualifications
John is a Principal Consultant @ DB Soft Inc.
Executive Editor for IOUGs SELECT Journal
Co-author of Oracle Database 10g Insider
Solutions
Technical Editors for various books
Frequent presenter IOUG/OAUG/OOW
Published in SELECT, OAUG Insight, SQL
Server Magazine
Automation
Incremental steps in 9i (Advisors, Time)
Major changes in many areas
Most significant change in Performance
management
Out of the box setups
GUI hides the complexity (and details!)
Previous status
Performance Management
Consistency (AWR)
Interface (DB Console/Views)
Storage/Presentation (AWR/DBC)
Interpretation (Advisors)
Session State:
Starting up or shutting down
Executing on the CPU
Waiting in the CPU queue to execute
Waiting for an event external to the
process to complete (OWI)
An earlier realization
V$SYS_TIME_MODEL System
V$SESS_TIME_MODEL Session
Some values are roll-ups of others
E.g. DB Time => DB CPU +
Connection management time + Parse
time + (others)
Extremely valuable (V$SESSTAT++)
SQL>selectstat_name,valuefromv$sys_time_model
2wherevalue>0;
STAT_NAMEVALUE
DBtime893170091346
DBCPU176244910473
sequenceloadelapsedtime10215471781
parsetimeelapsed4524012412
hardparseelapsedtime3657262901
failedparseelapsedtime103540062
hardparse(sharingcriteria)elapsedtime365217641
hardparse(bindmismatch)elapsedtime5923514
repeatedbindelapsedtime14768010
connectionmanagementcallelapsedtime328536127
PL/SQLexecutionelapsedtime5554924592
PL/SQLcompilationelapsedtime333815896
backgroundelapsedtime13782131027
backgroundcputime4572399582
ZerovaluesforstatisticssuchasJavaexecutionelapsedtime
SQL>selectwait_class,sum(time_waited)fromv$system_event
groupbywait_classorderbysum(time_waited)desc;
WAIT_CLASSSUM(TIME_WAITED)
Idle1167524793
UserI/O50076396
Application23244155
SystemI/O544713
Concurrency462203
Network44112
Other11973
Commit11021
Configuration5736
SQL>selectwait_class,namefromv$event_name
3wherewait_classin('SystemI/O','Concurrency')orderbywait_class,name;
WAIT_CLASSNAME
Concurrencybufferbusywaits
Concurrencyenq:TXindexcontention(**Enqueuetypebrokenout!**)
Concurrencylatch:cachebufferschains(**Latchtypebrokenout!**)
Concurrencylatch:librarycache
Concurrencyosthreadstartup
SystemI/OLGWRsequentiali/o
SystemI/Ocontrolfileparallelwrite
SystemI/Orecoveryread
SM/AWRServerManageabilityAutomaticWorkloadRepository200192
SM/ADVISORServerManageabilityAdvisorFramework39104
SM/OPTSTATServerManageabilityOptimizerStatisticsHistory102912
SM/OTHERServerManageabilityOtherComponents9472
AWR Baselines
API DBMS_WORKLOAD_REPOSITORY
Scripts in $OH/rdbms/admin
dbfilesequentialread347862918227910
dbfilescatteredread348701910389980
dbfilesequentialread349542918337010
dbfilescatteredread350401910229980
enq:TXrowlockcontention35119141505331852432211255142
dbfilescatteredread35204199964380
dbfilescatteredread352071910237180
enq:TXrowlockcontention35220141505331852432211255142
dbfilescatteredread352321910001980
enq:TXrowlockcontention35243141505331852432211255142
dbfilescatteredread352561910274780
ActivityOverTime
>Analysisperiodisdividedintosmallertimeslots
>Top3eventsarereportedineachofthoseslots
>'SlotCount'showsthenumberofASHsamplesinthatslot
>'EventCount'showsthenumberofASHsampleswaitingfor
thateventinthatslot
>'%Event'is'EventCount'overallASHsamplesintheanalysisperiod
SlotEvent
SlotTime(Duration)CountEventCount%Event
19:50:18(42secs)86enq:TXrowlockcontention438.10
dbfilescatteredread397.34
CPU+WaitforCPU40.75
19:51:00(1.0min)119enq:TXrowlockcontention5810.92
dbfilescatteredread509.42
CPU+WaitforCPU112.07
19:52:00(1.0min)126enq:TXrowlockcontention6011.30
dbfilescatteredread509.42
CPU+WaitforCPU132.45
19:53:00(1.0min)123enq:TXrowlockcontention5911.11
dbfilescatteredread499.23
CPU+WaitforCPU152.82
19:54:00(38secs)77enq:TXrowlockcontention376.97
dbfilescatteredread366.78
CPU+WaitforCPU30.56
ASH - Others
Underscore parameters (last 2 new in 10gR2)
_ash_enable (Enable ASH?)
_ash_disk_filter_ratio (inmemory to flush -10)
_ash_eflush_trigger (emergency flush 66% by default)
_ash_sampling_interval (1 second)
_ash_disk_write_enable (enable ASH history flushing to disk)
_ash_sample_all (sample everything including inactive
sessions)
CPU bottlenecks
Excessive parsing
Lock contention
Concurrency
I/O capacity
Incorrect sizing of Oracle memory and file structures
High-load SQL, Java and PL/SQL statements
Poor connection management
Hot objects
RAC-specific issues
ADDM Findings/Recommendations
Hardware changes
Database-configuration changes
Schema-level changes
Application changes
Using other advisors (for example)
SQL Tuning / Access Advisor
Segment Advisor
DBA_ADVISOR_LOG
DBA_ADVISOR_FINDINGS
DBA_ADVISOR_RECOMMENDATIONS
DBA_ADVISOR_ACTIONS
DBA_ADVISOR_RATIONALE
INFORMATION46
WARNING1
SYMPTOM49
PROBLEM79
24SQLstatementsconsumingsignificantdatabasetimewerefound.
24SQLstatementswerefoundwaitingforrowlockwaits.
24IndividualdatabasesegmentsresponsibleforsignificantuserI/O
waitwerefound.
4Theexecutionplanofthisstatementcanbeimprovedbycreating
oneormoreindices
1PL/SQLexecutionconsumedsignificantdatabasetime.
1Significantvirtualmemorypagingwasdetectedonthehost
operatingsystem.
1ThethroughputoftheI/Osubsystemwassignificantlylowerthan
expected
Advisor Framework
Ensures consistency and uniformity
Access (GUI, API - DBMS_ADVISOR,
DBMS_SQLTUNE)
Storage (Collection, AWR)
Invocation (easily and seamlessly between each
other)
Parameterization (WR%ADV%PAR%)
Reporting (Common tables and API)
SQL Profile
collects additional information via sampling/partial
execution techniques
verifies and adjusts CBOs estimates at runtime
SQL Profiles
Similar in function to Outlines
Stored in the Data dictionary when accepted
(DBA_SQL_PROFILES)
Located by hash value of SQL statement
Enabled by category so test-and-set
Access/manipulate DBMS_SQLTUNE
Precedence given to Stored Outlines (??!!)
Segment Advisor
Undo Advisor
Undo Advisor
Memory Advisor
Memory Advisor
Metric Views
V$METRIC/V$SYSMETRIC (V$SYSSTAT) ->
V$SYSMETRIC_HISTORY
V$EVENTMETRIC (V$SYSTEM_EVENT) ->
V$EVENT_METRIC_HISTORY
V$SYSMETRIC_SUMMARY (Avg/Min/StDev)
WRH$_SYSMETRIC_SUMMARY
V$METRICNAME / V$METRICGROUP
Service metrics, Event Histogram, File/Temp Metrics
_db_mttr_trace_to_alert
_optimizer_trace
_smm_trace
_stn_trace
_xpl_trace
Q & A Feedback
Your tuning arsenal: AWR, ADDM, ASH,
Metrics and Advisors
Expert Session #260