AUDIT Statement

Audit an SQL statement or access to a specific database object.

Syntax Auditing SQL:

   AUDIT ALL|ALL PRIVILEGES|sql_statement|system_priv [options]

   Options:
     BY user
     BY proxy [ON BEHALF OF ANY|user]
     BY ACCESS|SESSION [WHENEVER [NOT] SUCCESSFUL]

Syntax for Auditing Objects:

   AUDIT action on schema.object BY ACCESS|SESSION [WHENEVER [NOT] SUCCESSFUL]
   AUDIT action on DEFAULT BY ACCESS|SESSION [WHENEVER [NOT] SUCCESSFUL]
   AUDIT action on DIRECTORY dir_name BY ACCESS|SESSION [WHENEVER [NOT] SUCCESSFUL]

     Where actions is any of
      ALTER, AUDIT, COMMENT, DELETE, EXECUTE, GRANT,
      INDEX, INSERT, LOCK, RENAME, SELECT, UPDATE

You must first enable auditing with the init.ora parameter AUDIT_TRAIL = YES

"I would have made a good Pope" ~ Richard M. Nixon

Related:

NOAUDIT - Disable auditing
GRANT - Grant Privs

 DBA_AUDIT_EXISTS 
 DBA_AUDIT_OBJECT      USER_AUDIT_OBJECT 
 DBA_AUDIT_SESSION     USER_AUDIT_SESSION 
 DBA_AUDIT_STATEMENT   USER_AUDIT_STATEMENT 
 DBA_AUDIT_TRAIL       USER_AUDIT_TRAIL 
 DBA_OBJ_AUDIT_OPTS    USER_OBJ_AUDIT_OPTS 
 DBA_PRIV_AUDIT_OPTS                  QUEUE_PRIVILEGES

Equivalent SQL Server command: sp_trace_setstatus / DBCC TRACEON


© Copyright SS64.com 1999-2014
Some rights reserved