Weitere ähnliche Inhalte
Ähnlich wie Findfixandvalidate 140221013443-phpapp01 (20)
Kürzlich hochgeladen (20)
Findfixandvalidate 140221013443-phpapp01
- 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
Maximize your Database
Performance
Find, Fix and Validate
Jesús Leonardo Robles
DB & O Business Development Manager
Valentín Leonard Tabacaru
Presales Technology Consultant
- 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.2
Agenda
Database Performance Analysis
– Challenges and Solutions
1.- Find
2.- Fix
3.- Validate
Resources
- 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3
Database Performance Analysis
Challenges
•Reported by end users
•Discovered by daily
checks
•Reactive to end-users
Find?
•Relate symptom to
possible cause
•Relate possible cause to
probable metric
•Implement change
Fix? •Did it work?
•End-user feedback?
•Run reports on metric
Validate?
•Will it occur again?
•Custom script to watch
for the metric
•Complex alerting and
notification
Track?
1
2
3
4
- 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4
• For problem diagnosis
use ADDM, EM
Performance
• ADDM reveals
significant problems
including problematic
SQL details and
recommendations
improve to performance
• ADDM family –
Compare Period, Real-
Time ADDM
1 – Find: Diagnostics
- 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5
Boost Administrator
Productivity
Eliminate Performance
Bottlenecks
Lower IT Management
Costs
Deliver Higher Quality of
Service
Automatic Performance Diagnostics
Maximize Performance With Self-Managing Database
• Sustain maximum performance with self-managing database
• Top-down analysis using Automatic Workload Repository snapshots
• Real-time performance analysis with Automatic Database Diagnostic Monitor
• Resolve performance issues faster with drill-down root-cause analysis
• Classification tree based on Oracle performance tuning expertise
• Performance expert; now a RAC specialist too in Oracle Database 11g
Automatic Workload
Repository Snapshots
Performance &
Management
Advisors
High
Load
SQL
RAC
Issues
IO / CPU
Issues
Self-Diagnostic
Engine
- 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6
Performance Issues Automatically Diagnosed by ADDM
Top SQL I/O Issues
Parsing Configuration
Issues
Application
Usage
Excessive
Logon/Logoff
Undersized
Memory
Hot Blocks
and Objects
RAC Service
Issues
Locks & ITL
contention
Checkpoint
causes
PL/SQL,
Java Time
- 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7
Real-Time ADDM—Architecture
• Makes a lightweight connection without acquiring additional locks and
resources, bypassing the SQL layer through the agent
• Also attempts to initiate standard JDBC connection
• Data returned by either connection is analyzed by Real-Time ADDM
EM Agent
JDBC Connection
Diagnostic Connection
ADDM
Analysis
Database
Resource
Constraints
Hangs
Memory Issues
Resource Limits
Reached
Deadlocks
Top Issues Identified by
Real-Time ADDM
- 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8
Real-Time ADDM
- 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
Compare Period ADDM
• Full ADDM analysis across two AWR snapshot periods
• Detects causes, measure effects, then correlates them
• Causes: workload changes, configuration changes
• Effects: regressed SQL, reach resource limits (CPU, I/O, memory, interconnect)
• Makes actionable recommendations along with quantified impact
AWR Snapshot
Period 1
AWR Snapshot
Period 2
Analysis ReportCompare
Period ADDM
SQL Commonality
Regressed SQL
I/O Bound
Undersized SGA
- 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
Compare Period ADDM: Method
• Identify what changed
• DB configurations, workload changes
• Quantify performance differences
• Uses DB Time as basis for measuring performance
• Identify root cause
• Correlate performance differences with changes
Did the Buffer cache get smaller?
Why is there 10% new SQL?
Why Top SQL increased by 45%?
Read I/O are up by 55%, why?
Did a buffer cache reduction
cause a read I/O increase?
- 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
Compare Period – 3 Modes
One snapshot offset
System moving
window
Customized period
- 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12
Compare Period: Report
- 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
Active Session History (ASH)
All ‘Active’ sessions captured every second
• Foregrounds and backgrounds are sampled
• Active foregrounds contribute to DB Time
In-memory: V$ACTIVE_SESSION_HISTORY
• Sampling interval = 1 second
On-disk: DBA_HIST_ACTIVE_SESS_HISTORY
• Sampling interval = 10 seconds
ASH is a system-wide record of database activity
• A FACT table with multiple dimensions that help diagnose performance issues
- 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14
Drilling into Logical Dimensions
ASH
SQL
PL/SQL
Resource
Usage
Session
Identifiers
Session
Attributes
SQL
SQL ID
Plan
Hash
Operation
OpCode
PL/SQL
PL/SQL
Top Level
PL/SQL
Resources
Wait
Class
Wait
Event
Object
Blocking
Session
Identifiers
Instance
Services
User
Session
Parallel
Process
Program
Session
Type
Attributes
Cons.
Group
Module
Action
Client
Trans.
ID
- 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15
ASH Analytics
Flexible Time Picker
Flexible Activity Chart
Flexible Top Chart Flexible Top Chart
- 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
• Seamless integration
between Find and Fix
• In-depth analysis and
recommendation of the
fix
• Gather statistics for this
example…
• How would we validate
this changes?
2 – Fix: Tuning
- 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17
SQL Problems
Bind-sensitive SQL with bind peeking
Literal usage
CURSOR SHARING
Cursor Sharing
Issues
Hardware resource crunch
Contention (row lock contention, block update contention)
Data fragmentation
Resource &
Contention
Issues
RESOURCES
Stale/Missing statistics
Incomplete statistics
Improper optimizer configuration
Upgraded Database: new optimizer
Changing statistics
Rapidly changing data
STATISTICS
Optimizer
Statistics Issues
Missing access structures
Poorly written SQL statementsApplication
Issues
APPLICATIONS
Not parallelized (no scaling to large data)
Improperly parallelized (partially parallelized, skews)Parallelism
Issues
PARALLELISM
- 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18
SQL Tuning Advisor
SQL Tuning Advisor
Identifies alternate execution plans using
real-time and historical performance data
Recommends parallel profile if it will improve SQL
performance significantly (2x or more)
SQL Profiling
Statistics Analysis
Access Path Analysis
SQL Restructure Analysis
Alternative Plan Analysis
Parallel Query Analysis
Automatic Tuning Optimizer
Administrator
SQL Tuning
Recommendations
Gather Missing or Stale Statistics
Create a SQL Profile
Add Missing Access Structures
Modify SQL Constructs
Adopt Alternative
Execution Plan
Create Parallel SQL Profile
SQL Tuning
Advisor
- 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
Application Tuning
Automatic SQL Tuning
Automatic SQL
Tuning
•Captures high-load
SQL
•Tunes SQL using
SQL Profiles
•Implements improved
SQL plans (optional)
Performance
benefit of advice
provided
SQL Profiling
tunes execution
plan without
changing SQL
text
Enables
transparent
tuning for
packaged
applications
Applications
High-Load
Packaged Apps +
SQL Profile
Customizable Apps +
SQL Advice
Customizable Apps +
Indexes & MVs +
Partitions
Tuned SQL
Automatic Tuning Optimizer
- 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20
SQL Access Advisor
Automatic Tuning
Optimizer
SQL
Cache
SQL
Tuning
sets SQL Access
Advisor
Indexes
Materialized Views
Materialized Views
Logs
Partitioned Objects
SQL Access Advisor
• Capture SQL Workload
from multiple sources
Set filters on the
Workload
SQL Access
Recommendations
- 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21
Real-Time SQL Monitoring
Looking Inside SQL Execution
Guides tuning
effortsAutomatically
monitors
long running
SQL
Enabled
out-of-the-box
with no
performance impact
Monitors
SQL execution
Exposes monitoring statistics
Global execution level
Plan operation level
Parallel Execution level
- 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22
SQL Monitoring Details
Expensive Hash Join
- 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23
Real-Time PL/SQL Monitoring
PL/SQL execution no
longer a “black box”
•Answers questions like “why
did my DBMS_STATS job
take twice as long this
time?”
Shows global (PL/SQL)
and SQL level statistics
Each SQL called by
PL/SQL recursively
monitored
Drill-down to slow SQL
for diagnosing
unexpected PL/SQL
behavior
- 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24
Performance Diagnostics
Active Reports
Interactive reports
for
off-line analysis
Drill-downs for
detailed analysis
Can be emailed
for analysis
Does not require
Oracle Enterprise
Manager
installation
- 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25
D E M O N S T R A T I O N
Automatic SQL Tuning
- 96. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.96
D E M O N S T R A T I O N
Monitoring SQL Statements
- 173. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.173
• End-to-end SPA
workflow using
Optimizer Statistics
• Seamless integration
from Find to Fix to
Validate to Implement
with confidence
• No more guesswork
3 – Validate: SPA
- 174. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.174
Real Application Testing
SQL Performance Analyzer (SPA)
SQL Workload
STS
SQL Plans + Run-time Stats
Pre-Change Trial
SQL Plans + Run-time Stats
Post-Change Trial
Compare SQL
Performance Analysis Report
• Test and predict impact of system changes on SQL query performance
• Analyze performance changes for improvements and regressions
• Comprehensive performance analysis and reporting
• Re-execute SQL queries in the given environment
• End-to-end solution: STS, SQL Plan Baselines, and SQL Tuning Advisor
- 175. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.175
SPA Analysis Report Example
4
1
3
2
5
- 176. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.176
SPA Report
Regressed SQL Statements
- 177. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.177
Usage Scenario: Evaluating Changes On
Production
- 178. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.178
+Parameter
Change
Fix Regression thru
SPM
+Add
indexes
Using SPA For Changes in Production: Example
Fix Regression
SQL Profile
Prod
+SQL
Profile
+New Stats
Change
+Partitioning
+Validate
Tuning
Parameter change
was bad in this case
And so on…
+Index
Unusable
• Bubble following the arrow indicates the
delta change on Production
• SPA is used for testing every change
- 179. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.179
When to use SPA?
• Optimizer Statistics
• Database parameter changes
• Database schema changes (e.g., add/drop indexes)
• Implementation of tuning recommendations
• I/O subsystem changes (e.g., ASM, Database Machine)
• For consolidation (schema, CDB/PDB)
• On test, standby, and production environments
• Extended to home-grown scripts, application specific database changes, third-party
testing tools using STS compare analysis
• Supports most applications - EBS, SAP, Siebel, home-grown, etc
SPA Provides Broad Testing Coverage
• My Oracle Support (MOS) Note: 560977.1
• 9.2/10.1 10.2 or 11g or 12 releases
• 10.2.0.x 10.2.0.y or 11g or 12 releases
SPA Provides Testing in Various Database Releases
- 180. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.180
D E M O N S T R A T I O N
SQL Access Advisor & SQL
Performance Analyzer
- 274. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.274
Advanced Databases Performance Analysis
Solution
• Built-in, self-diagnostics
engine: Automatic
Database Diagnostics
Monitor (ADDM)
(Diagnostics Pack)
Find
• Automates complex and
time consuming task of
application tuning
(Tuning Pack)
Fix • Validates tuning and
“what-if” activities
(Real Application Testing)
Validate
• Extend EM out-of-box
metrics - Can be defined
for any target type,
including applications
(Metric Extensions)
Track
- 275. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.275
Resources
Oracle Enterprise Manager 12c:
http://www.oracle.com/us/products/enterprise-manager
Oracle Enterprise Manager 12c Database Management
http://www.oracle.com/technetwork/oem/db-mgmt
Database Manageability and Real Application Testing:
http://www.oracle.com/technetwork/database/manageability
Oracle Enterprise Manager on Beehive Online
Downloadable Technical Assets
oracle12c_es@oracle.com mailing list for support