|
|
ISBN
0-9744486-2-1
ISBN 13
978-0974448626 |
Library of
Congress Number:2005901261 |
980 pages: Hardcover -
9x7 |
PD 406 |
Shelving:
Database/Oracle
|
Oracle
in-Focus Series
# 24 |
|
|
Oracle Tuning
The Definitive Reference
Donald K. BurlesonRetail Price $59.95
/ £37.95
Order now for 30% off
and get
online access to the
code depot! |
Only $41.95
(30% off) |
 |
Oracle has become the most
flexible and robust database ever created and
Oracle tuning has become increasingly complex as the result of
this massive power. This book
provides a complete step-by-step approach for holistic Oracle
tuning and it is the accumulated knowledge from tuning thousands
of Oracle databases. |
Incorporating the principles of artificial intelligence, Oracle
has developed a sophisticated mechanism for capturing and tracking
database performance over time periods. This new complexity has
introduced dozens of new v$ and DBA views, plus dozens of
Automatic Workload Repository (AWR) tables.
The AWR and its interaction with the Automatic Database Diagnostic
Monitor (ADDM) is a revolution in database tuning. By
understanding the internal workings of the AWR tables, the senior
DBA can develop time-series tuning models to predict upcoming
outages and dynamically change the instance to accommodate the
impending resource changes.
This is not a book for beginners. Targeted at the senior Oracle
DBA, this book dives deep into the internals of the v$ views, the
AWR table structures and the new DBA history views. Packed with
ready-to-run scripts, you can quickly monitor and identify the
most challenging performance issues.
|
|
* See how Oracle
captures time-series performance data.
* Learn techniques for visualizing performance signatures over
time.
* Use the online code depot to quickly find performance
bottlenecks.
*
Use historical
data to predict impending performance problems.
* Understand how to interpret complex Oracle tuning metrics.
* Create customized performance alerts using AWR information.
* See how AWR allows intelligent Oracle performance
optimization.
* Learn why the Oracle wait interface and 10046 dumps may become
obsolete.
* Understand
proactive time-series Oracle tuning techniques. |
About the Author:

Donald Burleson |
Donald
K. Burleson is one of the world’s top Oracle Database experts
with more than 25 years of full-time DBA experience. He
specializes in creating database architectures for very large
online databases and he has worked with some of the world’s
most powerful and complex systems.
A former Adjunct
Professor, Don Burleson has written more than 30 books, published more
than 100 articles in National Magazines, and serves as
Editor-in-Chief of Rampant TechPress. Don is a popular lecturer
and teacher and is a frequent speaker at Oracle OpenWorld and
other international database conferences.
Table of Contents:
Chapter 1:
Introduction to Oracle Tuning
Oracle Tuning
Reactive Oracle
Tuning
Proactive Oracle
Tuning
Inside AWR
Poor Design and Poor System
Performance
The Proactive Oracle Tuning
Hierarchy
External Hardware
Performance Review
Finding Database
Bottlenecks
Disk Constrained
Database
CPU Constrained
Database
Network Constrained
Database
Using Hardware to Correct a
Sub-Optimal Oracle Database
Oracle Instance
Tuning
Dynamic Instance
Parameters
Static Instance
Parameters
Statistics for the Oracle
SQL Optimizer
Oracle Object Tuning
Oracle SQL Tuning
Emergency Oracle Tuning
Support
Fix Missing CBO
Statistics
Repair CBO Statistics
Set Missing Initialization
Parameters
Adding Missing
Indexes
Change CBO
Parameters
Employ cursor_sharing=force
Implement the KEEP
Pool
Employ Materialized Views
Implement Bitmap
Indexes
Adding Freelists
Summary of Silver Bullet
Tuning Techniques
Conclusion
Chapter 2: Time-Series Oracle Tuning
Introduction to Time Series
Analysis
Time-Series Tuning
Guidelines
Measuring Behavior over
Short Periods
Rules for adjusting
shared_pool_size
Sizing the Shared Pool with
the New Advisory Utility
Rules for adjusting
pga_aggregate_target
Rules for Adjusting the
Data Buffer Sizes
Scheduling an SGA
Reconfiguration
Trend-based Oracle
Reconfiguration
When to Trigger a Dynamic
Reconfiguration
Approaches to Self-tuning
Oracle Databases
Tuning a constantly
changing database
Can Oracle possess psychic
abilities?
Capturing time-series
metrics
AWR Licensing
Options
Tracking Oracle Option
Usage
Customized AWR Tuning
Reports
Exception Reporting with
OEM
Exception Reporting with
the AWR
Exception reporting with
dba_hist_filestatxs
Trend identification with
the AWR
Correlation analysis
reports with the AWR and ASH views
Conclusion
References
Chapter 3:
Oracle10g Automated Workload Structures
The Many Faces of Oracle10g
The AWR data collection
mechanism
Customizing AWR Scripts for
Proactive Tuning
The Mysterious AWR
Performance Tables
AWR vs. STATSPACK
Inside the AWR
Tables
The Oracle10g Wait Event
Tables
A Kick in the ASH
Inside the dba_hist
Views
Conclusion
Chapter 4:
Investigating the dba_hist Views
Know the History
Access Paths to AWR
data
Inside the dba_hist Data
Dictionary Views
Database Wait Events in the
dba_hist Views
dba_hist_system_event
dba_hist_event_name
dba_hist_bg_event_summary
dba_hist_waitstat
dba_hist_enqueue_stat
Metric dba_hist
Views
dba_hist_filemetric_history
dba_hist_sessmetric_history
dba_hist_sysmetric_history
dba_hist_sysmetric_summary
dba_hist_waitclassmet_history
Time Model Statistics
dba_hist Views
dba_hist_sys_time_model
System statistics
dba_hist_sysstat
dba_hist_latch
dba_hist_latch_misses_summary
dba_hist_librarycache
dba_hist_rowcache_summary
dba_hist_buffer_pool_stat
Operating System Statistics
in AWR
SQL Statistics
The dba_hist_sqlstat
View
Segment Statistics
Datafile I/O Statistics
Conclusion
References
Chapter 5:
AWR vs. STATSPACK
Why Such a Difference?
Files Delivered with
STATSPACK
STATSPACK and AWR
Statistics Comparison
Statistic Management in AWR
and STATSPACK
The snap_level
Parameter
session_id
num_sql
STATSPACK Collection
Thresholds
Conclusion
Chapter 6: Inside
Oracle10g v$ Views
The Secret World of the v$
Views
Changes in Wait Event v$
Views
New Active Session History
v$ View
New Time Model v$ Views
New Database Metric v$
Views
Changes to SQL Related v$
Views
Tips for v$data buffer
contents
Conclusion
Chapter 7:
Understanding the Oracle 10g Metrics
Inside Oracle10g Metrics
The v$metric Tables
Database Workload Metrics
Database Wait
Metrics
Datafile Metrics
Database Service
Metrics
Conclusion
Chapter 8:
Oracle10g DBMS Tuning Packages
Packaging Oracle10g Tuning
The
dbms_workload_repository Package
Creating an AWR
Report
The dbms_advisor
Package
The ADDM Advisor
Working with the SQLAccess
Advisor
Using the quick_tune
option
Inside the dbms_sqltune
Package
Conclusion
Chapter 9: The AWR Time
Model Approach
Time Model Tuning for
Oracle
Finding the Cause of Buffer
Busy Waits
Conclusion
Chapter 10: Reading an AWR
or STATSPACK Report
Listening to the
Database
Generating the AWR Report
Reading the AWR
Report
Report Summary
Cache Sizes
Load Profile
Instance Efficiency
Percentage
Top 5 Timed Events
Section
Wait Events
Time Model Statistics
Operating System
Statistics
Service Statistics
Top SQL
Instance Activity
Section
I/O Reports Section
Advisory Section
Buffer Pool Advisory
Buffer Wait Statistics
Section
Enqueue Activity
Section
Undo Segment Summary
Section
Undo Segment Stats
Section
Latch Statistics
Section
Segment Statistics
Section
Dictionary Cache Stats
Section
Library Cache Activity
Section
SGA Memory Summary
Section
init.ora Parameters
Section
Conclusion
Chapter
11: Predictive Models with AWR
Predicting the Future with AWR
Exception Reporting with
the AWR
Exception reporting with
dba_hist_filestatxs
General trend
identification with the AWR
Correlation analysis with
AWR and ASH
Conclusion
Chapter
12: Server & Network Tuning with AWR
Oracle Server Tuning
Outside the Oracle
Instance
Oracle Server
Bottlenecks
Disk I/O and Oracle
Moore’s Law
Server RAM and
Oracle
Tracking External Server
Metrics with AWR
Oracle and the 64-bit
server technology
The New Age of Oracle
Server Consolidation
Enterprise Manager for
Server & Environment
Server Metrics and SQL
Execution
CPU Based Optimizer
Costing
I/O Costing
Network Tuning
The tcp.nodelay
parameter
The automatic_ipc
parameter
The SDU and TDU
parameters
Conclusion
Chapter
13: Disk Tuning with Oracle
Monitoring Disk Performance
Inside Oracle Disk
Architecture
Disk Architectures of the
21st Century
RAID Technology
Oracle and Direct I/O
Checking the Server Direct
I/O Option
Enabling Direct I/O with
Kernel Parameters
Direct I/O for
Windows
Direct I/O for IBM
AIX
Direct I/O for Linux
Direct I/O for Sun
Solaris
Direct I/O for Veritas
Oracle Blocksize and Disk
I/O
Oracle Blocksize & Index
I/O
Not all Indexes are used in
Range Scans
Using Oracle Multiple
Blocksizes
Improving SQL execution
plans
Real World Applications of
multiple blocksizes
Reducing disk I/O with
SSD
Oracle Disk
Monitoring
Examining Real-time Disk
Statistics
Examining Global I/O
Locating Hot I/O
Objects
Tracking I/O for specific
Tables
Find the Current I/O
Session Bandits
Measuring Disk I/O
Speed
Analyzing real time I/O
waits
Time series I/O Wait
Analysis
Time Series Monitoring of
the Data Buffers
Monitoring Disk I/O with
AWR
Conclusion
|
Chapter
14: Oracle Instance Tuning
Semper Vigilans
Instance Tuning comes
first!
Instance Configuration for
High Performance
OS kernel parameters
Server Settings for Windows
Servers
Kernel setting for UNIX and
Linux servers
Oracle Parameter
Tuning
SQL Optimizer
Parameters
Data Buffer Cache Hidden
Parameters
Instance Wait Tuning
Tuning the Oracle10g Data
Buffer Pools
The Problem of Duplicitous
RAM Caches
Why is Oracle Logical I/O
so Slow?
Data Block Caching in the
SGA
Full Table Caching in
Oracle10g
Oracle Data Buffer
Metrics
Using AWR for buffer pool
statistics
Oracle’s Seven Data Buffer
Hit Ratios
Viewing Information about
SGA Performance
AMM and Oracle Instance
Tuning
Plotting the Data Buffer
Hit Ratio by Day of the Week
Internals of the Oracle
Data Buffers
Finding Hot Blocks inside
the Oracle Data Buffers
Viewing the Data Buffer
Contents
The Downside of Mega Data
Buffers
Allocating Oracle Objects
into Multiple RAM data Buffers
Sizing the KEEP Pool
Automating KEEP Pool
Assignment
Tuning the RECYCLE Pool
Small block size
Larger block size
Finding Baselines
Learning Instance Tuning
from Performance Benchmarks
Conclusion
Chapter
15: SQL Tuning
Understanding SQL Tuning
Optimizing Oracle SQL
Execution
Goals of SQL Tuning
Remove unnecessary
large-table full table scans
Cache small-table full
table scans
Verify optimal index
usage
Verify optimal JOIN
techniques
Tuning by Simplifying SQL
Syntax
Using the WITH clause to
simplify complex SQL
Tuning SQL with Temporary
Tables
Oracle SQL Performance
Parameters
Using
optimizer_index_cost_adj
Setting the SQL Optimizer
Cost Model
Turning on CPU
Costing
Turning on I/O
Costing
Notes on Bug
2820066:
Bi-modal system
configuration
Statistics and SQL
Optimization
Managing Schema Statistics
with dbms_stats
Schema Statistics
Management
External Costing with the
Optimizer
Tuning SQL with Histograms
Optimal table join
order
Index skew
Inside Oracle10g Dynamic
Sampling
How is join cardinality
estimated?
Enabling Dynamic Sampling
Sampling Table Scans
Tuning SQL access with
clustering_factor
Rules for Oracle
Indexing
Faster SQL with Database
Reorganizations
Oracle Indexes – Is
Maintenance Required?
When Should Indexes be
rebuilt?
Locating Tables and Indexes
for the KEEP Pool
Interrogating SQL execution
Plans
Identifying Problem
SQL
Find the Problem
Sessions
Identify the
Resource-Intensive SQL
Oracle tuning with
hints
AWR and SQL Tuning
The dba_hist_sqlstat
Table
The dba_hist_sql_plan
Table
Viewing table and index
access with AWR
Tracking SQL nested loop
joins
Counting index usage inside
SQL
Tracking full scan access
with AWR
Interrogating table join
methods
Supersizing the PGA for
large sorts and hash joins
Hidden parameters for
Oracle PGA regions
Super-sizing the PGA
Important caveats in PGA
management
Oracle10g SQL
Tuning
The SQL Tuning
Advisor
Using SQL Tuning Advisor
Session
Oracle10g Automatic
Database Diagnostics Management
Oracle SQL Tuning Silver
Bullets
Using Function-based
Indexes (FBI)
Using Temporary
Tables
Fixing CBO Statistics
Changing CBO SQL Optimizer
Parameters
Repairing Obsolete CBO
Statistics Gathering
Removing full-table scans
with Oracle Text
Oracle Text Index
Re-synchronization
Conclusion
Chapter
16: Oracle10g Wait Event Tuning with AWR and ASH
The Oracle Wait Event Model
Collecting ASH Wait
Information
Why Wait Event Tuning for
Oracle?
Active Session History in
Enterprise Manager
Active Session History in
WISE
How Does a Wait Bottleneck
Get Fixed?
System-wide Wait Event
Tuning
Not All Events Are Created
Equal
Inside the Real-time v$
Wait Events
Inside v$session_wait
Inside v$session_event
Using ASH for Time-series
Wait Tuning
Display SQL Wait
Details
Tip - wait_time vs.
time_waited
Event Wait Analysis with
ASH
Understanding Session Wait
History
Signature Analysis of Wait
Events
Conclusion
Chapter 17: Tablespace & Object Tuning
Introduction to Oracle Segment Management
Inside Oracle Tablespace
Management
The Issue of pctfree
The Issue of pctused
A Summary of Object Tuning
Rules
Reducing Segment Header
Contention and Buffer Busy Waits
Internal freelist
Management
Characteristics of Bitmap
Segment Management
Oracle Bitmap freelist
Internals
New High Water Mark
Pointers
Extent Control Header
Block
Potential Performance
Issues with ASSM
Proactive Tablespace
Management
Reclaiming Segment
Space
Online Segment
Reorganization
Segment Space Growth
Prediction
ASSM and RAC Advantages
Conclusion
References
Chapter
18: Oracle Data Warehouse
Tuning
Oracle Data Warehouse Tuning
What Does a Data Warehouse
Need?
Oracle STAR Transformations
and SQL
Bad Start Transformation
Plan
Good Star Transformation
Plan
Why Oracle 10g for the Data
Warehouse?
Scaling the Oracle10g data
warehouse
Conclusion
Chapter
19: Oracle 10g Tuning with OEM
Introduction to OEM
The New OEM
Tuning with Metrics and
Exceptions
Active Session History in
Enterprise Manager
Easy Customization of OEM
Alerts
Instance Efficiency
Metrics
Alerts Notification and
Setup
Overview of dbms_scheduler
Functions
Throughput Metrics in OEM
OEM Outside the
Instance
Exception Tuning Inside
Enterprise Manager
Advisor Central in
OEM
ADDM Main Screen
ADDM Recommendations
Understanding SQL Advisor
Recommendations
The SQL Tuning Advisor
Links
The Top SQL Screen
Viewing SQL Details in OEM
The Execution Plan
Tab
Current Statistics Tab
Execution History Tab
Tuning History Tab
Oracle SQL Tuning
Sets
Creating an SQL Tuning
Set
Viewing SQL Tuning Set
Details
Using the SQL Access
Advisor
New Features of the SQL
Advisors
Inside the SQL Access
Advisor
The SQL Access Advisor
Workload Definition
The SQL Access Advisor
Recommendation Options
The SQL Access Advisor
Schedule Advisor
The SQL Access Advisor
Review
SQL Access Advisor
Recommendations
Using the Memory Advisor
through OEM
Persistence of
Automatically Tuned Values
Automated Maintenance
Tasks
Resource Management
Introduction to Online
Oracle Tuning Tools
Oracle Dictionary Scripts
for Tuning
Oracle Time Series Tuning
Tools
Third-party Wait Event
Tuning Tools
External Bottlenecks
Internal Bottlenecks
Oracle10g OEM Review
New Features of the SQL
Advisors
Comprehensive
Collection
OEM Wait Event
Metrics
Automated Diagnostics in
OEM
SQL Access Advisor
Shortcomings of OEM
Conclusion
Chapter 20: Oracle RAC and Grid Tuning
Introduction to Tuning with RAC
Oracle RAC in a
Nutshell
Oracle Scalability and Grid
Technology
First Scale Up with SMP
Servers
Next Scale Out with
Multiple SMP Servers
Oracle10g Grid in a
Nutshell
Blade Servers and Oracle
RAC Tuning
Blade Servers and Oracle
App Servers
The Revolution of Cache
Fusion
Overview of RAC and Grid
Tuning
RAC Load Balancing
Managing Inter-instance
Data Block Transfers
Parallel Processing and RAC
Performance
|
|
Index Topics:
CHAPTER 1 - Introduction to Oracle Tuning
Environmental review
Server Review
Network Review
Disk Review
Verifying RAID
Verifying Direct I/O
Instance Tuning
Object Tuning
SQL Tuning
CHAPTER 2 - Introduction to time-series tuning
Principles of Proactive Tuning
Developing signatures
Server Review
CHAPTER 3 - The
Oracle10g Automated Workload Structures
New v$ views
New WR$ Views
-
WRM$ tables store metadata
information for the Workload Repository.
-
WRH$ tables store historical
data or snapshots.
-
WRI$ tables store data
related to advisory functions.
How the AWR captures
runtime metrics
Writing AWR Scripts
Server Tuning
Network Tuning
Disk Tuning
Instance Tuning
Object Tuning
SQL Tuning
Tuning with OPQ
Monitoring with AWR
Trend Analysis using AWR
Developing Predictive
models with AWR
Oracle 10g wait
event tuning
The 10046 wait interface becomes obsolete
v$session_wait
v$session_wait_history
v$active_session_history
v$waitclassmetric_history
v$system_wait_class
v$event_histogram
v$eventmetric
WRH wait event tables
wrh$_event_name
wrh$_system_event
wrh$_system_event_bl
wrh$_bg_event_summary
wrh$_waitclassmetric_history
wrh$active_session_history
Oracle10g DBA views for
historical wait events.
dba_hist_waitclassmet_history
dba_hist_system_event
dba_hist_bg_event_summary
CHAPTER 6 -
Oracle10g v$ SQL Views
go$sql_bind_capture
o$sql_bind_capture
v$client_stats
v$event_histogram
v$event_name
v$eventmetric
v$filemetric
v$filemetric_history
v$filestat
v$metricgroup
v$metricname
v$mystat
v$osstat
v$serv_mod_act_stats
v$service_event
v$service_stats
v$service_wait_class
v$session_event
v$session_wait_class
v$sessmetric
v$sesstat
v$sql
v$sql_bind_data
v$sql_bind_metadata
v$sql_cursor
v$sql_optimizer_env
v$sql_plan
v$sql_plan_statistics
v$sql_plan_statistics_all
v$sql_redirection
v$sql_shared_cursor
v$sql_shared_memory
v$sql_workarea
v$sql_workarea_active
v$sql_workarea_histogram
v$sqlarea
v$sqltext
v$sqltext_with_newlines
v$statistics_level
v$statname
v$svcmetric
v$svcmetric_history
v$sysmetric
v$sysmetric_history
v$sysmetric_summary
v$sysstat
v$system_event
v$system_wait_class
|
CHAPTER 7 -
Historical AWR data Tables
wrh$_waitclassmetric_history
wrh$_active_session_history
wrh$_active_session_history_bl
wrh$_bg_event_summary
wrh$_event_name
wrh$_metric_name
wrh$_sessmetric_history
wrh$_sys_time_model
wrh$_sys_time_model_bl
wrh$_sysmetric_history
wrh$_sysmetric_summary
wrh$_sysstat
wrh$_sysstat_bl
wrh$_system_event
wrh$_system_event_bl
Other history tables
wrh$_buffer_pool_statistics
wrh$_datafile
wrh$_db_cache_advice
wrh$_db_cache_advice_bl
wrh$_dlm_misc
wrh$_enqueue_stat
wrh$_enqueue_stat_bl
wrh$_filemetric_history
wrh$_filestatxs
wrh$_filestatxs_bl
wrh$_instance_recovery
wrh$_java_pool_advice
wrh$_latch
wrh$_latch_bl
wrh$_latch_children
wrh$_latch_children_bl
wrh$_latch_misses_summary
wrh$_latch_misses_summary_bl
wrh$_latch_name
wrh$_latch_parent
wrh$_latch_parent_bl
wrh$_librarycache
wrh$_log
wrh$_mttr_target_advice
wrh$_optimizer_env
wrh$_osstat
wrh$_parameter
wrh$_parameter_bl
wrh$_parameter_name
wrh$_pga_target_advice
wrh$_pga_target_advice_bl
wrh$_pgastat
wrh$_pgastat_bl
wrh$_recovery_file_dest_stat
wrh$_resource_limit
wrh$_rman_performance
wrh$_rollstat
wrh$_rowcache_summary
wrh$_rowcache_summary_bl
wrh$_seg_stat
wrh$_seg_stat_bl
wrh$_seg_stat_obj
wrh$_sga
wrh$_sgastat
wrh$_sgastat_bl
wrh$_shared_pool_advice
wrh$_sql_plan
wrh$_sql_summary
wrh$_sql_workarea_histogram
wrh$_sqlbind
wrh$_sqlbind_bl
wrh$_sqlstat
wrh$_sqlstat_bl
wrh$_sqltext
wrh$_stat_name
wrh$_tablespace_space_usage
wrh$_tablespace_stat
wrh$_tablespace_stat_bl
wrh$_tempfile
wrh$_tempstatxs
wrh$_thread
wrh$_undostat
wrh$_waitstat
wrh$_waitstat_bl
CHAPTER 8 - Time Model Tables & Views
v$sys_time_model
v$sess_time_model
wrh$_sys_time_model
wrh$_sys_time_model_bl
dba_hist_sys_time_model
CHAPTER 9 - Oracle 10g Metrics Tables
v$eventmetric
v$waitclassmetric
v$waitclassmetric_history
v$metricgroup
v$metricname
v$sysmetric
v$sessmetric
v$filemetric
v$eventmetric
v$waitclassmetric
v$svcmetric
v$sysmetric_history
v$filemetric_history
v$waitclassmetric_history
v$svcmetric_history
v$sysmetric_summary
Metadata Tables
wrm$_baseline
wrm$_database_instance
wrm$_snap_error
wrm$_snapshot
wrm$_wr_control
CHAPTER 10
- DBA History Views
DBA Alert Tables
dba_hist_sysmetric_history
dba_hist_sysmetric_summary
dba_hist_sessmetric_history
dba_hist_filemetric_history
dba_hist_waitclassmet_history
|
CHAPTER 11
- DBA AWR History Views
dba_hist_database_instance
dba_hist_snapshot
dba_hist_snap_error
dba_hist_baseline
dba_hist_wr_control
dba_hist_datafile
dba_hist_filestatxs
dba_hist_tempfile
dba_hist_tempstatxs
dba_hist_sqlstat
dba_hist_sqltext
dba_hist_sql_summary
dba_hist_sql_plan
dba_hist_sqlbind
dba_hist_optimizer_env
dba_hist_event_name
dba_hist_system_event
dba_hist_bg_event_summary
dba_hist_waitstat
dba_hist_enqueue_stat
dba_hist_latch_name
dba_hist_latch
dba_hist_latch_children
dba_hist_latch_parent
dba_hist_latch_misses_summary
dba_hist_librarycache
dba_hist_db_cache_advice
dba_hist_buffer_pool_stat
dba_hist_rowcache_summary
dba_hist_sga
dba_hist_sgastat
dba_hist_pgastat
dba_hist_resource_limit
dba_hist_shared_pool_advice
dba_hist_sql_workarea_hstgrm
dba_hist_pga_target_advice
dba_hist_instance_recovery
dba_hist_java_pool_advice
dba_hist_thread - logswitches
dba_hist_stat_name
dba_hist_sysstat
dba_hist_sys_time_model
dba_hist_osstat_name
dba_hist_osstat
dba_hist_parameter_name
dba_hist_parameter
dba_hist_undostat
dba_hist_rollstat
dba_hist_seg_stat
dba_hist_seg_stat_obj
dba_hist_metric_name
dba_hist_sysmetric_history
dba_hist_sysmetric_summary
dba_hist_sessmetric_history
dba_hist_filemetric_history
dba_hist_waitclassmet_history
dba_hist_dlm_misc
dba_hist_rcvry_file_dest_stat
dba_hist_rman_performance
dba_hist_active_sess_history
dba_hist_tablespace_stat
dba_hist_log
dba_hist_mttr_target_advice
dba_hist_tbspc_space_usage
CHAPTER 11
- Oracle10g dbms packages
dbms_sqltune
dbms_advisor
dbms_workload_repository
|
Index:
|
_always_star_transformation
_cpu_cost_model
_db_aging_cool_count
_db_aging_freeze_cr
_db_aging_hot_criteria
_db_aging_stay_count
_db_aging_touch_time
_db_block_cache_clone
_db_block_cache_map
_db_block_cache_protect
_db_block_hash_buckets
_db_block_hash_latches
_db_block_hi_priority_batch_size
_db_block_max_cr_dba
_db_block_max_scan_cnt
_db_block_med_priority_batch_size
_db_block_write_batch
_db_percent_hot_default
_db_percent_hot_keep
_db_percent_hot_recycle
_fast_full_scan_enabled
_kgl_latch_count
_latch_spin_count
_optimizer_cost_model
_parallelism_cost_fudge_factor
_small_table_threshold
A
accept_sql_profile
Active Session History
add_sqlwkld_statement
add_window_group_member
ADDM
ADDM Advisor
Advanced Queuing
Advisor Central
advisor_name
all_rows
alter_sql_profile
AMM
analyze index
analyze table
application_wait_time
ASSM
ASYNCH
auto_sample_size
auto_task_consumer_group
auto_tasks_job_class
Automated Database Diagnostic Monitor
Automated Session History
Automated Storage Management
Automatic Database Diagnostic Monitor
Automatic Memory Management
Automatic Memory Manager
Automatic Segment Management
Automatic Segment Space
Automatic Segment Space Management
Automatic Shared Memory Management
Automatic SQL Execution Memory
Automatic Storage Management
Automatic Storage Manager
Automatic Undo Management
Automatic Workload Repository
automatic_ipc
AUTOTRACE
average_waiter_count
avg_row_len
awr_report_html
awr_report_text
awrrptsql
B
b*tree
background elapsed time
baseline_name
begin_interval_time
begin_time
bitmap
bitmap block
bitmap indexes
bitmap join
bitmap_merge_area_size
break_poll_skip
B-tree
b-tree indexes
buffer busy waits
buffer_gets_th
buffer_pool_keep
buffer_pool_recycle
buffer_pool_statistics
C
cache buffers chain
cache buffers LRU chain
cancel_tuning_task
cardinality
cascade
catawrsql
category
CBO
Change-Aware Incremental Backup
Chi-Square
close_window
cluster_wait_time
clustering_factor
concurrency_wait_time
consistent gets
consistent mode
consistent_gets
convosync
Cost Based Optimizer
Cost-based SQL optimizer
count
covariate analysis
CPU Bottleneck
CPU Run Queue Waits
cpu_cost
CPU-bound
create_baseline
create_bitmap_area_size
create_index_cost
create_job
create_snapshot
create_sqlset
create_sqlwkld
create_table_cost
create_task
create_tuning_task
cron tab
cursor_sharing
cursor_space_for_time
D
data buffer hit ratio
Data Manipulation Lock
data_object_id
database buffer hit ratio
Database Diagnostic Pack
Database Time
Database Tuning Pack
days_to_expire
DB Block Gets
DB CPU
db file parallel write
db file scattered read
db file sequential read
db time
db_k_cache_size
db_k_cache_size
db_k_cache_size
db_aging_hot_criteria
db_aging_touch_time
db_block_buffers
db_block_gets
db_block_lru_statistics
db_block_size
db_cache_advice
db_cache_size
db_file_multiblock_read_count
db_file_simultaneous_writes
db_files
db_keep_cache_size
db_recycle_cache_size
db_time_in_wait
dba_advisor
dba_advisor_actions
dba_advisor_commands
dba_advisor_def_parameters
dba_advisor_definitions
dba_advisor_directives
dba_advisor_findings
dba_advisor_journal
dba_advisor_log
dba_advisor_object_types
dba_advisor_objects
dba_advisor_parameters
dba_advisor_rationale
dba_advisor_recommendations
dba_advisor_sqla_rec_sum
dba_advisor_sqla_wk_map
dba_advisor_sqla_wk_stmts
dba_advisor_sqlw_colvol
dba_advisor_sqlw_journal
dba_advisor_sqlw_parameters
dba_advisor_sqlw_stmts
dba_advisor_sqlw_sum
dba_advisor_sqlw_tables
dba_advisor_sqlw_tabvol
dba_advisor_sqlw_templates
dba_advisor_tasks
dba_advisor_templates
dba_advisor_usage
dba_alert_history
dba_all_tables
dba_cache_advice
dba_data_files
dba_extents
dba_feature_usage_statistics
dba_high_water_mark_statistics
dba_hist
dba_hist_active_sess_history
dba_hist_active_session_history
dba_hist_active_session_history_bl
dba_hist_baselines
dba_hist_bg_event_summary
dba_hist_buffer_pool_stat
dba_hist_buffer_pool_statistics
dba_hist_db_cache_advice
dba_hist_enqueue_stat
dba_hist_event_name
dba_hist_event_summary
dba_hist_filemetric_history
dba_hist_filestatxs
dba_hist_latch
dba_hist_latch_children
dba_hist_latch_misses_summary
dba_hist_librarycache
dba_hist_metric_name
dba_hist_osstat
dba_hist_pga_target_advice
dba_hist_pgastat
dba_hist_rowcache_summary
dba_hist_seg_stat
dba_hist_service_name
dba_hist_service_stat
dba_hist_service_wait_class
dba_hist_sessmetric_history
dba_hist_sgastat
dba_hist_shared_pool_advice
dba_hist_snapshot
dba_hist_sql_plan
dba_hist_sql_summary
dba_hist_sql_plan
dba_hist_sqlstat
dba_hist_sqltext
dba_hist_stat_name
dba_hist_statname
dba_hist_sys_time_model
dba_hist_sys_time_model_bl
dba_hist_sysmetric_history
dba_hist_sysmetric_summary
dba_hist_sysstat
dba_hist_sysstat_bl
dba_hist_systat
dba_hist_system_event
dba_hist_system_event_bl
dba_hist_tempstatxs
dba_hist_waitclassmet_history
dba_hist_waitclassmetric_history
dba_hist_waitstat
dba_hist_waitstat_bl
dba_hist_wr_control
dba_histograms
dba_ind_partitions
dba_ind_subpartitions
dba_indexes
dba_object_tables
dba_objects
dba_outstanding_alerts
dba_part_col_statistics
dba_scheduler_job_classes
dba_scheduler_jobs
dba_scheduler_schedules
dba_scheduler_window_groups
dba_scheduler_windows
dba_scheduler_wingroup_members
|
dba_segments
dba_sql_profiles
dba_sqlset
dba_sqlset_binds
dba_sqlset_definitions
dba_sqlset_statements
dba_subpart_col_statistics
dba_tab_col_statistics
dba_tab_cols
dba_tab_columns
dba_tab_modifications
dba_tab_partitions
dba_tab_subpartitions
dba_tables
dba_tablesavg_row_len
dba_users
dbid
dbms_advisor
dbms_job
dbms_mview
dbms_redefinition
dbms_scheduler
dbms_server_alertget_threshold
dbms_server_alertset_threshold
dbms_space
dbms_sqltune
dbms_statgather_system_stats
dbms_stats
dbms_statsgather_system_stats
dbms_utility
dbms_workload_repository
dbmsawrsql
Decision Support System
Decision Support Systems
def_index_owner
def_index_tablespace
def_mview_owner
def_mview_tablespace
DEFAULT pool
delete_task
description
dictionary-managed tablespaces
Direct I/O
DIRECTIO
disk access latency
Disk Bottleneck
Disk Enqueues
disk_read_th
Documented Oracle Hints
drop_baseline
drop_snapshot_range
drop_sql_profile
drop_tuning_task
drop_window_group
DSS
duration
dynamic_sampling
E
end_interval_time
end_snapshot
end_time
enqueue waits
enqueues
Enterprise Manager
estimate_percent
excessive logical I/O
execute_task
execute_tuning_task
execution plan
executions_delta
executions_th
EXPLAIN
explain_rewrite
F
file_id
filesystemio_options
first_rows
flush_level
force
FORCEDIRECTIO
free_buffer_wait
freelists
G
Gallium Arsenide
gather_stats_job
get_task_report
get_task_script
glance
grep
group_name
H
Hard Parse Count Per Txn
hard parse elapsed time
Hard Parses
hash_area_size
hash_multiblock_io_count
High Water Mark
I
import_sqlwkld_sqlcache
import_sqlwkld_sts
import_sqlwkld_user
index range scan
index range scans
index_name_templat
initora
initialization parameters
inline hint
instance_number
interrupt_task
interrupt_tuning_task
interval
interval_size
io_cost
iostat
J
java_exec_time
job_name
Journal File System
K
KEEP pool
L
Laboratory Information Management Systems
library cache hit ratio
library cache latch
library cache miss ratio
listenerora
locally-managed tablespaces
log buffer space
Log Writer
log_buffer
logical reads
lsattr
M
Manageability Monitor
materialize hint
materialized views
max_interval
max_retention
maximum transmission unit
Memory Advisor
method_opt
metric_unit
min_interval
min_retention
minextents
MMON
mode
modify_snapshot_settings
modify_statspack_parameter
Most-Recently-Used
MRU
MTS
mts_dispatchers
MTU
multiblock_read_count
Multi-Threaded Server
mview_name_templat
N
name
Network Bottleneck
Network Latency
next
no_cpu_costing
Non-Uniform Memory Access
num_intervals
num_rows
num_sql
O
object_growth_trend
ODM
OEMGO
OLTP
Online Table Redefinition
Online Transaction Processing
open_window
Optimizer Plan Stability
optimizer_dynamic_sampling
optimizer_features_enable
optimizer_index_caching
optimizer_index_cost_adj
optimizer_max_permutations
optimizer_mode
optimizer_percent_parallel
options
Oracle Call Interface
Oracle Data Mining
Oracle Enterprise Manager
Oracle instance tuning
Oracle MetaLink
Oracle Parallel Query
Oracle Parallel Server
Oracle Streams
Oracle Wait Interface
Oracle*Net
P
page-stealing daemon
parallel
parallel_automatic_tuning
parallel_threads_per_cpu
parallelism
parse count (hard)
parse_calls_th
PCTFREE
PCTUSED
perfstat
PGA
pga_aggregate_target
physical reads
physical reads per second
physical_reads
physical_writes
phywrts
plsql_exec_time
postcost
precost
Proactive Tablespace Management
proactive tuning
Program Global Area
protocolora
prtconf |
Q
QIO
QIOSTAT
query_rewrite_enabled
quick_tune
R
RAID +
RAID +
RAID
RAID
RAID
RAID-
RAM Bottleneck
RAM Page Ins
rank
reactive tuning
recodify_snapshot_settings
RECYCLE pool
redo allocation latch
remove_window_group_member
report_plans
report_tuning_task
reset_task
reset_tuning_task
resume_task
retention
RRDTool
run_job
S
SAME
sample_size
sample_time
sar
SAR
Schedule Advisor
SDU
Segment Advisor
Segment Space Management
segment space management auto
server generated alerts
session data unit
session_cached_cursors
session_id
session_state
sesstat
set_attribute
set_default_task_parameter
set_sqlwkld_parameter
SETALL
SGA
sga_max_size
sga_target
sharable_mem_th
shared pool advice
shared_pool
shared_pool_size
show parameters buffer
snap_id
snap_level
snap_time
Soft Parses
sort_area_size
sp*sql
space_alloc
space_usage
spautosql
spcpkgsql
spcreatesql
spctabsql
spcusrsql
spdoctxt
spdropsql
spdtabsql
spdusrsql
spfile
sppurgesql
sprepconsql
sprepinssql
spreportsql
spreports
sprepsqlsql
sprsqinssql
sptruncsql
spuexppar
SQL Access
SQL Access Advisor
SQL Advisor
sql execute elapsed time
SQL Profiles
SQL Tuning
SQL Tuning Advisor
SQL Tuning Optimizer
SQL Tuning Sets
SQL*DBA
SQL*Loader
SQL*Net
SQL*Plus
sql_id
SQLAccess Advisor
sqlnetora
sqltune_category
SQLTuning
STAR query
star_query
star_transformation
star_transformation_enabled
start_snapshot
statistics_level
stats$bg_event_summary
stats$buffer_pool_statistics
stats$buffered_queues
stats$buffered_subscribers
stats$event_histogram
stats$filestatxs
stats$latch
stats$latch_children
stats$librarycache
stats$propagation_receiver
stats$propagation_sender
stats$rowcache_summary
stats$rule_set
stats$sgastat
stats$sql_summary
stats$statspack_parameter
stats$streams_apply_sum
stats$streams_capture
stats$sysstat
stats$system_event
stats$waitstat
STATSPACK
Statspack Viewer
statspacksnap
status
stop_job
Stripe and Mirror Everywhere
Support Vector Machines
sysaux_stat$
sysv_$sysstat
sysv_$system_event
System Global Area
System Metrics Long Duration
System Metrics Short Duration
T
table scans (long tables)
tch
tcpnodelay
TDU
tim
time model statistics
time modeling
time_limit
time_waited
time-series tuning
TKPROF
tnsnamesora
top
Total Table Scans Per Sec
touch count
Transparent Network Substrate
U
Undocumented Oracle Hints
use_current_session
user_indexes
user_io_wait_time
utlbstat
utlestat
V
v$active_sess_hist
v$active_session_history
v$bh
v$buffer_pool_statistics
v$controlfile
v$db_cache_advice
v$enqueue_statistics
v$event_histogram
v$event_name
v$eventmetric
v$file_histogram
v$filemetric
v$filemetric_history
v$filestat
v$latch
v$librarycache
v$metric_name
v$metricgroup
v$metricname
v$osstat
v$pga_target_advice
v$rowcache
v$segment_statistics
v$segstat
v$segstat_name
v$servicemetric
v$servicemetric_history
v$services
v$sess_time_model
v$session
v$session_event
v$session_wait
v$session_wait_class
v$session_wait_history
v$sessmetric
v$shared_pool_advice
v$sql
v$sql_bind_capture
v$sql_plan
v$sqlarea
v$statname
v$sys_time_model
v$sysmetric
v$sysmetric_history
v$sysmetric_summary
v$sysstat
v$system_event
v$system_wait_class
v$temp_histogram
v$tempstat
v$version
v$waitclassmetric
v$waitclassmetric_history
v$waitstat
v_$sql_plan
varyio
version_count_th
Virtual Memory
vmstat
W
Wait Event Interface
wait_class
wait_class#
wait_count
wait_time
wait_time_detail
window_list
window_name
workarea_size_policy
wrh$_active_session_history
wrh$_active_session_history_bl
wrh$_bg_event_summary
wrh$_buffer_pool_statistics
wrh$_event_name
wrh$_filemetric_history
wrh$_filestatxs
wrh$_latch
wrh$_latch_children
wrh$_librarycache
wrh$_metric_name
wrh$_rowcache_summary
wrh$_sessmetric_history
wrh$_sgastat
wrh$_sql_summary
wrh$_sys_time_model
wrh$_sys_time_model_bl
wrh$_sysmetric_history
wrh$_sysmetric_summary
wrh$_sysstat
wrh$_sysstat_bl
wrh$_system_event
wrh$_system_event_bl
wrh$_waitclassmetric_history
wrh$_waitstat
wrh$_waitstat_bl
wrh$active_session_history
wri$_alert_history
wri$_dbu_feature_metadata
wri$_dbu_feature_usage
wri$_dbu_usage_sample
wrm$_snapshot
X
x$bh
x$kcbcbh
x$kcbrbh |
|
Reviews:
DEFINITIVE REFERENCE FOR ORACLE 10g TUNING!,
May 16, 2006
This book is a large reference volume, of about
1,000 pages. Rather than trying to read this large
book chapter by chapter, I recommend skimming over
the sections at first, to see which areas suit your
particular needs. For instance, you will likely find
Chapter 16 of great value. It's entitled "Oracle 10g
Wait Event Tuning with AWR and ASH." Or, if you are
working with data warehouses, you might check out
Chapter 18, "Oracle Data Warehouse Tuning."
Although there is much discussion about tuning in
general, I think its great strength is the focus on
Oracle 10g Tuning--especially "time series metrics,"
using the Oracle 10g AWR (Automatic Workload
Repository.) In fact, I found the most valuable
chapter to be Chapter 9, "The AWR Time Model
Approach."
In this approach, the DBA determines where the
database is actually spending its time. After all,
that's what performance tuning is all about--where's
the time going. The authors explain how to use the
time performance views: V$Sys_Time_Model and
V$Sess_Time_Model. These views gather cumulative
stats for either the entire instance, or per
session.
There are also references to more traditional tuning
techniques, such as gathering proper statistics, SQL
tuning, join order, etc. The authors also include
chapters on Network Tuning, Disk Tuning, as well as
tuning the various cache buffers and pools. Chapter
19 explains how to do performance tuning with the
aid of OEM (Oracle Enterprise Manager.)
Of special interest to OPS users: Chapter 20
provides an overview of RAC (aka Oracle Parallel
Server, OPS). The authors illustrate the "Cache
Fusion" architecture, and discuss the "data
localization" load balancing method.
This brief review doesn't come close to doing
justice to the huge amount of valuable information
in this book. The discussion of the DBA_HIST views
is alone worth the price. This is likely the most
complete set of Oracle tuning information in a
single book. You really have to see it to believe
it!
Jon Emmons

Despite new “self tuning” features
in recent versions of Oracle,
database tuning continues to be an
essential part of the DBA skill set,
but where do we acquire these
skills? There is no substitute for
experience, but once in a while
there’s a roadmap for it.
In
their new book
Oracle Tuning: The Definitive
Reference, Alexey B. Danchenkov
and Donald K. Burleson reveal a
holistic, platform agnostic approach
to tuning the Oracle RDBMS. Both
proactive and reactive tuning are
given ample treatment while always
conveying the “why” and not just the
“how”.
The authors, clearly tempered by
years of experience, take a very
realistic approach to database
tuning. They acknowledge that the
DBA may not have the time, ability
or influence to bring upon an
application rewrite or change in
server architecture. The bulk of the
book focuses on tuning methods
within the realm of the database
administrator (though all areas
affecting Oracle performance are
covered.) While focusing on Oracle
Database 10g the authors present
tuning concepts and techniques in a
way that many of the techniques and
nearly all the concepts are
applicable to all Oracle RDBMS
versions.
Thoroughly covering everything
from disk to SQL the book is
littered with the exact commands you
will be running in the field
including example output and
analysis. The authors have also
included several pages of “Silver
Bullet” tuning examples. These
examples demonstrate how a quick
diagnosis and the right tweak can
save the day.
Testing a hypothesis on a
large active database is like
trying to tune a car while it’s
flying down the freeway at 75
miles per hour.
This book is not for the
beginner. If you do not feel
confident about your knowledge of
the Oracle architecture you will
feel overwhelmed by this book. Of
course if you do not feel confident
about your knowledge of the Oracle
architecture you should not be
tuning a database.
For those comfortable with Oracle
but new to tuning there will be many
paragraphs you will read, re-read,
then read again, but Danchenkov and
Burleson have not missed a step. On
almost every topic there are a
couple notes on common pitfalls and
how to avoid them. The authors have
really taken great care to shepherd
you safely through all steps of
tuning the database.
In barely less than 1,000 pages,
Danchenkov and Burleson have
compiled the definitive reference
for Oracle tuning. Coupled with a
good background in Oracle, this book
contains everything you need to tune
almost every aspect of the Oracle
database. I highly recommend it to
the Oracle professional looking to
learn about tuning or the
experienced tuner looking for a good
reference. The type of tuning
presented in this book could easily
lower your hardware costs and make
you a rock-star DBA.
|
|
Errata:
The dbms_stats "gather stale"
option was wrongly corrected to read "GATHER STYLE".
Page 42 - ksh script is mis-named is sql script
The script oracle10g_quick.ksh is shown mis-named. It is
properly called oracle10g_rpt_last.sql.
To use this script, start by running oracle9i_quick.ksh on page 49 to
take two closely-timed snapshots.
Next, run the script from page 42 to compare the values between these
two snapshots.
Book Revision: Pages 41-42
Old text:
The listing above shows the significant value of
this report. The DBA can see a time-series report of Oracle
behavior and even gets choose the time interval. An experienced DBA
would likely run the quick.ksh script below using a five minute time
interval.
New Text:
An experienced DBA would likely run
the oracle9i_quick.ksh script from page 49, and then the script
below to compare the values between to two closely-timed snapshots.
Page 380 - optimizer_cost_model
This page incorrectly states the
hidden parameter name which should state
_optimizer_cost_model:
The new CPU
Costing feature, controlled by the _cpu_cost_model
hidden parameter.
Page 689
Tracking hash joins
Jonathan
Lewis has
noted that this script omits a specific join to the dbid for the
snapshot and offers other excellent refinements. This is the corrected script:
col c1 heading ‘Date’ format a20
col c2 heading ‘Hash|Join|Count’ format 99,999,999
col c3 heading ‘Rows|Processed’ format 99,999,999
col c4 heading ‘Disk|Reads’ format 99,999,999
col c5 heading ‘CPU|Time’ format 99,999,999
accept hash_thr char prompt ‘Enter Hash Join Threshold: ‘
ttitle ‘Hash Join Threshold|&hash_thr’
select
to_char(
sn.begin_interval_time,
'yy-mm-dd
hh24'
)
snap_time,
count(*)
ct,
sum(st.rows_processed_delta)
row_ct,
sum(st.disk_reads_delta)
disk,
sum(st.cpu_time_delta)
cpu
from
dba_hist_snapshot
sn,
dba_hist_sqlstat
st,
dba_hist_sql_plan
sp
where
st.snap_id
= sn.snap_id
and
st.dbid = sn.dbid
and
st.instance_number = sn.instance_number
and
sp.sql_id = st.sql_id
and
sp.dbid = st.dbid
and
sp.plan_hash_value = st.plan_hash_value
and
sp.operation = 'HASH JOIN'
group by
to_char(sn.begin_interval_time,'yy-mm-dd
hh24')
having
count(*)
> &hash_thr;
SEE CODE DEPOT FOR FULL SCRIPTS
|
Setting for filesystemio_options (lookup page)
Change:
According to the Oracle documentation, the
filesystemio_options
parameter must be set to TRUE or DIRECTIO in order for Oracle to read
data blocks directly from disk: Using DIRECTIO allows the
enhancement of I/O through the bypassing of the redundant OS block
buffers, reading the data block directly into the Oracle SGA. Using
direct I/O also allows the creation of multiple blocksized tablespaces
to improve I/O performance.
To
According to the Oracle documentation, the
filesystemio_options
parameter must be set to SETALL or DIRECTIO in order for Oracle to read
data blocks directly from disk.
Using DIRECTIO allows the enhancement of I/O
through the bypassing of the redundant OS block buffers, reading
the data block directly into the Oracle SGA. Using direct I/O
also allows the creation of multiple blocksized tablespaces. improve I/O performance.
Using SETALL allows both asynchronous I/O and direct I/O, the preferred
method according to the Oracle 11g documentation
Page 667
- Tracking Nested loop joins
Jonathan
Lewis has noted some great enhancements to this script, noting:
"Roughly speaking, the query is looking
for historic executions plans which used nested loop
joins and producing a report that is attempting to produce
some measures of work done by nested loops,
showing the variation over time. In principal this could be
a good thing as it allows us to ask things like: how did
metric X today compare with metric X yesterday (or on
the same day last week if we adjust the AWR defaults to keep
two weeks of data); how did metric Y look different
around 3:00 pm today when the users were complaining about
the performance. But before you get too keen on any
particular metrics, you need to make sure that you define
them properly and write code that calculates them properly.
Let’s look closely at this script:
First – the joins. The primary key on
wrm$_snapshot (the
thing underpinning
dba_hist_snapshot) is defined as (dbid,
snap_id,
instance_number). A single repository can
hold information from multiple databases (identified by
dbid) and many
instance from the same database (instance_number).
Virtually every table in the workload repository has the
same critical columns – because each set of snapshot
statistics belongs to one instance of one database. So if
you’ve managed to get multiple databases, or multiple
instances, collecting statistics into the same repository
then the results from your query are going to get distorted
in all sorts of strange ways if you don’t get this basic
join right.
Second – the joins, again. The view
dba_hist_sqlstat
is based on the dynamic performance view
v$sqlstat (a more
latch-friendly version of v$sql
that appeared in 10gR2). These views hold one row per
child cursor. Each SQL statement could end up with
multiple execution plans, and in the dynamic performance
views there is a column called
child_number that acts as part of the key to
the data. This doesn’t exist (for obvious reasons) in the
history tables – instead you have to assume that if two
child cursors have different execution plans they will have
different plan hash values – so it is the column
plan_hash_value
that becomes part of the key to
dba_hist_sqlstat and
dba_hist_sql_plan (or rather their
underpinning tables). This is another column that should be
in the query’s join clause. If you omit it, the reported
impact of a query in the result set will be scaled up by a
factor dependent on the number of child cursors for that
query..."
Hence, the revised script is here:
col c1 heading ‘Date’ format a20
col c2 heading ‘Nested|Loops|Count’ format 99,999,999
col c3 heading ‘Rows|Processed’ format 99,999,999
col c4 heading ‘Disk|Reads’ format 99,999,999
col c5 heading ‘CPU|Time’ format 99,999,999
accept nested_thr char prompt ‘Enter Nested Join Threshold: ‘
ttitle ‘Nested Join Threshold|&nested_thr’
select
to_char(
sn.begin_interval_time,
'yy-mm-dd
hh24'
)
snap_time,
count(*)
ct,
sum(st.rows_processed_delta)
row_ct,
sum(st.disk_reads_delta)
disk,
sum(st.cpu_time_delta)
cpu
from
dba_hist_snapshot
sn,
dba_hist_sqlstat
st,
dba_hist_sql_plan
sp
where
st.snap_id
= sn.snap_id
and
st.dbid = sn.dbid
and
st.instance_number = sn.instance_number
and
sp.sql_id = st.sql_id
and
sp.dbid = st.dbid
and
sp.plan_hash_value = st.plan_hash_value
and
sp.operation = 'NESTED LOOPS'
group
by
to_char(sn.begin_interval_time,'yy-mm-dd
hh24')
having
count(*) > &nested_thr;
SEE CODE DEPOT FOR FULL SCRIPTS
Oracle tuning
oracle tuning book

|
|

Copyright ©
1996 -2017 by Burleson. All rights reserved.
Oracle® is the registered trademark of Oracle
Corporation. SQL Server® is the registered trademark of Microsoft
Corporation. Many of the designations used by computer vendors to distinguish their
products are claimed as Trademarks
|
|