Oracle Database Performance Tuning: Presented By-Rahul Gaikwad
Oracle Database Performance Tuning: Presented By-Rahul Gaikwad
Oracle Database Performance Tuning: Presented By-Rahul Gaikwad
Tuning
Presented ByRahul Gaikwad
www.yogijicreations.com
Parameters
Getting Database I/O Wrong
Redo Log Setup Problems
Long Full Table Scans
High Amounts of Recursive (SYS) SQL
www.yogijicreations.com
improvements..
Application Tuning:
Approximately 80% of all Oracle system performance problems are
resolved by coding optimal SQL.
Memory Tuning:
By Properly size your database buffers (shared pool, buffer cache, log
buffer, etc)
By looking at your wait events, buffer hit ratios, system swapping and
paging, etc.
Disk I/O Tuning:
Database files needs to be properly sized.
Also look for frequent disk sorts, full table scans, data fragmentation, etc.
Eliminate Database Contention:
Study database locks, latches and wait events carefully and eliminate
where possible.
Tunewww.yogijicreations.com
the Operating System:
Monitor and tune operating system CPU, I/O and memory utilization .
Cardinality
Estimates
Object Statistics
DB parameters
And config
IO and CPU
Estimates
System Statistics
www.yogijicreations.com
Cost estimate
Database Statistics
Database statistics provide
information on the type of load on
the database, as well as the internal
and external resources used by the
database.
Performance Data
Statistics
Time Model
SQL
Wait
Metrics
Stats
Sessions
CPU Statistics
Virtual Memory Statistics
Disk Statistics
Network Statistics
Metric
A metric is defined as the rate of change in
some cumulative statistic.
That rate can be measured against time,
transactions, or database calls.
For example, the number database calls per
second is a metric.
A history of recent metric values is available
through V$ views.
V$SQL_PLAN
Trace/Tkprof
V$SQL_PLAN
Used
After
The
EXPLAIN PLAN
The
The
The
www.yogijicreations.com
PLAN_TABLE
While
www.yogijicreations.com
www.yogijicreations.com
www.yogijicreations.com
www.yogijicreations.com
Rowid Scans
The
Index Scans
In
www.yogijicreations.com
or table scan?
Avoid accidental table scans
Optimize indexes
best
Optimize
Vertical/Horizontal
partitioning
1000
Full Scan no caching
Index sorted data, no caching
Index unsorted, cached data
Full Table scan, cached data
100
10
1
0
10
20
30
40
50
60
70
80
90
100
last,first,BirthYear
last+first name
last name
SELECT cust_id
FROM sh.customers c
WHERE cust_first_name = 'Connor'
AND cust_last_name = 'Bishop'
AND cust_year_of_birth = 1976;
63
None
1459
200
400
600
800
Logical IO
1000
1200
1400
1600
BITMAP INDEXES
BITMAP INDEXES
100
10
0.1
0.01
10
100
1000
10000
B*-Tree index
100000
1000000
VERTICAL PARTITIONING
Joins
OPTIMIZING JOINS
Best
join order
Join
Type:
Eliminate
Nested
loops
Optimize the join index
Sort merge
Avoid, esp. if memory scarce
Hash join
Avoid multi-pass executions
2.2
time_id
Indexing
3.14
prod_id,channel_id
23.43
prod_id
48.36
No Index
546.55
100
200
300
400
500
600
200
150
Disk Sort
Elapsed Time (s)
100
In Memory
Multi pass disk sort
50
0
1
10
100
Workarea Memory (MB)
Hash Join
In Memory
1000
Access Path
13,480
Bitmap index
1,524
2000
4000
6000
Logical IO
8000
10000
12000
14000
Multi-pass
Disk Sort
Time
Single Pass
Disk Sort
Memory Sort
Table/Index IO
CPU Time
Temp Segment IO
DML
16,316
14,285
Number of indexes
12,727
10,719
8,691
6,671
1 (PK only)
1,191
2,000
4,000
6,000
8,000
10,000
12,000
14,000
16,000
18,000
MULTI-TABLE INSERT
Multi-table insert
Insert both
Insert EMEA
Insert US
Two Inserts
10
MERGE
Merge
Insert
Update
INSERT + UPDATE
3.89
3.71
6
Elapsed Time (s)
3.32
10
12
www.yogijicreations.com
THANK YOU.
www.yogijicreations.com