Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Problem: Custom conflict resoluton on oracle replication
I have a problem, defininig my own procedure for for conflict resolution,
using oracle 7.3.3.0 replication. I have to sites - pavel with database
“pavel” and kenan with database “oracle” On ‘kenan’ I have tables “ITEM” and
“ITEM_PROJECT”: I have defined as recommended on guide of replication -
db_link on ‘kenan’: CREATE PUBLIC DATABASE LINK PAVEL.WORLD CONNECT TO
MATAN48 IDENTIFIED BY MATAN48 USING 'pavel'
And on ‘pavel’ :
CREATE PUBLIC DATABASE LINK ORACLE.WORLD
CONNECT TO SYS
IDENTIFIED BY SYS
USING 'kenan'
On ‘kenan’ - I have created master group - “FOR_PAVEL” , consisting of tables - ‘ITEM’ and ‘ITEM_PROJECT’: Tables “ITEM” and ITEM_PROJECT have snapshot_logs:
CREATE SNAPSHOT LOG ON MATAN48.ITEM;
CREATE SNAPSHOT LOG ON MATAN48.ITEM_PROJECT;
On side of ‘pavel’ - I have created snapshot group: “FOR_PAVEL” , including
updatable snapshots on these two tables, replicated from ‘kenan’: And this
replication scheme worked quite fine - that’s mean it really replicate data.
Now I am trying to define my own routing if conflict resolution. Table “ITEM”
has unique index - ITEM_IDX. I have defined routine, to log conflicts on this
index. I have run on kenan: Connect matan48/bpdm; /*matan48 was granted as
replication administrator on ‘kenan’*
I suspended replication activity on ‘kenan’ from “Replication manager” on master group “FOR_PAVEL”
SQLWKS> BEGIN 2> DBMS_REPCAT.ADD_UNIQUE_RESOLUTION( 3> sname=>'matan48', 4> oname=>'ITEM', 5> constraint_name =>'ITEM_IDX', 6> sequence_no=>0, 7> method=>'USER FUNCTION', 8> parameter_column_name=>'item_key,revision,zz_id,db_zz_id', 9> function_name=>'MATAN48.KEY_REV_CONFLICT'); 10> end; 11>
SQLWKS> BEGIN 2> DBMS_REPCAT.GENERATE_REPLICATION_PACKAGE('matan48','ITEM'); 3> end; 4>
Here is text of 'MATAN48.KEY_REV_CONFLICT': (‘kenan’ site)
CREATE OR REPLACE FUNCTION MATAN48.KEY_REV_CONFLICT (
item_key IN OUT CHAR,
revision IN OUT CHAR,
zz_id IN OUT NUMBER,
db_zz_id IN OUT NUMBER,
ignore_discard_flag OUT BOOLEAN
)
Nothing is inserted into “duplicate_items”…….
???????????????????????????????????????????? -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your OwnReceived on Tue Mar 23 1999 - 04:24:15 CST
![]() |
![]() |