Oracle SQL查询日志记录 [英] Oracle SQL Query logging

查看:598
本文介绍了Oracle SQL查询日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Oracle 11g标准版.

I'm using Oracle 11g Standard Edition.

我想将用户正在执行的所有SQL查询记录到表中.

I would like to log all SQL queries, that are being executed by users, into a table.

这怎么办?

推荐答案

如果您使用的是现代版本的数据库(9i或更高版本),并且您拥有企业版许可证,则可以使用细粒度审核.它使我们能够通过已定义的策略以非常低的粒度审核用户查询.

If you're using a modern version of the database (9i or later) and you have an Enterprise Edition license you can use Fine-Graining Auditing. It allows us to audit user queries at a very low level of granularity, through defined policies.

要捕获SQL文本并绑定变量,您需要在添加FGA策略时适当设置AUDIT_TRAIL参数. 了解详情.

To capture SQL text and bind variables you will need to set the AUDIT_TRAIL parameter appropriately when adding an FGA Policy. Find out more.

我使用的是11g标准,因此不支持审核功能."

"i'm using an 11g standard, so auditing functions are not supported."

不完全是. AUDIT命令是标准Oracle构建的一部分,但是它仅允许我们在给定用户针对给定表发出SELECT时捕获.但是,是的,要确切地了解他们选择的内容是什么,需要Enterprise Edition许可证.

Not exactly. The AUDIT command is part of the standard Oracle build, but it only allows us to capture when a given user issues a SELECT against a given table. But, yes, to find out exactly what they are selecting requires Enterprise Edition license.

也没有ON SELECT触发器,因此我们无法滚动自己的触发器.

Also there is no ON SELECT trigger, so we cannot roll our own.

那么我可以在标准版中使用AUDIT命令吗? 顾问告诉我,如果不付钱,我就无法使用它 执照? "

"So can i use AUDIT command in the standard edition? ... But then a consultant told me, that i cannot use it without paying enterprise license? "

我自己以顾问的身份发言,我不得不说那些家伙并不总是知道他们在说什么.

Speaking as a consultant myself, I do have to say those guys don't always know what they are talking about.

所以我们要弄清楚:

  • AUDIT命令是Oracle SQL的一部分.它可与标准版一起使用.实际上,从11g开始,默认情况下已启用它.它审核一般活动. 了解更多信息.
  • 细粒度审核是一个PL/SQL程序包,仅当您拥有企业版时才可用.它使我们可以在非常低的水平上审计用户活动. 了解更多信息.
  • the AUDIT command is part of Oracle SQL. It is usable with the Standard Edition. In fact since 11g it is enabled by default. It audits general activity. Find out more.
  • Fine Grained Auditing is a PL/SQL package with is only usable if you have the Enterprise Edition. It allows us to audit user activity at a very low level. Find out more.

这篇关于Oracle SQL查询日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆