728x90

Question

How can you find out the type of existing enterprise replication; whether it is update anywhere or primary to target replication?

Answer

For Informix Dynamic Server version 7.31, "cdr list repl" command does not tell you whether it is a "Update Anywhere" or "Primary Target" replication. 

One method of checking the ER type is by checking partdef and repdef table from syscdr database for the definition, and finding out whether they are using Primary Target or Update Anywhere. If it is Update Anywhere, the partmode will be "P" for the repid entry. If it is Primary Target, you should see a "P" and "R" for the pair. 


For both 7.31 and 10.00, you can check from syscdr using the following SQL (you can modify the query to your own needs): 

dbaccess -> syscdr-> query 
select a.repid, a.repname, a.repstate, b.partstate, b.partmode, 
b.flags, b.selecstmt, b.servid from repdef a, partdef b 
where a.repid = b.repid; 

Example Results: 

From below results, you can tell there are 2 types of replications: 

1. repid 6881287( servid 105, servid 106) is update anywhere, as both 
partmode is "P", means Primary. 

2. repid 6881294 ( servid 105, servid 106) is Primary ->target type 
replication, as servid 105 's partmode is "P" and servid 106 's partmode is "R", 
means read only. 

repid 6881287 
repname rep_state 
repstate 2 
partstate 2 
partmode P 
flags 0 
selecstmt select * from state 
servid 105 

repid 6881287 
repname rep_state 
repstate 2 
partstate 2 
partmode P 
flags 0 
selecstmt select * from state 
servid 106 

repid 6881294 
repname rep_customer 
repstate 2 
partstate 2 
partmode P 
flags 0 
selecstmt select * from customer 
servid 105 

repid 6881294 
repname rep_customer 
repstate 2 
partstate 2 
partmode R 
flags 0 
selecstmt select * from customer 
servid 106 



For IDS 9.40, 10.00 and above, you can also check from the command line using " cdr list repl ".

Example Results: 

1. for replication "rep_state, you can see the REPLMODE are both "PRIMARY for both servers. Hence, we know this is an update anywhere type. 

2. for replication "rep_customer, you can see the REPLMODE fro server 105 is "PRIMARY" and for server 106 is : READ-ONLY". Hence, we know this is an Primary - Target type. 

Sever 105 
> cdr list repl 

CURRENTLY DEFINED REPLICATES 
------------------------------- 
REPLICATE: rep_state 
STATE: Inactive on:g_er1 
CONFLICT: Timestamp 
FREQUENCY: immediate 
QUEUE SIZE: 0 
PARTICIPANT: stores_demo:informix.state 
OPTIONS: transaction,ats,fullrow 
REPLID: 6881287 / 0x690007 
REPLMODE: PRIMARY on:g_er1 
APPLY-AS: INFORMIX on:g_er1 

REPLICATE: rep_customer 
STATE: Inactive on:g_er1 
CONFLICT: Ignore 
FREQUENCY: immediate 
QUEUE SIZE: 0 
PARTICIPANT: stores_demo:informix.customer 
OPTIONS: transaction,ats,fullrow 
REPLID: 6881294 / 0x69000e 
REPLMODE: PRIMARY on:g_er1 
APPLY-AS: INFORMIX on:g_er1 


Sever 106 
> cdr list repl 

CURRENTLY DEFINED REPLICATES 
------------------------------- 
REPLICATE: rep_state 
STATE: Inactive on:g_er2 
CONFLICT: Timestamp 
FREQUENCY: immediate 
QUEUE SIZE: 0 
PARTICIPANT: stores_demo:informix.state 
OPTIONS: transaction,ats,fullrow 
REPLID: 6881287 / 0x690007 
REPLMODE: PRIMARY on:g_er2 
APPLY-AS: INFORMIX on:g_er2 

REPLICATE: rep_customer 
STATE: Inactive on:g_er2 
CONFLICT: Ignore 
FREQUENCY: immediate 
QUEUE SIZE: 0 
PARTICIPANT: stores_demo:informix.customer 
OPTIONS: transaction,ats,fullrow 
REPLID: 6881294 / 0x69000e 
REPLMODE: READ-ONLY on:g_er2 
APPLY-AS: INFORMIX on:g_er2


https://www-304.ibm.com/support/docview.wss?uid=swg21288554

728x90

+ Recent posts