25
4 Copyright © 2008, Oracle. All rights reserved. Defining Problems

less_04_oracle_performance_tuning:11g

Embed Size (px)

DESCRIPTION

oracle performance tuning:11g

Citation preview

Page 1: less_04_oracle_performance_tuning:11g

4Copyright © 2008, Oracle. All rights reserved.

Defining Problems

Page 2: less_04_oracle_performance_tuning:11g

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

Page 3: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 3

Defining the Problem

Users DBA

Monitor

Reports and files

Database instance

Feedback

Page 4: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 4

Limit the Scope

Where is the problem?• Application (SQL)• Instance• Operating system

Page 5: less_04_oracle_performance_tuning:11g

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.

Page 6: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 6

Top Wait Events

Page 7: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 7

Setting the Priority: Example

Time Model Statistics

Page 8: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 8

Top SQL ReportsSQL by Elapsed Time

SQL by CPU Time

SQL by Executions

SQL by Buffer Gets

Page 9: less_04_oracle_performance_tuning:11g

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

Page 10: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 11

Tuning Life Cycle Phases

An application’s 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

Page 11: less_04_oracle_performance_tuning:11g

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.

ReactiveProactive

Page 12: less_04_oracle_performance_tuning:11g

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.

Page 13: less_04_oracle_performance_tuning:11g

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.

Page 14: less_04_oracle_performance_tuning:11g

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.

Page 15: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 16

Production

Tuning is reactive. You need to know:• What has changed?• Where is the baseline?

Page 16: less_04_oracle_performance_tuning:11g

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.

Page 17: less_04_oracle_performance_tuning:11g

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?”

Page 18: less_04_oracle_performance_tuning:11g

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

Page 19: less_04_oracle_performance_tuning:11g

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

Page 20: less_04_oracle_performance_tuning:11g

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.

Page 21: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 22

RDA Report

Page 22: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 23

Monitoring and Tuning Tool: Overview

Alert logTrace files

Performance views

Optimizer statisticsSQL statisticsBase statistics

HistogramsMetrics

Service statisticsASH

tkproftrcsess

System statisticsSession statistics

Wait modelTime model

Alerts

ASH reports

Services

Page 23: less_04_oracle_performance_tuning:11g

Copyright © 2008, Oracle. All rights reserved.4 - 24

Monitoring and Tuning Tool: Overview

Statspack

AWR

EM performance pages

Metric baselineEM policies

ADDMAdvisors

Direct SGA monitorHang analyzer

Baselines

AWR baselines

Compare periods

Services

Page 24: less_04_oracle_performance_tuning:11g

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

Page 25: less_04_oracle_performance_tuning:11g

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