【OCP学习1z0-052记录2】AUDIT_TRAIL

版权声明:所有文章禁止转载但是均可在生产中使用提高效率 https://blog.csdn.net/viviliving/article/details/88391106

42: To make audit information more productive, the DBA executes the following command before

starting an audit operation:
SQL> ALTER SYSTEM SETAUDIT_TRAIL=DB,EXTENDED SCOPE=SPFILE;
Which statement is true regarding the audit record generated when auditing starts after restarting
the database?
A.It contains only the plan for the SQL statement executed by the user.
B.It contains the SQL text executed by the user and the bind variables used with it.
C.It contains the plan and statistics associated with the SQL statement executed by the user.
D.It contains the plan for the SQL statement executed by the user and the bind variables used with
it.
Correct Answers:B
Explanation:

AUDIT_TRAIL

参数详解:

AUDIT_TRAIL启用或禁用数据库审计。当设置该参数为NONE或FALSE时,将禁止数据库审计;当设置该参数为OS时,将激活数据库审计,并将审计记录写入到OS审计跟踪文件中;当设置该参数为DB或TRUE时,将激活数据库审计,并将审计记录写入到数据字典SYS.AUD$中;当设置该参数为DB_EXTENDED时,不仅将审计记录写入到数据字典SYS.AUD$中,还会填充该数据字典的SQLBIND和SQLTEXT列。

取值说明:

none 禁用数据库审计

os 启用数据库审计,并将数据库审计记录定向到操作系统审计记录

db 启用数据库审计,并将数据库所有审计记录定向到数据库的SYS.AUD$表

db,extended 启用数据库审计,并将数据库所有审计记录定向到数据库的SYS.AUD$表。另外,填充SYS.AUD$表的SQLBIND 列和SQLTEXT CLOB 列。

xml 启用数据库审计,并将所有记录写到XML格式的操作系统文件中。

xml,extended 启用数据库审计,输出审计记录的所有列,包括SqlText和SqlBind的值。

你可以使用SQL语句AUDIT来设置审计选项,不管如何设置此参数。

用法举例:

因为该初始化参数是静态参数,所以修改后必须重新启动例程。示例如下:

?

1

2

SQL>ALTER SYSTEM SET audit_trail=DB SCOPE=SPFILE;

SQL>STARTUP FORCE;

猜你喜欢

转载自blog.csdn.net/viviliving/article/details/88391106