Replication definition between primary and pseudo groups
Replicate is defined only using primary->target configuration, and replication definition should include only primary group and pseudo group participants.
Note: Only ignore and always apply conflict resolutions rules are supported for
loopback replication.
$ cdr define repl --connect=g_er_server test_t1 --conflict=always --scope=row --ats --ris --floatieee --master=g_er_server
"P test@g_er_server:informix.t1" "select * from t1" "R test@g_loopback:informix.t2" "select * from t2"
In
the above replicate definition is established between table t1 and table2 in test database on the
same server All ER commands including ‘cdr sync’, ‘cdr check’, template commands work with pseudo group. The only restriction is that pseudo ER group cannot be added to grid definition, and grid commands are not supported with pseudo ER group.
Template example
Template can be used to define replication across multiple tables from two different
databases.
$ cdr define template --connect=g_er_server ifxt_test_test --conflict=always --scope=row --ats --ris --floatieee --master=g_er_server --database=test --all
$ cdr realize template --connect=g_er_server ifxt_test_test "test@g_er_server"
$ cdr realize template --connect=g_loopback ifxt_test_test --target "test2@g_loopback"
The
above commands define replication between tables in test and test2 databases on the same server‘cdr list replicate’ command show ‘loopback’ replication
attribute
REPLICATE: rep1
STATE: Active ON:g_informix
CONFLICT: Always Apply
FREQUENCY: immediate
QUEUE SIZE: 0
PARTICIPANT: ycsb:informix.usertable
OPTIONS: row,ris,ats,fullrow,loopback
REPLID: 65537 / 0x10001
REPLMODE: PRIMARY ON:g_informix
APPLY-AS: INFORMIX ON:g_informix
REPLTYPE: Master
Sample procedure to reorg table online
- Create RAW table with appropriate fragmentation strategyNote: Create standard table if you have secondary servers.
- Initial data load -- Unload and load data from old table to new table
- Create indexes
- Convert table type to “standard"
- Define replication and repair data using ‘cdr check --repair’ commandNote: Define replicate with --name=n option, if you plan to rename table while replication is still active.
- Use rename table DDL or synonym to point applications to new table
- Drop replicate once queues are empty
Sample procedure for online migration of database codeset
- Create new database with target codeset and schema
- Unload data from old database using appropriate CLIENT and DB locales, and load data into new database use CLIENT_LOCALE set to unloaded data codeset format, and DB_LOCALE set to target database codeset
- Define replication using –utf8 option and execute data re-synchronization task using cdr check –repair or cdr sync replset commands
- Use rename database DDL to point applications to new database