Aix Tun Oracle 2

53
1 Business Unit or Product Name IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC [email protected] / [email protected] UNIX in Focus 2005 Oracle/AIX Performance and Tuning Marc Bouzigues – IBM / Fabienne Lepetit – Oracle

Transcript of Aix Tun Oracle 2

Page 1: Aix Tun Oracle 2

1

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

[email protected] / [email protected]

UNIX in Focus 2005Oracle/AIX Performance and Tuning

Marc Bouzigues – IBM / Fabienne Lepetit – Oracle

Page 2: Aix Tun Oracle 2

2

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Learning objectives

Configure AIX to support Oracle with the best performance

Setup Oracle to take advantage of AIX features

Understand the joint effort to tune both Oracle and AIX and how they interact

Page 3: Aix Tun Oracle 2

3

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 4: Aix Tun Oracle 2

4

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 5: Aix Tun Oracle 2

5

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Oracle Server Architecture overview

SMONRECO PMON

DBWR QueryServers

System Global AreaBuffer Cache Log BufferShared SQL

LGWR

DB Files

Oracle InstanceOracle Instance

SharedServers

DedicatedServer

DispatcherProcesses

Program Global AreaPrivate SQL Area

Users

D000

Oracle DatabaseOracle Database

Page 6: Aix Tun Oracle 2

6

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

The components of an Oracle server are : database = set of datafiles (data + redologs + control files) instance = memory structures allocated at startup + background processes (automatically created at startup) associated to a database

Database files

datafiles – contains data (tables, indexes…) redologs – contains redo entries control files – record the physical structure of the database

Oracle memory structures = System Global Area (SGA) + Process Global Area (PGA)

SGA shared memory region that contains data and control information for one Oracle instance allocated at instance startup and deallocated at instance shutdown each instance has its own SGA

PGA memory buffer that contains data and control information for a server process PGA is created by Oracle when a server process is started contains private SQL area

Oracle Server Architecture overview

Page 7: Aix Tun Oracle 2

7

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

The three main components of the SGA are :

• buffer cache:- store the most recently used blocks of data- improves performance by reducing disk I/O activity

• shared pool contains : - shared SQL area (parse tree and execution plan for SQL statements) - dictionnary cache- library cache

• redolog buffer stores redo entries (log of changes made to the database) written to the online redo log (used during database recovery)

Oracle Server Architecture – focus on the SGA

System Global AreaBuffer Cache Log BufferShared

SQL

Program Global AreaPrivate SQL Area

Page 8: Aix Tun Oracle 2

8

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 9: Aix Tun Oracle 2

9

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

AIX VMM Tuning for Filesystems (vmstat or vmo)

MINPERM

15-20%: JFS or JFS2 filesystems without DIO or CIO 5%: RAW logical volumes

JFS or JFS2 with DIO or CIO GPFS

MAXPERM, MAXCLIENT

40-60%: JFS or JFS2 filesystems without DIO or CIO<= 20%: Raw logical volumes JFS or JFS2 with DIO or CIO GPFS

To start, set slightly less than vmtune "numperm" valueReduce until vmstat freed (fr) to scanned (sr) ratio is 4:1

FILE SYSTEM cache

PGM

Kernel

SGASGA + PGA

Page 10: Aix Tun Oracle 2

10

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Virtual Memory Manager (VMM) Tuning – Page Stealing Algorithm

MINFREE

120 x # cpus Increase if page stealing activity vmstat "po" column or vmstat -s "free frame waits“

MAXFREE Set to MINFREE +(MAXPGAHEAD x # cpus)

FILE SYSTEM cache

PGM

Kernel

SGASGA + PGA

Page 11: Aix Tun Oracle 2

11

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

AIX Memory Tools for use with OracleShared Memory

Pinning shared memory – prevents paging out SGAAIX Parameters

vmo –p –o v_pinshm = 1Leave maxpin% at the default of 80% unless the SGA

exceeds 77% of real memoryVmo –p –o maxpin%=[(total mem-SGA

size)*100/total mem] + 3Oracle Parameters

LOCK_SGA = TRUE

Large Page Support

vmo –r –o lgpg_size = 16777216 –o lgpg_regions=(SGA size / 16 MB)

Allow Oracle to use Large Pages

chuser capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle

Large pages can achieve 10 % greater performance.

Page 12: Aix Tun Oracle 2

12

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 13: Aix Tun Oracle 2

13

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

• Allows multiple requests to be sent without to have to wait until the disk subsystem has completed the physical IO.

• Utilization of asynchronous IO is strongly advised whatever the type of file-system and mount option implemented (JFS, JFS2, CIO, DIO).

Attributes check AIO configuration with : lsattr –El aio0 a rule of thumb : maxservers should be = (10 * <# of disk accessed concurrently>) / # cpu but only tests allow to set correctly minservers and maxservers

Monitoring in Oracle’s alert.log file, if maxservers set to low : “Warning: lio_listio returned EAGAIN” “Performance degradation may be seen” #aio servers used can be monitored via nmon (option A) or pstat (pstat –a | grep aios)

IO: asynchronous IO (AIO)

Page 14: Aix Tun Oracle 2

14

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

IO: mount options (DIO, CIO)Direct IO (DIO) – introduced in AIX 4.3.

• Data is transfered directly from the disk to the application buffer, bypassing the file buffer cache hence avoiding double caching (filesystem cache + Oracle SGA). • Emulates a raw-device implementation.

To mount a filesystem in DIO, use the filesystem mount option “–o dio” $ mount –o dio /data

Check with ‘mount’ command

Concurrent IO (CIO) – introduced in JFS2 in AIX 5.2 ML1

• Inode lock acquired in read-shared mode for read and writes accesses. • Implicit use of DIO. • Performance achieved using CIO is comparable to raw-devices.

To mount a filesystem in CIO, use the filesystem mount option “–o cio” $ mount –o cio /data

Check with ‘mount’ command

Page 15: Aix Tun Oracle 2

15

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Ability to implement AIO, DIO, CIO on JFS, JFS2, raw-device

Ability to implement AIO

Ability to implement DIO Ability to implement CIO

JFS OK OK N/A

JFS2 OK OK OK

Raw-device

OK N/A (DIO is a mount option for file-systems)

N/A (CIO is a mount option for file-systems)

IO: AIO and mount options on JFS, JFS2, raw-device

Page 16: Aix Tun Oracle 2

16

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

How to set filesystemio_options parameter

Possible values

ASYNCH : enable asynchronous I/O on file system files (default)DIRECTIO : enable direct I/O on file system filesSETALL : enable both asynchronous and direct I/O on file system filesNONE : disable both asynchronous and direct I/O on file system files

Advice : set this parameter to ‘asynch’ - except when filesystem is mounted with DIO, in this case, set it to ‘setall’…

Note : set the disk_asynch_io parameter to ‘true’ as well

IO: AIO and Oracle parameter

Page 17: Aix Tun Oracle 2

17

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

to get the best performance use JFS2 + CIO (~ equivalent to performance on raw-device)

Oracle files :• database datafiles should be stored on JFS2 + CIO • redologs should be stored on raw-device or JFS2 + CIO (block size 512 bytes) • controlfiles should be stored on JFS2 (without DIO or CIO)• binaries should be stored on JFS2 (no mount option)

if using JFS instead of JFS2, CIO is not available but DIO is – use it.

do not allocate a JFS (+DIO) with the large file enabled attribute

do not allocate compressed JFS

IO: implementation advices

Bench throughput over run duration – higher tps indicates better performance.

Page 18: Aix Tun Oracle 2

18

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

IO: how to lay out the database

Stripe and mirror everything (SAME) approach:Goal is to balance I/O activity across all disks, loops, adapters, etc...

Avoid/Eliminate I/O hotspots

Manual file-by-file data placement is time consuming, resource intensive and iterativeAdditional advices to implement SAME :

• apply the SAME strategy to data, indexes • separate redologs (+archivelogs) and if possible, undo

Use RAID-5 or RAID-10 to create striped LUNs (hdisks)

Try to minimize the number of LUNs

Create AIX Volume Group(s) (VG) with LUNs from multiple arrays, striping on the front end as well for maximum distribution

Page 19: Aix Tun Oracle 2

19

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Database Layout continuedStripe using Logical Volume (LV) or Physical Partition (PP) striping

LV StripingOracle recommends stripe width of a multiple of

Db_block_size * db_file_multiblock_read_countUsually around 1 MB

Valid LV Strip sizes:AIX 5.2: 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1 MBAIX 5.3: AIX 5.2 Strip sizes + 2M, 4M, 16 MB, 32M, 64M,

128MUse AIX Logical Volume 0 offset (9i Release 2 or later)

mklv –T 0 (requires big Volume Groups)e-fix (APAR IY36656) and an Oracle patch (bug 2620053)

PP StripingUse minimum Physical Partition (PP) size (mklv -t, -s parms)

Spread AIX Logical Volume (LV) PPs across multiple hdisks in VG

(mklv –e x)

Page 20: Aix Tun Oracle 2

20

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Oracle 10g - Automatic Storage Management (ASM)

• New feature of Oracle DB 10g with no additional cost

• First and only database file system

• Storage management for Oracle datafiles

• Alternative to conventional file-system and LVM functions

• Simplify the database storage administration : on all platforms (Unix, Linux, Windows, zOS) the management of Oracle datafiles is the same for the DBA.

• ASM manages pools of raw disk

• Oracle datafiles are automatically striped across all volumes in the applicable ASM pool - I/O is spread evenly across all available disk drives to prevent hot spots and maximize performance

• Online add/drop of disk devices with automatic online redistribution of data

• For single or RAC databases

• Co-existence of ASM and non-ASM files (help migration to ASM)

• Can maintain redundant copies of data

Page 21: Aix Tun Oracle 2

21

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 22: Aix Tun Oracle 2

22

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

• new feature available on POWER5 system running AIX 5L version 5.3

• allows 2 instruction path to share access to ther POWER5 execution units on every clock cycle

• instruction path = “virtual processor” = logical POWER5 processor (i.e. a server with 4 physical processors will have 8 logical processors with SMT enabled)

• SMT allows to use resources that would otherwise usually be unexploited

• No source code modification needed to use SMT

• Can achieve significant throughput gains – in the range of 25-40% greater performance.

CPU: Simultaneous Multi-Threading (SMT)

How to control SMT: smtcl [–m on | off]

“-w on” enables the SMT mode, “-w off” disables it

“-w boot” makes SMT change effective on reboot

“-w now” makes SMT change effective immediately but not persistent across reboots

Page 23: Aix Tun Oracle 2

23

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

CPU Affinity

• AIX provides a CPU affinity mechanism

• Bind process to a CPU by using the binprocessor commandNot recommanded for DB or Log writer

• Ressource set (lsrset, mkrset, rmrset) since AIX 5.2

Page 24: Aix Tun Oracle 2

24

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 25: Aix Tun Oracle 2

25

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

DLPAR

• DLPAR extends the capability of LPAR by providing dynamic partition creation

• Oracle8i and Oracle9i are not DLPAR aware (no dynamic adaptation to system changes)

• Oracle10g is capable of detecting changes on numbers of processors dynamicaly added (cpu_count parameter)

• Dedicated partitions are recommanded for strategic workload

Page 26: Aix Tun Oracle 2

26

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Micro-Partitioning virtualization

• Micro-Partitioning advanced virtualization feature providing micro partition of 1/10th of the physical CPU

• Oracle sees only virtual processors (x2 if SMT)Can be a performance problem if less physical CPU than virtual CPU(EG 10 vCPU vs 1 pCPU)

• For system with massive number of partitions use PLM for giving priority to the Oracle partition

• Sharing adaptor or physical disk is not recommanded for intensive I/O workload

• Virtual Ethernet is recommanded

Page 27: Aix Tun Oracle 2

27

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 28: Aix Tun Oracle 2

28

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

SMT (AIX)

• use as much as possible

• workload with many processes maximize their perfomances with SMT (e.g. OLTP, DSS with PQO…)

Large pages (AIX + Oracle setup)

• use as much as possible

• take care to the memory consumption (i.e. if OLTP workload, each process will allocate the size of the granule which is 16M minimum)

Shared servers (Oracle setup)

• Oracle offers an alternative to dedicated servers (1 user / 1 connection to the DB) with the shared servers: n users / 1 connection to the DB.

• Utilization of shared servers allows to consume less memory and CPU

• Can be use in case of resource contention with an OLTP workload

DSS/BI, OLTP implementation specificities and advices

Page 29: Aix Tun Oracle 2

29

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 30: Aix Tun Oracle 2

30

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Monitoring & tuning methodology tuning is an iterative process a minimun of changes should be performed at each iteration tuning is a joint effort between the system administrator and the DBA don’t hesitate to keep a log to track changes and the impact of these changes

OS monitoring

Oracle monitoring

design/parameters changes

DBA System administrator

impact ?

log of changes

Page 31: Aix Tun Oracle 2

31

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Main monitoring tools for the system

vmstat – useful for obtaining an overall picture of CPU, paging, and memory usage

lvmstat – useful to get logical volume I/O statistics

iostat – allows to get statistics on disk activity (and also on terminals, CPU, adapters)

nmon – complete tool which gives information on all the components of the system

filemon – uses the trace facility to report on the I/O activity of physical volumes, logical volumes, individual files, and the Virtual Memory Manager

xmperf – allows to define monitoring environments to supervise the performance of the local and remote systems

netstat – allows to monitor network activity

Page 32: Aix Tun Oracle 2

32

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Monitoring tools for Oracle Statspack is a standard tool which allow the collection, automation, storage and viewing of performance data. Replaces utlbstat/utlestat.

Tkprof allows to take and exploit SQL traces, gives explain plans etc…

Oracle Enterprise Manager is a convivial online graphical tool for administration and performance monitoring and analysis.

Grid Control (10g) integrates OEM and provide a centralized management of databases.

Toad, SpotLight … graphical tools (Quest)

Page 33: Aix Tun Oracle 2

33

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

IOvmstat (wa)iostat, filemonnmonaccesses well spread? hot spots?database layout? filesystem mount options? AIO?

Monitoring & tuning methodology Performance issue?

Monitor the system, diagnose the problem.Tools to use, questions to ask…

MEMORYvmstat (pi, po)nmonpagination?memory allocated to Oracle?other applications running? other Oracle instances?

init.ora/spfilealert.logbdump,cdump,udump statspackdata analyzed? strategy of analyze?memory allocated to instances (SGA, PGA)tkprof (parsing, explain plans, bind variables…)OEM (locks etc…)( and check ulimits + AIXTHREAD_SCOPE=S...)

CPUvmstat (us, sys, id, r)sar –P ALLnmonCPU bound?runqueue? workload ?parallelization of workload?

SYSTEM ORACLE

NETWORKnetstat

Page 34: Aix Tun Oracle 2

34

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 35: Aix Tun Oracle 2

35

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack• set of SQL, PL/SQL and SQL*Plus scripts • allows the collection, automation, storage and viewing of performance data

Statspack snapshot : set of statistics gathered at a single time and identified by a unique id.

Reports are generated between 2 snapshots. To get a report, two snapshot ids must be provided. The report produced calculates the activity on the instance between the two snapshot specified.

In 10g AWR (Automatic Workload Repository) functions in a similarly. It automatically collects and maintains performance statistics.  Manual AWR snapshots can also be taken via dbms_workload_repository.create_snapshot(). AWR reports can be generated by running the awrrpt.sql.

How to setup and use statspack setup :

SQL> connect /as sysdbaSQL> @?/rdbms/admin/spcreate(interactive script, informations like perfstat username, paswd, tablespace have to be entered)

snapshot creation :SQL> connect perfstat/perfstatSQL> execute statspack.snap

report generation :SQL> connect perfstat/perfstatSQL> @?/rdbms/admin/spreport #(two snapshot Ids have to be entered)

See $ORACLE_HOME/rdbms/admin/spdoc.txt !!

Page 36: Aix Tun Oracle 2

36

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack

Generate reports to see the impact of tuning and compare behavior of the database according to changes in the configuration

It is possible to change the level of statspack to get more detailed information : execute statspack.snap (i_snap_level=>10);

Use Metalink and/or the Oracle documentation to get the definition of events, statistics etc…

Take snapshots regularly during optimization campaign

No shutdown must be done between two snapshots

For the generation of statspack report, choose snapshot IDs which are representative of the activity..

# of

use

rs s

imul

ated

time

snapshot period analyzed in statspack report

For example, during an OLTP benchmark, take snapshots during steady phase…

Page 37: Aix Tun Oracle 2

37

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack report: header & hit ratios

STATSPACK report for

DB Name DB Id Instance Inst Num Release Cluster Host------------ ----------- ------------ -------- ----------- ------- ------------WABC 3922258313 ORC4 4 9.2.0.4.0 YES x445r4

Snap Id Snap Time Sessions Curs/Sess Comment ------- ------------------ -------- --------- -------------------Begin Snap: 3602 11-Dec-03 13:15:00 17 1.2 START-12-LEVEL-7 End Snap: 3756 11-Dec-03 13:39:23 25 96.2 STOP-12-LEVEL-7 Elapsed: 24.38 (mins)

Instance Efficiency Percentages (Target 100%)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Buffer Nowait %: 99.89 Redo NoWait %: 100.00 Buffer Hit %: 100.00 In-memory Sort %: 100.00 Library Hit %: 100.00 Soft Parse %: 100.00 Execute to Parse %: 99.38 Latch Hit %: 95.38Parse CPU to Parse Elapsd %: 98.10 % Non-Parse CPU: 99.81

Page 38: Aix Tun Oracle 2

38

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack report: sections you care about Top 5 Timed Events

list of events to focus on – this ‘top 5’ section will be used to lead the performance investigation

Wait Events for DB foreground events – events associated to sessions or client process waiting a resource

Background Wait Events for DBbackground wait events – events associated to background process and also ‘non-

background process’ (e.g.: parallel query slave). Allow to orientate the tuning process on a checkpointing issue, IO bound situation… SQL ordered by Gets for DB/...

sections ordered according different criterias (SQL ordered by Buffer Gets, SQL ordered by Physical Reads, SQL ordered by Executions, SQL ordered by Parse Calls…). Useful to detect a problem of parsing, IO, CPU…

Instance Activity Stats for DBthis section gives an overall view of the statistics of the DB. See the Oracle Reference Guide which give the list and description of statistics

Tablespace IO Stats for DBsections ordered according IO per tablespace, alphabetically (name of the tbs and

name of the file)

Page 39: Aix Tun Oracle 2

39

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack report: advisorsStatspack report gives an estimation of the impact of changes of the size of the buffer cache, pga, shared pool (cf buffer pool advisory, pga memory advisory, shared pool advisory)

Buffer Pool Advisory for DB: WABC Instance: ORC4 End Snap: 3756-> Only rows with estimated physical reads >0 are displayed-> ordered by Block Size, Buffers For Estimate

Size for Size Buffers for Est Physical EstimatedP Estimate (M) Factr Estimate Read Factor Physical Reads--- ------------ ----- ---------------- ------------- ------------------D 80 .1 18,590 2.08 29,752D 160 .2 37,180 1.05 14,993D 240 .3 55,770 1.03 14,716D 320 .4 74,360 1.00 14,293D 400 .5 92,950 1.00 14,276D 480 .6 111,540 1.00 14,275D 560 .7 130,130 1.00 14,275D 640 .8 148,720 1.00 14,273D 720 .9 167,310 1.00 14,273D 800 1.0 185,900 1.00 14,273D 880 1.1 204,490 1.00 14,273D 960 1.2 223,080 1.00 14,273D 1,040 1.3 241,670 1.00 14,273

Page 40: Aix Tun Oracle 2

40

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Statspack report: sections you care about

Undo Segment Statsstatistics about undo activity, snapshot too old etc…

Latch Activity for DBthis section help the problem determination on latches contention(e.g. : ‘cache buffer chains’ means a hot block issue, ‘shared pool’ indicates an undersized shared pool etc…)

Top 5 Logical Reads per Segment / Top 5 Physical Reads per Segment

these sections are not included in the report by default but only if the snapshot level is set to 7 or more. Useful section to identify hot spots.

SGA Memory Summary this section gives the size of the different structures of the SGA

init.ora Parametersthis section lists the parameters which are not set by default

Page 41: Aix Tun Oracle 2

41

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 42: Aix Tun Oracle 2

42

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Tkprof

Tkprof is a diagnostic tool which processes SQL trace output file and translates them into readable output files. It provides a summary of user-level statements and recursive SQL calls and generate execution plans.

How to use tkprof

set the following init.ora parameters sql_trace = truetimed_statistics = true

launch the workload

get the trace files generated in udump directory/oracle/admin/udump/ $cat *.trc > trace_all.trc

use tkprof to format the tracefiletkprof trace_all.trc trace.out explain=system/manager sort=execpu

Page 43: Aix Tun Oracle 2

43

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Tkprofselect PEPECODSIT ,PEPENUMPER ,PEPEGESPHY ,PEPEGESMOR ,PEPEENSOI1 into :b1,:b2,:b3,:b4,:b5 From PEPERSON where PEPEIDFSYS=:b8

call count cpu elapsed disk query current rows------- ------ -------- ---------- ---------- ---------- ---------- ----------Parse 17162 3.34 3.88 1 0 1 0Execute 117446 5.27 5.09 0 0 0 0Fetch 117446 10.72 146.62 18408 469784 0 117446------- ------ -------- ---------- ---------- ---------- ---------- ----------total 252054 19.33 155.59 18409 469784 1 117446

Optimizer goal: CHOOSEParsing user id: 70

Rows Row Source Operation------- --------------------------------------------------- 4 TABLE ACCESS BY INDEX ROWID PEPERSONCL 8 INDEX UNIQUE SCAN (object id 87722)

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows------- ------ -------- ---------- ---------- ---------- ---------- ----------Parse 1137676 280.06 289.29 51 0 51 0Execute 2353634 310.08 647.54 43085 558838 3138287 358930Fetch 3870697 870.12 10105.13 1281338 16842945 55962 3710730------- ------ -------- ---------- ---------- ---------- ---------- ----------total 7362007 1460.26 11041.96 1324474 17401783 3194300 4069660

“execute to parse” ratio

explain plan

physical reads logical reads

bind variable

Page 44: Aix Tun Oracle 2

44

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 45: Aix Tun Oracle 2

45

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

• db_cache_size / db_block_buffers

• shared_pool_size

• log_buffer

• pga_aggregate_target / workarea_size_policy

• sort_area_size

• log_checkpoint_interval / log_checkpoint_timeout

• filesystemio_options /disk_asynch_io

• undo_management / undo_tablespace

• optimizer_mode

Most important Oracle parameters

Size of the SGA

Allow to manage the frequence of the checkpointing.

Use pga_aggregate_target instead of sort_area_size.

Allow to use AIO

Use automatic undo_management instead of rollback segments.

Page 46: Aix Tun Oracle 2

46

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Agenda

Oracle server architecture overview

Memory

IO

CPU

DLPAR & Micro-partitioning

DSS/BI, OLTP: implementation specificities and advices

Monitoring & tuning methodology

Focus on two Oracle tools: Statspack and tkprof

Most important Oracle parameters

Conclusion

Page 47: Aix Tun Oracle 2

47

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

• Implement and get the best of Oracle on AIX is the result of a joint effort between the OS administrator and the Oracle DBA.

• The tuning process is made of a first guess parameter setting and then, iterations to change progressively the configuration to get the best results…

• As much as possible, use JFS2 and Concurrent IO mount option

• Always use Asynchronous IO servers

• Set AIXTHREAD_SCOPE to S

• Implement SMT if available on your system

• Use Large Pages if enough memory available

• … and feel free to contact us for additional questions!!! [email protected]

Conclusion

Page 48: Aix Tun Oracle 2

48

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Reference material

Thanks to the authors of the following documents

• Improving Database Performance with AIX Concurrent I/O – S. Kashyap, B. Olszewski, R Hendrickson

• Performance Management Guide – AIX5L version 5.3 documentation

• Oracle 9i & 10g on IBM AIX5L : Tips & Considerations – IBM/Oracle ICC

• Oracle Architecture and Performance Tuning on AIX – R. Ballough

Many thanks to Dennis Massanari, Michel Rivière and Majidkhan Remtoula for their help!

Page 49: Aix Tun Oracle 2

49

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

International Competency Centers

Montpellier, FranceEMEA Oracle IBM Support CenterProof of concept, sizing, benchmarks and educationAll hardware and software brands

Tokyo, JapanAP IBM Oracle Support CenterProof of concept, sizing and benchmarks

San Mateo, CaliforniaIBM Oracle International Competency CenterSizing methodology and tool development, benchmark coordination and education

Page 50: Aix Tun Oracle 2

50

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

A joint team:

…dedicated to your customer projects.

EMEA Oracle/IBM Joint Solutions Center

Six years of experience

How the JSC can help Perform benchmarks Demonstrations and customer briefings Workshops and educational events Architecture validation and sizing for Oracle solutions on IBM The JSC is located in the PSSC, the IBM training, benchmarking and support center in

Montpellier. The JSC is permanently staffed by Oracle as well as IBM. Its mission is to assist the Oracle

and IBM sales divisions. If you have an issue related to IBM and Oracle, the center might be able to help you. Don’t hesitate to contact the JSC!

Need to test The JSC can provide you with IBM hardware (pSeries, zSeries, xSeries, iSeries cluster) for

tests when performance is not the main issue.

Need to validate an architecture Make sure your solution will work and its components are compatible with each other.

Need to benchmark Need to run a benchmark or proof of concept? The JSC will be your interface to the IBM

benchmarking center in Montpellier and ensure that the test or prototype will run under optimal conditions.

Want to demonstrate Use zSeries, pSeries, xSeries, iSeries and Oracle products to show the latest technology

level of our products to your customers.

Page 51: Aix Tun Oracle 2

51

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

JSC Newsflash : a JSC information for the fields Produced quarterly Last issue ( Januray 2005 ) Audience IBM/Oracle/Partner fields Main contents :

Product information from Oracle and IBM

Technical and Sales oriented Statistics ( 3 month period )

Number of dowloads : 1079

(Oracle employees = 275, External = 368, Anonymous = 436)

Next issue : April 2005 Special Unix in Focus

# download per role

27%

24%17%

10%

9%6% 5%

2%

0%0%0%0%0%

Information Sys. /Information Tech.

Sales

Other

Business Development

Project Management

Finance / Accounting

Operations

Customer Service /Support

% Downloads per region

68%

25%

5%

1%

1%

EMEAAMERICAS

ASIA PACIFICOther

JAPAN

Page 52: Aix Tun Oracle 2

52

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

Oracle Sessions (Room Joffre C/D)

Oracle10g overview – Paul Bramy, Frederic Michiara(Tuesday – 15:50) (Wednesday – 14:20)

Oracle/AIX performance and Tuning - Fabienne Lepetit,/Marc Bouzigues(Tuesday – 17:00) (Wednesday – 15:30)

Implementing Oracle EBS 11i on AIX/Linux - Paul Bramy (Wednesday -9:40) (Thursday 15:30)

Lab (Room Rondelet)

10gRAC technical lab : Implementing 10gRAC-ASM/GPFS – Michel Passet, Thierry Plumeau, Frederic Michiara

(Tuesday – 17:00), (Wednesday -12:20)

3-day Booth - JSC teamMeet the Oracle/IBM team and discuss projects

Oracle/IBM at UNIX in Focus 2005An Oracle Cursus to build your Oracle/IBM projects.

Page 53: Aix Tun Oracle 2

53

Business Unit or Product Name

IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

EMEA Oracle/IBM Joint Solutions Center

C/O Compagnie IBM FranceRue de la Vieille Poste34006 Montpellier Cedex - FRANCE

[email protected] : +33 4 67 34 67 49