Professional Documents
Culture Documents
Marc_Bouzigues@fr.ibm.com / Fabienne.Lepetit@oracle.com
Learning objectives
Understand the joint effort to tune both Oracle and AIX and how they interact
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
Dedicated
Server
D000
Database files
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
• buffer cache:
- store the most recently used blocks of data
- improves performance by reducing disk I/O activity
• redolog buffer
stores redo entries (log of changes made to the database) written to the
online redo log (used during database recovery)
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
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
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
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
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)
• 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
• 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
Possible values
Advice : set this parameter to ‘asynch’ - except when filesystem is mounted with DIO, in
this case, set it to ‘setall’…
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)
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
CPU Affinity
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
DLPAR
• Oracle8i and Oracle9i are not DLPAR aware (no dynamic adaptation
to system changes)
Micro-Partitioning virtualization
• For system with massive number of partitions use PLM for giving
priority to the Oracle partition
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
OS monitoring
Oracle monitoring
log of
change design/parameters changes
s
impact ?
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
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
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)
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…
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
init.ora Parameters
this section lists the parameters which are not set by default
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
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.
Tkprof
select PEPECODSIT ,PEPENUMPER ,PEPEGESPHY ,PEPEGESMOR ,PEPEENSOI1 bind variable
into :b1,:b2,:b3,:b4,:b5 From PEPERSON where PEPEIDFSYS=:b8
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
• db_cache_size / db_block_buffers
• log_buffer
• pga_aggregate_target / workarea_size_policy
Use pga_aggregate_target instead of
• sort_area_size sort_area_size.
Agenda
Oracle server architecture overview
Memory
IO
CPU
Conclusion
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…
• Set AIXTHREAD_SCOPE to S
Reference material
• Oracle 9i & 10g on IBM AIX5L : Tips & Considerations – IBM/Oracle ICC
Many thanks to Dennis Massanari, Michel Rivière and Majidkhan Remtoula for
their help!
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
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 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.
Operations
Customer Service /
Support
51 IBM / ORACLE Joint Solutions Center | Presentation © 2005 JSC
Business Unit or Product Name
oraclibm@fr.ibm.com
Tel : +33 4 67 34 67 49