Database Tuning Tools - Notes
Database Tuning Tools - Notes
Without Packs:
1. SQL Traces
2. Statspack
3. System statistics
4. Wait model
5. Time model
6. OS statistics
7. Metrics
8. Service statistics
9. Histograms
10. Optimizer statistics
11. SQL statistics
Tuning Methodology:
1. Check the OS stats and general machine health before tuning the instance.
2. Tune from the top down: Start with the design, then application, and then
instance.
3. Tune the area with greatest potential benefit. Identify the biggest bottleneck,
and tune it.
4. Stop tuning when you meet your goals.
Tuning Objectives:
1. Minimizing response time or reducing user wait time.
2. Increasing throughput, which means decreasing time to perform a job or set of
jobs.
3. Increasing load capabilities
4. Decreasing recovery time
Services
Alert log
tkprof
Trace files
trcsess
Performance views
System statistics
Optimizer statistics Session statistics
SQL statistics Wait model
Base statistics Time model
Histograms
Metrics Alerts
Service statistics
ASH ASH reports
Services
EM performance
pages Compare periods
Metric baseline
EM policies
ADDM
Advisors
Direct SGA monitor
Hang analyzer
Statspack Baselines
1. Cumulative statistics
a. Wait events with time information
b. Time model
2. Metrics: Statistic rates (per second, per transaction, per session)
3. Sample statistics: Active session history (data gathered in past)
a. Statistics by session
b. Statistics by SQL
c. Statistics by Service
d. Other dimensions
1. Basic
a. EM pages
b. Alert log (checkpoints, archiving, alter system commands etc)
c. Trace files (background processes problem logging)
User Trace files: can be generated at the request of DBA, Instance
level tracing is enabled by enabling SQL_TRACE parameter, Session
level tracing by issuing alter session set sql_trace=true;
Background processes trace files
d. Dynamic performance views and tables
2. Add-in: Statspack
3. Options:
a. Diagnostic pack (AWR)
b. Tuning pack
V$SYSSTAT
V$SESSION
V$SESSION_EVENT
V$SESSION_WAIT
V$SGASTAT
V$EVENT_NAME
V$SYSTEM_EVENT
V$STATNAME
V$SERVICE_STATS
V$SERVICES
V$SERVICE_EVENT
V$SESSION_WAIT_CLASS
Wait Events