- oracle · essential diagnostic techniques for oracle database 11g graham wood, uri shaft, john...

43

Upload: others

Post on 06-Oct-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 2: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

<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

<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

<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

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

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

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
Page 9: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

= 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

= 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

= 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

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

DB time

Page 14: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

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

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

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

<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

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

ADDM for RAC

Page 20: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

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
Page 22: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

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

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

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

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
Page 27: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

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

<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

<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
Page 31: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 32: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

<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
Page 34: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 35: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 36: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 37: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA
Page 38: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA

…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

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

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

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
Page 43: - Oracle ·  Essential Diagnostic Techniques for Oracle Database 11g Graham Wood, Uri Shaft, John Beresniewicz Oracle USA