Professional Documents
Culture Documents
Rac Tuning Sig 2004
Rac Tuning Sig 2004
Audience Knowledge
Goals
Overview of RAC & RAC Tuning Target RAC tips that are most useful
Non-Goals
Learn ALL aspects of RAC
A TUSC Presentation
Overview
RAC Overview Tuning the RAC Cluster Interconnect Monitoring the RAC Workload Monitoring RAC specific contention Whats new in 10g Summary
A TUSC Presentation
Many instances of Oracle running on many nodes All instances share a single physical database and have common data & control files Each instance has its own log files and rollback segments (UNDO Tablespace) All instances can simultaneously execute transactions against the single database Caches are synchronized using Oracles Global Cache Management technology (Cache Fusion)
Start small, grow incrementally Scalable AND highly available NO downtime to add servers and disk
Server 1 Instance A
Server 2 Instance A
Database A
SERVER failure - your database failures available Protect from SERVER remains
A TUSC Presentation 6
84% Scalability
# Users
1,288
2 Nodes 4 Nodes 5 Nodes 6 Nodes
*Audited
A TUSC Presentation 7
Running on HP Computers
A TUSC Presentation
Prior to tuning RAC specific operations, each instance should be tuned separately.
APPLICATION Tuning DATABASE Tuning OS Tuning
A TUSC Presentation
Your primary tuning efforts after tuning each instance individually should focus on the processes that communicate through the cluster interconnect.
Global Services Directory Processes
GES Global Enqueue Services GCS Global Cache Services
A TUSC Presentation
10
buffer busy global cache A wait event that is signaled when a process has
to wait for a block to become available because another process is obtaining a resource for this block.
How:
1) Query V$SESSION_WAIT to determine whether or not any sessions are experiencing RAC related waits. 2) Identify the objects that are causing contention for these sessions. 3) Modify the object to reduce contention.
A TUSC Presentation 12
1)
Query v$session_wait to determine whether or not any sessions are experiencing RAC related waits.
SELECT inst_id, event, p1 FILE_NUMBER, p2 BLOCK_NUMBER, WAIT_TIME FROM v$session_wait WHERE event in ('buffer busy global cr', 'global cache busy', 'buffer busy global cache');
A TUSC Presentation
13
The output from this query should look something like this:
The block number and file number will indicate the object the requesting instance is waiting for.
INST_ID ------1 2
EVENT FILE_NUMBER BLOCK_NUMBER WAIT_TIME ----------------------------------- ----------- ------------ ---------global cache busy 9 150 15 global cache busy 9 150 10
A TUSC Presentation
14
2)
Identify objects that are causing contention for these sessions by identifying the object that corresponds to the file and block for each file_number/block_number combination returned:
SELECT owner, segment_name, segment_type FROM dba_extents WHERE file_id = 9 AND 150 between block_id AND block_id+blocks-1;
A TUSC Presentation
15
A TUSC Presentation
16
Reduce the number of rows per block Adjust the block size to a smaller block size Modify INITRANS and FREELISTS
A TUSC Presentation
17
Block contention can be measured by using block transfer time, calculated by:
Accumulated round-trip time for all requests for consistent read blocks.
INST_ID RECEIVED RECEIVE TIME AVG RECEIVE TIME (ms) ------- ---------- ------------ --------------------1 2791 3287 11.8 2 3760 7482 19.9
A TUSC Presentation 19
Problem Indicators:
High Transfer Time One node showing excessive transfer time
A TUSC Presentation
20
Measure the latency of service times. Service time is comprised of consistent read build time, log flush time, and send time.
global cache cr blocks served global cache cr block build time global cache cr block flush time global cache cr block send time
Number of requests for a CR block served by LMS The time that the LMS process requires to create a CR block on the holding instance. Time waited for a log flush when a CR request is served (part of the serve time) Time required by LMS to initiate a send of the CR block.
A TUSC Presentation 21
Result:
Instance LMS Service Time --------- ---------------1 1.07933923 2 .636687318
A TUSC Presentation
23
Instance Consistent Read Build Log Flush Wait Send Time --------- --------------------- -------------- ---------1 .00737234 1.05059755 .02203942 2 .04645529 .51214820 .07844674
A TUSC Presentation 24
A TUSC Presentation
26
Tuning the RAC Cluster Interconnect Global Performance Views for RAC
Global Dynamic Performance view names for Real Application Clusters are prefixed with GV$.
GV$SYSSTAT, GV$DML_MISC, GV$SYSTEM_EVENT, GV$SESSION_WAIT, GV$SYSTEM_EVENT contain numerous statistics that are of interest to the DBA when tuning RAC. The CLASS column of GV$SYSSTAT tells you the type of statistic. RAC related statistics are in classes 8, 32 and 40.
A TUSC Presentation 27
A TUSC Presentation
28
As mentioned, the view GV$SYSSTAT will contain statistics that indicate the performance of your RAC system. The following statistics should always be as near to zero as possible:
global cache blocks lost global cache blocks corrupt
Block losses during transfers. May indicate network problems. Blocks that were corrupted during transfer. High values indicate an IPC, network, or hardware problem.
A TUSC Presentation
29
SELECT A.VALUE "GC BLOCKS LOST 1", B.VALUE "GC BLOCKS CORRUPT 1", C.VALUE "GC BLOCKS LOST 2", D.VALUE "GC BLOCKS CORRUPT 2" FROM GV$SYSSTAT A, GV$SYSSTAT B, GV$SYSSTAT C, GV$SYSSTAT D WHERE A.INST_ID=1 AND A.NAME='global cache blocks lost' AND B.INST_ID=1 AND B.NAME='global cache blocks corrupt' AND C.INST_ID=2 AND C.NAME='global cache blocks lost' AND D.INST_ID=2 AND D.NAME='global cache blocks corrupt' GC BLOCKS LOST 1 GC BLOCKS CORRUPT 1 GC BLOCKS LOST 2 GC BLOCKS CORRUPT 2 ---------------- ------------------- ---------------- ------------------0 0 652 0
In this case the database Instance 1 takes 22 seconds to perform a series of tests, Instance 2 takes 25 minutes.
Instance gc blocks lost gc cur blocks served gc cr blocks served RATIO ---------- -------------- -------------------- ------------------- ---------1 0 3923 2734 0 2 652 3008 4380 .088251218
A TUSC Presentation
31
The TCP receive and send buffers on Instance 2 were set at 64K This is a 8k block size instance with a db_file_multiblock_read_count of 16. This was causing excessive network traffic since the system was using full table scans resulting in a read of 128K. In addition the actual TCP buffer area was set to a small number.
A TUSC Presentation 32
In addition to monitoring consistent read blocks, we also need to be concerned with processing current mode blocks. Calculate the average receive time for current mode blocks:
Global cache current block receive time Global cache current blocks received
Accumulated round trip time for all requests for current blocks
Number of current blocks received from the holding instance over the interconnect
A TUSC Presentation 33
Query the GV$SYSSTAT view to obtain this ratio for each instance:
COLUMN COLUMN PROMPT SELECT "AVG RECEIVE TIME (ms)" format 9999999.9 inst_id FORMAT 9999 GCS CURRENT BLOCKS b1.inst_id, b2.value "RECEIVED", b1.value "RECEIVE TIME", ((b1.value / b2.value) * 10) "AVG RECEIVE TIME (ms)" gv$sysstat b1, gv$sysstat b2 b1.name = 'global cache current block receive time' b2.name = 'global cache current blocks received' b1.inst_id = b2.inst_id;
INST_ID RECEIVED RECEIVE TIME AVG RECEIVE TIME (ms) ------ ---------- ------------ --------------------1 22694 68999 30.4 2 23931 42090 17.6 A TUSC Presentation 34
Tuning the RAC Cluster Interconnect Current Block Service Time Statistics
Service time for current blocks is comprised of pin time, log flush time, and send time.
global cache current blocks served
The number of current blocks shipped to the requesting instance over the interconnect.
The time it takes to pin the current block before shipping it to the requesting instance. Pinning is necessary to disallow changes to the block while it is prepared to be shipped to another instance.
global cache block flush The time it takes to flush the changes to a block to disk (forced log flush), before the block is shipped time
to the requesting instance.
The time it takes to send the current block to the requesting instance over the interconnect.
A TUSC Presentation 35
Tuning the RAC Cluster Interconnect Current Block Service Time Statistics
A TUSC Presentation
36
Tuning the RAC Cluster Interconnect Current Block Service Time Statistics
Drill-down to service time components will help identify the cause of the problem.
A TUSC Presentation
37
Tuning the RAC Cluster Interconnect Current Block Service Time Statistics
SELECT A.inst_id "Instance", (A.value/D.value) "Current Block Pin", (B.value/D.value) "Log Flush Wait", (C.value/D.value) "Send Time" FROM GV$SYSSTAT A, GV$SYSSTAT B, GV$SYSSTAT C, GV$SYSSTAT D WHERE A.name = 'global cache current block build time' AND B.name = 'global cache current block flush time' AND C.name = 'global cache current block send time' AND D.name = 'global cache current blocks served' AND B.inst_id=a.inst_id AND High pin times could indicate AND C.inst_id=a.inst_id AND AND D.inst_id=a.inst_id problems at the IO interface level. ORDER BY A.inst_id;
Instance Current Block Pin Log Flush Wait Send Time --------- ----------------- -------------- ---------1 .69366887 .472058762 .018196236 2 1.07740715 .480549199 .072346418
A TUSC Presentation 38
Tuning the RAC Cluster Interconnect Global Cache Convert and Get Times
GCS: Global Cache Services. A process that communicates through the cluster interconnect
A final set of statistics can be useful in identifying RAC interconnect performance issues.
global cache convert time global cache converts
The accumulated time that all sessions require to perform global conversion on GCS resources Resource converts on buffer cache blocks. Incremented whenever GCS resources are converted from Null to Exclusive, shared to Exclusive, or Null to Shared.
The accumulated time of all sessions needed to open a GCS resource for a local buffer.
The number of buffer gets that result in opening a new resource with the GCS.
A TUSC Presentation 39
Tuning the RAC Cluster Interconnect Global Cache Convert and Get Times
To measure these times, query the GV$SYSSTAT view:
SELECT A.inst_id "Instance", A.value/B.value "Avg Cache Conv. Time", C.value/D.value "Avg Cache Get Time", E.value "GC Convert Timeouts" FROM GV$SYSSTAT A, GV$SYSSTAT B, GV$SYSSTAT C, GV$SYSSTAT D, Neither convert time is excessive. GV$SYSSTAT Excessive would be > 10-20 ms. Instance WHERE A.name = 'global cache convert time' 1 has higher convert times because it is AND B.name = 'global cache converts' getting and converting from instance 2, AND c.name = 'global cache get time' which is running on slower CPUs AND D.name = 'global cache gets' AND E.name = 'global cache convert timeouts' AND B.inst_id = A.inst_id and AND C.inst_id = A.inst_id and AND D.inst_id = A.inst_id and AND E.inst_id = A.inst_id ORDER BY A.inst_id;
Instance Avg Cache Conv. Time Avg Cache Get Time GC Convert Timeouts --------- -------------------- ------------------ ------------------1 1.85812072 .981296356 0 2 1.65947528 .627444273 0
A TUSC Presentation 40
Tuning the RAC Cluster Interconnect Global Cache Convert and Get Times
Use the GV$SYSTEM_EVENT view to review TIME_WAITED statistics for various GCS events if the get or convert times become significant. STATSPACK can be used for this to view these events.
A TUSC Presentation
41
Tuning the RAC Cluster Interconnect Global Cache Convert and Get Times
A TUSC Presentation
If these RAC-specific wait events show up in the TOP-5 wait events on the STATSPACK report, you need to determine the cause of the waits:
global cache open s global cache open x global cache null to s global cache null to x global cache cr request Global Cache Service Utilization for Logical Reads
A TUSC Presentation 43
Description: A session has to wait for receiving permission for shared(s) or exclusive(x) access to the requested resource Wait duration should be short. Wait followed by a read from disk. Blocks requested are not cached in any instance.
Action: Not much can be done When associated with high totals or high per-transaction wait time, data blocks are not cached. Will cause sub-optimal buffer cache hit ratios Consider preloading heavily used tables
A TUSC Presentation 44
Description: Happens when two instances exchange the same block back and forth over the network. These events will consume a greater proportion of total wait time if one instance requests cached data blocks from other instances.
Action: Reduce the number of rows per block to eliminate the need for block swapping between instances.
A TUSC Presentation 45
Description: Happens when an instance requests a CR data block and the block to be transferred hasnt arrived at the requesting instance.
Action: Examine the cluster interconnects for possible problems. Modify objects to reduce possibility of contention.
A TUSC Presentation 46
Tuning the RAC Cluster Interconnect High GCS Time Per Request
AND
Response times or throughput does not conform to your service level requirements.
Tuning the RAC Cluster Interconnect High GCS Time Per Request
A TUSC Presentation
48
Tuning the RAC Cluster Interconnect High GCS Time Per Request
A TUSC Presentation
49
Tuning the RAC Cluster Interconnect High GCS Time Per Request
System Load
If processes are queuing for the CPU, raise the priority of the GCS processes (LMSn) to have priority over other processes to lower GCS times. Reduce the load on the server by reducing the number of processes on the database server. Increase capacity by adding CPUs to the server Add nodes to the cluster database
A TUSC Presentation 50
Tuning the RAC Cluster Interconnect High GCS Time Per Request
Network issues
OS logs and OS stats will indicate if a network link is congested. Ensure packets are being routed through the private interconnect, not the public network.
A TUSC Presentation
51
The STATSPACK report shows statistics ONLY for the node or instance on which it was run. Run statspack.snap procedure and spreport.sql script on each node you want to monitor to compare to other instances.
A TUSC Presentation
52
Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time -------------------------------------------- ------------ ----------- -------global cache cr request 820 154 72.50 CPU time 54 25.34 global cache null to x 478 1 .52 control file sequential read 600 1 .52 control file parallel write 141 1 .28 -------------------------------------------------------------
Transfer times are excessive from other instances in this cluster to this instance. Could be due to network problems or buffer cache sizing issues.
A TUSC Presentation 53
Network changes were made An index was added STATSPACK report now looks like this:
CPU time is now the predominant event
Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time -------------------------------------------- ------------ ----------- -------CPU time 99 64.87 global cache null to x 1,655 28 18.43 enqueue 46 8 5.12 global cache busy 104 7 4.73 DFS lock handle 38 2 1.64
A TUSC Presentation
54
Tuning the RAC Cluster Interconnect After network and index Using STATSPACK Reports changes.
Workload characteristics for this instance:
Cluster Statistics for DB: DB2 Instance: INST1 Snaps: 105 -106 Snaps: 25 -26 Global Cache Service - Workload Characteristics ----------------------------------------------Ave global cache get time (ms): Ave global cache convert time (ms): Ave build time for CR block (ms): Ave flush time for CR block (ms): Ave send time for CR block (ms): Ave time to process CR block request (ms): Ave receive time for CR block (ms): Ave pin time for current block (ms): Ave flush time for current block (ms): Ave send time for current block (ms): Ave time to process current block request (ms): Ave receive time for current block (ms): Global cache hit ratio: Ratio of current block defers: % of messages sent for buffer gets: % of remote buffer gets: Ratio of I/O for coherence: Ratio of local vs remote work: Ratio of fusion vs physical writes: A TUSC Presentation
3.1 3.2 0.2 0.0 1.0 1.3 17.2 0.2 0.0 0.9 1.1 3.1 1.7 0.0 1.4 1.1 8.7 0.6 1.0
8.2 16.5 1.5 6.0 0.9 8.5 18.3 13.7 3.9 0.8 18.4 17.4 2.5 0.2 2.2 1.6 2.9 0.5 0.0 55
Global Enqueue Services (GES) control the interinstance locks in Oracle 9i RAC. The STATSPACK report contains a special section for these statistics.
Global Enqueue Service Statistics --------------------------------Ave global lock get time (ms): Ave global lock convert time (ms): Ratio of global lock gets vs global lock releases:
A TUSC Presentation
56
High values could indicate possible network or memory problems Could also be caused by application locking issues May need to review the enqueue section of STATSPACK report for further analysis.
A TUSC Presentation 57
A TUSC Presentation
58
The GES Statistics section of the STATSPACK report shows gcs blocked convert statistics.
GES Statistics for DB: DB2 Instance: INST2 Snaps: 25 -26 Statistic Total per Second per Trans --------------------------------- ---------------- ------------ -----------dynamically allocated gcs resource 0 0.0 0.0 dynamically allocated gcs shadows 0 0.0 0.0 flow control messages received 0 0.0 0.0 flow control messages sent 0 0.0 0.0 gcs ast xid 0 0.0 0.0 gcs blocked converts 904 2.1 150.7 gcs blocked cr converts 1,284 2.9 214.0 gcs compatible basts 0 0.0 0.0 gcs compatible cr basts (global) 0 0.0 0.0 gcs compatible cr basts (local) 75 0.2 12.5 : :
A TUSC Presentation 59
Description: Instance requested a block from another instance and was unable to obtain the conversion of the block. Indicates users on different instances need to access the same blocks.
Action: Prevent users on different instances from needing access to the same blocks. Ensure sufficient freelists (not an issue if using automated freelists) Reduce block contention through freelists, initrans. Limit rows per block.
A TUSC Presentation 60
Event Waits Timeouts Time (s) (ms) /txn ---------------------------- ------------ ---------- ---------- ------ -------global cache cr request 820 113 154 188 136.7 global cache null to x 478 1 1 2 79.7 control file sequential read 600 0 1 2 100.0 control file parallel write 141 0 1 4 23.5 enqueue 29 0 1 18 4.8 library cache lock 215 0 0 2 35.8 db file sequential read 28 0 0 7 4.7 LGWR wait for redo copy 31 16 0 4 5.2 : : A TUSC Presentation :
61
The Library Cache Activity report shows statistics regarding the GES. Watch for GES Invalid Requests and GES Invalidations. Could indicate insufficient sizing of the shared pool resulting in GES contention.
Library Cache Activity for DB: DB2 ->"Pct Misses" should be very low Instance: INST2 Snaps: 25 -26
GES Lock GES Pin GES Pin GES Inval GES InvaliNamespace Requests Requests Releases Requests dations --------------- ------------ ------------ ------------ ----------- ----------BODY 1 0 0 0 0 CLUSTER 4 0 0 0 0 INDEX 84 0 0 0 0 SQL AREA 0 0 0 0 0 TABLE/PROCEDURE 617 192 0 77 0 TRIGGER 0 0 0 0 0
A TUSC Presentation
62
Single-instance tuning should be performed before attempting to tune the processes that communicate via the cluster interconnect.
The STATSPACK report contains valuable statistics that can help you identify SQL-related problems, memory problems, IO problems, latch contention and enqueue issues.
A TUSC Presentation
63
Oracle makes a Global Cache Service request whenever a user accesses a buffer cache to read or modify a data block and the block is not in the local cache. and the
crowd gasps!
RATIOS can be used to give an indication of how hard your Global Services Directory processes are working.
A TUSC Presentation
64
To estimate the use of the GCS relative to the number of logical reads: Sum of GCS requests
global cache gets + global cache converts + global cache cr blocks rcvd + global cache current blocks rcvd consistent gets + db block gets
A TUSC Presentation
65
Some blocks, those frequently requested by local and remote users, will be hot. If a block is hot, its transfer is delayed for a few milliseconds to allow the local users to complete their work. The following ratio provides a rough estimate of how prevalent this is:
global cache defers
A ratio of higher than 0.3 indicates that you have some pretty hot blocks in your database.
A TUSC Presentation 67
To find the blocks involved in busy waits, query the columns NAME, KIND, FORCED_READS, FORCED_WRITES.
Select INST_ID "Instance", name, kind, sum(forced_reads) "Forced Reads", sum(forced_writes) "Forced Writes" FROM gv$cache_transfer WHERE owner# != 0 GROUP BY inst_id, name, kind ORDER BY 1,4 desc,2;
Instance NAME KIND Forced Reads Forced Writes --------- -------------------- ---------- ------------ ------------1 MOD_TEST_IND INDEX 308 0 1 TEST2 TABLE 64 0 1 AQ$_QUEUE_TABLES TABLE 5 0 2 TEST2 TABLE 473 0 2 MOD_TEST_IND INDEX 221 0
A TUSC Presentation 68
Fusion writes occur when a block previously changed by another instance needs to be written to disk in response to a checkpoint or cache aging. Oracle sends a message to notify the other instance that a fusion write will be performed to move the data block to disk. Fusion writes do not require an additional write to disk. Fusion writes are a subset of all physical writes incurred by an instance.
A TUSC Presentation 70
A high large value for Cache Fusion Writes ratio may indicate:
Insufficiently sized caches Insufficient checkpoints Large numbers of buffers written due to cache replacement or checkpointing.
A TUSC Presentation
72
The V$XXX_CACHE_TRANSFER views show the types of blocks that use the cluster interconnect in a RAC environment.
A TUSC Presentation
73
V$CACHE_TRANSFER
Shows the types and classes of blocks that Oracle transfers over the cluster interconnect on a per-object basis. that experience cache transfers on a per-class of object basis. Use this view to monitor the blocks transferred per file. The FILE_NUMBER column identifies the datafile that contained the blocks transferred. Use this view to monitor the transfer of temporary tablespace blocks. Has the same structure as V$FILE_CACHE_TRANSFER.
A TUSC Presentation 74
V$FILE_CACHE_TRANSFER
V$TEMP_CACHE_TRANSFER
V$CACHE_TRANSFER
FILE# BLOCK# CLASS# STATUS XNC FORCED_READS FORCED_WRITES NAME PARTITION_NAME KIND OWNER# GC_ELEMENT_ADDR GC_ELEMENT_NAME NUMBER NUMBER NUMBER VARCHAR2(5) NUMBER NUMBER NUMBER VARCHAR2(30) VARCHAR2(30) VARCHAR2(15) NUMBER RAW(4) NUMBER
A TUSC Presentation
75
V$FILE_CACHE_TRANSFER FILE_NUMBER shows the file numbers of datafiles that are source of blocks transferred. Use this view to show the block transfers per file.
FILE_NUMBER X_2_NULL X_2_NULL_FORCED_WRITE X_2_NULL_FORCED_STALE X_2_S X_2_S_FORCED_WRITE S_2_NULL S_2_NULL_FORCED_STALE RBR RBR_FORCED_WRITE RBR_FORCED_STALE NULL_2_X S_2_X NULL_2_S CR_TRANSFERS CUR_TRANSFERS NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER
76
A TUSC Presentation
The shared disk architecture of Oracle 9i virtually eliminates forced disk writes, but V$CACHE_TRANSFER and V$FILE_CACHE_TRANSFER may still show the number of block mode conversions per block class or object, however, the values in FORCED_WRITES column will be zero.
A TUSC Presentation
77
To monitor the Global Enqueue Service Processes, use the GV$ENQUEUE_STAT view.
GV$ENQUEUE_STAT
INST_ID EQ_TYPE TOTAL_REQ# TOTAL_WAIT SUCC_REQ# FAILED_REQ# CUM_WAIT_TIME NUMBER VARCHAR2(2) NUMBER NUMBER NUMBER NUMBER NUMBER
A TUSC Presentation
78
Retrieve all of the enqueues with a total_wait# value greater than zero:
SELECT * FROM gv$enqueue_stat WHERE total_wait# > 0 ORDER BY inst_id, cum_wait_time desc; INST_ID ---------1 1 1 1 1 1 1 : : EQ TOTAL_REQ# TOTAL_WAIT# SUCC_REQ# FAILED_REQ# CUM_WAIT_TIME -- ---------- ----------- ---------- ----------- ------------TX 31928 26 31928 0 293303 PS 995 571 994 1 55658 TA 1067 874 1067 0 10466 TD 974 974 974 0 2980 DR 176 176 176 0 406 US 190 189 190 0 404 PI 47 27 47 0 104
A TUSC Presentation 79
Enterprise Manager 9i
A TUSC Presentation
81
Enterprise Manager 9i
A TUSC Presentation
82
A TUSC Presentation
83
Potential Fix Data Block (cont.) Increase initrans and/or maxtrans Undo Header Add rollback segments or areas Undo block Commit more (not too much) Larger rollback segments/areas. Investigate the detail (Covered later) Use LMTs or pre-allocate large extents Pre-allocate extents above high water mark A TUSC Presentation 85
Potential Fix Increase initrans and/or maxtrans on the table or index Index foreign keys; Check application locking of tables Increase the Log Buffer; Faster disks for the Redo Logs Archive destination slow or full; Add more or larger Redo Logs Commit more records at a time; Faster Redo Log disks; Raw devices A TUSC Presentation 86
Implementation
specify EXTENT MANAGEMENT LOCAL clause during tablespace creation in-place migration
A TUSC Presentation 88
Implementation
specify SEGMENT SPACE MANAGEMENT AUTO A TUSC Presentation 89 clause during tablespace creation
Database Oracle9iAS
Applications
Storage
A TUSC Presentation
90
EM 9i
EM 10g
Real performance for All Your Users, All Your Pages, All the Time Application Availability Synthetic transactions End-to-end tracing
91
OCS
IMAP, SMTP End-2-end service monitoring Files End-2-end service monitoring Files document analysis: count, size, format Files user analysis: number, quota consumed
RAC
Cluster cache coherency monitoring Failover events Discovery of RAC topology Startup/shutdown Relocate services Failover jobs
A TUSC Presentation
ASM
Disk group admin (rebalance) Startup/Shutdown Disk group usage/status I/O performance 92 Add/Remove disks
Host/Host Clusters
Top processes identification
Target Alerts
A TUSC Presentation
93
View it Wireless
Target Alerts
A TUSC Presentation
94
Internet
Application Developer Applications Application Server Data Center Support Database OS Storage Network Service Network DBA System Administrator
Who is the problem impacting? What is the business impact? Where in the infrastructure is the problem? Whose problem is it? Why is the problem occurring?
95
Provider
A TUSC Presentation
A TUSC Presentation
97
Choose a Host
Select Targets tab Pick a Host
A TUSC Presentation
98
A TUSC Presentation
101
A TUSC Presentation
102
A TUSC Presentation
103
A TUSC Presentation
104
JDBC
internet
105
A TUSC Presentation
106
Host Performance
Each Piece of the Web App. Choose the Host
A TUSC Presentation
107
Host Performance
I/O Memory CPU
A TUSC Presentation
108
Host Performance
Hardware
O/S Software
A TUSC Presentation
109
Host Performance
Side by Side Compare
A TUSC Presentation
110
Managing Groups
Managed from a single-view
Applications
Sets of Systems
Membership-based inheritance
A TUSC Presentation 111
ASM
Disk group admin (rebalance) Startup/Shutdown Disk group usage/status I/O performance Add/Remove disks
iAS
Config changes across cluster (OC4J, Apache) Create/Manage cluster Deploy app to cluster Reconfigure a farm Add/Remove node from cluster Clone (mid-tiers) Patch
DB
Analyze Backup Export Startup/Shutdown Configuration Advise Clone, Patch
OCS
Custom grouping Home pages for EMAIL and IM
RAC
WebApp
End-2-End availability End-2-End monitoring End-2-End tracing
Host/Host Clusters
Add/Remove node from OS cluster
Spfile changes across instances Start/Stop/Relocate services EM Startup/Shutdown Cluster cache coherency Agent deployment Monitoring rollups A TUSC Presentation Add/Remove Instance
112
Database Performance
Create a Prod DBs Group
Database Performance
View the Prod DBs Group
A TUSC Presentation
114
Database Performance
Alert History Waits
Database Performance
Alert Issues Major Waits
A TUSC Presentation
116
Database Performance
Fix
Critical
A TUSC Presentation
117
Oracle Standardization
Policy Management
Policy
Security policies
Software installation hardening Excess services/ports Excess user privileges
Configuration policies
Best practices Base images
Performance polices
Thresholds
A TUSC Presentation 118
9. Segment with Extent Growth Policy Violation 19. Non-uniform Default Extent Size 10.Tablespace Containing Mixed Segment Types
A TUSC Presentation
119
Database Services
1. 2. 3. 4. 5. 6. Enable listener logging Password-protect listeners Disable direct listener administration Disallow remote OS roles and authentication Disallow use of remote password file Restrict access to external procedure service
Host
Application Server
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
HTTPD has minimal privileges 1. Use HTTP/S 2. Apache logging should be on 3. Demo applications disabled 4. Disable default banner page 5. Disable access to unused directories 6. Disable directory indexing 7. Forbid access to certain packages 8. Disable packages not used by DAD owner 9. Remove unused DAD configurations 10. Redirect _pages directory 11. Password complexity enabled 12. A TUSC Presentation Use HTTP/S 13.
Database Performance
Monitor Database We have a CPU issue!
A TUSC Presentation
121
Database Performance
Monitor Perform. We have a Concurr. issue!
A TUSC Presentation
122
Database Performance
Monitor for a period of time Check the Top SQL
A TUSC Presentation
123
Database Performance
Drill down to show the Top SQL
Target Alerts
A TUSC Presentation 124
Database Performance
Top SQL Check Execution History or Other Options
A TUSC Presentation
125
A TUSC Presentation
127
A TUSC Presentation
128
ADDM
High-Load SQL
DBA
A TUSC Presentation
129
ADDMs Architecture
Uses Time & Wait Model data from Workload Repository Classification Tree is based on decades of Oracle performance tuning expertise Time based analysis Recommends solutions or next steps Runs proactively & manually
High-load SQL
IO / CPU issues
RAC issues
SQL Advisor
130
Workload data is captured every 30 minutes or manually and saved for 7 days by default Self-manages its space requirements Provides the basis for improved performance diagnostic facilities
A TUSC Presentation
131
Uses same plan generation process but performs additional steps that require lot more time To validate statistics and its own estimates
Uses dynamic sampling and partial executions
To investigate the use of new indexes that could provide significant speed-up To analyze SQL constructs that led to expensive plan operators A TUSC Presentation 133
Drill into Top SQL for worst time period Get Help!
A TUSC Presentation
134
A TUSC Presentation
135
A TUSC Presentation
136
Tuning Results for this job Suggests using a profile For this SQL
A TUSC Presentation 137
A TUSC Presentation
138
Detail
A TUSC Presentation
139
It is a new object in Oracle10g for capturing SQL workload It stores SQL statements along with
Execution context: parsing user, bind values, etc. Execution statistics: buffer gets, CPU time, elapse time, number of executions, etc.
Sources: AWR, cursor cache, user-defined SQL A TUSC Presentation 140 workload, another STS
internet
Web Application
A TUSC Presentation 141
A TUSC Presentation
142
Beacon running representative transaction Beacon running representative transaction Beacon running representative transaction
Oracle9iAS
A TUSC Presentation
143
Network
Database
Hosts
Storage
Oracle9iAS
Oracle Database
Headquarters
Beacon running availability transaction
A TUSC Presentation
144
A TUSC Presentation
145
Summary
Tune each instance in a database cluster independently prior to tuning RAC. Reduce contention for blocks to improve service time. Operate on a well-tuned network. Monitor system load. Use V$ views to monitor RAC systems. STATSPACK contains vital information for RAC systems. New Features of Oracle10g will ease administration even further.
A TUSC Presentation
146
A TUSC Presentation
147
Oracle9i Performance Tuning Tips & Techniques; Richard J. Niemiec; Oracle Press (May 2003)
If you are going through hell, keep going - Churchill
A TUSC Presentation 148
References
Oracle9i Performance Tuning Tips & Techniques, Rich
Niemiec
The Self-managing Database: Automatic Performance Diagnosis; Karl Dias & Mark Ramacher, Oracle
Corporation
EM Grid Control 10g; otn.oracle.com, Oracle Corporation Oracle Enterprise Manager 10g: Making the Grid a Reality; Jay Rossiter, Oracle Corporation The Self-Managing Database: Guided Application and SQL Tuning; Benoit Dageville, Oracle Corporation The New Enterprise Manager: End to End Performance 149 Management of OracleA;TUSC Presentation Julie Wong & Arsalan Farooq,
References
Oracle Database 10g Performance Overview; Herv
Lejeune, Oracle Corporation Oracle 10g; Penny Avril,, Oracle Corporation
Oracle9i RAC; Real Application Clusters Configuration and Internals, Mike Ault & Madhu Tumma
A TUSC Presentation 150
References
Oracle Tuning Presentation, Oracle Corporation
www.tusc.com, www.oracle.com, www.ixora.com, www.laoug.org, www.ioug.org, technet.oracle.com
Oracle PL/SQL Tips and Techniques, Joseph P. Trezzo; Oracle Press Oracle9i Web Development, Bradley D. Brown; Oracle Press Special thanks to Steve Adams, Mike Ault, Brad Brown, Don Burleson, Kevin Gilpin, Herve Lejeune, Randy Swanson and Joe Trezzo.
A TUSC Presentation 151
References
Oracle Database 10g Automated Features , Mike Ault, TUSC Oracle Database 10g New Features, Mike Ault, Daniel Liu, Madhu Tumma, Rampant Technical Press, 2003, www.rampant.cc Oracle Database 10g - The World's First SelfManaging, Grid-Ready Database Arrives, Kelli Wiseth, Oracle Technology Network, 2003, otn.oracle.com
A TUSC Presentation 152
References
Oracle 10g documentation Oracle 9i RAC class & instructors comments Oracle 9i Concepts manual http://geocities.com/pulliamrick/ Tips for Tuning Oracle9i RAC on Linux, Kurt Engeleiter, Van Okamura, Oracle
Leveraging Oracle9i RAC on Intel-based servers to build an Adaptive Architecture, Stephen White,
Cap Gemini Ernst & Young, Dr Don Mowbray, Oracle, Werner Schueler, Intel
A TUSC Presentation
153
References
Running YOUR Applications on Real Application Clusters (RAC); RAC Deployment Best Practices,
Kirk McGowan, Oracle Corporation Oracle
The Present, The Future but not Science Fiction; Real Application Clusters Development, Angelo Pruscino, Building the Adaptive Enterprise; Adaptive Architecture and Oracle, Malcolm Carnegie, Cap
Gemini Ernst & Young
References
Real Application Clusters, Real Customers Real Results, Erik Peterson, Technical Manager, RAC,
Oracle Corp.
Deploying a Highly Manageable Oracle9i Real Applications Database, Bill Kehoe, Oracle Getting the most out of your database, Andy
Oracle9iAS Clusters: Solutions for Scalability and Availability, Chet Fryjoff, Product Manager, Oracle Corporation Oracle RAC and Linux A TUSC Presentation enterprise, Mark 155 in the real
References
Oracle Database 10g Automated Features , Mike Ault, TUSC Oracle Database 10g New Features, Mike Ault, Daniel Liu, Madhu Tumma, Rampant Technical Press, 2003, www.rampant.cc Oracle Database 10g - The World's First SelfManaging, Grid-Ready Database Arrives, Kelli Wiseth, Oracle Technology Network, 2003, otn.oracle.com
A TUSC Presentation 156
References
Oracle 10g; Penny Avril, Principal Database Product Manager, Server Technologies, Oracle Corporation To Infinity and Beyond, Brad Brown, TUSC Forrester Reports, Inc., TechStrategy Research, April 2002, Organic IT Internals of Real Application Cluster, Madhu Tumma, Credit Suisse First Boston
Oracle9i RAC; Real Application Clusters Configuration and Internals, Mike Ault & Madhu Tumma Oracle9i Performance Tuning Tips & Techniques,
Richard J. Niemiec
A TUSC Presentation 157
References
The Traits of the Uncommon Leader; U.S. Marine Corps Manual 60 Minute Manager - Joe Trezzo, TUSC Uncommon Leaders; TUSC, 1989 Whats next for IT?; Larry Geisel, Netscape The Miracle of Motivation; George Shinn Gods little devotional book for leaders 7 Habits of Highly Effective People; Steven Covey The Laws of Leadership - John Maxwell The making of a leader - Frank Damazio Bullet Proof Manager Seminars, Krestcom Productions, Inc.
TUSC Services
Oracle Technical Solutions
Full-Life Cycle Development Projects Enterprise Architecture Database Services
Managed Services
24x7x365 Remote Monitoring & Management Functional & Technical Support
Copyright Information
Neither TUSC, Oracle nor the authors guarantee this document to be error-free. Please provide comments/questions to rich@tusc.com. TUSC 2004. This document cannot be reproduced without expressed written consent from an officer of TUSC
A TUSC Presentation
160