Configuring code set conversion between replicates

The examples in this topic show how to create replicate and template definitions while replicating data between databases that use different code sets.

When non-English characters are used for database, table, column, or owner names, each server must be added to the UTF-8 realize template definition by connecting to the server locally. Only one server at a time should be added to the replicate definition using the change replicate command. You cannot add multiple servers to a replication definition using the define repl command unless the database code set number is the same for all servers. The CLIENT_LOCALE environment variable must be set unless the database locale is en_us.819. Replicate and template names must be in English.

This example shows how to create and realize a template on two servers, named node_1 and node_2. For this example, assume that node_1 uses de_de.819 locale and node_2 uses de_de.utf8 locale:

  1. On node_1, run the following commands:
    export DB_LOCALE=de_de.819
    export CLIENT_LOCALE=de_de.819
    cdr define template set1 -C always -M g_node1 -S row -d testdb -a -A -R --UTF8=y
    cdr realize template set1 g_node1
  2. On node_1 run the following command and wait for the Txns in queue count to go to zero.
    onstat -g rqm cntrlq
  3. On node_2, run the following commands:
    export DB_LOCALE=de_de.utf8
    export CLIENT_LOCALE=de_de.utf8
    cdr realize template set1 g_node2

The following steps show how to define a replicate when non-ASCII characters are used for table, column, owner, or database names. Before starting, ensure that the replicate name uses English ASCII characters and that the DB_LOCALE environment variable on the server is set to the same value as the locale of the participant being added.

  1. Define the replicate with the first participant and then connect to the participant.
  2. Add and connect to each additional participant, one participant at a time.
  3. When all of the participants have been added, ensure that the control queue is empty and start the replicate definition.

    You can check the control queue message count using the onstat -g rqm cntrlq. Wait for the Txns in queue count to go zero.

The following example shows how to create a replicate definition between two servers to replicate data between de_de.819 and de_de.utf8 databases:

  1. On server node_1, run the following commands:
    export DB_LOCALE=de_de.819
    export CLIENT_LOCALE=de_de.819
    cdr define repl german_repl  -M g_node1 -C always -S transaction 
             -A -R -I --UTF8=y "testdb@g_node1:user1.table1" "select * from table1"
  2. On node_1 run the following command and wait for the Txns in queue count to go to zero.
    onstat -g rqm cntrlq
  3. On node_2, run the following commands:
    export DB_LOCALE=de_de.utf8
    export CLIENT_LOCALE=de_de.utf8
    cdr change repl -c node2 -a german_repl  
               "testdb@g_node2:user1.table1" "select * from table1"
     
  4. On node_2 run the following command and wait for the Txns in queue count to go to zero.
    onstat -g rqm cntrlq
  5. Run the following command on either server:
    cdr start repl german_repl