SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
<Insert Picture Here>
Average active sessions: the magic metric?
John Beresniewicz
Consulting Member of Technical Staff
Oracle USA
The following is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into
any contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remain at the sole discretion of Oracle.
Topics entertained
•  Database time and active sessions
•  Average active sessions
•  Oracle 10g V$ and AWR visibility
•  Estimating DB time with ASH
•  EM Performance Pages
•  Appendix A: The calculus of DB time
•  Appendix B: Little’s Law and average active sessions
What is this?
Database time
•  Time spent in the database by foreground sessions
•  Includes CPU time, IO time and wait time
•  Excludes idle wait time
•  The lingua franca for Oracle performance analysis
Database time is total time spent by user
processes either actively working or actively
waiting in a database call.
Where is DB time used?
•  AWR and AWR compare periods reports
•  EM Performance page and drill downs
•  ASH report
•  Top SQL impact rankings for SQL Tuning Advisor
•  Server-generated Alerts
•  See especially metric baselines and adaptive thresholds
DB time counters
•  Time Model
•  V$SYS_TIME_MODEL and DBA_HIST_SYS_TIME_MODEL
•  Stat_name = ‘DB time’
•  Values in microseconds
•  Wait Model
•  V$WAITCLASSMETRIC_HISTORY and
DBA_HIST_WAITCLASSMET_HISTORY
•  Columns DBTIME_IN_WAIT and TIME_WAITED
•  Values in centiseconds
System load and DB time
•  More users
•  => More calls
•  => DB time increases
•  Larger transactions
•  => Longer calls
•  => DB time increases
DB time increases as system load increases.
System performance and DB time
•  IO performance degrades
•  => IO time increases
•  => DB time increases
•  Application performance degrades
•  => Wait time increases
•  => DB time increases
DB time increases as system performance degrades.
Active sessions
•  Foreground sessions in a database call
•  Backgrounds are also interesting
•  Either on CPU, waiting for IO, or waiting (not idle)
•  V$ACTIVE_SESSION_HISTORY is a collection of
timed regular samples of active session attributes
Active sessions are foreground sessions
contributing to DB time in any given moment.
Average active sessions
•  NOTE: Synchronize time units in numerator and
denominator
AAS = DB time / elapsed time
(during some workload)
Average active sessions
•  Time-normalized DB time
•  Full-time equivalent sessions
•  Not whole sessions
•  How many full-time virtual sessions
to do the work?
•  Comparable
•  Across systems
•  Across time periods
Average active
sessions is the
rate of change of
DB time over
time.
What are the units?
•  Time / time = unitless?
•  DB time accumulates in micro- or centi-seconds
•  Time-normalized metrics are per second of elapsed
•  Centi-seconds (foreground time) per second (elapsed)
•  Centi-users per second
•  User seconds per elapsed second (normalize time units)
•  Active session seconds per second
•  Active sessions
V$ visibility (10g)
•  V$SYS_TIME_MODEL
•  STAT_NAME = ‘DB time’
•  Accumulated value over entire instance
•  V$WAITCLASSMETRIC_HISTORY
•  AVERAGE_WAITER_COUNT
•  It is precisely Average Active Sessions
•  V$SYSMETRIC_HISTORY
•  “Database Time Per Second”, “CPU Usage Per Sec”
•  Units are Centi-seconds per second
•  Value is 100 x Average Active Sessions
AWR visibility (10g)
•  DBA_HIST_SYS_TIME_MODEL
•  DBA_HIST_WAITCLASSMET_HISTORY
•  DBA_HIST_SYSMETRIC_HISTORY
•  Enabling EM metric baselines persists 15 metrics to AWR
AWR snaphots
•  One hour snapshot interval is a great default
•  Diurnal periodicity in workloads (e.g. corporate email)
•  Attempts snapshots on whole hour
•  Simplifies hour-of-day analysis
•  7-day snapshot retention is a conservative default
•  35 days for monthly/weekly cycles is nice for 10g R2 metric
baselines and adaptive thresholds
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS
(interval => 60 -- minutes
,retention => 20160 -- minutes
)
AWR average active sessions
•  DBA_HIST_SYS_TIME_MODEL
•  Stat_name = ‘DB time’
•  Values in microseconds
•  DBA_HIST_SNAPSHOT
•  Elapsed time = end_interval_time – begin_interval_time
•  Partition by startup_time (for instance)
We need to divide DB time by wall clock time.
Compute AWR average active
sessions by snapshot
•  Step 1: Prepare raw data stream
•  Join:
DBA_HIST_SNAPSHOT
DBA_HIST_SYS_TIME_MODEL
•  Step 2: Compute elapsed and DB time deltas by
snapshot
•  Step 3: Compute average active sessions
•  DB time(delta) over elapsed time(delta)
SQLAWRsnapAAS.sql
Compute AWR average active
sessions
Average active sessions: RAC email
Performance monitoring
•  Avg active sessions captures load and performance
•  Severe performance degradation can spike the metric
•  Server-generated alert metrics for monitoring:
•  Database Time Per Sec (10g)
•  Average Active Sessions (11g)
•  Server-set alert threshold values:
•  Set threshold values to statistically unusual (spike)
•  Compute statistics over baseline time periods
•  10gR2 Metric Baselines ; 11g Adaptive Thresholds
EM Performance page
•  Cumulative DB time by wait class
•  v$waitclassmetric_history and v$sysmetric_history
•  1 minute intervals
Active Session History (ASH)
•  Persisted samples of active session information
•  Sessions contributing to DB time at time of sampling
•  One-second sampling interval is a great default
•  Allows simplified AAS computations
•  DB time and Average active sessions can be
computed by aggregating ASH samples
•  See Appendix A: The calculus of DB time
EM Top Activity page
•  ASH-estimated DB time by wait class
•  Aggregated over 15 second intervals
•  Thanks Kyle!
ASH and DB time
•  ASH sample counts = DB Time in seconds
•  Assumes default 1 second sampling
•  Low sample sizes are less reliable
•  Look for skew within dimensions of interest
•  Sqlid, session id, module, instance
select COUNT(1) as dbtime
,sqlid
from v$active_session_history
where session_type=‘FOREGROUND’
group by sqlid
order by 1;
Estimated vs. cumulative DB time
See Appendix A for details on why this works.
Compare ASH estimates to SYSMETRIC
counters of DB time
•  Accumulated: V$SYSMETRIC_HISTORY
•  “Database Time Per Sec”
•  Estimated: V$ACTIVE_SESSION_HISTORY
•  DB Time = sample counts
•  Join by ASH sample time between
SYSMETRICS begin_time and end_time
Are there substantial differences between
accumulated and estimated values of DB time?
SQLASHmetricsAAS.sql
Compare ASH estimates to SYSMETRIC
counters of DB time
Comparison results: email DB
Comparison results: apps DB
Accumulation delays for long-running operations?
SQLASHcpuiowaitAS.sql
Decomposing DB time:
CPU, IO, Wait
Decomposing DB time:
CPU, IO, Wait
SQLASHdumpAAS.sql
Analyze ASH dump: FG vs. BG activity
ASH dump:
FB/BG avg active sessions
80-20 split of FOREGROUND to BACKGROUND time on this system.
ASH dump:
FG/BG avg active sessions on CPU
This is a 20 CPU machine so there is headroom.
BG CPU time PROGRAM DBTIME
------------------------- ----------
oracle@rgmdbs1 (CJQ0) 73
oracle@rgmdbs1 (CKPT) 80
oracle@rgmdbs1 (MMON) 126
oracle@rgmdbs1 (LCK0) 129
oracle@rgmdbs1 (LMON) 152
oracle@rgmdbs1 (m000) 309
oracle@rgmdbs1 (m001) 881
oracle@rgmdbs1 (DBW2) 1089
oracle@rgmdbs1 (ARC0) 1117
oracle@rgmdbs1 (SMON) 1118
oracle@rgmdbs1 (DBW1) 1123
oracle@rgmdbs1 (LMD0) 1313
oracle@rgmdbs1 (ARC1) 1325
oracle@rgmdbs1 (DBW0) 1341
oracle@rgmdbs1 (LMS3) 2745
oracle@rgmdbs1 (LMS4) 2746
oracle@rgmdbs1 (LMS1) 2824
oracle@rgmdbs1 (LMS2) 3070
oracle@rgmdbs1 (LMS0) 3146
oracle@rgmdbs1 (LGWR) 4239
select program
,count(*) as DBtime
from gmamocs_ashdata
where session_type=2
and instance_number=1
group by program having count(*) > 60
order by 2
/
RAC LMS processes
consuming significant CPU
resources
Summary
•  DB time is the fundamental performance metric
•  Increases with both client load and degraded system performance
•  Average active sessions is rate of change of DB time over
time
•  Instantaneous load/performance indicator
•  Oracle 10g Active Session History can be used to
aggregate DB time across many useful dimensions
•  Data-mining ASH for real-time indicators as well as
historical trends or model input parameters is useful
Appendix A
The calculus of DB time
ASH sample counting as a Riemann
integral estimate of DB time
The calculus of DB time
•  The number of active sessions at any time is the rate
of change of the DB time function at that time.
•  DB time is the integral of the Active Session function.
The DB time integral
Integral approximation using ASH
timet0 t1
Estimating DB time with ASH
Active sessions
Δt = 1 sec
ASH sample count is value
of active sessions function
at sample times
DB Time
DB time is area
under curve
Appendix B
Little’s Law and average active sessions
The relationship of average active sessions
to black-box queuing models.
Little’s Law for queuing systems
N = X * R
N = number of active requests in system
X = serviced request throughput
R = avg. service time per request
Little’s Law and SYSMETRICS
X2 = Calls per second
R2 = Response per call
N2 = X2 * R2 = ?
X1 = Txn per second
R1 = Response per txn
N1 = X1 * R1 = ?
Average active
sessions is the
average number
of items active in
the system.
N1 = N2 = AAS
Little’s Law and SYSMETRICS
Average active sessions
= Response per Call * Total calls per sec
= Response per Txn * Txn per sec
This explains why DB time increases with both
performance degradation and load increase.
Little’s Law and SYSMETRICS
•  These equivalences have been measured to 6 places
on very busy systems
•  Demonstrates the integrity of 10g instrumentation:
•  DB time used for response time computations is identical
•  Transaction and call counters are consistently updated
SQLLittlesLawAAS.sql
Average Active Sessions RMOUG2007

Contenu connexe

Tendances

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
 
Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014John Beresniewicz
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsCarlos Sierra
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the TradeCarlos Sierra
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
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 MigrationsTanel Poder
 
How to use 23c AHF AIOPS to protect Oracle Databases 23c
How to use 23c AHF AIOPS to protect Oracle Databases 23c How to use 23c AHF AIOPS to protect Oracle Databases 23c
How to use 23c AHF AIOPS to protect Oracle Databases 23c Sandesh Rao
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesBobby Curtis
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWRpasalapudi
 
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
 
Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slidesMohamed Farouk
 
New Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceNew Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceAnil Nair
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningAbishek V S
 
Awr + 12c performance tuning
Awr + 12c performance tuningAwr + 12c performance tuning
Awr + 12c performance tuningAiougVizagChapter
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 
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 #OOWLONMarkus Michalewicz
 
"It can always get worse!" – Lessons Learned in over 20 years working with Or...
"It can always get worse!" – Lessons Learned in over 20 years working with Or..."It can always get worse!" – Lessons Learned in over 20 years working with Or...
"It can always get worse!" – Lessons Learned in over 20 years working with Or...Markus Michalewicz
 

Tendances (20)

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)
 
Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Analyzing awr report
Analyzing awr reportAnalyzing awr report
Analyzing awr report
 
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
 
How to use 23c AHF AIOPS to protect Oracle Databases 23c
How to use 23c AHF AIOPS to protect Oracle Databases 23c How to use 23c AHF AIOPS to protect Oracle Databases 23c
How to use 23c AHF AIOPS to protect Oracle Databases 23c
 
Oracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best PracticesOracle GoldenGate 21c New Features and Best Practices
Oracle GoldenGate 21c New Features and Best Practices
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWR
 
Ash and awr deep dive hotsos
Ash and awr deep dive hotsosAsh and awr deep dive hotsos
Ash and awr deep dive hotsos
 
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...
 
Understanding oracle rac internals part 2 - slides
Understanding oracle rac internals   part 2 - slidesUnderstanding oracle rac internals   part 2 - slides
Understanding oracle rac internals part 2 - slides
 
New Generation Oracle RAC Performance
New Generation Oracle RAC PerformanceNew Generation Oracle RAC Performance
New Generation Oracle RAC Performance
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
Awr + 12c performance tuning
Awr + 12c performance tuningAwr + 12c performance tuning
Awr + 12c performance tuning
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
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
 
"It can always get worse!" – Lessons Learned in over 20 years working with Or...
"It can always get worse!" – Lessons Learned in over 20 years working with Or..."It can always get worse!" – Lessons Learned in over 20 years working with Or...
"It can always get worse!" – Lessons Learned in over 20 years working with Or...
 

En vedette

SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 Kyle Hailey
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemCary Millsap
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersKyle Hailey
 
AWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upAWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upJohn Beresniewicz
 
Awr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsAwr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsJohn Beresniewicz
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseKyle Hailey
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linuxKyle Hailey
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASKyle Hailey
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoringKyle Hailey
 
Awr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsAwr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsJohn Beresniewicz
 

En vedette (11)

SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013 SQL Tuning Methodology, Kscope 2013
SQL Tuning Methodology, Kscope 2013
 
Intro to ASH
Intro to ASHIntro to ASH
Intro to ASH
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problem
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
 
AWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add upAWR Ambiguity: Performance reasoning when the numbers don't add up
AWR Ambiguity: Performance reasoning when the numbers don't add up
 
Awr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsAwr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reports
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoring
 
Awr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reportsAwr1page - Sanity checking time instrumentation in AWR reports
Awr1page - Sanity checking time instrumentation in AWR reports
 

Similaire à Average Active Sessions RMOUG2007

Presentation maximizing database performance performance tuning with db time
Presentation    maximizing database performance performance tuning with db timePresentation    maximizing database performance performance tuning with db time
Presentation maximizing database performance performance tuning with db timexKinAnx
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportAlfredo Krieg
 
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...BI Brainz
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1sqlserver.co.il
 
Introducing Azure SQL Database
Introducing Azure SQL DatabaseIntroducing Azure SQL Database
Introducing Azure SQL DatabaseJames Serra
 
ASH Archit ecture and Advanced Usage.pdf
ASH Archit ecture and Advanced Usage.pdfASH Archit ecture and Advanced Usage.pdf
ASH Archit ecture and Advanced Usage.pdftricantino1973
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingAbouzar Noori
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesoramanc
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsMatt Kuklinski
 
Building Scalable Aggregation Systems
Building Scalable Aggregation SystemsBuilding Scalable Aggregation Systems
Building Scalable Aggregation SystemsJared Winick
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersTobias Koprowski
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...Amazon Web Services
 
Oracle Database : Addressing a performance issue the drilldown approach
Oracle Database : Addressing a performance issue the drilldown approachOracle Database : Addressing a performance issue the drilldown approach
Oracle Database : Addressing a performance issue the drilldown approachLaurent Leturgez
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore IndexSolidQ
 
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingTarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingJovan Popovic
 
Sizing Your MongoDB Cluster
Sizing Your MongoDB ClusterSizing Your MongoDB Cluster
Sizing Your MongoDB ClusterMongoDB
 

Similaire à Average Active Sessions RMOUG2007 (20)

Presentation maximizing database performance performance tuning with db time
Presentation    maximizing database performance performance tuning with db timePresentation    maximizing database performance performance tuning with db time
Presentation maximizing database performance performance tuning with db time
 
Collaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR ReportCollaborate 2019 - How to Understand an AWR Report
Collaborate 2019 - How to Understand an AWR Report
 
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
Introducing Azure SQL Database
Introducing Azure SQL DatabaseIntroducing Azure SQL Database
Introducing Azure SQL Database
 
ASH Archit ecture and Advanced Usage.pdf
ASH Archit ecture and Advanced Usage.pdfASH Archit ecture and Advanced Usage.pdf
ASH Archit ecture and Advanced Usage.pdf
 
Remote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New FeaturesRemote DBA Experts SQL Server 2008 New Features
Remote DBA Experts SQL Server 2008 New Features
 
SQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and ProfilingSQL Server 2014 Monitoring and Profiling
SQL Server 2014 Monitoring and Profiling
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
Building Scalable Aggregation Systems
Building Scalable Aggregation SystemsBuilding Scalable Aggregation Systems
Building Scalable Aggregation Systems
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
Monitor database essentials with Applications Manager
Monitor database essentials with Applications ManagerMonitor database essentials with Applications Manager
Monitor database essentials with Applications Manager
 
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
AWS re:Invent 2016| DAT318 | Migrating from RDBMS to NoSQL: How Sony Moved fr...
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Oracle Database : Addressing a performance issue the drilldown approach
Oracle Database : Addressing a performance issue the drilldown approachOracle Database : Addressing a performance issue the drilldown approach
Oracle Database : Addressing a performance issue the drilldown approach
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
 
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshootingTarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
Tarabica 2019 (Belgrade, Serbia) - SQL Server performance troubleshooting
 
Sizing Your MongoDB Cluster
Sizing Your MongoDB ClusterSizing Your MongoDB Cluster
Sizing Your MongoDB Cluster
 

Plus de John Beresniewicz

ASHviz - Dats visualization research experiments using ASH data
ASHviz - Dats visualization research experiments using ASH dataASHviz - Dats visualization research experiments using ASH data
ASHviz - Dats visualization research experiments using ASH dataJohn Beresniewicz
 
JB Design CV: products / mockups / experiments
JB Design CV: products / mockups / experiments JB Design CV: products / mockups / experiments
JB Design CV: products / mockups / experiments John Beresniewicz
 
Proactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholdsProactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholdsJohn Beresniewicz
 
Contract-oriented PLSQL Programming
Contract-oriented PLSQL ProgrammingContract-oriented PLSQL Programming
Contract-oriented PLSQL ProgrammingJohn Beresniewicz
 

Plus de John Beresniewicz (8)

ASHviz - Dats visualization research experiments using ASH data
ASHviz - Dats visualization research experiments using ASH dataASHviz - Dats visualization research experiments using ASH data
ASHviz - Dats visualization research experiments using ASH data
 
NoSQL is Anti-relational
NoSQL is Anti-relationalNoSQL is Anti-relational
NoSQL is Anti-relational
 
AAS Deeper Meaning
AAS Deeper MeaningAAS Deeper Meaning
AAS Deeper Meaning
 
Awr1page OTW2018
Awr1page OTW2018Awr1page OTW2018
Awr1page OTW2018
 
JB Design CV: products / mockups / experiments
JB Design CV: products / mockups / experiments JB Design CV: products / mockups / experiments
JB Design CV: products / mockups / experiments
 
Proactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholdsProactive performance monitoring with adaptive thresholds
Proactive performance monitoring with adaptive thresholds
 
Ash Outliers UKOUG2011
Ash Outliers UKOUG2011Ash Outliers UKOUG2011
Ash Outliers UKOUG2011
 
Contract-oriented PLSQL Programming
Contract-oriented PLSQL ProgrammingContract-oriented PLSQL Programming
Contract-oriented PLSQL Programming
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Average Active Sessions RMOUG2007

  • 1. <Insert Picture Here> Average active sessions: the magic metric? John Beresniewicz Consulting Member of Technical Staff Oracle USA
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remain at the sole discretion of Oracle.
  • 3. Topics entertained •  Database time and active sessions •  Average active sessions •  Oracle 10g V$ and AWR visibility •  Estimating DB time with ASH •  EM Performance Pages •  Appendix A: The calculus of DB time •  Appendix B: Little’s Law and average active sessions
  • 5. Database time •  Time spent in the database by foreground sessions •  Includes CPU time, IO time and wait time •  Excludes idle wait time •  The lingua franca for Oracle performance analysis Database time is total time spent by user processes either actively working or actively waiting in a database call.
  • 6. Where is DB time used? •  AWR and AWR compare periods reports •  EM Performance page and drill downs •  ASH report •  Top SQL impact rankings for SQL Tuning Advisor •  Server-generated Alerts •  See especially metric baselines and adaptive thresholds
  • 7. DB time counters •  Time Model •  V$SYS_TIME_MODEL and DBA_HIST_SYS_TIME_MODEL •  Stat_name = ‘DB time’ •  Values in microseconds •  Wait Model •  V$WAITCLASSMETRIC_HISTORY and DBA_HIST_WAITCLASSMET_HISTORY •  Columns DBTIME_IN_WAIT and TIME_WAITED •  Values in centiseconds
  • 8. System load and DB time •  More users •  => More calls •  => DB time increases •  Larger transactions •  => Longer calls •  => DB time increases DB time increases as system load increases.
  • 9. System performance and DB time •  IO performance degrades •  => IO time increases •  => DB time increases •  Application performance degrades •  => Wait time increases •  => DB time increases DB time increases as system performance degrades.
  • 10. Active sessions •  Foreground sessions in a database call •  Backgrounds are also interesting •  Either on CPU, waiting for IO, or waiting (not idle) •  V$ACTIVE_SESSION_HISTORY is a collection of timed regular samples of active session attributes Active sessions are foreground sessions contributing to DB time in any given moment.
  • 11. Average active sessions •  NOTE: Synchronize time units in numerator and denominator AAS = DB time / elapsed time (during some workload)
  • 12. Average active sessions •  Time-normalized DB time •  Full-time equivalent sessions •  Not whole sessions •  How many full-time virtual sessions to do the work? •  Comparable •  Across systems •  Across time periods Average active sessions is the rate of change of DB time over time.
  • 13. What are the units? •  Time / time = unitless? •  DB time accumulates in micro- or centi-seconds •  Time-normalized metrics are per second of elapsed •  Centi-seconds (foreground time) per second (elapsed) •  Centi-users per second •  User seconds per elapsed second (normalize time units) •  Active session seconds per second •  Active sessions
  • 14. V$ visibility (10g) •  V$SYS_TIME_MODEL •  STAT_NAME = ‘DB time’ •  Accumulated value over entire instance •  V$WAITCLASSMETRIC_HISTORY •  AVERAGE_WAITER_COUNT •  It is precisely Average Active Sessions •  V$SYSMETRIC_HISTORY •  “Database Time Per Second”, “CPU Usage Per Sec” •  Units are Centi-seconds per second •  Value is 100 x Average Active Sessions
  • 15. AWR visibility (10g) •  DBA_HIST_SYS_TIME_MODEL •  DBA_HIST_WAITCLASSMET_HISTORY •  DBA_HIST_SYSMETRIC_HISTORY •  Enabling EM metric baselines persists 15 metrics to AWR
  • 16. AWR snaphots •  One hour snapshot interval is a great default •  Diurnal periodicity in workloads (e.g. corporate email) •  Attempts snapshots on whole hour •  Simplifies hour-of-day analysis •  7-day snapshot retention is a conservative default •  35 days for monthly/weekly cycles is nice for 10g R2 metric baselines and adaptive thresholds DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS (interval => 60 -- minutes ,retention => 20160 -- minutes )
  • 17. AWR average active sessions •  DBA_HIST_SYS_TIME_MODEL •  Stat_name = ‘DB time’ •  Values in microseconds •  DBA_HIST_SNAPSHOT •  Elapsed time = end_interval_time – begin_interval_time •  Partition by startup_time (for instance) We need to divide DB time by wall clock time.
  • 18. Compute AWR average active sessions by snapshot •  Step 1: Prepare raw data stream •  Join: DBA_HIST_SNAPSHOT DBA_HIST_SYS_TIME_MODEL •  Step 2: Compute elapsed and DB time deltas by snapshot •  Step 3: Compute average active sessions •  DB time(delta) over elapsed time(delta)
  • 21. Performance monitoring •  Avg active sessions captures load and performance •  Severe performance degradation can spike the metric •  Server-generated alert metrics for monitoring: •  Database Time Per Sec (10g) •  Average Active Sessions (11g) •  Server-set alert threshold values: •  Set threshold values to statistically unusual (spike) •  Compute statistics over baseline time periods •  10gR2 Metric Baselines ; 11g Adaptive Thresholds
  • 22. EM Performance page •  Cumulative DB time by wait class •  v$waitclassmetric_history and v$sysmetric_history •  1 minute intervals
  • 23. Active Session History (ASH) •  Persisted samples of active session information •  Sessions contributing to DB time at time of sampling •  One-second sampling interval is a great default •  Allows simplified AAS computations •  DB time and Average active sessions can be computed by aggregating ASH samples •  See Appendix A: The calculus of DB time
  • 24. EM Top Activity page •  ASH-estimated DB time by wait class •  Aggregated over 15 second intervals •  Thanks Kyle!
  • 25. ASH and DB time •  ASH sample counts = DB Time in seconds •  Assumes default 1 second sampling •  Low sample sizes are less reliable •  Look for skew within dimensions of interest •  Sqlid, session id, module, instance select COUNT(1) as dbtime ,sqlid from v$active_session_history where session_type=‘FOREGROUND’ group by sqlid order by 1;
  • 26. Estimated vs. cumulative DB time See Appendix A for details on why this works.
  • 27. Compare ASH estimates to SYSMETRIC counters of DB time •  Accumulated: V$SYSMETRIC_HISTORY •  “Database Time Per Sec” •  Estimated: V$ACTIVE_SESSION_HISTORY •  DB Time = sample counts •  Join by ASH sample time between SYSMETRICS begin_time and end_time Are there substantial differences between accumulated and estimated values of DB time?
  • 28. SQLASHmetricsAAS.sql Compare ASH estimates to SYSMETRIC counters of DB time
  • 30. Comparison results: apps DB Accumulation delays for long-running operations?
  • 34. ASH dump: FB/BG avg active sessions 80-20 split of FOREGROUND to BACKGROUND time on this system.
  • 35. ASH dump: FG/BG avg active sessions on CPU This is a 20 CPU machine so there is headroom.
  • 36. BG CPU time PROGRAM DBTIME ------------------------- ---------- oracle@rgmdbs1 (CJQ0) 73 oracle@rgmdbs1 (CKPT) 80 oracle@rgmdbs1 (MMON) 126 oracle@rgmdbs1 (LCK0) 129 oracle@rgmdbs1 (LMON) 152 oracle@rgmdbs1 (m000) 309 oracle@rgmdbs1 (m001) 881 oracle@rgmdbs1 (DBW2) 1089 oracle@rgmdbs1 (ARC0) 1117 oracle@rgmdbs1 (SMON) 1118 oracle@rgmdbs1 (DBW1) 1123 oracle@rgmdbs1 (LMD0) 1313 oracle@rgmdbs1 (ARC1) 1325 oracle@rgmdbs1 (DBW0) 1341 oracle@rgmdbs1 (LMS3) 2745 oracle@rgmdbs1 (LMS4) 2746 oracle@rgmdbs1 (LMS1) 2824 oracle@rgmdbs1 (LMS2) 3070 oracle@rgmdbs1 (LMS0) 3146 oracle@rgmdbs1 (LGWR) 4239 select program ,count(*) as DBtime from gmamocs_ashdata where session_type=2 and instance_number=1 group by program having count(*) > 60 order by 2 / RAC LMS processes consuming significant CPU resources
  • 37. Summary •  DB time is the fundamental performance metric •  Increases with both client load and degraded system performance •  Average active sessions is rate of change of DB time over time •  Instantaneous load/performance indicator •  Oracle 10g Active Session History can be used to aggregate DB time across many useful dimensions •  Data-mining ASH for real-time indicators as well as historical trends or model input parameters is useful
  • 38.
  • 39. Appendix A The calculus of DB time ASH sample counting as a Riemann integral estimate of DB time
  • 40. The calculus of DB time •  The number of active sessions at any time is the rate of change of the DB time function at that time. •  DB time is the integral of the Active Session function.
  • 41. The DB time integral
  • 43. timet0 t1 Estimating DB time with ASH Active sessions Δt = 1 sec ASH sample count is value of active sessions function at sample times DB Time DB time is area under curve
  • 44. Appendix B Little’s Law and average active sessions The relationship of average active sessions to black-box queuing models.
  • 45. Little’s Law for queuing systems N = X * R N = number of active requests in system X = serviced request throughput R = avg. service time per request
  • 46. Little’s Law and SYSMETRICS X2 = Calls per second R2 = Response per call N2 = X2 * R2 = ? X1 = Txn per second R1 = Response per txn N1 = X1 * R1 = ? Average active sessions is the average number of items active in the system. N1 = N2 = AAS
  • 47. Little’s Law and SYSMETRICS Average active sessions = Response per Call * Total calls per sec = Response per Txn * Txn per sec This explains why DB time increases with both performance degradation and load increase.
  • 48. Little’s Law and SYSMETRICS •  These equivalences have been measured to 6 places on very busy systems •  Demonstrates the integrity of 10g instrumentation: •  DB time used for response time computations is identical •  Transaction and call counters are consistently updated SQLLittlesLawAAS.sql