Bo's Oracle Station

查看: 2357|回复: 0

第45次:2016-01-11星期一

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-1-12 09:30:26 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2016-1-12 09:40 编辑

第45次:2016-01-11星期一
  1. select * from dba_tablespaces;

  2. create tablespace tbsaudit datafile size 20M autoextend on;

  3. select  * from dba_views where view_name='DBA_AUDIT_TRAIL';

  4. select * from dba_tables t where t.table_name='AUD

  5. ;

  6. alter table aud$ move tablespace tbsaudit;

  7. truncate table aud$;


  8. select  * from aud$;



  9. -------------------------

  10. select  * from  dict where table_name like '%OPT%';

  11. select  * from  DBA_OBJ_AUDIT_OPTS;

  12. select  * from DBA_PRIV_AUDIT_OPTS  p  order by p.privilege;



  13. select  * from  DBA_STMT_AUDIT_OPTS a order by a.audit_option;


  14. select  * from  DBA_STMT_AUDIT_OPTS
  15. minus
  16. select  * from DBA_PRIV_AUDIT_OPTS;
  17. ----
  18. audit select  on hr.employees  ;
  19. select  * from dba_audit_trail    where username='HR'  order by timestamp desc;

  20. ----

  21. noaudit select on hr.employees ;

  22. audit select  on hr.employees by access;

  23. -----
  24. audit update on hr.employees whenever  successful;

  25. select  * from dba_audit_trail   where username ='SYS'  order by timestamp desc;


  26. ---
  27. select * from dba_tablespaces;

  28. create tablespace tbsaudit datafile size 20M autoextend on;

  29. select  * from dba_views where view_name='DBA_AUDIT_TRAIL';

  30. select * from dba_tables t where t.table_name='AUD

  31. ;

  32. alter table aud$ move tablespace tbsaudit;

  33. truncate table aud$;


  34. select  * from aud$;



  35. -------------------------

  36. select  * from  dict where table_name like '%OPT%';

  37. select  * from  DBA_OBJ_AUDIT_OPTS;

  38. select  * from DBA_PRIV_AUDIT_OPTS  p  order by p.privilege;



  39. select  * from  DBA_STMT_AUDIT_OPTS a order by a.audit_option;


  40. select  * from  DBA_STMT_AUDIT_OPTS
  41. minus
  42. select  * from DBA_PRIV_AUDIT_OPTS  order by 3 desc ;
  43. ----
  44. audit select  on hr.employees  ;
  45. select  * from dba_audit_trail    where username='HR'  order by timestamp desc;

  46. ----

  47. noaudit select on hr.employees ;

  48. audit select  on hr.employees by access;

  49. -----
  50. audit update on hr.employees whenever  successful;

  51. select  * from dba_audit_trail    order by timestamp desc;

  52. audit table by sh by session;

  53. ----
  54. grant select  any table to sh;

  55. ----
  56. select  * from v$xml_audit_trail    ;



  57. ---
  58. audit select  any table by sh by session ;

  59. ---
  60. select  * from dba_audit_trail    order by timestamp desc;

  61. ---
  62. noaudit drop any table by sh;

  63. audit drop any table by sh by access whenever successful;

  64. ----
  65. ---XML

  66. grant drop any table to sh;
  67. -----

  68. select  * from dba_common_audit_trail   order by 6 desc ;
  69. ---
  70. create table tvalue ( a varchar2(1000))  tablespace tbsaudit ;

  71. ---
  72. create or replace trigger trgvalue
  73. after update of salary on hr.employees
  74. referencing new as new old as old
  75. for each row
  76. begin
  77.   if :old.salary != :new.salary then
  78.      insert into tvalue
  79.       values (sys_context('userenv','os_user')||sysdate||' modified '||:new.salary|| :old.salary||'.'||
  80.         sys_context('userenv','current_user')|| sys_context('userenv','session_user')
  81.       );      
  82.   end if;
  83. end;

  84. select  * from dba_objects o where o.object_name='TRGVALUE';

  85. select  * from user_errors ;


  86. select  * from tvalue;






复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-1 10:33 , Processed in 0.052750 second(s), 25 queries .

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