Implementing a custom checksum function

You can implement a custom checksum function for consistency checking if you do not want to use the checksum function that is included with the database server.

About this task

The $ONEDB_HOME/extend/checksum directory contains sample checksum function code and registration statements.

Procedure

To implement a custom checksum function:
  1. Using the idschecksum.c file in the $ONEDB_HOME/demo/checksum directory as a template, write a C language function that creates a checksum.
    Overload the function for each of the supported data types.
  2. Compile the function code into a shared object file.
  3. Save a copy of the shared object file in the $ONEDB_HOME/extend/checksum directory on all replication servers.
  4. To register the function:
    1. Modify the idschecksum.sql file in the $ONEDB_HOME/demo/checksum directory to include the name of your function.
    2. Run the SQL statements on each replication server.

What to do next

Specify your checksum function name with the --checksum option when you run the cdr check replicate or cdr check replicateset command.

If the cdr check replicate or cdr check replicateset command fails with return code 172, your checksum function is not installed and registered on all replication servers.