Database Administration (MOSC)

MOSC Banner

Tying to get all the UPDATE statements between 2 snapshots

edited Jan 19, 2010 2:27PM in Database Administration (MOSC) 2 commentsAnswered
  Hi,

we are trying to find out how many UPDATE statements are executed in our database on hourly basis (between 2 AWR snapshots) using the following SQL

select
  p.sql_id,
  p.object_name,
  p.operation,
  p.options,
  count(1)
from
   dba_hist_sql_plan p,
   dba_hist_sqlstat  s
where
s.snap_id between &bgn_id and &end_id
and
p.object_owner not in ('SYS','SYSTEM','SYSAUX')
and
p.operation='UPDATE'
and
p.sql_id = s.sql_id
group by
   p.sql_id,
   p.object_name,
   p.operation,
   p.options
order by
2,3,4;


But the problem here is that in our database, there are 2 types of update statments

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