SlideShare a Scribd company logo
John Kanagaraj DB Soft Inc Session # S291013  Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Speaker Qualifications John is a Principal Consultant @ DB Soft Inc. Executive Editor for IOUG’s SELECT Journal Co-author of “Oracle Database 10g Insider Solutions” Technical Editor for various books Frequent presenter – IOUG/OAUG/OOW/NoCOUG Published in SELECT, OAUG Insight, SQL Server Magazine and other publications Recognized by Oracle Corp as an “Oracle ACE”
SELECT: Call for Articles/Reviewers Distributed to all IOUG members worldwide Submit an article or Review one! Contact ‘select@ioug.org’
What this presentation is about Tuning tools in Oracle 10gR2  AWR, ADDM, ASH, Metrics, Advisors  Look “Under the hood” Real life Examples Audience Survey: Use of GUI tools, DB Console, Grid Control
Philosophy behind Oracle DB 10g “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 DB never lacked perf. statistics Then what  was  lacking? Consistency Common/Unified interface Stats storage and presentation Interpretation
Now in Oracle DB 10g…. Performance Management Consistency (AWR) Interface (DB Console/Views) Storage/Presentation (AWR/DBC) Interpretation (Advisors) Builds on previous concepts! HOWEVER (!!)  – Check licensing
“OWI” - The “Wait” interface OWI – Term never acknowledged “What is the session waiting for?” Rolls up session/system level Ignores the “CPU” component Well understood (after many years!)
The basics – Session State 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  Oracle recognized this  Look at a STATSPACK report “ Top 5  Wait  Events” – 8i/9iR1 “ Top 5  Timed  Event” – 9iR2 (and 10g) CPU stats from V$SESSTAT and V$SYSSTAT
Time Model in 10g  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> select stat_name, value from  v$sys_time_model 2  where value > 0; STAT_NAME  VALUE ---------------------------------------------  -------------- DB time  893170091346 DB CPU  176244910473 sequence load elapsed time  10215471781 parse time elapsed  4524012412 hard parse elapsed time  3657262901 failed parse elapsed time  103540062 hard parse (sharing criteria) elapsed time  365217641 hard parse (bind mismatch) elapsed time  5923514 repeated bind elapsed time  14768010 connection management call elapsed time  328536127 PL/SQL execution elapsed time  5554924592 PL/SQL compilation elapsed time  333815896 background elapsed time  13782131027 background cpu time  4572399582 Zero values for statistics such as ‘ Java execution elapsed time’
Wait Classes in 10g From 100 events (7.3.4) to 874 (10.2)! 10g classified events under “Wait Class” Rollup in V$SYSTEM_WAIT_CLASS Complete set in V$EVENT_NAME New WAIT_CLASS column in various “wait” views (system and session level)
SQL> select wait_class, sum(time_waited) from v$system_event  group by wait_class order by sum(time_waited) desc; WAIT_CLASS  SUM(TIME_WAITED) ------------------------------ ---------------- Idle  1167524793 User I/O  50076396 Application  23244155 System I/O  544713 Concurrency  462203 Network  44112 Other  11973 Commit  11021 Configuration  5736 SQL> select wait_class, name  from v$event_name 3  where wait_class in ('System I/O','Concurrency') order by wait_class, name; WAIT_CLASS  NAME ------------------ ------------------------------------------------------------ Concurrency  buffer busy waits Concurrency  enq: TX - index contention  (**  Enqueue type broken out!**) Concurrency  latch: cache buffers chains  (** Latch type broken out!**) Concurrency  latch: library cache Concurrency  os thread startup System I/O  LGWR sequential i/o System I/O  control file parallel write System I/O  recovery read
Front page news – DB Console
Automatic Workload Repository Performance Data Warehouse for 10g AWR collects, stores performance data  In-memory component (V$/Metric views) “Persisted” in WR tables (SYSAUX)  162 tables – WRI$, WRH$, WRM$ Self managing “out of the box” Set retention, frequency, baseline
Automatic Workload Repository Active Session History (ASH) High-load SQL statements Time model statistics (both System/Session) Object usage - access counts for segments Snapshots of V$ and some Metrics
AWR – “Statspack on Steroids” Similar to STATSPACK “snapshots” Reportable – AWRRPT.SQL AWR snapshot automatically analyzed Accessible via GUI  and  API/SQL (*) High-impact SQL captured differently Stores session level info as well
AWR – Storage in SYSAUX SQL> select occupant_name, occupant_desc, space_usage_kbytes 2  from v$sysaux_occupants 3  where occupant_name like 'SM%‘; Name  Description  Used KB ---------- ---------------------------------------------------- ------ SM/AWR  Server Manageability-Automatic Workload Repository  200192 SM/ADVISOR Server Manageability-Advisor Framework  39104 SM/OPTSTAT Server Manageability-Optimizer Statistics History  102912 SM/OTHER  Server Manageability-Other Components  9472 Overheads of AWR – Storage, Collection, Archive log usage, latching Metalink Note 296765.1
AWR Baselines Enables performance “baselining” Collection of two or more snapshots Stored in “_BL” tables; data retained View using WRM$_BASELINE Reports diff via AWRDDRPT.SQL Can also be used with SQL Tuning Sets
API - DBMS_WORKLOAD_REPOSITORY   Scripts in $OH/rdbms/admin awrrpt.sql AWR report (STATSPACK) awrddrpt.sql AWR Diff-Diff report awrextr.sql frontends a DataPump dump  awrinfo.sql Space usage by AWR/ASH awrsqrpt.sql Execution statistics for specific SQL statement
ASH – What’s up with sessions Historical view of  active  sessions V$ACTIVE_SESSION_HISTORY  Active sessions sampled every second Stored in  circular  memory buffer Every 10 th  sample persisted in AWR Enables “after-the-fact” analysis!!!
ASH – Session states exposed! “On-the-spot” analysis Retroactive analysis  From memory buffer (V$ACTIVE_SESSION_HISTORY) From persisted AWR data (WRH$_ACTIVE_SESSION_HISTORY connected via SNAP_ID) High load SQL execution behavior Determine Blocking sessions and “hot” segments SESSION_STATE : “ON CPU” or “WAITING ”
ASH – What is happening to me?! SQL> select event, seq#, p1, p2, p3, blocking_session 2  from v$active_session_history  3  where session_id = 113 and session_serial# = 333;  EVENT  Seq#  P1  P2  P3 BlkSess ---------------------------- ------- ------------ ------------ ------------ ------ db file sequential read  34786  29  182279  1  0 db file scattered read  34870  19  103899  8  0 db file sequential read  34954  29  183370  1  0 db file scattered read  35040  19  102299  8  0 enq: TX - row lock contention  35119  1415053318  524322  11255  142 db file scattered read  35204  19  99643  8  0 db file scattered read  35207  19  102371  8  0 enq: TX - row lock contention  35220  1415053318  524322  11255  142 db file scattered read  35232  19  100019  8  0 enq: TX - row lock contention  35243  1415053318  524322  11255  142 db file scattered read  35256  19  102747  8  0
ASH Report - New in 10gR2  Summary of all user activity over the selected period Drill down to a more granular period List details of  only  a Session, SQL ID, Wait Class, Service, Module or Client ID over a particular period “ Top” Background events, P1-P3 values, etc. $OH/rdbms/admin/ashrpt.sql + GUI
Activity Over Time  -> Analysis period is divided into smaller time slots -> Top 3 events are reported in each of those slots -> 'Slot Count' shows the number of ASH samples in that slot -> 'Event Count' shows the number of ASH samples waiting for that event in that slot -> '% Event' is 'Event Count' over all ASH samples in the analysis period Slot  Event Slot Time (Duration)  Count Event  Count % Event -------------------- -------- ------------------------------ -------- ------- 19:50:18  (42 secs)  86 enq: TX - row lock contention  43  8.10 db file scattered read  39  7.34 CPU + Wait for CPU  4  0.75 19:51:00  (1.0 min)  119 enq: TX - row lock contention  58  10.92 db file scattered read  50  9.42 CPU + Wait for CPU  11  2.07 19:52:00  (1.0 min)  126 enq: TX - row lock contention  60  11.30 db file scattered read  50  9.42 CPU + Wait for CPU  13  2.45 19:53:00  (1.0 min)  123 enq: TX - row lock contention  59  11.11 db file scattered read  49  9.23 CPU + Wait for CPU  15  2.82 19:54:00  (38 secs)  77 enq: TX - row lock contention  37  6.97 db file scattered read  36  6.78 CPU + Wait for CPU  3  0.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)  ASH Dump – Metalink Note 243132.1
ADDM – Your unpaid Tuning Expert! Starting point for most investigations Runs after  every  AWR snapshot Determines and records performance issue Recommends corrective action Generates probable benefit Suggest use of other advisors Common currency - “DB Time” (qualitative!)
 
ADDM checks for: (partial list) 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
ADDM – Accessing “ADDuM” GUI! (easiest because of linkage) $OH/rdbms/admin/addmrpt.sql  API – DBMS_ADVISOR In-built PL/SQL Look at following tables DBA_ADVISOR_LOG DBA_ADVISOR_FINDINGS  DBA_ADVISOR_RECOMMENDATIONS  DBA_ADVISOR_ACTIONS  DBA_ADVISOR_RATIONALE
ADDM – Don’t stare at the screen! SQL> select type, count(*) from dba_advisor_findings where task_id in (select task_id from dba_advisor_log  where execution_start  >  sysdate - 1) group by type; TYPE  COUNT(*) -----------  -------- INFORMATION  46 WARNING  1 SYMPTOM  49 PROBLEM  79
ADDM – Don’t stare at the screen! SQL> select count(*) count, message from dba_advisor_findings where task_id in  (select task_id from dba_advisor_log  where execution_start > sysdate - 1)  and type =  'PROBLEM‘  group by message order by 1 desc; COUNT MESSAGE ----- -----------------------------------------------------------------  24 SQL statements consuming significant database time were found. 24 SQL statements were found waiting for row lock waits. 24 Individual database segments responsible for significant user I/O wait were found. 4 The execution plan of this statement can be improved by creating one or more indices 1 PL/SQL execution consumed significant database time. 1 Significant virtual memory paging was detected on the host operating system. 1 The throughput of the I/O subsystem was significantly lower than expected
 
 
 
Advisors – More freebies! 9i – Buff. Cache, Summary, ShPool, etc New in Oracle Database 10g SQL Tuning Advisor SQL Access Advisor Segment Advisor Redolog sizing Advisor Undo Advisor
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 Tuning Advisor – What? Frontend to Automatic Tuning Optimizer Extension (reuse) of Optimizer (CBO) Performs “what-if” analysis Creates an “SQL Profile” (as required) Not restricted by “time to optimize”  (_optimizer_max_permutations = 2000)
SQL Tuning Advisor – How? The following advice is provided Gather missing or stale statistics Create new indexes Restructure SQL statement SQL profiles SQL Profile  collects  additional  information via sampling/partial execution techniques verifies and adjusts CBO’s 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 (??!!)
 
SQL Tuning Set Set of SQLs to be tuned all together DB object of SQLs and environments User can set priority within set Created from Top SQL (Spot/Period), ADDM -> Tuning Advisor, User-specified Use DBMS_SQLTUNE to manipulate
SQL Access Advisor – 9i SumAdv++ Works alongside SQL Tuning Advisor Advice on MV, Indexes, MV logs Considers space usage vs performance  Inputs: STS, User-defined, Hypothetical Advanced: Workload type (RO), Drop unused indexes, Filters (Top N, Module)
Segment Advisor
Undo Advisor
Undo Advisor
Memory Advisor
Memory Advisor
Avoiding Advisor Pitfalls Out-of-the-box thinking (redesign; rethink approach) False positives (check validity for all situations – e.g. Index non-usage) Changing workload or environment (additional load, new code, H/W or S/W changes)
Metrics and SGA Statistics views -> Cumulative counters Metrics ->  Rate of change  of counters Alerts on  rate  -> Server Generated Alerts (changeable via EM) Metrics -> In memory and persisted Short/Long durations: 15/60 seconds 3 mins of 15 seconds; 1 hr of 60 seconds
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
Server Generated Alerts Alerts when set thresholds are reached DBA_THRESHOLDS V$ALERT_TYPES Under “SYSMAN” schema; uses AQ Fully functional monitoring system Controlled by EM (GC/DBC)
Tidbits - Tracing the Advisors _db_mttr_trace_to_alert  Dump trace entries to alert _optimizer_trace   Optimizer trace parameter _smm_trace   SQL memory Manager _stn_trace   SQL tracing parameter _xpl_trace   Explain Plan tracing “ Don’t do this at home!”
Tidbits – Advisor Messages $OH/rdbms/mesg/smgus.msg “ Host CPU was a bottleneck and the instance was consuming %s\% of the host CPU. All wait times will be inflated by wait for CPU.”  “ The SQL statement with SQL_ID \"%s\" was found waiting for the Interested Transaction List (ITL) enqueue on the %s \"%s.%s\" with object id %s."
Tidbits – Statistics Aggregation DBMS_MONITOR package Enable stat collection & tracing at various levels (Client ID, Session, Service, Module, Action) Boon for ConnectionPooled applications Metalink Note: 281787.1 OTN articles
Where do you go from here? Oracle DB 10g Perf. Tuning Guide ML Note:332889.1 Issues & Best Practices  ML Note:276103.1 Perf. Tuning using Advisors & Server Manageability Books, OTN, IOUG, …
Items learnt in this session Tuning tools in Oracle 10gR2  AWR, ADDM, ASH, Metrics, Advisors  Look “Under the hood” Real life Examples Next steps
Q & A – Feedback Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors IOUG Session S291013  John Kanagaraj, DB Soft Inc [email_address] Please complete evaluation form!
Ad

More Related Content

What's hot (20)

AWR and ASH Deep Dive
AWR and ASH Deep DiveAWR and ASH Deep Dive
AWR and ASH Deep Dive
Kellyn Pot'Vin-Gorman
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
Tanel Poder
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizer
Mauro Pagano
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
Mauro Pagano
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
Kyle Hailey
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder
 
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata MigrationsTanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
Ash and awr deep dive hotsos
Ash and awr deep dive hotsosAsh and awr deep dive hotsos
Ash and awr deep dive hotsos
Kellyn Pot'Vin-Gorman
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
Enkitec
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
Kyle Hailey
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
Mohamed Farouk
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
Markus Michalewicz
 
SQL Plan Directives explained
SQL Plan Directives explainedSQL Plan Directives explained
SQL Plan Directives explained
Mauro Pagano
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
Kyle Hailey
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion Edition
Markus Michalewicz
 
Tanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools shortTanel Poder - Scripts and Tools short
Tanel Poder - Scripts and Tools short
Tanel Poder
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizer
Mauro Pagano
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
Mauro Pagano
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
Kyle Hailey
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder
 
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata MigrationsTanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Tanel Poder
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
Enkitec
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
Kyle Hailey
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
Mohamed Farouk
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
Markus Michalewicz
 
SQL Plan Directives explained
SQL Plan Directives explainedSQL Plan Directives explained
SQL Plan Directives explained
Mauro Pagano
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
UKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction LocksUKOUG, Oracle Transaction Locks
UKOUG, Oracle Transaction Locks
Kyle Hailey
 
Oracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion EditionOracle RAC Internals - The Cache Fusion Edition
Oracle RAC Internals - The Cache Fusion Edition
Markus Michalewicz
 

Viewers also liked (6)

Tips and Tricks for Toad
Tips and Tricks for ToadTips and Tricks for Toad
Tips and Tricks for Toad
Aflex Distribution
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
Kernel Training
 
Analyzing awr report
Analyzing awr reportAnalyzing awr report
Analyzing awr report
satish Gaddipati
 
Using AWR/Statspack for Wait Analysis
Using AWR/Statspack for Wait AnalysisUsing AWR/Statspack for Wait Analysis
Using AWR/Statspack for Wait Analysis
Texas Memory Systems, and IBM Company
 
Reading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the GoalReading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the Goal
Franck Pachot
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
Chris Adkin
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
Kernel Training
 
Reading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the GoalReading AWR or Statspack Report - Straight to the Goal
Reading AWR or Statspack Report - Straight to the Goal
Franck Pachot
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
Chris Adkin
 
Ad

Similar to Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors (20)

AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.ppt
bugzbinny
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
Kyle Hailey
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
afa reg
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10g
sagai
 
copenhagen_schema_performance_tuning.ppt
copenhagen_schema_performance_tuning.pptcopenhagen_schema_performance_tuning.ppt
copenhagen_schema_performance_tuning.ppt
cookie1969
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
Kyle Hailey
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
Texas Memory Systems, and IBM Company
 
Using AWR for SQL Analysis
Using AWR for SQL AnalysisUsing AWR for SQL Analysis
Using AWR for SQL Analysis
Texas Memory Systems, and IBM Company
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
Karam Abuataya
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
fcamachob
 
active_session_history_oracle_performance.ppt
active_session_history_oracle_performance.pptactive_session_history_oracle_performance.ppt
active_session_history_oracle_performance.ppt
cookie1969
 
Using Statspack and AWR for Memory Monitoring and Tuning
Using Statspack and AWR for Memory Monitoring and TuningUsing Statspack and AWR for Memory Monitoring and Tuning
Using Statspack and AWR for Memory Monitoring and Tuning
Texas Memory Systems, and IBM Company
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
Sidney Chen
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel Execution
Doug Burns
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
Kellyn Pot'Vin-Gorman
 
Awr doag
Awr doagAwr doag
Awr doag
Marcin Przepiórowski
 
Oracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 samplingOracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 sampling
Kyle Hailey
 
Less04 Instance
Less04 InstanceLess04 Instance
Less04 Instance
vivaankumar
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
Jason Arneil
 
Performance Tuning Using oratop
Performance Tuning Using oratop Performance Tuning Using oratop
Performance Tuning Using oratop
Sandesh Rao
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.ppt
bugzbinny
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
afa reg
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10g
sagai
 
copenhagen_schema_performance_tuning.ppt
copenhagen_schema_performance_tuning.pptcopenhagen_schema_performance_tuning.ppt
copenhagen_schema_performance_tuning.ppt
cookie1969
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
Kyle Hailey
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
Karam Abuataya
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
fcamachob
 
active_session_history_oracle_performance.ppt
active_session_history_oracle_performance.pptactive_session_history_oracle_performance.ppt
active_session_history_oracle_performance.ppt
cookie1969
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
Sidney Chen
 
Introduction to Parallel Execution
Introduction to Parallel ExecutionIntroduction to Parallel Execution
Introduction to Parallel Execution
Doug Burns
 
Oracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 samplingOracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 sampling
Kyle Hailey
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
Jason Arneil
 
Performance Tuning Using oratop
Performance Tuning Using oratop Performance Tuning Using oratop
Performance Tuning Using oratop
Sandesh Rao
 
Ad

Recently uploaded (20)

Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 

Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors

  • 1. John Kanagaraj DB Soft Inc Session # S291013 Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
  • 2. Speaker Qualifications John is a Principal Consultant @ DB Soft Inc. Executive Editor for IOUG’s SELECT Journal Co-author of “Oracle Database 10g Insider Solutions” Technical Editor for various books Frequent presenter – IOUG/OAUG/OOW/NoCOUG Published in SELECT, OAUG Insight, SQL Server Magazine and other publications Recognized by Oracle Corp as an “Oracle ACE”
  • 3. SELECT: Call for Articles/Reviewers Distributed to all IOUG members worldwide Submit an article or Review one! Contact ‘[email protected]
  • 4. What this presentation is about Tuning tools in Oracle 10gR2 AWR, ADDM, ASH, Metrics, Advisors Look “Under the hood” Real life Examples Audience Survey: Use of GUI tools, DB Console, Grid Control
  • 5. Philosophy behind Oracle DB 10g “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!)
  • 6. Previous status DB never lacked perf. statistics Then what was lacking? Consistency Common/Unified interface Stats storage and presentation Interpretation
  • 7. Now in Oracle DB 10g…. Performance Management Consistency (AWR) Interface (DB Console/Views) Storage/Presentation (AWR/DBC) Interpretation (Advisors) Builds on previous concepts! HOWEVER (!!) – Check licensing
  • 8. “OWI” - The “Wait” interface OWI – Term never acknowledged “What is the session waiting for?” Rolls up session/system level Ignores the “CPU” component Well understood (after many years!)
  • 9. The basics – Session State 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)
  • 10. An earlier realization Oracle recognized this Look at a STATSPACK report “ Top 5 Wait Events” – 8i/9iR1 “ Top 5 Timed Event” – 9iR2 (and 10g) CPU stats from V$SESSTAT and V$SYSSTAT
  • 11. Time Model in 10g 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++)
  • 12. SQL> select stat_name, value from v$sys_time_model 2 where value > 0; STAT_NAME VALUE --------------------------------------------- -------------- DB time 893170091346 DB CPU 176244910473 sequence load elapsed time 10215471781 parse time elapsed 4524012412 hard parse elapsed time 3657262901 failed parse elapsed time 103540062 hard parse (sharing criteria) elapsed time 365217641 hard parse (bind mismatch) elapsed time 5923514 repeated bind elapsed time 14768010 connection management call elapsed time 328536127 PL/SQL execution elapsed time 5554924592 PL/SQL compilation elapsed time 333815896 background elapsed time 13782131027 background cpu time 4572399582 Zero values for statistics such as ‘ Java execution elapsed time’
  • 13. Wait Classes in 10g From 100 events (7.3.4) to 874 (10.2)! 10g classified events under “Wait Class” Rollup in V$SYSTEM_WAIT_CLASS Complete set in V$EVENT_NAME New WAIT_CLASS column in various “wait” views (system and session level)
  • 14. SQL> select wait_class, sum(time_waited) from v$system_event group by wait_class order by sum(time_waited) desc; WAIT_CLASS SUM(TIME_WAITED) ------------------------------ ---------------- Idle 1167524793 User I/O 50076396 Application 23244155 System I/O 544713 Concurrency 462203 Network 44112 Other 11973 Commit 11021 Configuration 5736 SQL> select wait_class, name from v$event_name 3 where wait_class in ('System I/O','Concurrency') order by wait_class, name; WAIT_CLASS NAME ------------------ ------------------------------------------------------------ Concurrency buffer busy waits Concurrency enq: TX - index contention (** Enqueue type broken out!**) Concurrency latch: cache buffers chains (** Latch type broken out!**) Concurrency latch: library cache Concurrency os thread startup System I/O LGWR sequential i/o System I/O control file parallel write System I/O recovery read
  • 15. Front page news – DB Console
  • 16. Automatic Workload Repository Performance Data Warehouse for 10g AWR collects, stores performance data In-memory component (V$/Metric views) “Persisted” in WR tables (SYSAUX) 162 tables – WRI$, WRH$, WRM$ Self managing “out of the box” Set retention, frequency, baseline
  • 17. Automatic Workload Repository Active Session History (ASH) High-load SQL statements Time model statistics (both System/Session) Object usage - access counts for segments Snapshots of V$ and some Metrics
  • 18. AWR – “Statspack on Steroids” Similar to STATSPACK “snapshots” Reportable – AWRRPT.SQL AWR snapshot automatically analyzed Accessible via GUI and API/SQL (*) High-impact SQL captured differently Stores session level info as well
  • 19. AWR – Storage in SYSAUX SQL> select occupant_name, occupant_desc, space_usage_kbytes 2 from v$sysaux_occupants 3 where occupant_name like 'SM%‘; Name Description Used KB ---------- ---------------------------------------------------- ------ SM/AWR Server Manageability-Automatic Workload Repository 200192 SM/ADVISOR Server Manageability-Advisor Framework 39104 SM/OPTSTAT Server Manageability-Optimizer Statistics History 102912 SM/OTHER Server Manageability-Other Components 9472 Overheads of AWR – Storage, Collection, Archive log usage, latching Metalink Note 296765.1
  • 20. AWR Baselines Enables performance “baselining” Collection of two or more snapshots Stored in “_BL” tables; data retained View using WRM$_BASELINE Reports diff via AWRDDRPT.SQL Can also be used with SQL Tuning Sets
  • 21. API - DBMS_WORKLOAD_REPOSITORY Scripts in $OH/rdbms/admin awrrpt.sql AWR report (STATSPACK) awrddrpt.sql AWR Diff-Diff report awrextr.sql frontends a DataPump dump awrinfo.sql Space usage by AWR/ASH awrsqrpt.sql Execution statistics for specific SQL statement
  • 22. ASH – What’s up with sessions Historical view of active sessions V$ACTIVE_SESSION_HISTORY Active sessions sampled every second Stored in circular memory buffer Every 10 th sample persisted in AWR Enables “after-the-fact” analysis!!!
  • 23. ASH – Session states exposed! “On-the-spot” analysis Retroactive analysis From memory buffer (V$ACTIVE_SESSION_HISTORY) From persisted AWR data (WRH$_ACTIVE_SESSION_HISTORY connected via SNAP_ID) High load SQL execution behavior Determine Blocking sessions and “hot” segments SESSION_STATE : “ON CPU” or “WAITING ”
  • 24. ASH – What is happening to me?! SQL> select event, seq#, p1, p2, p3, blocking_session 2 from v$active_session_history 3 where session_id = 113 and session_serial# = 333; EVENT Seq# P1 P2 P3 BlkSess ---------------------------- ------- ------------ ------------ ------------ ------ db file sequential read 34786 29 182279 1 0 db file scattered read 34870 19 103899 8 0 db file sequential read 34954 29 183370 1 0 db file scattered read 35040 19 102299 8 0 enq: TX - row lock contention 35119 1415053318 524322 11255 142 db file scattered read 35204 19 99643 8 0 db file scattered read 35207 19 102371 8 0 enq: TX - row lock contention 35220 1415053318 524322 11255 142 db file scattered read 35232 19 100019 8 0 enq: TX - row lock contention 35243 1415053318 524322 11255 142 db file scattered read 35256 19 102747 8 0
  • 25. ASH Report - New in 10gR2 Summary of all user activity over the selected period Drill down to a more granular period List details of only a Session, SQL ID, Wait Class, Service, Module or Client ID over a particular period “ Top” Background events, P1-P3 values, etc. $OH/rdbms/admin/ashrpt.sql + GUI
  • 26. Activity Over Time -> Analysis period is divided into smaller time slots -> Top 3 events are reported in each of those slots -> 'Slot Count' shows the number of ASH samples in that slot -> 'Event Count' shows the number of ASH samples waiting for that event in that slot -> '% Event' is 'Event Count' over all ASH samples in the analysis period Slot Event Slot Time (Duration) Count Event Count % Event -------------------- -------- ------------------------------ -------- ------- 19:50:18 (42 secs) 86 enq: TX - row lock contention 43 8.10 db file scattered read 39 7.34 CPU + Wait for CPU 4 0.75 19:51:00 (1.0 min) 119 enq: TX - row lock contention 58 10.92 db file scattered read 50 9.42 CPU + Wait for CPU 11 2.07 19:52:00 (1.0 min) 126 enq: TX - row lock contention 60 11.30 db file scattered read 50 9.42 CPU + Wait for CPU 13 2.45 19:53:00 (1.0 min) 123 enq: TX - row lock contention 59 11.11 db file scattered read 49 9.23 CPU + Wait for CPU 15 2.82 19:54:00 (38 secs) 77 enq: TX - row lock contention 37 6.97 db file scattered read 36 6.78 CPU + Wait for CPU 3 0.56
  • 27. 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) ASH Dump – Metalink Note 243132.1
  • 28. ADDM – Your unpaid Tuning Expert! Starting point for most investigations Runs after every AWR snapshot Determines and records performance issue Recommends corrective action Generates probable benefit Suggest use of other advisors Common currency - “DB Time” (qualitative!)
  • 29.  
  • 30. ADDM checks for: (partial list) 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
  • 31. ADDM – Findings/Recommendations Hardware changes Database-configuration changes Schema-level changes Application changes Using other advisors (for example) SQL Tuning / Access Advisor Segment Advisor
  • 32. ADDM – Accessing “ADDuM” GUI! (easiest because of linkage) $OH/rdbms/admin/addmrpt.sql API – DBMS_ADVISOR In-built PL/SQL Look at following tables DBA_ADVISOR_LOG DBA_ADVISOR_FINDINGS DBA_ADVISOR_RECOMMENDATIONS DBA_ADVISOR_ACTIONS DBA_ADVISOR_RATIONALE
  • 33. ADDM – Don’t stare at the screen! SQL> select type, count(*) from dba_advisor_findings where task_id in (select task_id from dba_advisor_log where execution_start > sysdate - 1) group by type; TYPE COUNT(*) ----------- -------- INFORMATION 46 WARNING 1 SYMPTOM 49 PROBLEM 79
  • 34. ADDM – Don’t stare at the screen! SQL> select count(*) count, message from dba_advisor_findings where task_id in (select task_id from dba_advisor_log where execution_start > sysdate - 1) and type = 'PROBLEM‘ group by message order by 1 desc; COUNT MESSAGE ----- ----------------------------------------------------------------- 24 SQL statements consuming significant database time were found. 24 SQL statements were found waiting for row lock waits. 24 Individual database segments responsible for significant user I/O wait were found. 4 The execution plan of this statement can be improved by creating one or more indices 1 PL/SQL execution consumed significant database time. 1 Significant virtual memory paging was detected on the host operating system. 1 The throughput of the I/O subsystem was significantly lower than expected
  • 35.  
  • 36.  
  • 37.  
  • 38. Advisors – More freebies! 9i – Buff. Cache, Summary, ShPool, etc New in Oracle Database 10g SQL Tuning Advisor SQL Access Advisor Segment Advisor Redolog sizing Advisor Undo Advisor
  • 39. 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)
  • 40.  
  • 41. SQL Tuning Advisor – What? Frontend to Automatic Tuning Optimizer Extension (reuse) of Optimizer (CBO) Performs “what-if” analysis Creates an “SQL Profile” (as required) Not restricted by “time to optimize” (_optimizer_max_permutations = 2000)
  • 42. SQL Tuning Advisor – How? The following advice is provided Gather missing or stale statistics Create new indexes Restructure SQL statement SQL profiles SQL Profile collects additional information via sampling/partial execution techniques verifies and adjusts CBO’s estimates at runtime
  • 43.  
  • 44.  
  • 45. 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 (??!!)
  • 46.  
  • 47. SQL Tuning Set Set of SQLs to be tuned all together DB object of SQLs and environments User can set priority within set Created from Top SQL (Spot/Period), ADDM -> Tuning Advisor, User-specified Use DBMS_SQLTUNE to manipulate
  • 48. SQL Access Advisor – 9i SumAdv++ Works alongside SQL Tuning Advisor Advice on MV, Indexes, MV logs Considers space usage vs performance Inputs: STS, User-defined, Hypothetical Advanced: Workload type (RO), Drop unused indexes, Filters (Top N, Module)
  • 54. Avoiding Advisor Pitfalls Out-of-the-box thinking (redesign; rethink approach) False positives (check validity for all situations – e.g. Index non-usage) Changing workload or environment (additional load, new code, H/W or S/W changes)
  • 55. Metrics and SGA Statistics views -> Cumulative counters Metrics -> Rate of change of counters Alerts on rate -> Server Generated Alerts (changeable via EM) Metrics -> In memory and persisted Short/Long durations: 15/60 seconds 3 mins of 15 seconds; 1 hr of 60 seconds
  • 56. 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
  • 57. Server Generated Alerts Alerts when set thresholds are reached DBA_THRESHOLDS V$ALERT_TYPES Under “SYSMAN” schema; uses AQ Fully functional monitoring system Controlled by EM (GC/DBC)
  • 58. Tidbits - Tracing the Advisors _db_mttr_trace_to_alert Dump trace entries to alert _optimizer_trace Optimizer trace parameter _smm_trace SQL memory Manager _stn_trace SQL tracing parameter _xpl_trace Explain Plan tracing “ Don’t do this at home!”
  • 59. Tidbits – Advisor Messages $OH/rdbms/mesg/smgus.msg “ Host CPU was a bottleneck and the instance was consuming %s\% of the host CPU. All wait times will be inflated by wait for CPU.” “ The SQL statement with SQL_ID \"%s\" was found waiting for the Interested Transaction List (ITL) enqueue on the %s \"%s.%s\" with object id %s."
  • 60. Tidbits – Statistics Aggregation DBMS_MONITOR package Enable stat collection & tracing at various levels (Client ID, Session, Service, Module, Action) Boon for ConnectionPooled applications Metalink Note: 281787.1 OTN articles
  • 61. Where do you go from here? Oracle DB 10g Perf. Tuning Guide ML Note:332889.1 Issues & Best Practices ML Note:276103.1 Perf. Tuning using Advisors & Server Manageability Books, OTN, IOUG, …
  • 62. Items learnt in this session Tuning tools in Oracle 10gR2 AWR, ADDM, ASH, Metrics, Advisors Look “Under the hood” Real life Examples Next steps
  • 63. Q & A – Feedback Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors IOUG Session S291013 John Kanagaraj, DB Soft Inc [email_address] Please complete evaluation form!

Editor's Notes

  • #6: Many architectural changes have been made to automatically improve memory handling, resource management, storage provisioning, SQL tuning, data movement, recovery speed, and globalization
  • #14: Available in V_$SESSION, V_$SESSION_WAIT_CLASS, V_$SESSION_WAIT, V_$SESSION_EVENT, V_$SYSTEM_WAIT_CLASS, V_$SYSTEM_EVENT, V_$EVENT_NAME, V_$SERVICE_WAIT_CLASS, V_$ACTIVE_SESSION_HISTORY, WRH$_EVENT_NAME, WRH$_SERVICE_WAIT_CLASS, WRH$_SERVICE_WAIT_CLASS_BL, DBA_HIST_EVENT_NAME, DBA_HIST_SYSTEM_EVENT, DBA_HIST_BG_EVENT_SUMMARY, etc.
  • #15: Event breakout: 29 different types of latching and the ‘enqueue’ event breaks out into an amazing 208 types!
  • #17: WRM$_WR_CONTROL – management, WRH$_ACTIVE_SESSION_HISTORY – History, WRI$_ADV_REC_ACTIONS – Interpretation and results
  • #19: Knowing and reporting off STATSPACK data – extend to 10g
  • #23: Persisted in the WRH$_ACTIVE_SESSION_HISTORY
  • #38: Note the Total Time (30 minutes) – Remember there were only 3 SQL statements selected for tuning, and all of them appear here
  • #39: Other 9i – MTTR, PGA Aggr Target
  • #40: Other 9i – MTTR, PGA Aggr Target
  • #42: Sub-optimal execution plans are generated even if everything is collected (object/system stats, histograms, configuration) – because this a mathematical model (e.g. information about correlated columns). The query optimizer under normal mode makes estimates about cardinality, selectivity, and cost that can sometimes be off by a significant amount resulting in poor execution plans
  • #46: The default active category is set through the INIT.ORA parameter SQLTUNE_CATEGORY, but can be changed with ALTER SYSTEM or ALTER SESSION. If the SQL statement contains literals, the hash value changes as well, and hence the SQL profile may be useless. 10gR2 allows substitution of literals with bind variables during the normalization phase as long no other bind variables are present in the SQL statement
  • #48: An STS includes: A set of SQL statements; Associated execution context, such as user schema, application module name and action, list of bind values, and the cursor compilation environment; Associated basic execution statistics, such as elapsed time, CPU time, buffer gets, disk reads, rows processed, cursor fetches, the number of executions, the number of complete executions, optimizer cost, and the command type; Associated execution plans and row source statistics for each SQL statement (optional)
  • #49: User-defined workload. In this source, you use the Torch icon to choose a table in a schema that contains at least the SQL_TEXT and a USERNAME column. You can use this option to run the advisor on a pre-populated set of SQL statements. Hypothetical load. This is the most intriguing of the choices. Basically, it enables a performance analyst to choose a schema or a set of tables that contain dimensions or primary and foreign key constraints. SQL Access Advisor can then generate recommendations for indexes and materialized views based on these relationships.
  • #50: Segment Advisor where you can get advice on segments including recommendations to shrink the object. Quick tip: Metalink Note: 242736.1 10g NEW FEATURES on SEGMENT ADVISOR
  • #51: Undo Advisor which can be used to display Undo usage over a selected period and set Undo parameters using a GUI screen. The Undo Advisor can help you determine the best size for your undo tablespace to ensure successful completion of queries.
  • #53: Use the Memory Advisor to perform what-if analysis on the database performance benefits of adding or reducing physical memory to your database.
  • #57: Metric groups indicate: Event Metrics, Event Class Metrics, System Metrics Long Duration, System Metrics Short Duration, Session Metrics Long Duration, Session Metrics Short Duration, Service Metrics, File Metrics Long Duration, Tablespace Metrics Long Duration, Service Metrics (Short)
  • #62: Metalink Note:332889.1 Oracle Database 10g Migration/Upgrade: Known Issues and Best Practices with Self-Managing Database Metalink Note:276103.1 PERFORMANCE TUNING USING 10g ADVISORS AND MANAGEABILITY FEATURES