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

Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rmanitsabidhussain
 
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DBHow a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DBCarlos Sierra
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
 
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 Database Performance Tuning Basics
Oracle Database Performance Tuning BasicsOracle Database Performance Tuning Basics
Oracle Database Performance Tuning Basicsnitin anjankar
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuningYogiji Creations
 
Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014John Beresniewicz
 
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$ contentionTanel Poder
 
DB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerDB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerMaris Elsins
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuningSimon Huang
 
Overview of oracle database
Overview of oracle databaseOverview of oracle database
Overview of oracle databaseSamar Prasad
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizerMauro Pagano
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by exampleMauro Pagano
 
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
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginnersPini Dibask
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architectureSoumya Das
 

Tendances (20)

Analyzing awr report
Analyzing awr reportAnalyzing awr report
Analyzing awr report
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rman
 
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DBHow a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
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 Database Performance Tuning Basics
Oracle Database Performance Tuning BasicsOracle Database Performance Tuning Basics
Oracle Database Performance Tuning Basics
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
 
Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014
 
Oracle archi ppt
Oracle archi pptOracle archi ppt
Oracle archi ppt
 
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
 
AWR and ASH Deep Dive
AWR and ASH Deep DiveAWR and ASH Deep Dive
AWR and ASH Deep Dive
 
DB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerDB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource Manager
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Overview of oracle database
Overview of oracle databaseOverview of oracle database
Overview of oracle database
 
Chasing the optimizer
Chasing the optimizerChasing the optimizer
Chasing the optimizer
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
 
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...
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginners
 
Oracle architecture
Oracle architectureOracle architecture
Oracle architecture
 

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

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

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