SlideShare a Scribd company logo
MARIS ELSINS
HARMONY 16
Mining the AWR:
Alternative Methods for
Identification of the Top SQLs
Maris Elsins
Lead DatabaseConsultant
at Pythian since 2011
Located in Riga, Latvia
Oracle [Apps] DBA since 2005
Speaker at conferences since 2007
@MarisElsins elsins@pythian.com
http://bit.ly/getMOSPatch
ABOUT PYTHIAN
11,400
Pythian currently manages
more than 11,400 systems.
400+
Pythian currently employs
more than 400 people in 200
cities in 35 countries
1997
Pythian was founded in 1997
Global Leader In IT Transformation And Operational Excellence
Unparalleled Expertise
• Top 5% in databases,applications,infrastructure,Big Data, Cloud,Data Science,
and DevOps
Unmatched Certifications
• 9 Oracle ACEs, 4 Oracle ACE Directors, 1 Oracle ACE Associate
• 6 Microsoft MVPs, 1 Microsoft Certified Master
• 5 Google Platform Qualified Developers
• 1 Cloudera Champion ofBig Data
• 1 Mongo DB Certified DBAAssociate Level
• 1 DataStax Certified Partner, 1 MVP
Broad Technical Experience
• Oracle, Microsoft, MySQL, Oracle EBS, Hadoop,Cassandra,MongoDB,
virtualization,configuration management,monitoring,trending,and more.
AGENDA
A SERIOUS WASH PLANT
Agenda
Panning
DEMO
DEMO
What is AWR?
Workload
What is AWR?
Snapshot
9
What is AWR?
Repository
What is AWR?
AWR Report
AWR
Automatic Workload Repository
Let’s try again …
Workload
768 V$ (12.1.0.2)
AWR Snapshot
62+ V$ & X$
Workload
Captured by AWR
• Object statistics that determine both access and usage statistics of
database segments
• Time model statistics based on time usage for activities, displayed
in the V$SYS_TIME_MODEL and V$SESS_TIME_MODEL views
• Some of the system and session statistics collected in the
V$SYSSTAT and V$SESSTAT views
• SQL statements that are producing the highest load on the system,
based on criteria such as elapsed time and CPU time
• Active Session History (ASH) statistics, representing the history
of recent sessions activity
AWR Snapshot
“The Selfie”
• MMON or dbms_workload_repository.create_snapshot()
• DBA_HIST_WR_CONTROL
• TOPNSQL “DEFAULT” depends on the STATISTICS_LEVEL
– TYPICAL => 30 (is this enough?)
– ALL => 100
• DBMS_WORKLOAD_REPOSITORY
– Modify settings: MODIFY_SNAPSHOT_SETTINGS
– Colored SQL: ADD_COLORED_SQL
SNAPSHOT
2 WAYS OF COLLECTING STATISTICS
• DELTAs & TOTALs
– Captures current values
– Pre-calculates ∆values
– DBA_HIST_SQLSTAT
– DBA_HIST_SEG_STAT
• TOTALs
– Captures current values
– Similar to STATSPACK
– DBA_HIST_IOSTAT_DETAIL and others
Repository
Metadata
REPOSITORY
SNAP_ID - BASED INFORMATION (105)
DEMO
THANK YOU LARRY FOR AWR REPORTS!
THANK YOU LARRY FOR AWR REPORTS!
THANK YOU LARRY FOR AWR REPORTS!
THANK YOU LARRY FOR AWR REPORTS!
THANK YOU LARRY FOR AWR REPORTS!
AWR REPORT
• “SQL Statistics” section is aggregated by SQL_ID
• Do you know what’s good about SQL_ID?
– It uniquely identifies a SQL statement
• Do you know what’s bad about SQL_ID?
– It uniquely identifies a SQL statement
SQL ID AND OTHER IDENTIFICATION METHODS
• DEMO - identification_demo.sql
CHALLENGES WITH UNIQUE IDENTIFICATION
• Different formatting of a SQL statement
• Misuse of constants in SQL statements
• Use of constants in semantically equivalent statements
(should these be separated?)
• Different names for bind variables in equivalent SQL
statements
• Does EXACT_MATCHING_SIGNATURE help?
• Does FORCE_MATCHING_SIGNATURE help?
• Does PLAN_HASH_VALUE help?
LET’S MINE THE AWR!
• DEMO - awr_top_sqlid_demo.sql
LET’S MINE THE AWR!
• DEMO - awr_top_fms_demo.sql
LET’S MINE THE AWR!
• DEMO - awr_top_plan_demo.sql
SUMMARY
• AWR report is sufficient, except when it’s not
– No clear top consumer
– Dynamic SQL
– Combined reporting intervals
• Overhead of creating an AWR report
• TOPNSQL
• FORCE_MATCHING_SIGNATURE
• PLAN_HASH_VALUE
• Don’t stop ! You decide how to filter and aggregate the data
– Module
– Action
– …
AWR is a complex beast, but it’s not necessary to know much to start mining
Be Brave!
But buy Diagnostics pack licenses first.
Contact Information
elsins@pythian.com
@MarisElsins
Lead Database Consultant,
Pythian
613 565 8696 ext 337
Maris Elsins
Pythian.com
@pythian
Demo scripts available here: http://bit.ly/Maris_Harmony16_AWR

More Related Content

What's hot

Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
Timothy Schubert
 

What's hot (20)

MySQL Cluster
MySQL ClusterMySQL Cluster
MySQL Cluster
 
MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle Databases
 
01 upgrade to my sql8
01 upgrade to my sql8 01 upgrade to my sql8
01 upgrade to my sql8
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWS
 
Architecting Your Own DBaaS in a Private Cloud with EM12c
Architecting Your Own DBaaS in a Private Cloud with EM12cArchitecting Your Own DBaaS in a Private Cloud with EM12c
Architecting Your Own DBaaS in a Private Cloud with EM12c
 
Expert summit SQL Server 2016
Expert summit   SQL Server 2016Expert summit   SQL Server 2016
Expert summit SQL Server 2016
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document Store
 
Oracle Database Appliance Workshop
Oracle Database Appliance WorkshopOracle Database Appliance Workshop
Oracle Database Appliance Workshop
 
Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
Suffering from Chronic Patching Pain? Get Relief with Fleet Maintenance [CON6...
 
A3 transforming data_management_in_the_cloud
A3 transforming data_management_in_the_cloudA3 transforming data_management_in_the_cloud
A3 transforming data_management_in_the_cloud
 
SQL Server Reporting Services Disaster Recovery Webinar
SQL Server Reporting Services Disaster Recovery WebinarSQL Server Reporting Services Disaster Recovery Webinar
SQL Server Reporting Services Disaster Recovery Webinar
 
Exadata MAA Best Practices
Exadata MAA Best PracticesExadata MAA Best Practices
Exadata MAA Best Practices
 
2019 - OOW - Database Migration Methods from On-Premise to Cloud
2019 - OOW - Database Migration Methods from On-Premise to Cloud2019 - OOW - Database Migration Methods from On-Premise to Cloud
2019 - OOW - Database Migration Methods from On-Premise to Cloud
 
Oracle Database In-Memory Advisor (English)
Oracle Database In-Memory Advisor (English)Oracle Database In-Memory Advisor (English)
Oracle Database In-Memory Advisor (English)
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
 
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
 
PayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL ClusterPayPal Big Data and MySQL Cluster
PayPal Big Data and MySQL Cluster
 
The Oracle Autonomous Database
The Oracle Autonomous DatabaseThe Oracle Autonomous Database
The Oracle Autonomous Database
 

Similar to Mining the AWR: Alternative Methods for Identification of the Top SQLs (including demo)

SQL SERVER DBA MARK
SQL SERVER DBA MARKSQL SERVER DBA MARK
SQL SERVER DBA MARK
Mark Eremah
 
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
confluent
 
vinay reddy resume 2yrs
vinay reddy resume 2yrsvinay reddy resume 2yrs
vinay reddy resume 2yrs
Vinay Reddy
 

Similar to Mining the AWR: Alternative Methods for Identification of the Top SQLs (including demo) (20)

Data Management for High Performance Analytics
Data Management for High Performance AnalyticsData Management for High Performance Analytics
Data Management for High Performance Analytics
 
Ripon Datta. SQL DBA N
Ripon Datta. SQL DBA NRipon Datta. SQL DBA N
Ripon Datta. SQL DBA N
 
Anil T D Souza
Anil T D SouzaAnil T D Souza
Anil T D Souza
 
Options for Data Prep - A Survey of the Current Market
Options for Data Prep - A Survey of the Current MarketOptions for Data Prep - A Survey of the Current Market
Options for Data Prep - A Survey of the Current Market
 
ETL Developer.pdf
ETL Developer.pdfETL Developer.pdf
ETL Developer.pdf
 
Introduction to Dremio
Introduction to DremioIntroduction to Dremio
Introduction to Dremio
 
Don’t Struggle with Complex and Rigid Data Migrations, Leverage API Wizard to...
Don’t Struggle with Complex and Rigid Data Migrations, Leverage API Wizard to...Don’t Struggle with Complex and Rigid Data Migrations, Leverage API Wizard to...
Don’t Struggle with Complex and Rigid Data Migrations, Leverage API Wizard to...
 
Building Data Warehouse in SQL Server
Building Data Warehouse in SQL ServerBuilding Data Warehouse in SQL Server
Building Data Warehouse in SQL Server
 
SQL SERVER DBA MARK
SQL SERVER DBA MARKSQL SERVER DBA MARK
SQL SERVER DBA MARK
 
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
Relational Database Stockholm Syndrome (Neal Murray, 6 Point 6) London 2019 C...
 
Alok.Resume_3.4
Alok.Resume_3.4Alok.Resume_3.4
Alok.Resume_3.4
 
Incorporating the Data Lake into Your Analytic Architecture
Incorporating the Data Lake into Your Analytic ArchitectureIncorporating the Data Lake into Your Analytic Architecture
Incorporating the Data Lake into Your Analytic Architecture
 
Setting Up the Data Lake
Setting Up the Data LakeSetting Up the Data Lake
Setting Up the Data Lake
 
CV | Sham Sunder | Data | Database | Business Intelligence | .Net
CV | Sham Sunder | Data | Database | Business Intelligence | .NetCV | Sham Sunder | Data | Database | Business Intelligence | .Net
CV | Sham Sunder | Data | Database | Business Intelligence | .Net
 
What Data Do You Have and Where is It?
What Data Do You Have and Where is It? What Data Do You Have and Where is It?
What Data Do You Have and Where is It?
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and Approach
 
vinay reddy resume 2yrs
vinay reddy resume 2yrsvinay reddy resume 2yrs
vinay reddy resume 2yrs
 
Leveraging HPE ALM & QuerySurge to test HPE Vertica
Leveraging HPE ALM & QuerySurge to test HPE VerticaLeveraging HPE ALM & QuerySurge to test HPE Vertica
Leveraging HPE ALM & QuerySurge to test HPE Vertica
 
Develop a Custom Data Solution Architecture with NorthBay
Develop a Custom Data Solution Architecture with NorthBayDevelop a Custom Data Solution Architecture with NorthBay
Develop a Custom Data Solution Architecture with NorthBay
 
Resume
ResumeResume
Resume
 

More from Maris Elsins

More from Maris Elsins (17)

An AWS DMS Replication Journey from Oracle to Aurora MySQL
An AWS DMS Replication Journey from Oracle to Aurora MySQLAn AWS DMS Replication Journey from Oracle to Aurora MySQL
An AWS DMS Replication Journey from Oracle to Aurora MySQL
 
Oracle Databases on AWS - Getting the Best Out of RDS and EC2
Oracle Databases on AWS - Getting the Best Out of RDS and EC2Oracle Databases on AWS - Getting the Best Out of RDS and EC2
Oracle Databases on AWS - Getting the Best Out of RDS and EC2
 
Migrating and Running DBs on Amazon RDS for Oracle
Migrating and Running DBs on Amazon RDS for OracleMigrating and Running DBs on Amazon RDS for Oracle
Migrating and Running DBs on Amazon RDS for Oracle
 
Mining AWR V2 - Trend Analysis
Mining AWR V2 - Trend AnalysisMining AWR V2 - Trend Analysis
Mining AWR V2 - Trend Analysis
 
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 -  Using SQL Plan Baselines for Performance TestingOUG Harmony 2012 -  Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
 
LVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11gLVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11g
 
Surviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource ManagerSurviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource Manager
 
Concurrent Processing Performance Analysis for Apps DBAs
Concurrent Processing Performance Analysis for Apps DBAsConcurrent Processing Performance Analysis for Apps DBAs
Concurrent Processing Performance Analysis for Apps DBAs
 
Simplify Consolidation with Oracle Database 12c
Simplify Consolidation with Oracle Database 12cSimplify Consolidation with Oracle Database 12c
Simplify Consolidation with Oracle Database 12c
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
 
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
 
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
 
Running E-Business Suite Database on Oracle Database Appliance
Running E-Business Suite Database on Oracle Database ApplianceRunning E-Business Suite Database on Oracle Database Appliance
Running E-Business Suite Database on Oracle Database Appliance
 
Internals of concurent managers
Internals of concurent managersInternals of concurent managers
Internals of concurent managers
 
Using SQL Plan Management for Performance Testing
Using SQL Plan Management for Performance TestingUsing SQL Plan Management for Performance Testing
Using SQL Plan Management for Performance Testing
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 

Mining the AWR: Alternative Methods for Identification of the Top SQLs (including demo)

  • 1. MARIS ELSINS HARMONY 16 Mining the AWR: Alternative Methods for Identification of the Top SQLs
  • 2. Maris Elsins Lead DatabaseConsultant at Pythian since 2011 Located in Riga, Latvia Oracle [Apps] DBA since 2005 Speaker at conferences since 2007 @MarisElsins elsins@pythian.com http://bit.ly/getMOSPatch
  • 3. ABOUT PYTHIAN 11,400 Pythian currently manages more than 11,400 systems. 400+ Pythian currently employs more than 400 people in 200 cities in 35 countries 1997 Pythian was founded in 1997 Global Leader In IT Transformation And Operational Excellence Unparalleled Expertise • Top 5% in databases,applications,infrastructure,Big Data, Cloud,Data Science, and DevOps Unmatched Certifications • 9 Oracle ACEs, 4 Oracle ACE Directors, 1 Oracle ACE Associate • 6 Microsoft MVPs, 1 Microsoft Certified Master • 5 Google Platform Qualified Developers • 1 Cloudera Champion ofBig Data • 1 Mongo DB Certified DBAAssociate Level • 1 DataStax Certified Partner, 1 MVP Broad Technical Experience • Oracle, Microsoft, MySQL, Oracle EBS, Hadoop,Cassandra,MongoDB, virtualization,configuration management,monitoring,trending,and more.
  • 15. Workload Captured by AWR • Object statistics that determine both access and usage statistics of database segments • Time model statistics based on time usage for activities, displayed in the V$SYS_TIME_MODEL and V$SESS_TIME_MODEL views • Some of the system and session statistics collected in the V$SYSSTAT and V$SESSTAT views • SQL statements that are producing the highest load on the system, based on criteria such as elapsed time and CPU time • Active Session History (ASH) statistics, representing the history of recent sessions activity
  • 16. AWR Snapshot “The Selfie” • MMON or dbms_workload_repository.create_snapshot() • DBA_HIST_WR_CONTROL • TOPNSQL “DEFAULT” depends on the STATISTICS_LEVEL – TYPICAL => 30 (is this enough?) – ALL => 100 • DBMS_WORKLOAD_REPOSITORY – Modify settings: MODIFY_SNAPSHOT_SETTINGS – Colored SQL: ADD_COLORED_SQL
  • 17. SNAPSHOT 2 WAYS OF COLLECTING STATISTICS • DELTAs & TOTALs – Captures current values – Pre-calculates ∆values – DBA_HIST_SQLSTAT – DBA_HIST_SEG_STAT • TOTALs – Captures current values – Similar to STATSPACK – DBA_HIST_IOSTAT_DETAIL and others
  • 19. REPOSITORY SNAP_ID - BASED INFORMATION (105)
  • 20. DEMO
  • 21. THANK YOU LARRY FOR AWR REPORTS!
  • 22. THANK YOU LARRY FOR AWR REPORTS!
  • 23. THANK YOU LARRY FOR AWR REPORTS!
  • 24. THANK YOU LARRY FOR AWR REPORTS!
  • 25. THANK YOU LARRY FOR AWR REPORTS!
  • 26. AWR REPORT • “SQL Statistics” section is aggregated by SQL_ID • Do you know what’s good about SQL_ID? – It uniquely identifies a SQL statement • Do you know what’s bad about SQL_ID? – It uniquely identifies a SQL statement
  • 27. SQL ID AND OTHER IDENTIFICATION METHODS • DEMO - identification_demo.sql
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. CHALLENGES WITH UNIQUE IDENTIFICATION • Different formatting of a SQL statement • Misuse of constants in SQL statements • Use of constants in semantically equivalent statements (should these be separated?) • Different names for bind variables in equivalent SQL statements • Does EXACT_MATCHING_SIGNATURE help? • Does FORCE_MATCHING_SIGNATURE help? • Does PLAN_HASH_VALUE help?
  • 57. LET’S MINE THE AWR! • DEMO - awr_top_sqlid_demo.sql
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73. LET’S MINE THE AWR! • DEMO - awr_top_fms_demo.sql
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88. LET’S MINE THE AWR! • DEMO - awr_top_plan_demo.sql
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101. SUMMARY • AWR report is sufficient, except when it’s not – No clear top consumer – Dynamic SQL – Combined reporting intervals • Overhead of creating an AWR report • TOPNSQL • FORCE_MATCHING_SIGNATURE • PLAN_HASH_VALUE • Don’t stop ! You decide how to filter and aggregate the data – Module – Action – …
  • 102. AWR is a complex beast, but it’s not necessary to know much to start mining Be Brave! But buy Diagnostics pack licenses first.
  • 103. Contact Information elsins@pythian.com @MarisElsins Lead Database Consultant, Pythian 613 565 8696 ext 337 Maris Elsins Pythian.com @pythian Demo scripts available here: http://bit.ly/Maris_Harmony16_AWR