-- Relatório de objetos auditados
select distinct os_username,username,terminal,trunc(timestamp),action_name,obj_name from dba_audit_trail order by 4 desc
--
SELECT * FROM DBA_AUDIT_TRAIL A ORDER BY A.timestamp desc
SELECT * FROM DBA_AUDIT_OBJECT
SELECT * FROM DBA_COMMON_AUDIT_TRAIL
SELECT * FROM DBA_AUDIT_EXISTS
SELECT * FROM DBA_AUDIT_POLICIES
SELECT * FROM DBA_AUDIT_POLICY_COLUMNS
SELECT * FROM DBA_AUDIT_SESSION
SELECT * FROM DBA_AUDIT_STATEMENT
-- Políticas de autitoria em vigor
SELECT * FROM DBA_OBJ_AUDIT_OPTS
SELECT * FROM DBA_PRIV_AUDIT_OPTS
SELECT * FROM DBA_STMT_AUDIT_OPTS


-- Comando para audidar tabelas e objetos
AUDIT [SELECT | UPDATE | INSERT | ALL] on CORPORATIVO.TB_GRUPO_TIPO_DOCUMENTO BY ACCESS WHENEVER SUCCESSFUL
AUDIT ALTER USER
AUDIT SELECT TABLE, UPDATE TABLE; 
AUDIT SELECT TABLE, UPDATE TABLE BY hr, oe; 

-- Comando para remover a auditoria 
NOAUDIT [SELECT | UPDATE | INSERT | ALL] on DBCORPORATIVO.TB_PAIS [WHENEVER SUCCESSFUL]NOAUDIT session;
NOAUDIT session BY preston, sebastian;
NOAUDIT select ANY TABLE;
NOAUDIT SELECT TABLE, INSERT TABLE, DELETE TABLE, EXECUTE PROCEDURE;
NOAUDIT select, update, delete, insert on OWNER.TABLE;
NOAUDIT ALL STATEMENTS;

--Purging a Subset of Records from the Database Audit Trail
SELECT * FROM SYS.AUD$;
--1.
DELETE FROM SYS.AUD$;
--1.1
ALTER TABLE SYS.AUD$ SHRINK SPACE;
-- or
--2.
TRUNCATE TABLE SYS.AUD$;


--documentation:
--http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_9017.htm#i2088908
--http://download.oracle.com/docs/cd/E11882_01/network.112/e16543/auditing.htm#DBSEG006
--http://download.oracle.com/docs/cd/E11882_01/server.112/e10575/tdpsg_auditing.htm#CEGIDHAG
 

hostgator