oracle tuning ashok kapur hawkeye technology, inc

29
Oracle Tuning Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.

Upload: raymond-ferguson

Post on 16-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

Oracle TuningOracle Tuning

Ashok Kapur

Hawkeye Technology, Inc.

Page 2: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 2

AgendaAgenda

Oracle Database StructureOracle Database AccessTuning ConsiderationsOracle Database TuningOracle Tuning Tools

Page 3: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 3

Oracle Database StructureOracle Database Structure

Page 4: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 4

Logical StructureLogical Structure

Page 5: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 5

Logical StructureLogical Structure

Tablespaces SYSTEM RBS or UNDO TEMP User Data and Indices

Schema Tables and Indices Segments (Data, Index, RBS, Temp) Extents

Page 6: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 6

Physical StructurePhysical Structure

Page 7: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 7

Physical StructurePhysical Structure

Database– Data– Parameter Files

Instance– Processes– Memory Structures

Page 8: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 8

Physical DatabasePhysical Database

Data FilesRedo Log FilesControl FilesParameter FileArchive Log Files

Page 9: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 9

Parameter FileParameter File

Read at instance startupSpecifies values for various system wide

parametersSize parameters

– SGA, db buffer, sort area size, …

Tuning parameters…

Page 10: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 10

Database InstanceDatabase 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)

Page 11: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 11

Memory StructureMemory Structure

SGA– Database buffer cache– Redo log buffer– Shared Pool

Shared SQL Area PL/SQL Procedures and Packages Dictionary Cache

– … PGA

– Heap– Sort Area

Page 12: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 12

Oracle Database AccessOracle Database Access

Page 13: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 13

Database ConnectionDatabase Connection

Sql*NetListenerServer Process

Page 14: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 14

Data AccessData Access

Access data via SQL or PL/SQL Processing of SQL in three phases:

– Parse– Execute– Fetch

Execution plan depends on the optimizer mode:– Role based– Cost based

Page 15: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 15

Tuning ConsiderationsTuning Considerations

Page 16: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 16

Tuning ConsiderationsTuning Considerations

OLTP vs DSSResponse Time vs ThroughputResponse Time = Service Time + Wait

TimeTuning Tradeoffs

– Affect of tuning on rest of the system

Frequency of use

Page 17: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 17

Special Tuning Special Tuning ConsiderationsConsiderations

Oracle Parallel ServerMulti-Threaded ServerReplicationDistributed Queries

Page 18: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 18

Consider All OptionsConsider All Options

Business RulesDatabase Design and Application DesignSystem ArchitectureNetwork: LAN and WANSystem: Hardware and Operating SystemApplication TuningDatabase Tuning

Page 19: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 19

Oracle Database TuningOracle Database Tuning

Page 20: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 20

Proactive vs ReactiveProactive 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– …

Reactive Tuning React to a trouble report or performance problem

Page 21: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 21

Tuning StepsTuning Steps

Identify and define the problemSet clear and measurable tuning goalsTake initial performance measurementsIteratively apply tuning changes and

measure performance on TEST systemDocument ALL tuning changesAfter goal is reached, apply changes to

PRODUCTION.

Page 22: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 22

What Is Tunable in OracleWhat Is Tunable in Oracle

File placement DB Block Size SGA Size Listener setup Init Parameters Table/tablespace mapping Table/Index parameters RBS/Undo parameters Other Features: OPS, Replication, MTS, …

Page 23: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 23

How to TuneHow 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

Page 24: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 24

How to TuneHow 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

Page 25: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 25

How to TuneHow 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

Page 26: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 26

Oracle Tuning ToolsOracle Tuning Tools

Page 27: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 27

Oracle Tuning ToolsOracle Tuning ToolsExplain PlanSQL Trace

Session Level System Level

Dynamic Performance Views

V$SYSSTAT V$SESSSTAT V$WAITSTAT

V$SGASTAT V$ROLLSTAT V$LATCH

V$LIBRARYCACHE V$SORT_USAGE V$SQLAREA

Page 28: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 28

Oracle Tuning ToolsOracle Tuning Tools

UTLBSTAT and UTLESTATSTATSPACKOracle Enterprise ManagerPerformance Tool Vendors

– Quest Software– Precise– ….

Page 29: Oracle Tuning Ashok Kapur Hawkeye Technology, Inc

06/14/2002 Hawkeye Technology, Inc. 29

Contact InformationContact Information

Ashok Kapur

Hawkeye Technology, Inc.

561-236-4204

[email protected]

http://www.hawkeyetechnology.com