Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling Supplemental logging.

Status
Not open for further replies.

madhes

Programmer
Apr 16, 2001
18
US
Hi,

We need to enable the supplemental logging for Oracle 8i tables. This is
used to tell Oracle, what are all the columns should be logged when the DMLs
are performed.

This can be done in 9i, using the following commands:
Database level:
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
Table level:
ALTER TABLE T1 ADD SUPPLEMENTAL LOG GROUP T1_LOGGRP (col1, col2) ALWAYS;
(where col1 and col2 are primary keys of table T1).

But, the ALTER DATABASE and ALTER TABLE commands in 8i doesnt have these
clauses. There should be some other way to do this, but not sure how.

Example:
Assume the following query is applied on table T1:
"UPDATE T1 SET col3=100 WHERE col3=10;".

This will be logged in the log file as follows:

with SUPPLEMENTAL LOGGING enabled:
&quot;UPDATE T1 SET col3 = 100 WHERE col1 = 'E001' AND col2 = 'Tom' AND col3 = 10 AND ROW-ID = '<row-id>';&quot;

with SUPPLEMENTAL LOGGING disabled:
&quot;UPDATE T1 SET col3 = 100 WHERE col3 = 10 AND ROW-ID = '<row-id>';&quot;

tia,
madhes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top