You are on page 1of 53

Business Unit or Product Name

UNIX in Focus 2005


Oracle/AIX Performance and Tuning

Marc Bouzigues – IBM / Fabienne Lepetit – Oracle

Marc_Bouzigues@fr.ibm.com / Fabienne.Lepetit@oracle.com

1 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

2 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

3 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

4 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Oracle Server Architecture overview


Oracle Instance
RECO PMON SMON

Dispatcher System Global Area Program Global Area


Processes Buffer Cache Shared SQL Log Buffer Private SQL Area

Dedicated
Server

Shared DBWR Query LGWR Users


Servers Servers

D000

Oracle Database DB Files

5 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Oracle Server Architecture overview


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

6 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Oracle Server Architecture – focus on the SGA


 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)

System Global Area Program Global Area


Buffer Cache Shared Log Buffer Private SQL Area
SQL

7 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

8 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

AIX VMM Tuning for Filesystems (vmstat or vmo)

MINPERM

FILE SYSTEM
15-20%: JFS or JFS2 filesystems without DIO or CIO
cache
5%: RAW logical volumes
JFS or JFS2 with DIO or CIO
GPFS
SGASGA
+ PGA
MAXPERM, MAXCLIENT

40-60%: JFS or JFS2 filesystems without DIO or CIO PGM


<= 20%: Raw logical volumes
JFS or JFS2 with DIO or CIO GPFS
Kernel
To start, set slightly less than vmtune "numperm" value
Reduce until vmstat freed (fr) to scanned (sr) ratio is 4:1

9 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Virtual Memory Manager (VMM) Tuning – Page


Stealing Algorithm

FILE SYSTEM
cache
MINFREE

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

Set to MINFREE +(MAXPGAHEAD x # cpus) Kernel

10 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

AIX Memory Tools for use with Oracle


Shared Memory
Pinning shared memory – prevents paging out SGA
AIX Parameters
vmo –p –o v_pinshm = 1
Leave maxpin% at the default of 80% unless the SGA
exceeds 77% of real memory
Vmo –p –o maxpin%=[(total mem-SGA
size)*100/total mem] + 3
Oracle 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.


11 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC
Business Unit or Product Name

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

12 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

IO: asynchronous IO (AIO)


• 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)

13 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

14 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

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

Ability to Ability to implement DIO Ability to implement CIO


implement AIO
JFS OK OK N/A
JFS2 OK OK OK
Raw- OK N/A (DIO is a mount option N/A (CIO is a mount option
device for file-systems) for file-systems)

15 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

IO: AIO and Oracle parameter

 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 files
SETALL : enable both asynchronous and direct I/O on file system files
NONE : 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

16 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

IO: implementation advices

 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 Bench throughput over run duration – higher
option) tps indicates better performance.

 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

17 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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 iterative
Additional 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

18 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Database Layout continued


Stripe using Logical Volume (LV) or Physical Partition (PP) striping

 LV Striping
Oracle recommends stripe width of a multiple of
Db_block_size * db_file_multiblock_read_count
Usually around 1 MB
Valid LV Strip sizes:
AIX 5.2: 4k, 8k, 16k, 32k, 64k, 128k, 256k, 512k, 1 MB
AIX 5.3: AIX 5.2 Strip sizes + 2M, 4M, 16 MB, 32M, 64M,
128M
Use 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 Striping
Use minimum Physical Partition (PP) size (mklv -t, -s parms)
Spread AIX Logical Volume (LV) PPs across multiple hdisks
in VG
(mklv –e x)

19 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

20 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

21 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

CPU: Simultaneous Multi-Threading (SMT)


• 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.

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

22 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

CPU Affinity

• AIX provides a CPU affinity mechanism

• Bind process to a CPU by using the binprocessor command


Not recommanded for DB or Log writer

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

23 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

24 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

25 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

26 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

27 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

DSS/BI, OLTP implementation specificities and


advices
 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

28 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

29 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

DBA System administrator

OS monitoring

Oracle monitoring

log of
change design/parameters changes
s
impact ?

30 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

31 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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)

32 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Monitoring & tuning methodology


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

SYSTEM ORACLE
CPU IO
MEMORY init.ora/spfile
vmstat (us, sys, id, r) vmstat (wa)
vmstat (pi, po) alert.log
sar –P ALL iostat, filemon
nmon bdump,cdump,udump
nmon nmon
pagination? statspack
CPU bound? accesses well
memory allocated to spread? hot data analyzed?
runqueue? Oracle? strategy of analyze?
spots?
workload ? other applications memory allocated to
database layout?
parallelization of running? instances (SGA, PGA)
filesystem mount
workload? other Oracle tkprof (parsing, explain
options?
instances? plans, bind variables…)
AIO?
( and check ulimits + AIXTHREAD_SCOPE=S...) OEM (locks etc…)

NETWORK
netstat

33 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

34 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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.
See
 How to setup and use statspack $ORACLE_HOME/rdbms/admin/spdoc.txt !!
 setup :
SQL> connect /as sysdba
SQL> @?/rdbms/admin/spcreate
(interactive script, informations like perfstat username, paswd, tablespace have to be entered)
 snapshot creation :
SQL> connect perfstat/perfstat
SQL> execute statspack.snap
 report generation :
SQL> connect perfstat/perfstat
SQL> @?/rdbms/admin/spreport #(two snapshot Ids have to be entered)

35 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Statspack
 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 users simulated

snapshot
period analyzed in
statspack report
time
For example, during an OLTP benchmark, take snapshots
during steady phase…

 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…

36 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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.38
Parse CPU to Parse Elapsd %: 98.10 % Non-Parse CPU: 99.81

37 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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 DB
background 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 DB
this 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 DB
sections ordered according IO per tablespace, alphabetically (name of the tbs and
name of the file)

38 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Statspack report: advisors


Statspack 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 Estimated


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

39 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Statspack report: sections you care about


 Undo Segment Stats
statistics about undo activity, snapshot too old etc…

 Latch Activity for DB


this 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 Parameters
this section lists the parameters which are not set by default

40 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

41 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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 = true
timed_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 tracefile


tkprof trace_all.trc trace.out explain=system/manager
sort=execpu

42 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Tkprof
select PEPECODSIT ,PEPENUMPER ,PEPEGESPHY ,PEPEGESMOR ,PEPEENSOI1 bind variable
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 0
Execute 117446 5.27 5.09 0 0 0 0
Fetch 117446 10.72 146.62 18408 469784 0 117446
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 252054 19.33 155.59 18409 469784 1 117446

Optimizer goal: CHOOSE physical reads logical reads


Parsing user id: 70
“execute to parse” ratio
Rows Row Source Operation
------- ---------------------------------------------------
4 TABLE ACCESS BY INDEX ROWID PEPERSONCL
8 INDEX UNIQUE SCAN (object id 87722) explain plan

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows


------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1137676 280.06 289.29 51 0 51 0
Execute 2353634 310.08 647.54 43085 558838 3138287 358930
Fetch 3870697 870.12 10105.13 1281338 16842945 55962 3710730
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 7362007 1460.26 11041.96 1324474 17401783 3194300 4069660

43 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

44 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Most important Oracle parameters

• db_cache_size / db_block_buffers

• shared_pool_size Size of the SGA

• log_buffer

• pga_aggregate_target / workarea_size_policy
Use pga_aggregate_target instead of
• sort_area_size sort_area_size.

• log_checkpoint_interval / log_checkpoint_timeout Allow to manage the frequence of the


checkpointing.
• filesystemio_options /disk_asynch_io Allow to use AIO

• undo_management / undo_tablespace Use automatic undo_management instead


of rollback segments.
• optimizer_mode

45 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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

46 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

Conclusion

• 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!!!


oraclibm@fr.ibm.com

47 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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!

48 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

International Competency Centers


Tokyo, Japan
AP IBM Oracle Support
Center
Proof of concept, sizing and
benchmarks

San Mateo,
California
IBM Oracle
International
Competency Center
Sizing methodology
Montpellier, France
and tool development,
benchmark EMEA Oracle IBM Support Center
coordination and Proof of concept, sizing,
benchmarks and education
education
All hardware and software brands

49 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

A joint
EMEA Oracle/IBM Joint Solutions Center team:
 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. …dedicated to your
Six years of experience customer projects.

50 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

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


Information Sys. /
Information Tech.
% Downloads per region
1% # download per role Sales
1% 2%
EMEA Other
5% 0%
AMERICAS 6% 5% 27%
ASIA PACIFIC 9% Business Development
25%
Other
JAPAN 10% Project Management

68% 17% 24%


Finance / Accounting

Operations

Customer Service /
Support
51 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC
Business Unit or Product Name

Oracle/IBM at UNIX in Focus 2005


An Oracle Cursus to build your Oracle/IBM projects.
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 team


Meet the Oracle/IBM team and discuss projects

52 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC


Business Unit or Product Name

EMEA Oracle/IBM Joint Solutions Center

C/O Compagnie IBM France


Rue de la Vieille Poste
34006 Montpellier Cedex - FRANCE

oraclibm@fr.ibm.com
Tel : +33 4 67 34 67 49

53 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC

You might also like