Database Tuning (MOSC)

MOSC Banner

ASH sampling

Dear Experts,

We have a session started yesterday at 14-JUL-2023 22:00:00 PM,it is still running. We are querying the ASH to find out which sql is seen most. We are usingbelow query from dba_hist_active_sess_history. But it shows the first sql seen for 33 hours,but it not in reality. Are we checking something wrong?


SELECT ash.SQL_ID,ash.event,count(*)*10
FROM dba_hist_active_sess_history ash , dba_users u WHERE u.user_id=ash.user_id and ash.sample_time BETWEEN
to_date('14-JUL-2023 22:00:00','DD-MON-YYYY HH24:MI:SS') and
   to_date('15-JUL-2023 15:00:10','DD-MON-YYYY HH24:MI:SS') and session_id=521 and session_Serial#=22192 group by ash.SQL_ID,ash.event order by 3 desc;

SQL_ID        EVENT                          COUNT(*)*10
------------- ------------------------------ -----------
bzj08ydszd31g                                     121260
bzj08ydszd31g db file sequential read                340
bzj08ydszd31g gc current block 2-way                  60
8k1k3u2v5f5a2 db file sequential read                 40
 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center