SlideShare uma empresa Scribd logo
1 de 24
NYOUG – Summer Meeting – AWR 11g

ADDM, ASH and AWR
A DBA’s Best Friends

Earl D. Shaffer
Senior Oracle DBA
Planet Payment
LinkedIn: “Earl D Shaffer”
NYOUG – Summer Meeting – AWR 11g

My Oracle
qualifications
•
•
•
•
•
•

30+ years of hands-on IS experience
Oracle DBA since 1988, Unix, WIN, Linux
Project Leader, Forms/Reports/Pro*C
Presented Oracle technical papers at 10
international conferences, 25+ elsewhere
Hands-on DBA v6, 7, 8i, 9i, 10g, 11g, 12c
Oracle Corp Adv Cust Service team alumni
NYOUG – Summer Meeting – AWR 11g

Format of the
Presentation
•
•
•
•
•
•

Survey of your Oracle DBA Experience
Go through the basic slides
Look at real AWR, ASH, and ADDM reports
Go through screen captures, graphs,
diagrams, and real-life examples
See the AWR tables/views for DB 12c
If time, go over real scripts that use AWR
NYOUG – Summer Meeting – AWR 11g

The Bad Old Days
•
•
•
•
•

In 1988, V5.1 was out and 6.0 was coming
Oracle v6 through v8.0 had BSTAT/ESTAT
reports (but the tables were in SYSTEM)
We tuned using “cache hit ratios”
Wait info was captured, but hard to get to
Before 8i, tuning was “an art” because it was
subjective, and hard to repeat
NYOUG – Summer Meeting – AWR 11g

Working hard to
get any real
Improvement
•
•
•
•
•

No one wants to get the “DB is slow” call
Management usually does not want to buy
more RAM or a new, faster server
In most cases, you have to make what you
have run faster with no additional resources
Performance Tuning = Magic Trick?
HINT – make a list of things that work, where
they work, and use it again next time
NYOUG – Summer Meeting – AWR 11g

Work Smarter Not
Harder
•
•
•
•
•
•

Cache hit ratios are deceptive
You really want to know: 'what is going on'
Need info on all resources inside the DB
Need stats on all the SQL recently run
Need a way to compare 1pm to 9am
Would be nice if the DB did this for us
NYOUG – Summer Meeting – AWR 11g

AWR to the Rescue
•
•
•
•
•
•
•

Automatic Workload Repository
Auto gather of internal DB statistics
Key – stats stored in DB managed tables
Easy-to-use views help the DBA use the info
Feeds into ADDM and the advisory suite
Frequency of stats gather can be changed
Statistics retention time can be changed
NYOUG – Summer Meeting – AWR 11g

What about STATSPACK?

•
•
•
•
•
•

Why not just use our friend STATSPACK?
Was better than BSTAT/ESTAT
Requires an external job to get a snapshot
Physical tables need manual management
Report is good, but limited
Cannot easily compare REP4 to REP5
NYOUG – Summer Meeting – AWR 11g

V$ACTIVE_SESSION_HISTORY

•
•
•

V$ACTIVE_SESSION_HISTORY displays
sampled session activity in the database.
It contains snapshots of active database
sessions taken once a second.
A database session is considered active if it
was on the CPU or was waiting for an event
that didn't belong to the Idle wait class.
NYOUG – Summer Meeting – AWR 11g

The Players
•
•
•
•
•

ADDM – the AI sub-system of DB rules
ASH – active session history, “back info”
AWR – Automatic Workload Repository
Enterprise Manager – info + GUI + graphs
You – use ADDM, ASH, and AWR to monitor
the DB, fix problems, proactively plan make the
whole environment as effective as possible
NYOUG – Summer Meeting – AWR 11g

The Basics
•
•
•
•

•

Each stat gather is called a SNAPSHOT
A SNAPSHOT is specific to a point in time
DBA_HIST_SNAPSHOT joins to the views
Each DBA_HIST view has different kinds of
stats, from different areas of the DB, but all are
specific to a SNAPSHOT
There are 40+ 11g DBA_HIST views
NYOUG – Summer Meeting – AWR 11g

Examples of
the DBA_HIST
Views
•

DBA_HIST_SNAPSHOT - Displays snapshot information.

•

DBA_HIST_SYSSTAT - Displays detailed system statistics

•

DBA_HIST_FILESTATXS – Displays detailed datafile
statistics

•

DBA_HIST_SQL_SUMMARY – Displays summary and
higher level SQL statistics

•

DBA_HIST_SQLSTAT – Displays detailed SQL statistics

•

DBA_HIST_WAITSTAT – Displays detailed wait statistics
NYOUG – Summer Meeting – AWR 11g

Input to AWR Reports
Database time “DB Time” is:
total time spent by user processes either actively working or
actively waiting in a database call
Time spent in the DB by foreground sessions includes:
•CPU time
•IO time
•WAIT time
Excludes
•IDLE wait time
NYOUG – Summer Meeting – AWR 11g

AWR Reports
•
•
•

AWR reports are superior to STATSPACK
Based on the events between 2 snapshots
Can be run from $ORACLE_HOME/rdbms/admin



awrrpt.sql statistics for a range of snapshot Ids.





awrsqrpt.sql statistics of a particular SQL statement for a range of
snapshot IDs, to inspect the performance of a SQL statement.
awrddrpt.sql compares detailed performance attributes and
configuration settings between two selected time periods.
NYOUG – Summer Meeting – AWR 11g

AWR Reports (2)

•

AWR reports can be run as PL/SQL call
Call: dbms_workload_repository.awr_sql_report_text
•
Later we will look at “real” reports
•
Take report file and email it, or compress it
and move it to a filesystem for later review
Another example: www.dba-oracle.com/art_orafaq_awr_sql_tuning.htm
NYOUG – Summer Meeting – AWR 11g

AWR Reports (3)
•
•

AWR reports can be run via VARIABLES
Define the variables, then call the report:

define begin_snap = &1
define end_snap = &2
define report_name = &3
define report_type = 'text';
define db_name = 'SALES3';
define dbid = 994285834;
@/ora/product/11106/rdbms/admin/awrrpti
NYOUG – Summer Meeting – AWR 11g

Too Much Info?
•
•

With all the DBA_HIST views there, it can get
confusing as to which to use, and when
Look at these general categories:
File statistics
General system statistics
Concurrency statistics
Instance tuning statistics
SQL statistics
Segment Statistics
Undo Statistics
Time-model statistics
Recovery Statistics
NYOUG – Summer Meeting – AWR 11g

Some Real Query
Examples

Look at Buffer Pool stats
•
HISTBUFPOOLSTAT.SQL
Look at logon stats between 2 dates
•
LOGONHIST.SQL
NYOUG – Summer Meeting – AWR 11g

Learn, Learn and
Learn More
•
•
•
•
•
•

Oracle Doc – CD, online
Books by well-regarded authors
On-line websites and Blogs
National conferences and training classes
Local Oracle User Groups
Email with other local DBAs
NYOUG – Summer Meeting – AWR 11g

What Never Changes
•
•
•
•
•

End users cannot explain what 'seems slow'
really means
You wont get more money for RAM
More work, fewer people, multiple projects
Fixing AA can break BB
Everything affects everything else – other
DBs, other applications, other
programs/systems, SAN use, etc.
NYOUG – Summer Meeting – AWR 11g

Using these
new Powers
•
•
•
•
•
•

Looking for SQL which consumes the most
resources in your environment
See which areas use the same SQL
See IO Problems 'over time'
See the 'hottest' datafile this week
Explore the 'system metrics'
Use Enterprise Manager to 'dig in'
NYOUG – Summer Meeting – AWR 11g

Everyone Needs to
Have this Data
•
•
•
•
•

That includes the SAs, DBAs, and Developers
SAs can see IO and OS statistics
Developers can see SQL and PL/SQL plans
Data modelers can see Table/View use
Others DBAs can see the statistics and
compare them to issues they have seen
elsewhere, learn, and share their 'fixes'
NYOUG – Summer Meeting – AWR 11g

Things To
Watch Out For
•
•
•
•

Watch the size of SYSAUX
Don't test fixes in PROD, 'test in test'
Don't change the snapshot interval, it is a
good balance between too often/too few
Unless you run reports and save the output,
you cant diagnose a 'down DB'
NYOUG – Summer Meeting – AWR 11g

Final Tips
•
•
•
•
•

Use AWR in 10g and 11g, and remove
STATSPACK from the DB entirely
Set the retention to 60 or 90 days
Develop your own set of scripts that you can run
regularly, OEM 'steps' are often forgotten/lost
Review the reports at least once a week
Look into ASH also for more information

Mais conteúdo relacionado

Mais procurados

Oracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance TuningOracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance Tuning
OracleTrainings
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
Kernel Training
 
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and VisualizationWhitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Kristofferson A
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
Aaron Shilo
 
New fordevelopersinsql server2008
New fordevelopersinsql server2008New fordevelopersinsql server2008
New fordevelopersinsql server2008
Aaron Shilo
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
Aaron Shilo
 

Mais procurados (20)

Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Ash and awr deep dive hotsos
Ash and awr deep dive hotsosAsh and awr deep dive hotsos
Ash and awr deep dive hotsos
 
Oracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance TuningOracle Performance Tuning Training | Oracle Performance Tuning
Oracle Performance Tuning Training | Oracle Performance Tuning
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)
 
Analyzing awr report
Analyzing awr reportAnalyzing awr report
Analyzing awr report
 
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
 
resource governor
resource governorresource governor
resource governor
 
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
 
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and VisualizationWhitepaper: Mining the AWR repository for Capacity Planning and Visualization
Whitepaper: Mining the AWR repository for Capacity Planning and Visualization
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
 
New fordevelopersinsql server2008
New fordevelopersinsql server2008New fordevelopersinsql server2008
New fordevelopersinsql server2008
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
 
Oracle DB Performance Tuning Tips
Oracle DB Performance Tuning TipsOracle DB Performance Tuning Tips
Oracle DB Performance Tuning Tips
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database Performance
 
SQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First TimeSQL Server Query Tuning Tips - Get it Right the First Time
SQL Server Query Tuning Tips - Get it Right the First Time
 
Advanced tips for making Oracle databases faster
Advanced tips for making Oracle databases fasterAdvanced tips for making Oracle databases faster
Advanced tips for making Oracle databases faster
 

Destaque

OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
Kyle Hailey
 
Oracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_shortOracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_short
Kyle Hailey
 
OOUG: Oracle transaction locking
OOUG: Oracle transaction lockingOOUG: Oracle transaction locking
OOUG: Oracle transaction locking
Kyle Hailey
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Kevin Meade
 

Destaque (18)

OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
 
Oracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance TuningOracle LOB Internals and Performance Tuning
Oracle LOB Internals and Performance Tuning
 
zero data loss recovery appliance
 zero data loss recovery appliance zero data loss recovery appliance
zero data loss recovery appliance
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
Oracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_shortOracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_short
 
Sql DML
Sql DMLSql DML
Sql DML
 
Oracle cloud, private, public and hybrid
Oracle cloud, private, public and hybridOracle cloud, private, public and hybrid
Oracle cloud, private, public and hybrid
 
OOUG: Oracle transaction locking
OOUG: Oracle transaction lockingOOUG: Oracle transaction locking
OOUG: Oracle transaction locking
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
 
Extreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateExtreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGate
 
Advanced goldengate training ⅰ
Advanced goldengate training ⅰAdvanced goldengate training ⅰ
Advanced goldengate training ⅰ
 
Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra
 
Oracle database 12c 2 day + performance tuning guide
Oracle database 12c 2 day + performance tuning guideOracle database 12c 2 day + performance tuning guide
Oracle database 12c 2 day + performance tuning guide
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1
 
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
 
Low Level CPU Performance Profiling Examples
Low Level CPU Performance Profiling ExamplesLow Level CPU Performance Profiling Examples
Low Level CPU Performance Profiling Examples
 

Semelhante a Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses

Semelhante a Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses (20)

Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Performance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and UnderscoresPerformance Stability, Tips and Tricks and Underscores
Performance Stability, Tips and Tricks and Underscores
 
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
 
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
 
In-memory ColumnStore Index
In-memory ColumnStore IndexIn-memory ColumnStore Index
In-memory ColumnStore Index
 
Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007Average Active Sessions RMOUG2007
Average Active Sessions RMOUG2007
 
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...
 
Snowplow Analytics: from NoSQL to SQL and back again
Snowplow Analytics: from NoSQL to SQL and back againSnowplow Analytics: from NoSQL to SQL and back again
Snowplow Analytics: from NoSQL to SQL and back again
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
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
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
Introducing Azure SQL Database
Introducing Azure SQL DatabaseIntroducing Azure SQL Database
Introducing Azure SQL Database
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
An AMIS overview of database 12c
An AMIS overview of database 12cAn AMIS overview of database 12c
An AMIS overview of database 12c
 
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
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 
Ashawr perf kscope
Ashawr perf kscopeAshawr perf kscope
Ashawr perf kscope
 
Oracle DataGuard Online Training in USA | INDIA
Oracle DataGuard Online Training in USA | INDIAOracle DataGuard Online Training in USA | INDIA
Oracle DataGuard Online Training in USA | INDIA
 
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
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses

  • 1. NYOUG – Summer Meeting – AWR 11g ADDM, ASH and AWR A DBA’s Best Friends Earl D. Shaffer Senior Oracle DBA Planet Payment LinkedIn: “Earl D Shaffer”
  • 2. NYOUG – Summer Meeting – AWR 11g My Oracle qualifications • • • • • • 30+ years of hands-on IS experience Oracle DBA since 1988, Unix, WIN, Linux Project Leader, Forms/Reports/Pro*C Presented Oracle technical papers at 10 international conferences, 25+ elsewhere Hands-on DBA v6, 7, 8i, 9i, 10g, 11g, 12c Oracle Corp Adv Cust Service team alumni
  • 3. NYOUG – Summer Meeting – AWR 11g Format of the Presentation • • • • • • Survey of your Oracle DBA Experience Go through the basic slides Look at real AWR, ASH, and ADDM reports Go through screen captures, graphs, diagrams, and real-life examples See the AWR tables/views for DB 12c If time, go over real scripts that use AWR
  • 4. NYOUG – Summer Meeting – AWR 11g The Bad Old Days • • • • • In 1988, V5.1 was out and 6.0 was coming Oracle v6 through v8.0 had BSTAT/ESTAT reports (but the tables were in SYSTEM) We tuned using “cache hit ratios” Wait info was captured, but hard to get to Before 8i, tuning was “an art” because it was subjective, and hard to repeat
  • 5. NYOUG – Summer Meeting – AWR 11g Working hard to get any real Improvement • • • • • No one wants to get the “DB is slow” call Management usually does not want to buy more RAM or a new, faster server In most cases, you have to make what you have run faster with no additional resources Performance Tuning = Magic Trick? HINT – make a list of things that work, where they work, and use it again next time
  • 6. NYOUG – Summer Meeting – AWR 11g Work Smarter Not Harder • • • • • • Cache hit ratios are deceptive You really want to know: 'what is going on' Need info on all resources inside the DB Need stats on all the SQL recently run Need a way to compare 1pm to 9am Would be nice if the DB did this for us
  • 7. NYOUG – Summer Meeting – AWR 11g AWR to the Rescue • • • • • • • Automatic Workload Repository Auto gather of internal DB statistics Key – stats stored in DB managed tables Easy-to-use views help the DBA use the info Feeds into ADDM and the advisory suite Frequency of stats gather can be changed Statistics retention time can be changed
  • 8. NYOUG – Summer Meeting – AWR 11g What about STATSPACK? • • • • • • Why not just use our friend STATSPACK? Was better than BSTAT/ESTAT Requires an external job to get a snapshot Physical tables need manual management Report is good, but limited Cannot easily compare REP4 to REP5
  • 9. NYOUG – Summer Meeting – AWR 11g V$ACTIVE_SESSION_HISTORY • • • V$ACTIVE_SESSION_HISTORY displays sampled session activity in the database. It contains snapshots of active database sessions taken once a second. A database session is considered active if it was on the CPU or was waiting for an event that didn't belong to the Idle wait class.
  • 10. NYOUG – Summer Meeting – AWR 11g The Players • • • • • ADDM – the AI sub-system of DB rules ASH – active session history, “back info” AWR – Automatic Workload Repository Enterprise Manager – info + GUI + graphs You – use ADDM, ASH, and AWR to monitor the DB, fix problems, proactively plan make the whole environment as effective as possible
  • 11. NYOUG – Summer Meeting – AWR 11g The Basics • • • • • Each stat gather is called a SNAPSHOT A SNAPSHOT is specific to a point in time DBA_HIST_SNAPSHOT joins to the views Each DBA_HIST view has different kinds of stats, from different areas of the DB, but all are specific to a SNAPSHOT There are 40+ 11g DBA_HIST views
  • 12. NYOUG – Summer Meeting – AWR 11g Examples of the DBA_HIST Views • DBA_HIST_SNAPSHOT - Displays snapshot information. • DBA_HIST_SYSSTAT - Displays detailed system statistics • DBA_HIST_FILESTATXS – Displays detailed datafile statistics • DBA_HIST_SQL_SUMMARY – Displays summary and higher level SQL statistics • DBA_HIST_SQLSTAT – Displays detailed SQL statistics • DBA_HIST_WAITSTAT – Displays detailed wait statistics
  • 13. NYOUG – Summer Meeting – AWR 11g Input to AWR Reports Database time “DB Time” is: total time spent by user processes either actively working or actively waiting in a database call Time spent in the DB by foreground sessions includes: •CPU time •IO time •WAIT time Excludes •IDLE wait time
  • 14. NYOUG – Summer Meeting – AWR 11g AWR Reports • • • AWR reports are superior to STATSPACK Based on the events between 2 snapshots Can be run from $ORACLE_HOME/rdbms/admin  awrrpt.sql statistics for a range of snapshot Ids.   awrsqrpt.sql statistics of a particular SQL statement for a range of snapshot IDs, to inspect the performance of a SQL statement. awrddrpt.sql compares detailed performance attributes and configuration settings between two selected time periods.
  • 15. NYOUG – Summer Meeting – AWR 11g AWR Reports (2) • AWR reports can be run as PL/SQL call Call: dbms_workload_repository.awr_sql_report_text • Later we will look at “real” reports • Take report file and email it, or compress it and move it to a filesystem for later review Another example: www.dba-oracle.com/art_orafaq_awr_sql_tuning.htm
  • 16. NYOUG – Summer Meeting – AWR 11g AWR Reports (3) • • AWR reports can be run via VARIABLES Define the variables, then call the report: define begin_snap = &1 define end_snap = &2 define report_name = &3 define report_type = 'text'; define db_name = 'SALES3'; define dbid = 994285834; @/ora/product/11106/rdbms/admin/awrrpti
  • 17. NYOUG – Summer Meeting – AWR 11g Too Much Info? • • With all the DBA_HIST views there, it can get confusing as to which to use, and when Look at these general categories: File statistics General system statistics Concurrency statistics Instance tuning statistics SQL statistics Segment Statistics Undo Statistics Time-model statistics Recovery Statistics
  • 18. NYOUG – Summer Meeting – AWR 11g Some Real Query Examples Look at Buffer Pool stats • HISTBUFPOOLSTAT.SQL Look at logon stats between 2 dates • LOGONHIST.SQL
  • 19. NYOUG – Summer Meeting – AWR 11g Learn, Learn and Learn More • • • • • • Oracle Doc – CD, online Books by well-regarded authors On-line websites and Blogs National conferences and training classes Local Oracle User Groups Email with other local DBAs
  • 20. NYOUG – Summer Meeting – AWR 11g What Never Changes • • • • • End users cannot explain what 'seems slow' really means You wont get more money for RAM More work, fewer people, multiple projects Fixing AA can break BB Everything affects everything else – other DBs, other applications, other programs/systems, SAN use, etc.
  • 21. NYOUG – Summer Meeting – AWR 11g Using these new Powers • • • • • • Looking for SQL which consumes the most resources in your environment See which areas use the same SQL See IO Problems 'over time' See the 'hottest' datafile this week Explore the 'system metrics' Use Enterprise Manager to 'dig in'
  • 22. NYOUG – Summer Meeting – AWR 11g Everyone Needs to Have this Data • • • • • That includes the SAs, DBAs, and Developers SAs can see IO and OS statistics Developers can see SQL and PL/SQL plans Data modelers can see Table/View use Others DBAs can see the statistics and compare them to issues they have seen elsewhere, learn, and share their 'fixes'
  • 23. NYOUG – Summer Meeting – AWR 11g Things To Watch Out For • • • • Watch the size of SYSAUX Don't test fixes in PROD, 'test in test' Don't change the snapshot interval, it is a good balance between too often/too few Unless you run reports and save the output, you cant diagnose a 'down DB'
  • 24. NYOUG – Summer Meeting – AWR 11g Final Tips • • • • • Use AWR in 10g and 11g, and remove STATSPACK from the DB entirely Set the retention to 60 or 90 days Develop your own set of scripts that you can run regularly, OEM 'steps' are often forgotten/lost Review the reports at least once a week Look into ASH also for more information