Professional Documents
Culture Documents
Less 04 Oracle Performance Tuning:11g
Less 04 Oracle Performance Tuning:11g
Defining Problems
Copyright 2008, Oracle. All rights reserved. 4 - 2
Objectives
After completing this lesson, you should be able to do the
following:
Identify performance issues
Set tuning priorities
Interpret tuning diagnostics
Tune for life cycle phase
Copyright 2008, Oracle. All rights reserved. 4 - 3
Defining the Problem
Users
DBA
Monitor
Reports and files
Database
instance
Feedback
Copyright 2008, Oracle. All rights reserved. 4 - 4
Limit the Scope
Where is the problem?
Application (SQL)
Instance
Operating system
Copyright 2008, Oracle. All rights reserved. 4 - 5
Setting the Priority
Choose the problem that has the greatest impact:
Analyze system performance in terms of work done (CPU or
service time) versus time spent waiting for work (wait time).
Determine which component consumes the greatest amount
of time.
Drill down to tune that component, if appropriate.
Copyright 2008, Oracle. All rights reserved. 4 - 6
Top Wait Events
Copyright 2008, Oracle. All rights reserved. 4 - 7
Setting the Priority: Example
Time Model Statistics
Copyright 2008, Oracle. All rights reserved. 4 - 8
Top SQL Reports
SQL by Elapsed Time
SQL by CPU Time
SQL by Executions
SQL by Buffer Gets
Copyright 2008, Oracle. All rights reserved. 4 - 9
Common Tuning Problems
The most common tuning problems:
Inefficient or high-load SQL statements
Suboptimal use of Oracle Database by the application
Undersized memory structures
Concurrency issues
I/O issues
Database configuration issues
Short-lived performance problems
Degradation of database performance over time
Unexpected performance regression after environment
changes
Locking issues
Copyright 2008, Oracle. All rights reserved. 4 - 11
Tuning Life Cycle Phases
An applications life cycle can be divided into different phases:
Application design and development
Testing: Database configuration
Deployment: Adding a new application to an existing
database
Production: Troubleshooting and tuning
Migration, upgrade, and environment changes
Copyright 2008, Oracle. All rights reserved. 4 - 12
Tuning During the Life Cycle
Tuning can be divided into two classes:
Proactive (make it better, so it will not break)
Test scenarios.
Find the problem areas.
Resolve the problem.
Reactive (wait until it breaks, then fix it)
Monitor active instance.
Tune issues as needed.
Reactive
Proactive
Copyright 2008, Oracle. All rights reserved. 4 - 13
Application Design and Development
The application can be tuned, even in the design and
development phases, by building and tuning test cases.
Check normalization against major functions.
Check data structures against access times.
Look at points where processes are serialized.
Tune the major reports.
Tune the high-volume processes.
Copyright 2008, Oracle. All rights reserved. 4 - 14
Testing: Database Configuration
The testing phase allows tuning at a deeper level.
Check physical layout.
Monitor for resource contention.
Memory utilization
Locks
Disk hot spots
Test for resource exhaustion.
Copyright 2008, Oracle. All rights reserved. 4 - 15
Deployment
Deployment of:
New application and database
Take baseline.
Monitor growth and performance.
New application in existing database
Take baseline before deployment.
Take baseline after deployment.
Compare baselines.
Copyright 2008, Oracle. All rights reserved. 4 - 16
Production
Tuning is reactive. You need to know:
What has changed?
Where is the baseline?
Copyright 2008, Oracle. All rights reserved. 4 - 17
Migration, Upgrade, and Environment Changes
1. Create a test system.
2. Capture a representative workload.
3. Execute the workload against the test system.
4. Collect statistics.
5. Reset the test system, make a change.
6. Execute the workload.
7. Capture statistics and compare.
Copyright 2008, Oracle. All rights reserved. 4 - 18
ADDM Tuning Session
An ADDM tuning session follows the same procedure as a
manual tuning session, but combines steps.
ADDM Tuning Session Manual Tuning Session
Generate the ADDM report. Collect current statistics.
Compare current statistics with a previous set; look
up in a performance-issues knowledge base.
Define the problem and make recommendations.
Review the recommendations. Build a trial solution.
Implement the
recommendations.
Implement and measure the change.
Review the next ADDM report. Decide: Did the solution meet the goal?
Copyright 2008, Oracle. All rights reserved. 4 - 19
Performance Versus Business Requirements
Factors that affect performance:
Frequent checkpointing
Performing archiving
Block check sums
Redundancy
Frequent backups of data files
Multiple control files
Multiple redo log members in a group
Security
Auditing
Encryption
Virtual Private Database/Fine Grained Access Control
Copyright 2008, Oracle. All rights reserved. 4 - 20
Performance Tuning Resources
Oracle provides a large set of resources for problem solving.
Documentation
Metalink
Forums
Performance Service requests
Remote Diagnostics Report
Copyright 2008, Oracle. All rights reserved. 4 - 21
Filing a Performance Service Request
File a performance service request.
Is the problem instance-wide or query specific?
Identify the root cause.
Provide Statspack or AWR reports, and OS statistics.
Provide Remote Diagnostics Agent (RDA) reports.
Provide SQL_TRACE reports.
Copyright 2008, Oracle. All rights reserved. 4 - 22
RDA Report
Copyright 2008, Oracle. All rights reserved. 4 - 23
Monitoring and Tuning Tool: Overview
Alert log
Trace files
Performance views
Optimizer statistics
SQL statistics
Base statistics
Histograms
Metrics
Service statistics
ASH
tkprof
trcsess
System statistics
Session statistics
Wait model
Time model
Alerts
ASH reports
Services
Copyright 2008, Oracle. All rights reserved. 4 - 24
Monitoring and Tuning Tool: Overview
Statspack
AWR
EM performance
pages
Metric baseline
EM policies
ADDM
Advisors
Direct SGA monitor
Hang analyzer
Baselines
AWR baselines
Compare periods
Services
Copyright 2008, Oracle. All rights reserved. 4 - 25
Summary
In this lesson, you should have learned how to:
Identify performance issues
Set tuning priorities
Interpret tuning diagnostics
Tune for life-cycle phase
Copyright 2008, Oracle. All rights reserved. 4 - 26
Practice 4 Overview:
Identifying the Problem
This practice covers the following topics:
Identify an OS problem using EM