Setting character sets

In a heterogeneous replication system, in which the primary and replicate data servers are different types, the data servers might not support the same character sets. In that case, replication system components must perform at least one character set conversion (from the primary data server’s character set to the replicate data server’s character set).

Even in a homogeneous replication system, in which both primary and replicate data servers are the same type, character set conversions might be required if replication system components reside on more than one type of platform.

Character set problems can produce data inconsistencies between the primary database and the replicate database. To avoid character set problems, you must either:

By default, the Java Virtual Machine (JVM) under which a Replication Agent instance runs, finds your system’s default character set. The type of character data that Replication Agent can handle is determined by the character set, also known as the encoding. Unless you want to override the default character set that the JVM finds on your system, you do not have to explicitly set the character set-related environment variable.

To support overriding the default character set, all of the executable scripts (or batch files) in the Replication Agent /bin directory and the Replication Agent instance RUN scripts refer to an environment variable named RA_JAVA_DFLT_CHARSET. You can set this environment variable to use the character set you want. However, the character set you specify must be the character set configured on the primary database. For a list of valid Java character sets, see Supported Encodings on the Internationalization page under Documentation for the J2SE 5.0 JDKhttp://java.sun.com/javase/technologies/core/basic/intl/.

NoteIf you are using Replication Server to replicate a number of different character sets, you must configure it for UTF8.

You can override the system default character set by either:

If you start a Replication Agent instance by invoking the ra utility, you can override the value of the RA_JAVA_DFLT_CHARSET system variable in your environment to specify the character set. All instances you start with the ra utility will use the same character set.

If you start a Replication Agent instance by invoking the instance RUN script (or batch file), you can edit the instance RUN script to specify the default value of RA_JAVA_DFLT_CHARSET and specify the character set you want to use. You can configure each instance with a different character set.

For more information on setting and overriding the default character set, see Chapter 2, “Setup and Configuration” in the Replication Agent Administration Guide.