Tuning With AWR
Tuning With AWR
Agenda
What is AWR ?
How to go through all the information?
How can we maximize the use of it?
Useful tools to complete the whole picture
What is AWR?
Automatic Workload Repository
What is AWR?
Automatic Workload Repository
ADDM finds
top problems
MMON
SYSAUX
AWR Data
BG
BG
FG
FG
In-memory
statistics
7:00 a.m.
8:00 a.m.
9:00 a.m.
10:00 a.m.
AWR
ASH
Statistics
Snapshot 1
Snapshot 2
Snapshot 3
Snapshot 4
SGA
V$
DBA
DBA_HIST%
Eight
days
Likely Impact
Oracle Parameters
System Environment
Object Configuration
Application
DB Id
1214027630
Instance
acme
Inst num
1
Release
10.2.0.2.0
RAC
NO
Host
y507
Snap Time
Sessions
Cursors/Session
Begin Snap:
6131
26-Feb-07 21:00:29
109
17.9
End Snap:
6132
26-Feb-07 22:00:31
139
16.2
Elapsed:
DB Time:
60.03 (mins)
748.92 (mins)
DB Time
Total time in database calls by foreground sessions
Includes CPU time, IO time and non-idle wait time
Total DB time = sum of DB time for all active sessions
Waits
Time(s)
Avg Wait(ms)
Wait Class
7,454,667
21,110
47.0
User I/O
7,065,241
18,357
40.9
User I/O
CPU time
SQL*Net more data to client
13,937
31.0
32,863,361
927
2.1
64,329
72
.2
Network
System I/O
4,239,109
4,070,549
3,998,368
3,901,973
3,843,075
3,797,817
3,771,288
3,744,369
IO Issues
Application usage: Table scans / index usage, parallel executions
Background processes workload: DBWR, LGWR, ARCH, CKPT
Files workload oracle level (extents, hot spots, fragmentation)
Relevant issues:
db file scattered read
parallel statistics
Cache sizes
Application Issues
Relevant issues:
Library cache*
cursor : mutex x
Latches: buffer cache/shared pool/session allocation
Enqueues (TX,TM,UL etc)
read by other session
Log file sync
Memory Issues
Configuration issues: cache size, shared pool etc.
Internal management: latches
Fragmentation
Relevant issues:
Buffer busy waits
Free buffer waits
Log file sync
Shared pool*
RAC Issues
Cache Fusion
Interconnect and IO
Configuration: services, parallel
Relevant issues:
GC cr *
GC current *
Interconnect traffic
IO access
Memory latches
Application enqueues
Methodology
How to check yourself?
Use Data Dictionary views
Use ADDM (Automatic Database Diagnostics Monitor) to:
Quantify problems
Quantify recommendations
Identify the root cause
Ids.
awrrpti.sql
awrsqrpt.sql
awrsqrpi.sql
awrddrpt.sql
awrddrpi.sql
Per Second
--------------13.93
16.03
63.75
79.59
0.25
267.65
Per Transaction
----------------9.64
11.09
44.10
55.06
0.17
The estimated interconnect traffic (per second) = ((blocks sent + blocks received)*block size
+ (messages sent + messages received)*message size
Memory Resize
Ela
Oper
Init
Target
Final
Start
(s) Component
Typ/Mod Size (M Delta Delta
(M) Sta
-------------- ----- ----------- ------- ------- ------ ------ ------ ---09/02 15:46:08
0 bufcache
SHR/IMM
1,520
-16
N/A 1,504 COM
09/02 15:46:08
0 bufcache
SHR/IMM
1,504
-16
N/A 1,488 COM
09/02 15:46:08
0 bufcache
GRO/DEF
1,488
32
N/A 1,520 COM
09/02 15:46:08
0 shared
SHR/DEF
640
-32
N/A
608 COM
09/02 15:46:08
0 shared
GRO/IMM
624
16
N/A
640 COM
09/02 15:46:08
0 shared
GRO/IMM
608
16
N/A
624 COM
--------------------------------------------------------------------------
to convert the times (expressed in seconds) back into percentages, then total
elapsed time is :
Total elapsed time = BUSY_TIME + IDLE_TIME + IOWAIT TIME
OR
Total elapsed time = SYS_TIME + USER_TIME + IDLE_TIME + IOWAIT_TIME
For example:
BEGIN
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS
(retention => 43200,
interval => 10,
topnsql => 50);
END;
/
In this example, the retention period is specified as 43200 minutes (30
days), the interval between each snapshot is specified as 10 minutes,
and the number of Top SQL to flush for each SQL criteria as 50.
Useful Commands
Create baseline, save the data for future analysis
k
exec
dbms_workload_repository.create_baseline
(start_snap_id => 1003, end_snap_id => 1013,
baseline_name => 'baseline_OCT10');
To see stored baselines use dba_hist_baseline view
Summary
Know your system: DB, Application & O/S.
Keep a track on your base statistics (baseline).