Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6666479
  • 博文数量: 1005
  • 博客积分: 8199
  • 博客等级: 中将
  • 技术积分: 13071
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-25 20:19
个人简介

脚踏实地、勇往直前!

文章分类

全部博文(1005)

文章存档

2020年(2)

2019年(93)

2018年(208)

2017年(81)

2016年(49)

2015年(50)

2014年(170)

2013年(52)

2012年(177)

2011年(93)

2010年(30)

分类: Oracle

2013-05-23 10:42:35

环境:
DB:11.2.0.1

本想对ddl做审计,执行如下语句报错误
SQL> connect system/oracle@mydb
已连接。
SQL> AUDIT Drop ANY TABLE BY scott BY Session WHENEVER Successful;
AUDIT Drop ANY TABLE BY scott BY Session WHENEVER Successful
                                 *
第 1 行出现错误:
ORA-32595: 不能使用指定的 BY SESSION 对 DDL 语句进行审计

该错误的描述如下:
ORA-32595: DDL statement cannot be audited with BY SESSION specified Cause: An attempt was made to audit a DDL statement with BY SESSION clause specified. DDL statements can be audited BY ACCESS only.
Action: Specify BY ACCESS instead of BY SESSION to audit the DDL statement.

将语句修改如下问题解决

SQL> AUDIT Drop ANY TABLE BY scott BY ACCESS  WHENEVER Successful;

审计已成功。


有关by session和by access官网的解释如下:
BY SESSION
In earlier releases, BY SESSION caused the database to write a single record for all SQL statements or operations of the same type executed on the same schema objects in the same session. Beginning with this release of Oracle Database, both BY SESSION and BY ACCESS cause Oracle Database to write one audit record for each audited statement and operation. BY SESSION continues to populate different values to the audit trail compared with BY ACCESS. Oracle recommends that you include the BY ACCESS clause for all AUDIT statements, which results in a more detailed audit record. If you specify neither clause, then BY SESSION is the default.

Note:

This change applies only to schema object audit options, statement options and system privileges that audit SQL statements other than data definition language (DDL) statements. The database has always audited BY ACCESS all SQL statements and system privileges that audit a DDL statement.


BY ACCESS
Specify BY ACCESS if you want Oracle Database to write one record for each audited statement and operation.

-- The End --

阅读(4670) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~