You are on page 1of 24

Performance Management

Copyright © 2005, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to do


the following:
• Use Enterprise Manager to monitor performance
• Tune SQL by using the SQL Tuning Advisor
• Tune SQL by using the SQL Access Advisor
• Use Automatic Shared Memory Management
(ASSM)
• Use the Memory Advisor to size memory buffers
• View performance-related dynamic views
• Troubleshoot invalid and unusable objects

Copyright © 2005, Oracle. All rights reserved.


> Perf Mon
Performance Monitoring Tuning Adv
Access Adv
Memory
Stats
Invalid Obj

Memory
Memory
allocation
allocation
issues
issues

Input/output
Input/output Resource
device Resource
device contention
contention
contention
contention
?
DBA
Application
Application Network
Network
code
code bottlenecks
bottlenecks
problems
problems

Copyright © 2005, Oracle. All rights reserved.


Performance Monitoring

Copyright © 2005, Oracle. All rights reserved.


Performance Monitoring

Copyright © 2005, Oracle. All rights reserved.


Performance Monitoring

Copyright © 2005, Oracle. All rights reserved.


Performance Monitoring: Top Sessions

Copyright © 2005, Oracle. All rights reserved.


Performance Monitoring: Top Services

Copyright © 2005, Oracle. All rights reserved.


Perf Mon
SQL Tuning Advisor: Overview > Tuning Adv
Access Adv
Memory
Stats
Invalid Obj

Automatic Tuning Optimizer Comprehensive SQL tuning

Statistics check
optimization mode Detect stale or missing
statistics

Plan tuning Tune SQL plan


optimization mode
(SQL profile)

Access analysis Add missing index


optimization mode
Run access advisor

SQL analysis
SQL Tuning
optimization mode Advisor Restructure SQL

Copyright © 2005, Oracle. All rights reserved.


SQL Tuning Advisor Options and
Recommendations

Copyright © 2005, Oracle. All rights reserved.


Using the SQL Tuning Advisor

• Use the SQL Tuning Advisor to analyze SQL


statements and obtain performance
recommendations.
• Sources for SQL Tuning Advisor to analyze
– Top SQL: Analyzes the top SQL statements
currently active
– SQL Tuning Sets: Analyzes a set of SQL statements
you provide
– Snapshots: Analyzes a snapshot
– Baselines: Analyzes a baseline

Copyright © 2005, Oracle. All rights reserved.


Using the SQL Tuning Advisor: Example

Copyright © 2005, Oracle. All rights reserved.


SQL Tuning Advisor: SQL Statistics

select count(*) from x select count(*) from x


where object_id < 340 where object_id < 220

Each statement causes a hard parse.

Copyright © 2005, Oracle. All rights reserved.


SQL Tuning Advisor:
Identifying Duplicate SQL

Bind variable
candidates

Copyright © 2005, Oracle. All rights reserved.


Perf Mon
Using the SQL Access Advisor Tuning Adv
> Access Adv
Memory
Stats
Invalid Obj

Copyright © 2005, Oracle. All rights reserved.


Perf Mon
Managing Memory Tuning Adv
Access Adv
Components > Memory
Stats
Invalid Obj

• Automatic Shared Memory Management:


– Is recommended to simplify management
– Enables you to specify the total SGA memory
through one initialization parameter
– Enables the Oracle server to manage the amount of
memory allocated to the shared pool, Java pool,
buffer cache, streams pool, and the large pool
• Manually setting shared memory management:
– Sizes the components through multiple individual
initialization parameters
– Uses the Memory Advisor to make
recommendations

Copyright © 2005, Oracle. All rights reserved.


Enabling Automatic Shared
Memory Management (ASMM)

Click Enable to enable


Automatic Shared
Memory Management.

Copyright © 2005, Oracle. All rights reserved.


Manually Setting Shared
Memory Management

Copyright © 2005, Oracle. All rights reserved.


Using the Memory Advisor

Copyright © 2005, Oracle. All rights reserved.



Access Adv
Dynamic Performance Statistics Memory
> Stats
Invalid Obj

Systemwide Session specific Service specific

V$SYSSTAT V$SESSTAT V$SERVICE_STATS


• statistic# • sid • service_name_hash
• name • statistic# • service_name
• class • value • stat_id
• value • stat_name
• stat_id • value

V$SYSTEM_EVENT V$SESSION_EVENT V$SERVICE_EVENT


• event • sid • service_name
• total_waits • event • service_name_hash
• total_timeouts • total_waits • event
• time_waited • total_timeouts • event_id
• average_wait • time_waited • total_waits
• time_waited_micro • average_wait • total_timeouts
• max_wait • time_waited
Cumulative stats • time_waited_micro • average_wait
• event_id • time_waited_micro
Wait events

Copyright © 2005, Oracle. All rights reserved.


Troubleshooting and Tuning Views

Instance/Database Disk
V$DATABASE V$DATAFILE
V$INSTANCE V$FILESTAT
V$PARAMETER V$LOG
V$SPPARAMETER V$LOG_HISTORY
V$SYSTEM_PARAMETER V$DBFILE
V$PROCESS V$TEMPFILE
V$BGPROCESS V$TEMPSEG_USAGE
V$PX_PROCESS_SYSSTAT V$SEGMENT_STATISTICS
V$SYSTEM_EVENT
Contention
Memory V$LOCK
V$BUFFER_POOL_STATISTICS V$UNDOSTAT
V$LIBRARYCACHE V$WAITSTAT
V$SGAINFO V$LATCH
V$PGASTAT

Copyright © 2005, Oracle. All rights reserved.


Perf Mon
Invalid and Unusable Objects Tuning Adv
Access Adv
Memory
Stats
> Invalid Obj

Effect on Performance:
• PL/SQL code objects are recompiled.
• Indexes are rebuilt.

Copyright © 2005, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


• Use Enterprise Manager to monitor performance
• Tune SQL using the SQL Tuning Advisor
• Tune SQL using the SQL Access Advisor
• Use Automatic Shared Memory Management
• Use the Memory Advisor to size memory buffers
• View performance-related dynamic views
• Troubleshoot invalid and unusable objects

Copyright © 2005, Oracle. All rights reserved.


Practice Overview:
Monitoring and Improving Performance

This practice covers the following topics:


• Detecting and repairing unusable indexes
• Using the SQL Tuning Advisor
• Using the Performance page in Enterprise
Manager

Copyright © 2005, Oracle. All rights reserved.

You might also like