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!

find how many times a sql script ran in one day

User_HFHKPJun 8 2016 — edited Jun 8 2016

trying to find out how many times a sql script ran in one day.

"script 1" ran on june 2 according to a search OEM and shows up on about 96 snapshots. On an AWR that spans the whole day, it doesnt show up.

is there a way to find out how many times it ran?


i have looked at different tables and used "script 2" to compare with.

script 2 ran on june 2, 16,256 times according to an AWR that spanned the whole day.

but when doing a search like

select EXECUTIONS,FIRST_LOAD_TIME from gv$sql where SQL_ID = 'script2' order by FIRST_LOAD_TIME;

all i get is

EXECUTIONS FIRST_LOAD_TIME

---------- -------------------

       973 2016-01-09/10:25:03

        20 2016-01-09/10:25:03

         5 2016-01-09/10:25:03

        12 2016-01-09/10:25:03

I have also tried

select s.executions_total, s.sql_id,  h.snap_id from dba_hist_sqlstat s, dba_hist_snapshot h

        where h.BEGIN_INTERVAL_TIME between '02-JUN-16' and '03-JUN-16' and s.sql_id = 'script2' group by h.snap_id,s.executions_total,s.sql_id;

and that returns over 25,000 rows.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 6 2016
Added on Jun 8 2016
5 comments
978 views