Oracle - 特定用户的审计跟踪

Oracle - Audit Trail for a specific user(Oracle - 特定用户的审计跟踪)
本文介绍了Oracle - 特定用户的审计跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如该主题所述,我正在寻找一种方法来跟踪特定用户的活动.可能有也可能没有 SYSDBA 或 SYSOPER 权限.

例如,人力资源部.

我想知道他登录的细节是什么,他改变的对象是什么,它们的原始值是什么,执行的SQL语句,执行的过程/函数等.

我们可以在 Oracle 11gR2 Standard/Enterprise 中设置这样的审计跟踪日志吗?

谢谢

解决方案

首先,您需要通过设置audit_trail 参数在您的数据库中启用审计,如下所示-

SQL>更改系统设置 audit_trail='OS|DB|DB,EXTENDED|XML|XML,EXTENDED';

用于审计的初始化参数

然后,您可以将用户审核为-

SQL>CONNECT sys/password AS SYSDBASQL>AUDIT ALL BY 用户名 BY ACCESS;SQL>AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY username BY ACCESS;SQL>AUDIT EXECUTE PROCEDURE BY username BY ACCESS;

审计

审计记录可以在DBA_AUDIT_TRAIL视图中找到.以下查询列出了所有与审计相关的视图.

SQL>SELECT view_name FROM dba_views WHERE view_name LIKE 'DBA%AUDIT%';

细粒度审计仅在企业版中可用.

各版本的功能可用性

As stated on the topic , I am looking for a way for us to track on the activities of the specific user. May or may not have the SYSDBA or SYSOPER privilege.

For example , HR.

I would like to know what are the details of his login , what are the objects that are changed by him , what were their original values , SQL statements executed , what procedure/functions that were executed etc.

Could we set up such audit trail log in Oracle 11gR2 Standard/Enterprise?

Thanks

解决方案

First of all you need to enable auditing in your database by setting audit_trail parameter as shown below-

SQL> alter system set audit_trail='OS|DB|DB,EXTENDED|XML|XML, EXTENDED';

Initialization Parameters Used for Auditing

Then, you can audit user as-

SQL>CONNECT sys/password AS SYSDBA

SQL> AUDIT ALL BY username BY ACCESS;
SQL> AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY username BY ACCESS;
SQL> AUDIT EXECUTE PROCEDURE BY username BY ACCESS;

AUDIT

Audit records can be found in DBA_AUDIT_TRAIL view.Following query list all audit related views.

SQL>SELECT view_name FROM dba_views WHERE view_name LIKE 'DBA%AUDIT%';

Fine-grained auditing is available in Enterprise Edition only.

Feature Availability by Edition

这篇关于Oracle - 特定用户的审计跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
MyBatis support for multiple databases(MyBatis支持多个数据库)
Oracle 12c SQL: Missing column Headers in result(Oracle 12c SQL:结果中缺少列标题)
SQL query to find the number of customers who shopped for 3 consecutive days in month of January 2020(查询2020年1月连续购物3天的客户数量)
How to get top 10 data weekly (This week, Previous week, Last month, 2 months ago, 3 month ago)(如何每周获取前十大数据(本周、前一周、上个月、2个月前、3个月前))
Select the latest record for an Id per day - Oracle pl sql(选择每天ID的最新记录-Oracle pl SQL)