Also called as active to active configuration
Source will send the changes to target
Both the sites are actively doing transactions and sending changes to each other
There are several configuration need to take consideration while create active active configuration.
EG.
Conflict Detetion and resolution:
Conflict Resolution:
Resolveconflict Built in Methods:
Sequence Considerations:
Truncate considerations:
=================================
Setup:
edit param BE_SCOTT
EXTRACT BE_SCOTT
SETENV (ORACLE_HOME = "/u008/app/oracle/product/19.3.0/dbsoft")
SETENV (ORACLE_SID = "SRC")
useridalias boggsource
TRANLOGOPTIONS EXCLUDEUSER OGG_CLASS
--logallsupcols supports IR and conflict resolution feature
LOGALLSUPCOLS
--GETUPDATEBEFORES
TRANLOGOPTIONS integratedparams (max_sga_size 200, parallelism 2)
GETTRUNCATES
--ENCRYPTTRAIL AES192
exttrail ./dirdat/bl
TABLE BSCOTT.*,GETBEFORECOLS (ON UPDATE ALL,ON DELETE ALL);
---
add extract BE_SCOTT, integrated TRANLOG , begin now
ADD EXTTRAIL ./dirdat/bl, EXTRACT BE_SCOTT, megabytes 200
GGSCI (rac1.databasexpert.com as ogg_class@SRCDB) 36> open wallet
Opened wallet at location 'dirwlt'.
GGSCI (rac1.databasexpert.com as ogg_class@SRCDB) 37> add masterkey
Master key 'OGG_DEFAULT_MASTERKEY' added to wallet at location 'dirwlt'.
GGSCI (rac1.databasexpert.com as ogg_class@SRCDB) 38>
edit param BP_SCOTT
EXTRACT BP_SCOTT
useridalias boggsource
--RMTHOSTOPTIONS encrypt AES192
rmttrail ./dirdat/br
rmthost 192.168.56.40,mgrport 7809
TABLE BSCOTT.*;
add extract BP_SCOTT , exttrailsource ./dirdat/bl begin now
add rmttrail ./dirdat/br, extract BP_SCOTT
edit param Br_scott
replicat br_scott
DBOPTIONS INTEGRATEDPARAMS(parallelism 2)
useridalias boggtarget
MAP BSCOTT.*, TARGET BSCOTT.*
COMPARECOLS (ON UPDATE ALL, ON DELETE ALL),
RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, IGNORE)),
RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, IGNORE));
add replicat BR_SCOTT, Integrated exttrail ./dirdat/br
Reverse Configuration
edit param BE_SCOTT
EXTRACT BE_SCOTT
SETENV (ORACLE_HOME = "/u008/app/oracle/product/19.3.0/db")
SETENV (ORACLE_SID = "TRGT")
useridalias boggtarget
TRANLOGOPTIONS EXCLUDEUSER OGG_CLASS
--logallsupcols supports IR and conflict resolution feature
LOGALLSUPCOLS
--GETUPDATEBEFORES
TRANLOGOPTIONS integratedparams (max_sga_size 200, parallelism 2)
--ENCRYPTTRAIL AES192
exttrail ./dirdat/bs
TABLE BSCOTT.*,GETBEFORECOLS (ON UPDATE ALL,ON DELETE ALL);
add extract BE_SCOTT, integrated TRANLOG , begin now
ADD EXTTRAIL ./dirdat/bs, EXTRACT BE_SCOTT, megabytes 200
edit param BP_SCOTT
EXTRACT BP_SCOTT
--RMTHOSTOPTIONS encrypt AES192
rmttrail ./dirdat/sb
rmthost 192.168.56.30,mgrport 7809
TABLE BSCOTT.*;
add extract BP_SCOTT , exttrailsource ./dirdat/bs begin now
add rmttrail ./dirdat/sb, extract BP_SCOTT
edit param Br_scott
replicat Br_scott
DBOPTIONS INTEGRATEDPARAMS(parallelism 2)
useridalias boggsource
MAP BSCOTT.OGG_TEST, TARGET BSCOTT.OGG_TEST
COMPARECOLS (ON UPDATE ALL, ON DELETE ALL),
RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)),
RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, IGNORE)),
RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, IGNORE));
add replicat BR_SCOTT, Integrated exttrail ./dirdat/sb
REGISTER EXTRACT BP_SCOTT, DATABASE---> rac3
REGISTER EXTRACT BP_SCOTT, DATABASE---> rac4
DbLogin useridalias boggsource
GGSCI (rac3.databasexpert.com as bscott@SRC) 6> Add SchemaTrandata bscott;
DbLogin useridalias boggtarget
GGSCI (rac4.databasexpert.com as bscott@TRGT) 6> Add SchemaTrandata bscott;
create table BSCOTT.OGG_TEST (
roll number(10) PRIMARY KEY ,
name varchar2(10));
Test the insert on both the sides:
SQL> select * from BSCOTT.OGG_TEST;
ROLL NAME
---------- ----------
102 MRUNA---- from rac4
101 JAYESH---- from rac3
Replication is OK
=========================================================================================
GGSCI (rac3.databasexpert.com as bscott@SRC) 47> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING BE_SCOTT 00:00:00 00:00:00
EXTRACT RUNNING BP_SCOTT 00:00:00 00:00:01
EXTRACT RUNNING E_SCOTT 00:00:00 00:00:07
EXTRACT RUNNING IE_SCOTT 00:00:00 00:00:06
EXTRACT RUNNING IP_SCOTT 00:00:00 00:00:02
EXTRACT RUNNING P_SCOTT 00:00:00 00:00:02
REPLICAT RUNNING BR_SCOTT 00:00:00 00:00:08
======================================
RAC4
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string TRGT
SQL> insert into BSCOTT.OGG_TEST values(103,'DEEP');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from BSCOTT.OGG_TEST;
ROLL NAME
---------- ----------
102 MRUNA
103 DEEP
101 JAYESH
=================================
RAC3
SQL> select * from BSCOTT.OGG_TEST;
ROLL NAME
---------- ----------
102 MRUNA
103 DEEP
101 JAYESH
insert into BSCOTT.OGG_TEST values(104,'ADU');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from BSCOTT.OGG_TEST;
ROLL NAME
---------- ----------
102 MRUNA
103 DEEP
101 JAYESH
104 ADU
============================================
RAC4
SQL> select * from BSCOTT.OGG_TEST;
ROLL NAME
---------- ----------
102 MRUNA
103 DEEP
101 JAYESH
104 ADU
====================================
Comments
Post a Comment