Home
Add Document
Sign In
Register
Oracle 9i - High Performance Tuning With STATSPACK
Home
Oracle 9i - High Performance Tuning With STATSPACK
Oracle 9i - High Performance Tuning With STATSPACKDescription complète...
Author:
acsabo_14521769
13 downloads
277 Views
386KB Size
Report
DOWNLOAD .PDF
Recommend Documents
Oracle 9i - High Performance Tuning With STATSPACK
Oracle 9i - High Performance Tuning With STATSPACKDescripción completa
Oracle 12c Performance Tuning
This is the new oracle documentation for the new feature in Oracle 12C database performance tuning overviewFull description
Oracle RAC Performance Tuning
Full description
Oracle Performance Tuning
tuningFull description
Understanding Performance Tuning in Oracle
performance tuningFull description
Oracle performance tuning part 4
Oracle performance tuningFull description
001Introduction to Oracle Performance Tuning
Introduction to Oracle Performance TuningFull description
Oracle 9i Notes
Full description
Oracle 9i Notes
Full description
Oracle Performance Troubleshooting - With Dictionary Internals SQL & Tuning Scripts
Performance Tuning
Oracle Performance tuning
Oracle 8i to 9i Migration
Oracle 9i 1Z0-007 Exam
Oracle 9i 1Z0-007 ExamFull description
101 Oracle Tuning Tips
Oracle SQL Tuning
Oracle SQL Tuning database
101 Oracle Tuning Tips
Oracle 9i- Program With PL-SQL Vol-2
Manual Oracle 9i por JENIFFER MANOSALVAS
MANUAL BÁSICO DE ORACLE 9IDescripción completa
Performance Tuning in Qlikview
Performance Tuning in QlikviewFull description
OCP - Performance Tuning StudPDF1
Full description
HFM Performance Tuning 042513
Performance Tuning HFM
4 Stroke Performance Tuning
MongoDB Performance Tuning
Full description
Java Performance Tuning Tech
Full description
Contents ACKNOW ACKN OWLE LEDG DGME MENT NTS S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv xvii ii INTR IN TROD ODUC UCTI TION ON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi xix x PART I
Overview of the Method and the Tools 1 Ov Over ervi view ew of Or Oracl acle e Tuni Tuning ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Th eO Ove vera rall ll Tu Tuni ning ng Ap Appr proa oach ch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Serv Se rver er Tu Tuni ning ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Netw Ne twor ork k Tun Tunin ing g . .. .. .. .. . .. .. .. .. .. .. .. .. . .. .. .. .. .. Disk Di sk Tun Tunin ing g . .. .. .. .. .. .. . .. .. .. .. .. .. .. .. . .. .. .. .. .. Inst In stan ance ce Tu Tuni ning ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Obje Ob ject ct Tu Tuni ning ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SQL SQ L Tun Tunin ing g . .. .. .. .. .. .. . .. .. .. .. .. .. .. .. . .. .. .. .. .. Tuni Tu ning ng wi with th Or Orac acle le Pa Para rall llel el Qu Quer ery y . .. .. .. .. .. .. .. .. .. .. .. Tuni Tu ning ng Rea Reall Appl Applic icat atio ion n Clus Cluste ters rs (RA (RAC) C) . . . . . . . . . . . . . . . . . . . . Orac Or acle le an and d STAT STATSP SPAC ACK K . . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . Conclu Con clusio sion n . .. . .. .. .. .. .. .. .. .. . .. .. .. .. .. .. .. . .. .. .. .. .. . 2 Ov Over ervi view ew of ST STATS ATSPAC PACK K
. . .. .. .. .. .. .. .. . .. .. .. .. .. .. . .. .. .. .. .. The Th e STA STATS TSPA PACK CK Ar Arch chit itec ectu ture re . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How Ho w STAT STATSP SPAC ACK K Coll Collec ects ts Dat Data a . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . The STA STATSP TSPACK ACK Tab Table le Stru Structu ctures res . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STAT ST ATSP SPAC ACK K Con Contr trol ol Ta Tabl bles es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STAT ST ATSP SPAC ACK K Par Param amet eter er Ta Tabl bles es . . . . . . . . . . . . . . . . . . . . . . . . . . . Usess for Use for STATS STATSPAC PACK K Infor Informat mation ion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Da taba base se Tu Tuni ning ng wi with th ST STAT ATSP SPAC ACK K . .. .. .. .. .. .. .. .. .. .. .. Reso Re sourc urce e Pla Plann nnin ing g . .. .. .. .. . .. .. .. .. .. .. .. . .. .. .. .. .. . Predi Pre dict ctiv ive e Mod Model elin ing g . .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . Conclu Con clusio sion n . .. . .. .. .. .. .. .. .. .. . .. .. .. .. .. .. .. . .. .. .. .. .. .
3 4 9 10 11 12 13 14 15 15 16 19 21 23 23 26 27 29 31 31 32 33 34
vii
viii
Oracle9i High Performance Tuning with STATSPACK
3 Installing and Configuring STATSPACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of the STATSPACK Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Scripts for Oracle8 and Oracle8i . . . . . . . . . . . . . . . STATSPACK Scripts for Post-8.1.6 STATSPACK . . . . . . . . . . . . . . . Step 1: Create the perfstat Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . Step 2: Run the Create Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Run the Pre-8.1.7 Install Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . Install Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 3: Test the STATSPACK Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 4: Schedule Automatic STATSPACK Data Collections . . . . . . . . . . . STATSPACK Configuration and Maintenance . . . . . . . . . . . . . . . . . . . . . Viewing STATSPACK Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . Adjusting the STATSPACK Collection Thresholds . . . . . . . . . . . . . . . . . . Snapshot Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Snapshot Thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Back-Porting STATSPACK for Oracle 8.0 Through 8.1.5 . . . . . . . . . . . . . Removing Old STATSPACK Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . Using the STATSPACK purge Utility . . . . . . . . . . . . . . . . . . . . . . Manually Removing STATSPACK Snapshots . . . . . . . . . . . . . . . . Removing Ranges of Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . An Intelligent UNIX Script to Purge Snapshots . . . . . . . . . . . . . . . Handy STATSPACK Shell Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Quick Elapsed-Time STATSPACK Script . . . . . . . . . . . . . . . . . . Monitoring STATSPACK Table Extents . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Data Inside the STATSPACK Tables
. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . What Is Missing from STATSPACK? . . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Subordinate Table Structures . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changes in STATSPACK Tables for Oracle9i . . . . . . . . . . . . . . . . The stats$latch_misses_summary Table . . . . . . . . . . . . . . . . . . . . The stats$sgastat_summary Table (Oracle8i Only) . . . . . . . . . . . . . The stats$sql_summary Table . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$parameter Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK System Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$rollstat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$latch Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$latch_children Table . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$librarycache Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$waitstat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$enqueuestat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . .
35 36 37 38 40 41 41 41 43 43 45 45 47 47 48 50 50 50 51 51 54 59 59 65 67 69 70 70 71 71 74 75 77 79 80 80 82 83 83 84 85
Contents
The stats$sysstat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$sesstat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$sgastat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Transaction Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$buffer_pool Table (Pre-Oracle9i Only) . . . . . . . . . . . . . The stats$buffer_pool_statistics Table . . . . . . . . . . . . . . . . . . . . . The stats$filestatxs Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Event Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$system_event Table . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$session_event Table . . . . . . . . . . . . . . . . . . . . . . . . . . . The stats$bg_event_summary Table . . . . . . . . . . . . . . . . . . . . . . The stats$idle_event Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle Parallel Server Tables (Real Application Clusters) . . . . . . . . . . . . The stats$rowcache_summary Table . . . . . . . . . . . . . . . . . . . . . . The stats$sgaxs Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
87 89 90 91 91 92 94 95 96 98 99 100 100 101 101 102
PART II
Tuning the Oracle Database with STATSPACK 5 Extending STATSPACK to Collect Server Statistics
. .. .. .. .. .. . .. .. .. .. Overview of the vmstat Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dialect Differences in vmstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . What to Look for in vmstat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Identifying CPU Bottlenecks with vmstat . . . . . . . . . . . . . . . . . . . Identifying High CPU Usage with vmstat . . . . . . . . . . . . . . . . . . . Identifying RAM Memory Bottlenecks . . . . . . . . . . . . . . . . . . . . . Understanding UNIX RAM Memory Paging . . . . . . . . . . . . . . . . . Capturing Server Performance Data Inside STATSPACK . . . . . . . . . . . . . A Script to Capture vmstat Information . . . . . . . . . . . . . . . . . . . . Internals of the vmstat Capture Script . . . . . . . . . . . . . . . . . . . . . Reporting vmstat Information on Other Oracle Servers . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
105 106 107 108 109 112 112 112 119 119 123 124 125
6 Tuning the Server Environment
127
. .. .. .. .. .. .. . .. .. .. .. .. .. . .. .. .. .. . The Relationship Between the Database Administrator and the Systems Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Online Server Monitor Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using top to Monitor the Server . . . . . . . . . . . . . . . . . . . . . . . . . . Using sar to Monitor Server Statistics . . . . . . . . . . . . . . . . . . . . . . Monitoring Server CPU Consumption . . . . . . . . . . . . . . . . . . . . . . . . . .
129 129 129 130 132 135
ix
x
Oracle9i High Performance Tuning with STATSPACK
Upgrading an Entire Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Additional CPU Processors . . . . . . . . . . . . . . . . . . . . . . . Load Balancing of Server Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . Using nice and priocntl to Change Execution Priority . . . . . . . . . Monitoring Server Memory Consumption . . . . . . . . . . . . . . . . . . . . . . . . Server Memory Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Very Large Memory and Oracle . . . . . . . . . . . . . . . . . . . . . . . . . Making Oracle Memory Nonswappable . . . . . . . . . . . . . . . . . . . Reporting on Server Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Exception Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Daily vmstat Trend Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Long-Term Server Analysis and Trending . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Tuning the Network Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Optimizing Oracle NET Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . The tcp.nodelay Parameter in protocol.ora . . . . . . . . . . . . . . . . . The automatic_ipc Parameter of sqlnet.ora . . . . . . . . . . . . . . . . . SDU and TDU Parameters in tnsnames.ora . . . . . . . . . . . . . . . . . The queuesize Parameter in listener.ora . . . . . . . . . . . . . . . . . . . The break_poll_skip Parameter of sqlnet.ora . . . . . . . . . . . . . . . . The disable_oob Parameter of sqlnet.ora . . . . . . . . . . . . . . . . . . . The epc_disabled Environment Variable . . . . . . . . . . . . . . . . . . . Other Oracle Features that Affect Network Behavior . . . . . . . . . . . . . . . Using Array Fetches to Improve Network Throughput . . . . . . . . . Using the Multi-Threaded Server . . . . . . . . . . . . . . . . . . . . . . . . . Connection Pooling and Network Performance . . . . . . . . . . . . . . ODBC and Network Performance . . . . . . . . . . . . . . . . . . . . . . . . Tuning with Oracle Replication . . . . . . . . . . . . . . . . . . . . . . . . . . Monitoring Network Performance from Oracle STATSPACK . . . . . . . . . Tuning the Distributed Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using netstat to Monitor Network Activity . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Tuning the Disk I/O Subsystem with STATSPACK . . . . . . . . . . . . . . . . . . . . .
Oracle Tuning Factors that Influence Disk I/O . . . . . . . . . . . . . . . . . . . . Oracle Internals and Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle File Organization Techniques . . . . . . . . . . . . . . . . . . . . . Transient Disk Hot Spots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping Oracle Disk Architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Multiple RAM Buffer Issue . . . . . . . . . . . . . . . . . . . . . . . . . . File Striping with Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using RAID with Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
136 137 137 141 143 144 144 145 146 146 150 154 154 155 156 157 158 158 160 160 161 161 162 162 162 164 166 167 169 172 172 174 175 177 178 178 180 186 187 188 189
Contents
Using Oracle with Raw Devices . . . . . . . . . . . . . . . . . . . . . . . . . Load Balancing Disks with Oracle Databases . . . . . . . . . . . . . . . Configuring Oracle Tablespaces and Datafiles . . . . . . . . . . . . . . Building the Oracle File-to-Disk Architecture . . . . . . . . . . . . . . . Reporting on the Oracle Disk Architecture . . . . . . . . . . . . . . . . . STATSPACK Reports for Oracle Datafiles . . . . . . . . . . . . . . . . . . . . . . . . Detailed Disk and File I/O with STATSPACK . . . . . . . . . . . . . . . . A STATSPACK Report on Specific I/O Activity . . . . . . . . . . . . . . . A STATSPACK Script to Identify Hot Datafiles . . . . . . . . . . . . . . . The Approach to Locating Hot Disks . . . . . . . . . . . . . . . . . . . . . . Extending STATSPACK for Disk I/O Data . . . . . . . . . . . . . . . . . . . . . . . . The Basic iostat Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining the STATSPACK Table . . . . . . . . . . . . . . . . . . . . . . . . . . Capturing the iostat Information . . . . . . . . . . . . . . . . . . . . . . . . . Generating iostat Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Viewing I/O Signatures with STATSPACK . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
190 191 191 194 195 196 203 204 206 207 208 208 210 211 213 217 222
PART III
Tuning the Oracle Database with STATSPACK 9 Tuning the Oracle Database Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
An Overview of the Oracle Database Instance . . . . . . . . . . . . . . . . . . . . The Oracle SGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle Background Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . Blocksize and Oracle Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . The db_file_multiblock_read_count and Oracle . . . . . . . . . . . . . Tuning the Oracle7 through Oracle8i Data Buffers . . . . . . . . . . . . . . . . Introduction of Data Block Caching . . . . . . . . . . . . . . . . . . . . . . Full Data Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Data Buffer Hit Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Buffer Pool Internals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Monitoring Data Buffer Pool Usage with STATSPACK . . . . . . . . . Overview of the Oracle8i Data Pools . . . . . . . . . . . . . . . . . . . . . Locating Tables and Indexes for the KEEP Pool . . . . . . . . . . . . . . Tuning the RECYCLE Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Identifying Candidates for the RECYCLE Pool . . . . . . . . . . . . . . . Trend Reports of the Data Buffer Hit Ratio with STATSPACK . . . . . . . . . Tuning the Oracle9i Data Buffer Pools . . . . . . . . . . . . . . . . . . . . . . . . . . The Seven Data Buffer Hit Ratios . . . . . . . . . . . . . . . . . . . . . . . . . Tuning the Oracle8.0 Database Writer Processes . . . . . . . . . . . . . . . . . . Oracle 8.0 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
225 227 228 232 235 236 236 237 239 240 242 245 248 249 256 257 261 267 267 274 275
xi
xii
Oracle9i High Performance Tuning with STATSPACK
Monitoring Database Writer Contention in Oracle8i and Oracle9i . . . . . Tuning the Shared Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning the Library Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Monitoring the Library Cache Miss Ratio . . . . . . . . . . . . . . . . . . . Monitoring Objects Within the Library Cache with STATSPACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning the Dictionary Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning Oracle Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning the Undo Records (Rollback Segments) . . . . . . . . . . . . . . . . . . . Monitoring Dedicated Connections to Oracle . . . . . . . . . . . . . . . . . . . . UNIX Interaction with the Multi-Threaded Server . . . . . . . . . . . . . . . . . . Prerequisites for Using the MTS . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle9i Dynamic RAM and UNIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle9i and UNIX Granules . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing Dynamic SGA and PGA Components . . . . . . . . . . . . . Oracle9i PGA Memory Allocation for Dedicated Connections . . . . . . . . Automatic RAM Memory Management in Oracle9 i . . . . . . . . . . . Moving Toward a Self-Tuning Oracle9i Database . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Tuning Oracle Tables and Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Automatic Space Management in Oracle9i . . . . . . . . . . . . . . . . . . . . . . The Evolution of Bitmaps in Oracle . . . . . . . . . . . . . . . . . . . . . . . Oracle9i Freelists Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . Characteristics of Bitmap Segment Management . . . . . . . . . . . . . Oracle9i Freelist Internals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Oracle9i Tools for Automatic Space Management . . . . . . . . . . . . Traditional Oracle Storage Parameters and Performance . . . . . . . . . . . . The pctfree Storage Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . The pctused Storage Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . The Freelists Storage Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . The Freelist Groups Storage Parameter for OPS . . . . . . . . . . . . . . . Summary of Storage Parameter Rules . . . . . . . . . . . . . . . . . . . . . Traditional Freelist Management and Oracle Objects . . . . . . . . . . . . . . . Linking and Unlinking from the Freelists . . . . . . . . . . . . . . . . . . . Reducing Freelist Relinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table Internals and Freelists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Long Data Columns and Freelist Behavior . . . . . . . . . . . . . . . . . . Setting pctfree and pctused Based on Average Row Length . . . . . . . . . . Buffer Busy Waits and Freelist Contention . . . . . . . . . . . . . . . . . . . . . . . Using STATSPACK to Find Wait Contention . . . . . . . . . . . . . . . . Finding Buffer Busy Waits with STATSPACK . . . . . . . . . . . . . . . . Reorganizing Oracle Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using CTAS to Reorganize a Table . . . . . . . . . . . . . . . . . . . . . . .
282 285 292 293 294 299 305 312 316 319 320 329 331 333 334 334 342 351 353 354 355 356 357 358 362 365 365 366 367 367 367 369 370 372 373 375 377 378 379 382 390 392
Contents
Identifying Oracle Tables with Chained Rows . . . . . . . . . . . . . . . . . . . . Identifying Tables with Long Rows . . . . . . . . . . . . . . . . . . . . . . . Identifying Sparse Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resequencing Oracle Table Rows for High Performance . . . . . . . . . . . . Index Rebuilding Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . When to Rebuild Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Automating Index Rebuilds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Identifying Unused Indexes in Oracle9i . . . . . . . . . . . . . . . . . . . . . . . . . A Sample Index Monitoring Session . . . . . . . . . . . . . . . . . . . . . . Tuning Index Contention with Hidden Parameters . . . . . . . . . . . Monitoring Oracle Tables and Indexes with STATSPACK . . . . . . . . . . . . Allocating the STATSPACK Extension Tables . . . . . . . . . . . . . . . . Collecting the STATSPACK Snapshot for Tables and Indexes . . . . Reports on Tables and Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . Distributing the Table Reports via E-mail . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Tuning Oracle SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Goals of SQL Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Problem of Declarative SQL Syntax . . . . . . . . . . . . . . . . . . . . . . . . . The Oracle SQL Optimizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . optimizer_mode = RULE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . optimizer_mode = FIRST_ROWS . . . . . . . . . . . . . . . . . . . . . . . . . optimizer_mode = ALL_ROWS . . . . . . . . . . . . . . . . . . . . . . . . . . optimizer_mode = CHOOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning with Rule-Based Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . Changing the Rule-Based Driving Table . . . . . . . . . . . . . . . . . . . When the Rule-Based Optimizer Fails to Use the Correct Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning with Cost-Based Optimization (CBO) . . . . . . . . . . . . . . . . . . . . . Invoking the Cost-Based Optimizer . . . . . . . . . . . . . . . . . . . . . . . Gathering Statistics for the CBO . . . . . . . . . . . . . . . . . . . . . . . . . Determining the Default optimizer_mode . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Tuning Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning with CBO SQL Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tuning SQL Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Problem of Literal SQL Statements . . . . . . . . . . . . . . . . . . . . Using cursor_sharing in Oracle8i . . . . . . . . . . . . . . . . . . . . . . . . Tuning SQL with Temporary Tables . . . . . . . . . . . . . . . . . . . . . . Tuning SQL by Adding Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . General Rules for Writing Efficient SQL . . . . . . . . . . . . . . . . . . . .
398 403 404 406 409 415 415 417 417 418 419 419 421 424 442 443 445 446 447 449 449 449 449 450 453 453
454 456 458 458 460 461 462 462 463 466 467 468 469
xiii
xiv
Oracle9i High Performance Tuning with STATSPACK
The SQL Tuning Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 1: Identify High-Impact SQL in the Library Cache . . . . . . . . Step 2: Extract and Explain the SQL Statement . . . . . . . . . . . . . . . Step 3: Tune the SQL Statement . . . . . . . . . . . . . . . . . . . . . . . . . An Actual Case-Study in SQL Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . Get the Full Table Scan Report . . . . . . . . . . . . . . . . . . . . . . . . . . Advanced SQL Execution Plan Analysis . . . . . . . . . . . . . . . . . . . . . . . . . Table Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Making Permanent Changes to Tuned SQL . . . . . . . . . . . . . . . . . . . . . . Using Stored Outlines for SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the v$sql_plan and the v$sql_workarea Views . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
470 471 481 487 488 488 490 494 495 495 496 499
12 Tuning with Oracle Parallel Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
501 503 504 505 509 511 511 512 513 514 516 516 517 518 519
Using Oracle Parallel Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallel Query Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting the Optimal Degree of Parallelism . . . . . . . . . . . . . . . . . . Using Parallel Query Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Monitoring Oracle Parallel Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Monitoring Oracle Parallel Query with STATSPACK . . . . . . . . . . Monitoring Oracle Parallel Query with v$ Views . . . . . . . . . . . . Parallel Queries and Distributed Objects . . . . . . . . . . . . . . . . . . . Finding Candidate Tables for Oracle Parallel Query . . . . . . . . . . Using Parallel DML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Turning On Parallel DML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parallelizing Oracle Table Reorganizations . . . . . . . . . . . . . . . . . Parallel Index Rebuilding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Tuning the Oracle Parallel Server Environment . . . . . . . . . . . . . . . . . . . . . . . .
521 Introduction to Oracle Cluster Server Architecture . . . . . . . . . . . . . . . . . 522 Partitioning Data for RAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 The Integrated Distributed Lock Manager (Oracle7 Through Oracle8i ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 Configuring the IDLM within the Oracle8i OPS Environment . . . 527 Oracle Table Settings for OPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 Tuning the OPS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 STATSPACK Tables for Monitoring OPS . . . . . . . . . . . . . . . . . . . . . . . . . 534 The stats$rowcache_summary Table . . . . . . . . . . . . . . . . . . . . . . 534 The stats$sgaxs Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 The stats$sysstat Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 Extending STATSPACK for OPS Information . . . . . . . . . . . . . . . . . . . . . . 537 Querying the v$ Views for Oracle Parallel Server . . . . . . . . . . . . . . . . . . 540
Contents
Comparing Real Application Clusters to Oracle Parallel Server . . . . . . . 543 Monitoring Transaction Application Failover in Oracle9i . . . . . . 545 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 PART PART IV
Database Reporting with STATSPACK 14 Monitoring Oracle with STATSPACK
. .. .. .. . .. .. .. .. .. .. .. . .. .. .. .. The Standard STATSPACK Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introductory Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Wait Event Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SQL Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tablespace Activity Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview of the Alert Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Customized Exception Alert Reports for the DBA . . . . . . . . . . . . . . . . . . Daily STATSPACK Alert Report . . . . . . . . . . . . . . . . . . . . . . . . . . Daily Server Alert Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A Real-Time Check for Oracle Problems . . . . . . . . . . . . . . . . . . . Weekly Object Growth Report . . . . . . . . . . . . . . . . . . . . . . . . . . Trace Alert Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Web Server Alert Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Buffer Busy Waits Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A STATSPACK Reactive Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Scheduling and Customizing Oracle Alert Reports . . . . . . . . . . . . . . . . . A Sample UNIX Crontab to Schedule Oracle Reports and Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15 Trend Analysis with STATSPACK
. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . Plotting STATSPACK Data Using Microsoft Excel . . . . . . . . . . . . . . . . . . Plotting STATSPACK Data with a Spreadsheet Chart Wizard . . . . Step 1: Customize the STATSPACK Report . . . . . . . . . . . . . . . . . Step 2: Run the Report in SQL*Plus . . . . . . . . . . . . . . . . . . . . . . . Step 3: Highlight and Copy the Results . . . . . . . . . . . . . . . . . . . . Step 4: Open Excel and Paste the Data . . . . . . . . . . . . . . . . . . . . Step 5: Partition the Data into Columns . . . . . . . . . . . . . . . . . . . . Step 6: Column Delimit the Data . . . . . . . . . . . . . . . . . . . . . . . . . Step 7: Start the Chart Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 8: Choose a Line Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step 9: Complete the Chart Wizard and View the Chart . . . . . . . Step 10: Add a Trend Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STATSPACK Reports for Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . Basic STATSPACK Metrics for Trend Analysis . . . . . . . . . . . . . . .
549 550 550 553 554 559 568 569 570 579 580 582 585 588 589 591 596
596 597 599 600 600 601 603 603 604 604 604 606 606 606 608 609 609
xv
xvi
Oracle9i High Performance Tuning with STATSPACK
STATSPACK Extensions for Database Server Trend Analysis . . . . Checking Server Trends by Hour . . . . . . . . . . . . . . . . . . . . . . . . . Plotting Server Statistics by Day of the Week . . . . . . . . . . . . . . . . Web-Based Plotting of STATSPACK Data . . . . . . . . . . . . . . . . . . . . . . . . The RRDtool Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Web-Based Graphing Tools . . . . . . . . . . . . . . . . . . . . . . . . The STATSPACK Viewer Product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
610 613 616 617 617 618 620 625
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
×
Report "Oracle 9i - High Performance Tuning With STATSPACK"
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
×
Sign In
Email
Password
Remember me
Forgot password?
Sign In
Our partners will collect data and use cookies for ad personalization and measurement.
Learn how we and our ad partner Google, collect and use data
.
Agree & close