- Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John...
Transcript of - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John...
![Page 1: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/1.jpg)
![Page 2: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/2.jpg)
<Insert Picture Here>
Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John BeresniewiczOracle USA
![Page 3: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/3.jpg)
<Insert Picture Here>
Agenda
• 11g Diagnostic Pack: Highlights and Usage
• However, we start with “Why It Works”• DB Time and Average Active Sessions• The DB Time Performance Method
Diagnostic Pack Is EssentialFor Database Performance Tuning
![Page 4: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/4.jpg)
<Insert Picture Here>
Oracle Performance Analysis: The DB Time Method
![Page 5: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/5.jpg)
Why Do We Care About Time?Performance Is Always About Time
• Human time is critical to the enterprise
• System time includes human and IT resource time to accomplish business goals
• System performance affects business goals• “Time is money.”
• Performance improvement usually means doing things faster
• Method: find where system time is spent – reduce it!
![Page 6: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/6.jpg)
Single session with Database Black Box server
Browse Books
Read ReviewsFor One Book
Add to Cart Checkout
TIME= time spent in database
A Single Session
![Page 7: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/7.jpg)
Active Session = Session currently spending time in a database call
Database Time (DB Time) =Total time session spent in all database calls
Average Activity of the Session =The ratio of time being active to total wall clock time
Browse Books
Read ReviewsFor One Book
Add to Cart Checkout
TIME= time spent in database
Fundamental concepts
![Page 8: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/8.jpg)
![Page 9: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/9.jpg)
= time spent in database
Browse Books
Read ReviewsFor One Book
Add to Cart Checkout
TIME
Avg. Active Sessions =Wall Clock (Elapsed) Time
Database Time
The Basic Relationship
![Page 10: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/10.jpg)
= time spent in database
Multiple Sessions
TIME
User 1
User 2
User 3
User n
t
At time t we have 2 active sessions
DB Time = Sum of DB Time Over All Sessions
Avg. Active Sessions = Sum of Avg. Active Sessions Over All Sessions
![Page 11: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/11.jpg)
= time spent in database
Breaking down DB Time (example)
TIME
User 1
User 2
User 3
User n
Sessions do different database things at different times
![Page 12: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/12.jpg)
Breaking down DB Time (example)
TIME
User 1
User 2
User 3
User n
CPUI/OOther Waits
Lot’s of brown…maybe I
should investigate other wait time?
![Page 13: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/13.jpg)
DB time
![Page 14: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/14.jpg)
DB Time Tuning
• DB Time can be scoped at multiple levels:• Database / instance• Service / module / action• Session / user• SQL id / rowsource
• Performance improvement for Oracle database means doing the same work in less DB Time
![Page 15: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/15.jpg)
Performance Diagnosis Method
1. Look for large contributions to DB Time. (Start from large scope to specific scope, regardless of complaint)
2. Find root cause for DB Time consumption (At scope found in step 1)
3. Fix problem (apply one fix at a time)
4. Observe reduction in DB Time (At same scope)
5. Affected users are happy? (Rinse and repeat)
![Page 16: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/16.jpg)
What enables the DB Time method?
• Server instrumentation to measure DB Time directly• Time Model• Wait Events• SQL Statistics• Segment Statistics• Metrics
• Sampling instrumentation to sample all active sessions• Active Session History (ASH)
• Storage warehouse of statistics for historical reference• Automatic Workload Repository (AWR)• Statspack (pre-10g)
![Page 17: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/17.jpg)
<Insert Picture Here>
Oracle Diagnostic Pack:
11g Highlights
![Page 18: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/18.jpg)
ADDM for RAC
• Identifies the most “Globally Significant” performance issues
• Automatically runs every hour
• Cluster-wide analysis of:• Global cache interconnect issues• Lock manager congestion issues • Global resource contention, e.g. IO
bandwidth, hot blocks• Globally high-load SQL• Skew in instance response times
Self-Diagnostic Engine
Database-Level ADDM
Instance-Level ADDMs
Node 1 Node 2 Node 3
DatabaseLevel
Analysis
![Page 19: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/19.jpg)
ADDM for RAC
![Page 20: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/20.jpg)
ADDM Finding History
• Identify systemic vs. transient issues• Does the finding appear consistently over many ADDM runs?
• Justify expensive or difficult recommendations• How much DB Time could be saved by implementing?
![Page 21: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/21.jpg)
![Page 22: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/22.jpg)
AWR Instrumentation improvements
• Event waits separate foreground and background time• Allows wait-event and DB Tuning methods to sync better
• DB Time CPU measurement improvements
• Average Active Sessions metric• Replaces DB Time per Second
![Page 23: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/23.jpg)
AWR Baselines
• Capture and preserve representative workload performance• Continuous set of AWR snapshots• Can schedule advance captures using templates
• SYSTEM_MOVING_WINDOW baseline• Trailing N days of AWR activity
• Usages• AWR Compare period reports• Manual or adaptive alert thresholds
![Page 24: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/24.jpg)
Baselines and Metric Thresholds
• Set fixed or adaptive thresholds using a baseline as context
• Quick Configure Adaptive Thresholds • Simple bootstrap settings by workload pattern
• Metric Analysis• Which metrics are correlated with known problem?
![Page 25: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/25.jpg)
Set metric alert thresholds using
context of baseline data
![Page 26: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/26.jpg)
![Page 27: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/27.jpg)
11g ASH improvements• SQL row source information captured
• Which SQL execution plan operations take most time?
• SQL execution ID captured• Are successive identical samples the same or different
executions of the SQL?
• Untimed session states captured (e.g. bind, close)• Use ASH to estimate times spent in difficult to time operations.
• Remote instance id for cache transfers captured• Remote blocking session captured
• Much improved diagnosis of RAC performance issues.
![Page 28: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/28.jpg)
<Insert Picture Here>
Oracle Diagnostic Pack:
Usage
![Page 29: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/29.jpg)
<Insert Picture Here>
The easy way:
Ask ADDM
![Page 30: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/30.jpg)
![Page 31: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/31.jpg)
![Page 32: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/32.jpg)
<Insert Picture Here>
The fun way:
Click on the big stuff!
![Page 33: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/33.jpg)
![Page 34: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/34.jpg)
![Page 35: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/35.jpg)
![Page 36: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/36.jpg)
![Page 37: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/37.jpg)
![Page 38: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/38.jpg)
…and ADDM as well.
11g Automatic SQL Tuning working it
![Page 39: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/39.jpg)
Conclusion
• DB Time method: • Simple, powerful concept for analyzing Oracle performance
• Diagnostic Pack• Instrumentation (AWR, ASH)• Method (automated into ADDM)• Graphical Interface (manual method)• Reports (scoped tightly or widely)
Diagnostic Pack Is EssentialFor Database Performance Tuning
![Page 40: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/40.jpg)
The preceding 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 remains at the sole discretion of Oracle.
![Page 41: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/41.jpg)
Q U E S T I O N SQ U E S T I O N SA N S W E R SA N S W E R S
![Page 42: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/42.jpg)
![Page 43: - Oracle · Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA](https://reader034.fdocuments.in/reader034/viewer/2022051607/603056cb0ebcd945947131f0/html5/thumbnails/43.jpg)