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:
- 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.
- Compile the function code into a shared object file.
- Save a copy of the shared object file in the $ONEDB_HOME/extend/checksum directory
on all replication servers.
- To register the function:
- Modify the idschecksum.sql file
in the $ONEDB_HOME/demo/checksum directory to
include the name of your function.
- 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.