Re: Database auditing

  • From: "Jared Still" <jkstill@xxxxxxxxx>
  • To: fred_fred_1@xxxxxxxxxxx
  • Date: Tue, 22 Aug 2006 10:55:02 -0700

The attached script will create a view DBA_TABLE_AUDIT_FLAGS.

If you create this, do it as SYS or SYSDBA.

The following statement will show tables are being audited:

 select * from dba_table_audit_flags;


Jared

On 8/10/06, Fred Smith <fred_fred_1@xxxxxxxxxxx> wrote:

How can I check if the previous dba left anything auditing in my database?

Thanks!

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

--
//www.freelists.org/webpage/oracle-l





--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
-- dba_table_audit_flags.sql
--
-- show audit owner, table, status of auditing on
-- SELECT, INSERT, UPDATE, DELETE
--
-- works on 7.3+

drop view dba_table_audit_flags;

create or replace view dba_table_audit_flags
(
        owner
        , table_name
        , select_audit
        , insert_audit
        , update_audit
        , delete_audit
        , alter_audit
        , audit_audit
        , comment_audit
        , grant_audit
        , index_audit
        , lock_audit
        , rename_audit
        , references_audit
        , execute_audit
        --, audit_flags
)
as
select u.name, o.name
                 , decode(substr(t.audit$,19,2),'SS','Y','N') -- select
                 , decode(substr(t.audit$,13,2),'SS','Y','N') -- insert
                 , decode(substr(t.audit$,21,2),'SS','Y','N') -- update
                 , decode(substr(t.audit$, 7,2),'SS','Y','N') -- delete
                 , decode(substr(t.audit$, 1,2),'SS','Y','N') -- alter 
                 , decode(substr(t.audit$, 3,2),'SS','Y','N') -- audit
                 , decode(substr(t.audit$, 5,2),'SS','Y','N') -- comment
                 , decode(substr(t.audit$, 9,2),'SS','Y','N') -- grant
                 , decode(substr(t.audit$,11,2),'SS','Y','N') -- index
                 , decode(substr(t.audit$,15,2),'SS','Y','N') -- lock
                 , decode(substr(t.audit$,17,2),'SS','Y','N') -- rename
                 , decode(substr(t.audit$,23,2),'SS','Y','N') -- references
                 , decode(substr(t.audit$,25,2),'SS','Y','N') -- execute
       --, t.audit$
from sys.user$ u, sys.tab$ t, sys.obj$ o
where o.owner# = u.user#
  and o.obj# = t.obj#
  and instr(t.audit$,'S') > 0
/


create public synonym dba_table_audit_flags for sys.dba_table_audit_flags;

grant select on dba_table_audit_flags to dba;

Other related posts: