简体   繁体   English

Oracle Audit Trail获取在上次交易中更新的列的列表

[英]Oracle Audit Trail to get the list of columns which got updated in last transaction

Consider a table(Student) under a schema say Candidates(NOT DBA): 考虑在名为Candidates(NOT DBA)的模式下的表(学生):

Student 学生
{RollNumber : VARCHAR2(10), {RollNumber:VARCHAR2(10),
Name : VARCHAR2(100), 名称:VARCHAR2(100),
CLass : VARCHAR2(5), CLass:VARCHAR2(5),
... ...
... ...
... ...
} }

Let us assume that the table already contains some valid data. 让我们假设该表已经包含一些有效数据。

I executed an update query to modify the name and class of the Student table 我执行了一个更新查询来修改Student表的名称和类

UPDATE STUDENT SET Name = 'ASHWIN' , CLASS = 'XYZ' 
WHERE ROLLNUMBER = 'AQ1212'

Followed by another update query in which I am updating some other fields 其次是另一个更新查询,其中我正在更新其他一些字段

UPDATE STUDENT SET Math_marks = 100 ,PHY_marks , CLASS = 'XYZ' 
WHERE ROLLNUMBER = 'AQ1212'

Since I modified different columns in two different queries. 由于我在两个不同的查询中修改了不同的列。 I need to fetch the particular list of columns which got updated in last transaction. 我需要获取在上次交易中更新的特定列列表。 I am pretty sure that oracle must be maintaining this in some table logs which could be accessed by DBA. 我非常确定oracle必须在某些表日志中维护此设置,DBA可以访问该表日志。 But I don't have the DBA access. 但是我没有DBA访问权限。

All I need is a the list of columns that got updated in last transaction under schema Candidates I DO NOT have the DBA rights 我需要的只是在上一个事务中在架构候选没有我具有DBA权限的列的更新列表

Please suggest me some ways. 请给我一些建议。

NOTE : Here above I mentioned a simple table. 注意 :在上面我提到了一个简单的表。 But In actual I have got 8-10 tables for which I need to do this auditing where a key factor lets say ROLLNUMBER acts a foreign key for all other tables. 但是实际上我有8-10个表,我需要对其进行审计,其中一个关键因素可以说ROLLNUMBER对所有其他表都充当外键。 Writing triggers would be a complex for all tables. 对于所有表而言,编写触发器都会很复杂。 So please help me out if there exists some other way to fetch the same. 因此,如果有其他获取方法,请帮助我。

"I am pretty sure that oracle must be maintaining this in some table logs which could be accessed by DBA." “我很确定oracle必须在某些表日志中维护此设置,DBA可以访问该表日志。”

Actually, no, not be default. 实际上,不,不是默认值。 An audit trail is a pretty expensive thing to maintain, so Oracle does nothing out of the box. 审计跟踪是一项非常昂贵的维护工作,因此Oracle不会立即采取任何措施。 It leaves us to decide what we what to audit (actions, objects, granularity) and then to switch on auditing for those things. 它使我们可以决定要审核的内容(操作,对象,粒度),然后为这些内容开启审核。

The Oracle requires DBA access to enable the built-in functionality, so that may rule it out for you anyway. Oracle需要DBA访问权才能启用内置功能,因此无论如何仍可能需要排除它。

Auditing is a very broad topic, with lots of things to consider and configure. 审计是一个非常广泛的主题,需要考虑和配置许多事项。 The Oracle documentation devotes a big chunk of the Security manual to Auditing. Oracle文档将《安全性》手册的很大一部分专门用于审核。 Find the Introduction To Auditing here . 此处找到审计简介 For monitoring updates to specific columns, what you're talking about is Fine-Grained Audit. 为了监视特定列的更新,您要说的是“精细审核”。 Find out more . 了解更多


"I have got 8-10 tables ... Writing triggers would be a complex for all tables." “我有8-10张桌子。写触发器对于所有桌子来说都是很复杂的。”

Not necessarily. 不必要。 The triggers will all resemble each other, so you could build a code generator using the data dictionary view USER_TAB_COLUMNS to customise some generic boilerplate text. 触发器将彼此相似,因此您可以使用数据字典视图USER_TAB_COLUMNS来构建代码生成器,以自定义一些通用样板文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM