Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

High Parse calls on Recursive SQL in 12.1.0.2

rchemJul 20 2016 — edited Jul 20 2016

Hello,

Thanks for your time and help.

While investigating a query in 12c (version 12.1.0.2, OS: RHEL 6.4)  Pre production testing, I have generated AWR in a 2 hour sample , I was surprised to see lot of parse calls from a recursive SQL and top wait being Latch Free accounting for 60% of DB time. I couldn't find any Application Queries consuming significant DB Time, only one recursive SQL has consumed 13% of DB time .

Need help in understanding below questions

1) I couldn't find which SQL contributed to DB time of 449 mins, considering the top sql (which seems to be related to snapshot) contributed to 13% and rest < 1%.

2) From Time Model statistics , I could see Hard Parse time being 95% of DB time, but I am assuming this parse time should be shown in SQL elapsed time of queries.

3)  What might have caused SQLID 4b4wp0a8dvkf0 to execute 172016 times.

I have gone through Frank's below post, I couldn't verify if to be a bug ( bug 20907061) as I do not have trace output. I will check if the issue can be reproduced.

http://blog.dbi-services.com/sql-plan-directives-strike-again/

I have copied the AWR relevant details to whatever I described above.

Snap IdSnap TimeSessionsCursors/SessionCDB
Begin Snap:231619-Jul-16 18:00:2895  2.3YES
End Snap:231819-Jul-16 20:00:55902.5YES
Elapsed:  120.46 (mins)
DB Time:  449.96 (mins)

Top 10 Foreground Events by Total Wait Time

EventWaitsTotal Wait Time (sec)Wait Avg(ms)% DB timeWait Class
latch free543,90116.4K30.1460.7Other
DB CPU10.1K37.5

Time Model Statistics

Statistic NameTime (s)% of DB Time% of Total CPU Time
parse time elapsed25,854.5395.77
hard parse elapsed time25,792.7595.54
sql execute elapsed time23,411.1686.72

SQL ordered by Elapsed Time

Elapsed Time (s)ExecutionsElapsed Time per Exec (s)%Total%CPU%IO  SQL IdSQL ModulePDB NameSQL Text
3,691.00172,0160.0213.6725.040.004b4wp0a8dvkf0SELECT executions, end_of_fetc...
97.8310,0100.010.3699.620.007y6sm34vu7g0dSELECT /* OPT_DYN_SAMP */ /*+ ...
69.812,630,4720.000.2684.830.0047r1y8yn34jmjselect default$ from col$ wher...

SQLID: 4b4wp0a8dvkf0

SELECT executions, end_of_fetch_count, elapsed_time/px_servers elapsed_time, cpu_time/px_servers cpu_time, buffer_gets/executions buffer_gets FROM (SELECT sum(executions_delta) as EXECUTIONS, sum(case when px_servers_execs_delta > 0 then px_servers_execs_delta else executions_delta end) as px_servers, sum(end_of_fetch_count_delta) as end_of_fetch_count, sum(elapsed_time_delta) as ELAPSED_TIME, sum(cpu_time_delta) as CPU_TIME, sum(buffer_gets_delta) as BUFFER_GETS FROM DBA_HIST_SQLSTAT s, V$DATABASE d, DBA_HIST_SNAPSHOT sn WHERE s.dbid = d.dbid AND bitand(nvl(s.flag, 0), 1) = 0 AND sn.end_interval_time > (select systimestamp at TIME ZONE dbtimezone from dual) - 7 AND s.sql_id = :1 AND s.snap_id = sn.snap_id AND s.instance_number = sn.instance_number AND s.dbid = sn.dbid AND parsing_schema_name = :2)

SQlID:

47r1y8yn34jmj

select default$ from col$ where rowid=:1


SQL ordered by Parse Calls

Parse CallsExecutions% Total Parses  SQL IdSQL ModulePDB NameSQL Text
2,627,6992,630,47249.5447r1y8yn34jmjselect default$ from col$ wher...

select default$ from col$ where rowid=:1

Latch NameGet RequestsPct Get MissAvg Slps /MissWait Time (s)NoWait RequestsPct NoWait Miss
Result Cache: RC Latch3,550,18116.141.03163940
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2016
Added on Jul 20 2016
11 comments
1,482 views