-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaudit_logoff_cleanup.sql
43 lines (33 loc) · 1.39 KB
/
audit_logoff_cleanup.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--====== ========================================================================
-- GPI - Gunther Pippèrr
-- Desc: Query the audit log entries for LOGOFF BY CLEANUP events
--
-- Must be run with dba privileges
--==============================================================================
set linesize 130 pagesize 300
column username format a20 heading "DB User|name"
column action_name format a25 heading "Action|name"
column first_log format a25 heading "First|entry"
column last_log format a25 heading "Last|entry"
column entries format 999G999G999 heading "Audit|entries"
column action_count format 999G9999 heading "Action|Count"
column os_username format a16 heading "User|Name"
column userhost format a20 heading "User |Host"
column timestamp format a23 heading "Time"
column CLIENT_ID format a18 heading "DB User|Client Id"
ttitle left "Audit log Clean Up Entries order by time desc" skip 2
select
to_char (extended_timestamp, 'dd.mm hh24:mi:ss') as timestamp
, instance_number
, username
, action_name
, userhost
, CLIENT_ID
from dba_audit_trail
where extended_timestamp between sysdate - ( 1 / 4) and sysdate
and action_name like 'LOGOFF BY CLEANUP'
order by extended_timestamp desc
/
prompt
prompt
ttitle off