|
本帖最后由 botang 于 2014-8-6 16:39 编辑
- select * from dict where table_name like 'DBA%AUDIT%';
- select * from DBA_OBJ_AUDIT_OPTS;
- select * from DBA_STMT_AUDIT_OPTS;
- select * from DBA_PRIV_AUDIT_OPTS;
- select * from dba_audit_trail;
- select * from dba_views v where v.view_name='DBA_AUDIT_TRAIL';
- select * from dba_tables t where t.owner='SYS' and t.table_name='AUD
- ;
- alter table aud$ move tablespace tbsaudit;
- select * from dba_tables t where t.owner='SYS' and t.table_name='AUD
- ;
- select * from dba_audit_trail;
- truncate table aud$;
- select * from dba_audit_trail where username='HR';
- select * from tlogon;
- select * from dba_source s where s.name='TRGLOGON';
- --ing , ed
- create or replace trigger trglogon
- after logon on database
- when ( user ='HR' )
- begin
- insert into tlogon values( to_char(sysdate,'YYYY-MM-DD HH24:MI:SS'),
- sys_context('userenv','ip_address'),
- sys_context('userenv','session_user'));
- commit;
- end;
- select a.audit_option from DBA_STMT_AUDIT_OPTS a
- minus
- select b.privilege from DBA_PRIV_AUDIT_OPTS b ;
- audit table ;
- select a.audit_option from DBA_STMT_AUDIT_OPTS a
- minus
- select b.privilege from DBA_PRIV_AUDIT_OPTS b ;
- select * from dba_audit_trail where username='HR' order by timestamp desc ;
- select * from dba_stmt_audit_opts where audit_option='TABLE';
- noaudit table;
- audit table by hr by access whenever successful ;
- alter user sh identified by oracle_4U account unlock;
- grant select on hr.employees to sh ;
- audit select on hr.employees by session ;
- select * from DBA_OBJ_AUDIT_OPTS;
- noaudit select on hr.employees;
- audit select on hr.employees by access whenever successful ;
- select * from dba_audit_trail where username='SYSTEM' order by timestamp desc ;
- grant update(salary) on hr.employees to sh;
- ---audit update(salary) on hr.employees ;
- grant select any table to sh ;
- -----
- audit select any table by sh by session whenever successful;
- select * from DBA_PRIV_AUDIT_OPTS;
- select * from dba_audit_trail where username='SH' order by timestamp desc ;
- select * from v$xml_audit_trail order by extended_timestamp desc;
- select * from dba_audit_trail where username='SH' order by timestamp desc ;
- select * from dba_common_audit_trail where db_user='HR' order by extended_timestamp desc ;
- select * from DBA_OBJ_AUDIT_OPTS;
- audit update on hr.employees whenever successful;
- create table tvalue as select * from tlogon where 1=2;
- select * from tvalue;
- alter table tvalue add ( audit_oldvalue number(8,2) , audit_newvalue number(8,2)) ;
- create or replace trigger trgvalue
- after update of salary on hr.employees
- referencing new as new old as old
- for each row
- begin
- if :old.salary != :new.salary then
- insert into tvalue
- values ( to_char(sysdate,'YYYY-MM-DD:HH24:MI:SS'),
- sys_context('userenv','ip_address'),
- sys_context('userenv', 'session_user'),
- :old.salary,
- :new.salary
- );
- end if;
- end;
复制代码
|
|