oracle 数据库 AUDIT 不显示 SQL 文本和绑定值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13100054/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:11:50  来源:igfitidea点击:

oracle database AUDIT doesn't show SQL text and bind values

oracleaudit

提问by Majid Azimi

Based on this tutorialI have configured auditing on a database with these options:

根据本教程,我使用以下选项配置了对数据库的审计:

AUDIT ALL BY db BY ACCESS;
AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY db BY ACCESS;
AUDIT EXECUTE PROCEDURE BY db BY ACCESS;

I prepare query from java and run a SELECTquery. DBA_AUDIT_TRAILtable shows my SELECTquery but SQL_TEXTand SQL_BINDfields are empty. How can I see them? Should I enable any other option? I'm using Oracle 11.2 Express Edition. Is this because It is express edition?

我从 java 准备查询并运行SELECT查询。DBA_AUDIT_TRAIL表格显示我的SELECT查询,但SQL_TEXTSQL_BIND字段为空。我怎么能看到他们?我应该启用任何其他选项吗?我正在使用 Oracle 11.2 快捷版。这是因为它是速成版吗?

回答by Nick Krasnov

The column SQLTEXTand SQLBINDare populated only when AUDIT_TRAILoption is set to db, extended. Here is an example:

The column SQLTEXTand SQLBINDare populated only when AUDIT_TRAILoption is set to db, extended. 下面是一个例子:

SQL> alter system set audit_trail=db,extended scope=spfile;

System altered

Restart the instance.

重启实例。

SQL> audit select on your_table;

Audit succeeded

SQL> select sqltext from sys.aud$ where obj$name = 'YOUR_TABLE';

SQLTEXT
--------------------------------------------------------------------------------
null

SQL> select count(*) from your_table;

  COUNT(*)
----------
         3

SQL> select sqltext from sys.aud$ where obj$name = 'YOUR_TABLE';

SQLTEXT
--------------------------------------------------------------------------------
select count(*) from your_table


SQL>