Skip to content
March 2, 2011 / doganay

COUNT AUD$ RECORDS, GROUP BY USERNAME

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Hi,

sometimes you wonder which user has lots of activities in a day.
you can user this sql to group by counts of audits per user:


-- Code by Mustafa DOGANAY (2011)
prompt 'list audit counts and groups by username...'
accept mydate prompt 'Enter Date(dd.mm.yyyy hh24:mi): '
select userid,count(*) from sys.aud$ where ntimestamp# > to_date('&&mydate','dd.mm.yyyy hh24:mi')
group by userid
order by 2 desc;

try and pray 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: