ITPub博客

首页 > 应用开发 > IT综合 > audit时的by session和by access选项的区别!

audit时的by session和by access选项的区别!

原创 IT综合 作者:warehouse 时间:2011-01-26 22:26:15 0 删除 编辑

不知道该起一个怎样的标题,总之写这个文章的目的是源于一个从我这儿报名考ocp的哥们的问题,他做了一个针对042题库上第12题的测试然后向我求证答案是否正确,很显然答案A是不正确的,原因就像下面doc说的在语句审计和权限审计审计DDL语句时只能使用by access,可语法上oracle并没有限制,也就是说使用by session时也不会报错,这样很容易引起误导,感觉oracle在很多地方都不够严谨。

Number of Audit Records from Multiple Executions of a Statement

If an audited statement is issued multiple times in a single user session, then your audit trail can have one or more related records. The controlling clause BY ACCESS causes each execution of an auditable operation within a cursor to generate a separate audit record. If you use the BY SESSION clause instead, then your audit trail will contain a single audit record for each session, for each user and schema object. Only one audit record results, no matter how often the statement occurs in that session.

However, several audit options can be set only BY ACCESS:

  • All statement audit options that audit DDL statements

  • All privilege audit options that audit DDL statements

For all other audit options, BY SESSION is used by default.

[@more@]12. You execute the following command to audit the database activities:
SQL> AUDIT DROP ANY TABLE BY scott BY SESSION WHENEVER SUCCESSFUL;
What is the effect of this command?
A. One audit record is created for the whole session if user SCOTT successfully drops one or more tables
in his session.
B. One audit record is created for every session when any user successfully drops a table owned by
SCOTT.
C. One audit record is created for each successful DROP TABLE command executed by any user to drop
tables owned by SCOTT.
D. One audit record is generated for the session when SCOTT grants the DROP ANY TABLE privilege to
other users in his session.
E. One audit record is created for each successful DROP TABLE command executed in the session of
SCOTT.
Answer: A

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/19602/viewspace-1045216/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: EM和动态ip
请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    717
  • 访问量
    5366293