Home » RDBMS Server » Server Administration » Information regarding audit trail for changes in tables
Information regarding audit trail for changes in tables [message #171931] Fri, 12 May 2006 06:27 Go to next message
akghatuary
Messages: 2
Registered: April 2006
Junior Member
Hi,

Oracle must be keeping audit trail of changes in tables in some logfile. I want to know which logfile. How to retrive information from these logfiles ...
Re: Information regarding audit trail for changes in tables [message #172498 is a reply to message #171931] Tue, 16 May 2006 20:28 Go to previous message
krystian.zieja
Messages: 12
Registered: May 2006
Location: Poland
Junior Member
I think you are asking about LogMiner please correct me if I am wrong. Log Minner enables you to read archive redo logs and online redo logs. Below I prepare for you small example (I used the online redo logs but it works the same with archive redo logs.

mob@MOB92.WORLD> create table emp_audit as select * from scott.emp;

Table created.

mob@MOB92.WORLD> update emp_audit set sal = 1.1 * sal where empno=7369;

1 row updated.

mob@MOB92.WORLD> delete emp_audit where ename = 'WARD';

1 row deleted.

sys@MOB92.WORLD> exec dbms_logmnr.add_logfile(logfilename=>'C:\ORACLE\ORADATA\MOB92\REDO01.LOG', options => dbms_logmnr.new)

sys@MOB92.WORLD> exec dbms_logmnr.add_logfile(logfilename=>'C:\ORACLE\ORADATA\MOB92\REDO02.LOG', options=>dbms_logmnr.addfile)

sys@MOB92.WORLD> select timestamp, username, seg_name, sql_redo
2 from v$logmnr_contents
3 where seg_name = 'EMP_AUDIT';

17-MAY-06 MOB
EMP_AUDIT
insert into "MOB"."EMP_AUDIT"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7876','ADAMS','CLERK','7788',TO_DATE('1
2-JAN-83', 'DD-MON-R
R'),'1100',NULL,'20');

17-MAY-06 MOB
EMP_AUDIT
insert into "MOB"."EMP_AUDIT"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7900','JAMES','CLERK','7698',TO_DATE('0
3-DEC-81', 'DD-MON-R
R'),'950',NULL,'30');
….
Output truncated

You can also use auditing – your question is not to descriptive 

Best Regards
Krystian Zieja / mob
Previous Topic: SH schema in Oracle 10g
Next Topic: Finding out if a patch is installed
Goto Forum:
  


Current Time: Fri Sep 20 12:32:25 CDT 2024