1.19k likes | 1.37k Views
To Do. ADDM – add chart showing advice over time Client id – draw sessions and client bouncing from session to session Services – show connection diagram Get John’s screen shot Talk about SQL tuning on SQL details Show group bys with ASH by various axes
E N D
To Do • ADDM – add chart showing advice over time • Client id – draw sessions and client bouncing from session to session • Services – show connection diagram • Get John’s screen shot • Talk about SQL tuning on SQL details • Show group bys with ASH by various axes • Show examples of setting client_id, service, turning on • More test cases, what does ADDM find
Performance Tuning in Oracle 10g Kyle Hailey
EM Product Layout for Performance Database Home Page Database Performance Page Drilldowns Session SQL
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail EM Pages Layout
Three Paths Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail ADDM Path
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail ADDM Home
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail ADDM Details
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail Manual Path
Home Page Perf Page ADDM Top Session Top SQL Wait Detail ADDM Details SQL Detail Session Detail Performance Page
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail Wait Drill Down
Home Page Perf Page ADDM Top Session Wait Detail Top SQL ADDM Details SQL Detail Session Detail SQL Details
New Features • Metrics • Wait Classes • Time Model • ASH • AWR ( DBA_HIST_ ) • ADDM • Misc Part I Part II Part III
Metrics • Metrics • Wait Classes • Time Model • ASH • AWR ( DBA_HIST_ ) • ADDM • Misc Part I Part II Part III
Metrics Motivation • Performance Statistics • Indicators of Database performance • Cumulative Counters since DB Start • Not Much use in raw form
Querying Statistics Select value from v$sysstat where name=‘physical reads’; SQL> / VALUE --------------- 1,533,787 SQL>
Statistics are Cumulative v$sysstat physical reads Statistics just keep growing
How many Physical Reads/Sec v$sysstat physical reads 1.5M What is the rate here? Statistics just keep growing
Low IO v$sysstat physical reads 1.5M 30 minutes IO’s time
High IO - same cumulative v$sysstat physical reads 1.5M IO’s 30 minutes time
Need Deltas to get Rates • Take value at time A • Take value at time B • Rate = (B-A)/elapsed time
Current Methods • Utlbstat.sql/Utlestat.sql • Creates tables, inserts, deletes • Statspack • needs to be set up • Customized Scripts • Take time to write, no standards Bit overkill for just a quick statistic rate query
Solution : Metrics Rates are Automated in 10g • Deltas at set intervals • 15 second • 60 second • Current Rates • per second • per transaction • Ratios and percentages
Which Statistics have Metrics? • Wait Events • V$EVENTMETRIC (60 secs ) • V$WAITCLASSMETRIC (60 secs) • Statistics • V$SESSMETRIC (15/60 secs) • V$SYSMETRIC (15/60 secs) • Files • V$FILEMETRIC ( 10 minutes)
Short Term History: What happened in the Past? v$sysstat physical reads Low rate Little IO High rate Lots of IO
v$sysstat physical reads 60 secs 60 secs 60 secs 60 secs 60 secs 60 secs 60 secs Solution: Metric History Tables • Last 60 minutes of history delta delta delta delta delta delta delta
Metric History Tables In memory • Statistics • V$SYSMETRIC_HISTORY (15 and 60 seconds) • File IO • V$FILEMETRIC_HISTORY (10 minutes) • Waits • V$WAITCLASSMETRIC_HISTORY ( 60 seconds)
v$sysstat physical reads 60 secs 60 secs 60 secs 60 secs 60 secs 60 secs 60 secs More Detail for Last 3 minutes delta delta delta delta delta delta delta
Statistics have 15 sec deltas v$sysstat physical reads 3 Minutes 15 second deltas
v$sysmetric_history 3 minutes of 15 second deltas 60 minutes of 1 minute deltas Not saved to disk but summary is
Long Term History, 7 days On Disk • Statistics • DBA_HIST_SYSMETRIC_SUMMARY • DBA_HIST_SYSSTAT (cumulative) • DBA_HIST_SYSMETRIC_HISTORY (alerts) • Waits • WAITCLASSMETRIC_HISTORY (alerts) • DBA_HIST_SYSTEM_EVENT (cumulative) • File IO • DBA_HIST_FILEMETRIC_HISTORY(alerts) • DBA_HIST_FILESTATXS (cumulative)
In Resume: Statistics • Raw : v$sysstat • Now : v$sysmetric • 1 Hour : v$sysmetric_history (in memory) • 7 Days : dba_hist_sysmetric_summary (with AWR) There is also v$sessmetric
Session Metrics 15 Ses V$sessmetric BEGIN_TIME END_TIME INTSIZE_CSEC SESSION_ID SESSION_SERIAL_NUM CPU PHYSICAL_READS PGA_MEMORY HARD_PARSES SOFT_PARSES PHYSICAL_READ_PCT LOGICAL_READ_PCT