Using Automatic Workload Repository For Database Tuning Tips For Expert DBAs
Using Automatic Workload Repository For Database Tuning Tips For Expert DBAs
The following 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 Oracles products remains at the sole discretion of Oracle.
Agenda
Automatic Workload Repository Infrastructure Out of the box AWR reports Active Reports
Eight days
SGA
V$
DBA
DBA_HIST%
Fundamental Concepts
DB Time
Total time in database calls by foreground sessions Includes CPU time, IO time and non-idle wait time DB Time <> response time Total DB time = sum of DB time for all active sessions
Multiple Sessions
Total DB Time = Sum of DB Time Over All Sessions Avg. Active Sessions = Sum of Avg. Activity Over All Sessions =
Total Database Time Wall-Clock (Elapsed) Time
User 2
User 3
User n
TIME
AWR Data
Time Model
v$sys_time_model => dba_hist_sys_time_model DB Time Automatic Tracking of Operation Times Overall parse time (hard, soft, failed,..) SQL, PLSQL and Java overall execution times
Commit Application CPU
User I/O
Wait Model
v$system_event => dba_hist_system_event Wait Events Categorized Based On Solution Area More than 900 different wait events. 12 wait classes (Application, Concurrency..)
OS Stats
v$osstat => dba_hist_osstat CPU + Memory
AWR Data
Snapshots
DBA_HIST_SNAPSHOT Tracks Snapshots in the AWR When querying AWR, always join to other tables to constrain the time frame
AWR Data
On-disk persistence
DBA_HIST_ACTIVE_SESS_HISTORY
DB Time
Time
7:38:26 7:42:35 7:50:59 7:52:33
SID
213 213 213 213
Module
Book by author Get review id Add to cart One click
SQL ID
qa324jffritcf aferv5desfzs5 hk32pekfcbdfr abngldf95f4de
State
WAITING CPU WAITING WAITING
Event
db file sequential read
ASH
V$SESSION V$SESSION_WAIT V$ACTIVE_SESSION_HISTORY DBA_HIST_ACTIVE_SESS_HISTORY
Session State Objects Every snapshot or out of space AWR MMON Lite (MMNL) Circular buffer in SGA
Top Activity
SQL Details
Demo
Active Session Widget
Agenda
Automatic Workload Repository Infrastructure Out of the box AWR reports Active Reports
In addition, predefined AWR html reports are provided in each Oracle database release
Each report has a specific function and use case The following slides show the major reports and their use cases
awrrpt.sql
addmrpt.sql ashrpt.sql awrddrpt.sql awrsqrpt.sql awrgrpt.sql awrgdrpt.sql 11gR2
AWR Report
The AWR report is the most well known performance report. Oracle tuning professionals frequently start their analysis with this report. AWR report contains much data but contains no concrete recommendations for action.
ADDM Report
ADDM lists the tuning opportunities with the highest benefit. ADDM makes specific, actionable recommendations. ADDM also lists areas of the system that are performing well that dont need tuning.
Demo
ADDM
My database was running fine yesterday but it is really slow today? What has changed?
Tip: Use AWR Compare Periods Report to Identify Changes in Database Performance
AWR Compare Periods Report
awrddrpt.sql single instance awrgdrpt.sql - RAC
Compares database performance over two time periods Good for identifying what changed in performance Tip: Save AWR snapshots of time periods with good performance for reference Example:
Overall system performance resulting from database upgrade
Actual
Normal
AWR Baseline
User-specifiable, schedulable, e.g.: last Thanksgiving period every Monday 10am-noon for 4 Mondays Automatically captures 8-day moving window baseline for week to week comparisons (default)
time
A user complains that his session seemed to hang for a few minutes. What happened?
ASH Report
Click on Run ASH Report button from performance page Select time range and dimension to report on
ASH Report:
ASH Report of a single session for a 5 minute period The session accounted for 52% of database activity for the time period The session spent 64% of the time in a concurrency wait event, 36% on CPU. There is clearly some opportunity for tuning.
Plan Statistics
Before tuning
After tuning
Agenda
Automatic Workload Repository Infrastructure Out of the box AWR reports Active Reports
Demo
Active Reports
Conclusion
AWR contains vast amounts of database performance data Enterprise Manager displays a comprehensive view and analysis of that data Standard reports can provide additional insights
Use the right report for the right problem
Active reports are a useful new tool for the Oracle database professional
Cuts configuration management effort by 90% Replaces manual tools with automation; saves time by 50% Saves weeks on application testing time Delivers 24/7 uptime with Oracle Enterprise Manager
1:45 p.m.- Quick Tips for Database Performance Tuning 5:00 p.m.- SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) 5:00pm Oracle Enterprise Manager: Beyond the Basics: Getting More from Oracle Enterprise Manager
10:30 a.m.Everyone Is Applying CPUs (Critical Patch Updates), Right? 10:30 am DBAs New Best Friend: Oracle Database 10g and Oracle Database 11g SQL Performance Analyzer
12:00 p.m. Worry-Free Application Upgrade Using Oracle Change Management Pack 1:30pm Dell IT's Implementation of Oracle Enterprise Manager Patch Provisioning