Bo's Oracle Station

查看: 2213|回复: 0

第39次:2015-04-21 星期二

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2015-4-22 08:06:19 | 显示全部楼层 |阅读模式
  1. select  p.spid  , s.terminal
  2. from v$session s , v$process p
  3. where s.paddr=p.addr and s.username='OPS$ORACLE';

  4. ---

  5. create tablespace tbsaudit datafile size 50M autoextend on;

  6. create table taudit1 ( username varchar2(30)  ,   audtime date ,  audip varchar2(100) , authen  varchar2(50))  ;

  7. select  * from dba_triggers t where t.owner='SYS' and t.trigger_name='TRIGGER1';


  8. create or replace trigger trigger1
  9. after logon on database
  10. when (user like 'OPS$%'  or user ='HR')
  11. begin
  12.         insert into taudit1 values( user,  sysdate ,  sys_context('userenv','ip_address'),  sys_context('userenv','authentication_method')    );
  13.         commit;
  14. end;


  15. select  * from dba_triggers t where t.owner='SYS' and t.trigger_name='TRIGGER1';

  16. select  * from taudit1;

  17. ----

  18. select  * from aud$;

  19. select * from dba_audit_trail order by timestamp desc;

  20. ---

  21. select * from dba_tables t where t.owner='SYS' and t.table_name='AUD

  22. ;

  23. alter table AUD$  move tablespace tbsaudit;

  24. ----

  25. select * from dba_common_audit_trail;

  26. select *  from dba_audit_trail  order by timestamp desc ;

  27. ---
  28. select * from dict where table_name like '%AUDIT%OPTS';

  29. select * from DBA_OBJ_AUDIT_OPTS;



  30. select * from  DBA_STMT_AUDIT_OPTS
  31. minus
  32. select  * from  DBA_PRIV_AUDIT_OPTS;

  33. --
  34. audit select on hr.employees   by  session   whenever successful   ;

  35. noaudit select  on hr.employees;
  36. audit select on hr.employees   by  access  whenever successful   ;

  37. ----
  38. audit update on  hr.employees    whenever successful   ;
  39. ----
  40. select  * from v$xml_audit_trail order by 6 desc;

  41. ---
  42. select * from dba_common_audit_trail order by 6 desc;
  43. ---
  44. select * from  DBA_STMT_AUDIT_OPTS order  by 1;


  45. audit table by hr ;

复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 00:18 , Processed in 0.033337 second(s), 24 queries .

快速回复 返回顶部 返回列表