How to check if auditing is enabled:
- connect as sysdba
- run
SHOW PARAMETER AUDIT_TRAIL;
- Update parameter file:
ALTER SYSTEM SET AUDIT_TRAIL='DB' SCOPE=SPFILE;
- Shutdown the database
SHUTDOWN IMMEDIATE;
- Re-start and open database
STARTUP OPEN;
- Check the parameter value:
SHOW PARAMETER AUDIT_TRAIL;
SELECT ACTION, SQL_TEXT FROM DBA_AUDIT_TRAIL;To view what is audited for each user, run:
SELECT USER_NAME, AUDIT_OPTION FROM DBA_STMT_AUDIT_OPTS WHERE NOT USER_NAME IS NULL;To retrieve all the sql statements ran by a current user, run (AUDIT_TRAIL should be set to DB_EXTENDED in order to auddit actual sql statements):
SELECT SQL_TEXT FROM USER_AUDIT_OBJECT;
No comments:
Post a Comment