Oracle Tuning
Oracle Tuning
Oracle Tuning
Agenda
Oracle Database Structure Oracle Database Access Tuning Considerations Oracle Database Tuning Oracle Tuning Tools
06/14/2002
06/14/2002
Logical Structure
06/14/2002
Logical Structure
Tablespaces
SYSTEM RBS or UNDO TEMP User Data and Indices
Schema Tables and Indices Segments (Data, Index, RBS, Temp) Extents
06/14/2002 Hawkeye Technology, Inc. 5
Physical Structure
06/14/2002
Physical Structure
Database
Data Parameter Files
Instance
Processes Memory Structures
06/14/2002
Physical Database
Data Files Redo Log Files Control Files Parameter File Archive Log Files
06/14/2002
Parameter File
Read at instance startup Specifies values for various system wide parameters Size parameters
SGA, db buffer, sort area size,
Tuning parameters
06/14/2002 Hawkeye Technology, Inc. 9
Database Instance
Processes
Process Monitor (PMON) System Monitor (SMON) Database Writer(s) (DBWRx) Recovery (RECO) Archiver (ARCx) Checkpoint (CKPT) Log Writer (LGWR) Server Processes .
Memory Structure
System Global Area (SGA) Program Global Area (PGA)
06/14/2002 Hawkeye Technology, Inc. 10
Memory Structure
SGA
Database buffer cache Redo log buffer Shared Pool
Shared SQL Area PL/SQL Procedures and Packages Dictionary Cache
PGA
Heap Sort Area
06/14/2002 Hawkeye Technology, Inc. 11
06/14/2002
12
Database Connection
Sql*Net Listener Server Process
06/14/2002
13
Data Access
Access data via SQL or PL/SQL Processing of SQL in three phases:
Parse Execute Fetch
06/14/2002
14
Tuning Considerations
06/14/2002
15
Tuning Considerations
OLTP vs DSS Response Time vs Throughput Response Time = Service Time + Wait Time Tuning Tradeoffs
Affect of tuning on rest of the system
Frequency of use
06/14/2002 Hawkeye Technology, Inc. 16
06/14/2002
17
06/14/2002
19
Proactive vs Reactive
Proactive Tuning
Balance IO Distribution Manage Object Extents Manage batch jobs Manage long running and poorly tuned queries Database parameter review and tuning React to a trouble report or performance problem
Reactive Tuning
06/14/2002 Hawkeye Technology, Inc. 20
Tuning Steps
Identify and define the problem Set clear and measurable tuning goals Take initial performance measurements Iteratively apply tuning changes and measure performance on TEST system Document ALL tuning changes After goal is reached, apply changes to PRODUCTION.
06/14/2002 Hawkeye Technology, Inc. 21
How to Tune
SQL Statements
Can they be rewritten for better data access? Review Execution plan for use of Indexes
Resource Contention
RBS or Undo CPU Memory IO Network
06/14/2002 Hawkeye Technology, Inc. 23
How to Tune
RBS or Undo Contention
Add more Rollback Segments Change RBS segment size
CPU Contention
Tune SQL Distribute workload to off-peak hours Add more CPU
Memory Contention
Change SGA size Change PGA size Consider Multi-Threaded Server Config
06/14/2002 Hawkeye Technology, Inc. 24
How to Tune
IO Contention
Moving Data files to balance IO Moving Tables to different Tablespace to balance IO Adding/Removing Indexes Change table structures: going to Partioned tables Maybe consider Tuning SQL Review fragmentation including chained/migrated rows
Network Contention
Adding LAN/WAN resources Modifying Listener configuration Review application design
06/14/2002 Hawkeye Technology, Inc. 25
06/14/2002
26
06/14/2002
27
Contact Information
Ashok Kapur Hawkeye Technology, Inc. 561-236-4204 afkapur@hawkeyetechnology.com http://www.hawkeyetechnology.com
06/14/2002
29