Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Replication
At the beginning of your trigger you should have a condition check as
follows:
if DBMS_REPUTIL.FROM_REMOTE = false
<do your action>
end if.
Richard Ji
-----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Paul van
Dijken
Sent: Thursday, July 20, 2000 2:46 PM
To: Multiple recipients of list ORACLE-L
Subject: Replication
Listers,
Since I have had no experience with replication and looking through the manuals did not provide a clear answer, here is a basic question on replication :
I want to create a multi (2) master replicated database. Changes in database A have to be replicated in database B and vice versa for all tables. There is a requirement that all changes in the database have to be audited into a separate audit_trail table including time, user, reason, etc. We use triggers to do so.
When I insert into database A, the inserted record is audited into the
Audit_trail table of database A. However, since all tables are replicated
into database B, the same record is also inserted into database B. The new
record in the (A) Audit_trail table is replicated into (B) Audit_Table. But
inserting a record triggers the database to put a new record into the (B)
Audit_Trail table, resulting in 2 records in the (B) audit_trail table.
(Now I do not want to think of the replication back into A again)
How do I prevent above scenario. Does Oracle make a distinction between real Inserts in (B) and replicated inserts from (A) ? or do I have to modify my triggers so that I can see from where the insert came from ?
Please help
Paul
-- Author: Paul van Dijken INET: paul.vandijken_at_sema.nl Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Thu Jul 20 2000 - 14:53:53 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).