Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> An issue of auditing DML operations
Hi All,
I have a requirement described below.
Requirement:
When connection is made to the database, the schema to which all the application users connect is the one and the same - i.e. we use SCOTT schema credentials for establishing DB connection for all different application users.
Therefore the detail of which application user is performing the DML is not available for oracle. It is available in the application code. Our primary requirement is that we need to have the detail of the application user doing the transaction to be passed into the database so that we can audit the DML operations done.
To take an example:
Let's say that the table to be audited is EMP which is in SCOTT schema:
SQL> desc EMP
Name Null? Type
----------------------------------------- --------
----------------------------
EMPNO NOT NULL NUMBER (4) ENAME VARCHAR2 (10) JOB VARCHAR2 (9) MGR NUMBER (4) HIREDATE DATE SAL NUMBER (7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2)
Let's say that there are 4 application users; user1, user2, user3 & user4. Now when they connect to the database, the connection is to schema SCOTT. So all the 4 application users will connect to the same db schema 'Scott'. The app users will do some transactions; they may roll it back etc. And we need to track that. - The tricky part being that we need to track which application user has done the DML.
We are planning to track the Edit Audits through Triggers. Before the actual Data record Insert into the EMP table the trigger should insert the Record into the Audit Table, along with the UserID.
We have distributed transactions (under the COM+ Environment)
I am unable to figure out how to meet this requirement...shall be very thankful for any help/suggestions.
Thanks,
Nirav
Received on Fri Nov 23 2007 - 00:59:45 CST
![]() |
![]() |