You Asked
What is your opinion on "best practice" of soft parsing. We have an instance that is soft parsing over 3800 times a second:
STATSPACK report for
DB Name DB Id Instance Inst Num Release Cluster Host
------------ ----------- ------------ -------- ----------- ------- ------------
cusdb 1083030182 cusdb 1 9.2.0.8.0 NO bnscqpd1
Snap Id Snap Time Sessions Curs/Sess Comment
--------- ------------------ -------- --------- -------------------
Begin Snap: 379269 21-Jan-08 12:00:05 1,912 2.8
End Snap: 379272 21-Jan-08 12:30:03 1,925 2.9
Elapsed: 29.97 (mins)
Cache Sizes (end)
~~~~~~~~~~~~~~~~~
Buffer Cache: 6,032M Std Block Size: 8K
Shared Pool Size: 1,504M Log Buffer: 4,608K
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
Redo size: 621,357.62 6,061.70
Logical reads: 99,239.66 968.14
Block changes: 4,238.09 41.35
Physical reads: 1,070.14 10.44
Physical writes: 181.68 1.77
User calls: 21,396.63 208.74
Parses: 3,872.55 37.78
Hard parses: 12.46 0.12
Sorts: 1,287.22 12.56
Logons: 0.04 0.00
Executes: 4,296.70 41.92
Transactions: 102.51
% Blocks changed per Read: 4.27 Recursive Call %: 3.58
Rollback per transaction %: 56.88 Rows per Sort: 19.38
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 99.98 Redo NoWait %: 100.00
Buffer Hit %: 98.92 In-memory Sort %: 100.00
Library Hit %: 100.20 Soft Parse %: 99.68
Execute to Parse %: 9.87 Latch Hit %: 99.55
Parse CPU to Parse Elapsd %: 92.50 % Non-Parse CPU: 95.41
Shared Pool Statistics Begin End
------ ------
Memory Usage %: 91.07 91.24
% SQL with executions>1: 26.60 24.69
% Memory for SQL w/exec>1: 33.36 31.83
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Ela Time
-------------------------------------------- ------------ ----------- --------
CPU time 33,354 45.42
db file sequential read 1,846,550 30,063 40.94
latch free 236,788 3,161 4.30
db file parallel write 105,258 2,494 3.40
log file sync 82,828 2,189 2.98
-------------------------------------------------------------
Wait Events for DB: cusdb Instance: cusdb Snaps: 379269 -379272
-> s - second
-> cs - centisecond - 100th of a second
-> ms - millisecond - 1000th of a second
-> us - microsecond - 1000000th of a second
-> ordered by wait time desc, waits desc (idle events last)
Avg
Total Wait wait Waits
Event Waits Timeouts Time (s) (ms) /txn
---------------------------- ------------ ---------- ---------- ------ --------
db file sequential read 1,846,550 0 30,063 16 10.0
latch free 236,788 199,772 3,161 13 1.3
db file parallel write 105,258 0 2,494 24 0.6
log file sync 82,828 0 2,189 26 0.4
log file parallel write 127,946 0 991 8 0.7
buffer busy waits 38,764 2 450 12 0.2
log file sequential read 1,434 0 407 284 0.0
SQL*Net more data to client 1,216,519 0 245 0 6.6
db file scattered read 7,923 0 40 5 0.0
SQL*Net break/reset to clien 9,674 0 14 1 0.1
log file switch completion 155 0 13 84 0.0
LGWR wait for redo copy 1,689 107 5 3 0.0
enqueue 490 0 4 8 0.0
control file parallel write 736 0 4 5 0.0
db file parallel read 42 0 3 61 0.0
direct path write 484 0 1 2 0.0
log file single write 12 0 0 32 0.0
direct path read 1,692 0 0 0 0.0
async disk IO 2,808 0 0 0 0.0
library cache pin 12 0 0 17 0.0
control file sequential read 1,694 0 0 0 0.0
wait list latch free 8 0 0 12 0.0
direct path read (lob) 3 0 0 20 0.0
buffer deadlock 203 202 0 0 0.0
local write wait 1 0 0 18 0.0
db file single write 2 0 0 2 0.0
SQL*Net message from client 38,083,283 0 2,174,167 57 206.6
SQL*Net more data from clien 771,705 0 265 0 4.2
SQL*Net message to client 38,083,799 0 208 0 206.6
-------------------------------------------------------------
Background Wait Events for DB: cusdb Instance: cusdb Snaps: 379269 -3792
-> ordered by wait time desc, waits desc (idle events last)
Avg
Total Wait wait Waits
Event Waits Timeouts Time (s) (ms) /txn
---------------------------- ------------ ---------- ---------- ------ --------
db file parallel write 105,198 0 2,493 24 0.6
log file parallel write 127,913 0 990 8 0.7
log file sequential read 1,436 0 408 284 0.0
LGWR wait for redo copy 1,689 107 5 3 0.0
control file parallel write 726 0 4 5 0.0
direct path write 480 0 1 2 0.0
latch free 494 15 1 2 0.0
db file sequential read 114 0 1 6 0.0
db file scattered read 686 0 0 1 0.0
log file single write 12 0 0 32 0.0
direct path read 1,692 0 0 0 0.0
async disk IO 2,814 0 0 0 0.0
control file sequential read 916 0 0 0 0.0
db file single write 2 0 0 2 0.0
buffer busy waits 1 0 0 4 0.0
rdbms ipc message 327,475 2,099 11,890 36 1.8
smon timer 2,309 0 1,746 756 0.0
pmon timer 619 575 1,720 2778 0.0
-------------------------------------------------------------
SQL ordered by Gets for DB: cusdb Instance: cusdb Snaps: 379269 -379272
-> End Buffer Gets Threshold: 10000
-> Note that resources reported for PL/SQL includes the resources used by
all SQL statements called within the PL/SQL code. As individual SQL
statements are also reported, it is possible and valid for the summed
total % to exceed 100
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
--------------- ------------ -------------- ------ -------- --------- ----------
626,074,800 10,323 60,648.5 350.9 6087.28 17744.76 1840019295
Module: JDBC Thin Client
select DISTINCT CUST_ID from (select a.CUST_ID from BO_MAPPING a whe
re BO_STATUS_CODE in (1,2,3,4,5,7) start with a.CUST_ID = :1 con
nect by prior a.CUST_ID = a.VOL_PARENT_CUST_ID and a.NODE_TYPE_ID <>
1 UNION ALL select a.CUST_ID from ORDER_TRANS a where exists (
select 1 from ORDER_MASTER c, ORDER_TRANS d where c.INT_ORDER_
etc
and Tom said...
I have written and said many times....
there are three types of parses (well, maybe four) in Oracle...
there is the dreaded hard parse - they are VERY VERY VERY bad.
there is the hurtful soft parse - they are VERY VERY very bad.
there is the hated softer soft parse you might be able to achieve with session cached cursors - they are VERY very very bad.
then there is the absence of a parse, no parse, silence. This is golden, this is perfect, this is the goal.
You are far from it:
Execute to Parse %: 9.87
As that goes to zero, that implies the number of parses = number of executions - horrible, worst practice, something to be avoide.
Maybe they can enable statement caching? So that the JDBC layer will fix their bug (by not closing SQL when they say "close it" - because they are closing it prematurely)
This needs to be REDUCED. Soft parses are simply better than a hard parse - but they are still a bad thing to be avoided.
Rating
(3 ratings)
Is this answer out of date? If it is, please let us know via a Comment