|
- select p.spid , s.terminal
- from v$session s , v$process p
- where s.paddr=p.addr and s.username='OPS$ORACLE';
- ---
- create tablespace tbsaudit datafile size 50M autoextend on;
- create table taudit1 ( username varchar2(30) , audtime date , audip varchar2(100) , authen varchar2(50)) ;
- select * from dba_triggers t where t.owner='SYS' and t.trigger_name='TRIGGER1';
- create or replace trigger trigger1
- after logon on database
- when (user like 'OPS$%' or user ='HR')
- begin
- insert into taudit1 values( user, sysdate , sys_context('userenv','ip_address'), sys_context('userenv','authentication_method') );
- commit;
- end;
- select * from dba_triggers t where t.owner='SYS' and t.trigger_name='TRIGGER1';
- select * from taudit1;
- ----
- select * from aud$;
- select * from dba_audit_trail order by timestamp desc;
- ---
- select * from dba_tables t where t.owner='SYS' and t.table_name='AUD
- ;
- alter table AUD$ move tablespace tbsaudit;
- ----
- select * from dba_common_audit_trail;
- select * from dba_audit_trail order by timestamp desc ;
- ---
- select * from dict where table_name like '%AUDIT%OPTS';
- select * from DBA_OBJ_AUDIT_OPTS;
- select * from DBA_STMT_AUDIT_OPTS
- minus
- select * from DBA_PRIV_AUDIT_OPTS;
- --
- audit select on hr.employees by session whenever successful ;
- noaudit select on hr.employees;
- audit select on hr.employees by access whenever successful ;
- ----
- audit update on hr.employees whenever successful ;
- ----
- select * from v$xml_audit_trail order by 6 desc;
- ---
- select * from dba_common_audit_trail order by 6 desc;
- ---
- select * from DBA_STMT_AUDIT_OPTS order by 1;
- audit table by hr ;
复制代码
|
|