Replication with Infosphere CDC : IBM InfoSphere CDC for solidDB® reference : Commands for IBM InfoSphere CDC : Database transaction log commands
  
Database transaction log commands
This section contains commands that help you manage your database transaction log or bookmarks.
See also
dmdecodebookmark: Display verbose bookmark information
dmsetbookmark: Set bookmark
dmshowbookmark: Display bookmark information
dmshowlogdependency: Show log dependency
Commands for IBM InfoSphere CDC
dmdecodebookmark: Display verbose bookmark information
Use this command to display verbose information about a bookmark.
Syntax
dmdecodebookmark -I <instance_name> (-b | -f) [-L <locale>]
Parameters
-I <instance_name>
The name of the IBM InfoSphere CDC instance. You can set the TSINSTANCE environment variable to the name of your IBM InfoSphere CDC instance. After this is complete, you no longer have to specify the instance when issuing commands.
-b <bookmark>
The bookmark as a hexadecimal-encoded string.
-f <bookmark_file>
The bookmark file as a binary file.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Examples
dmdecodebookmark -f bookmark.txt
IBM InfoSphere CDC displays information about the bookmark.txt file.
See also
Database transaction log commands
dmsetbookmark: Set bookmark
Use this command on your IBM InfoSphere CDC source system to set the replication position (bookmark) in the stream of change data for a subscription. You can obtain the replication position for a subscription with the dmshowbookmark command, which is executed on your IBM InfoSphere CDC target system. More information on the IBM InfoSphere CDC stream of change data is provided in the following paragraphs.
IBM InfoSphere CDC parses the data from your database logs and creates a stream of change data to process on the source and eventually apply on the target. The stream of change data is sorted in the order in which the data was committed in the source database, whereas the data in your database logs is sorted in the order in which the individual action was done in the source database.
For example, two transactions named T1 and T2 may be ordered like this in your source database log:
T1: Insert1 T2: Insert1 T2: Insert2 T2: Commit T1: Commit
As you can see, data is sorted in the database log according to when the individual action was done in your source database.
However, the IBM InfoSphere CDC stream of change data will order the two transactions like this:
T2: Insert1 T2: Insert2 T2: Commit T1: Insert1 T1: Commit
Data is sorted according to when the data is committed in your source database.
Syntax
dmsetbookmark [-I <instance_name>] -s <SUBSCRIPTION_NAME ...> (-b <bookmark> | -f <bookmark_file_name>) [-a] [-L <locale>]
Parameters
-I <instance_name>
The name of the IBM InfoSphere CDC instance. You can set the TSINSTANCE environment variable to the name of your IBM InfoSphere CDC instance. After this is complete, you no longer have to specify the instance when issuing commands.
-s <SUBSCRIPTION_NAME>
The name of the subscription for which IBM InfoSphere CDC sets a bookmark.
-b <bookmark>
Indicates the name of the binary or XML file that contains all replication position (bookmark) information which determines the point in the database log where you want IBM InfoSphere CDC to resume mirroring. When mirroring resumes, IBM InfoSphere CDC will start capturing change data at the replication position indicated in the file. You can specify an absolute path for the location of the file. If you do not specify an absolute path, you must place the file in the IBM InfoSphere CDC installation directory. IBM InfoSphere CDC will auto-detect the binary or XML format of the file.
Specifies the bookmark which determines the point in the database log where you want IBM InfoSphere CDC to resume mirroring. The next time IBM InfoSphere CDC mirrors, it will scrape at the given position. The bookmark is a hex encoded string that is obtained from the dmshowbookmark command.
-l <bookmark>
Bookmark indicating the new scraping point. The bookmark is a string obtained from the dmdecodebookmark command. For more information, see dmdecodebookmark: Display verbose bookmark information.
-f <bookmark_file>
Specifies the binary file containing a bookmark which determines the point in the database log where you want IBM InfoSphere CDC to resume mirroring. The next time IBM InfoSphere CDC mirrors, it will scrape at the given position. The bookmark file is a binary file that stores the position.
-a
Sets all tables in the subscriptions (except for parked tables) as active as of the new scraping point.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails
Examples
dmsetbookmark -I MYINSTANCE -b 2FC5GJHKLKSJLKJL458K9K809IK9 -s FINANCE
IBM InfoSphere CDC sets a bookmark position on the Finance subscription for the specified instance. This command specifies that mirroring will resume at the indicated position in the database log.
See also
Database transaction log commands
dmshowbookmark: Display bookmark information
Use this command on your IBM InfoSphere CDC target system to obtain the replication position (bookmark) in the stream of change data for a subscription. After generating the replication position information with this command, you can use the dmsetbookmark command on the source system to set the replication position for a subscription. More information on the IBM InfoSphere CDC stream of change data is provided in the following paragraphs.
IBM InfoSphere CDC parses the data from your database logs and creates a stream of change data to process on the source and eventually apply on the target. The stream of change data is sorted in the order in which the data was committed in the source database, whereas the data in your database logs is sorted in the order in which the individual action was done in the source database.
For example, two transactions named T1 and T2 may be ordered like this in your source database log:
T1: Insert1 T2: Insert1 T2: Insert2 T2: Commit T1: Commit
As you can see, data is sorted in the database log according to when the individual action was done in your source database.
However, the IBM InfoSphere CDC stream of change data will order the two transactions like this:
T2: Insert1 T2: Insert2 T2: Commit T1: Insert1 T1: Commit
Data is sorted according to when the data is committed in your source database.
Syntax
dmshowbookmark [-I <instance_name>] -s <SOURCE_ID>
[-f <
bookmark_file_name>] [-x <bookmark_file_name>] [-v] [-L <locale>]
Parameters
-I <instance_name>
The name of the IBM InfoSphere CDC instance. You can set the TSINSTANCE environment variable to the name of your IBM InfoSphere CDC instance. After this is complete, you no longer have to specify the instance when issuing commands.
-s <SOURCE_ID>
Specifies the source ID of the subscription for which you want to obtain the replication position (bookmark).
-f <bookmark_file_name>
Specifies the name of the binary file that will be generated by this command. The generated file contains information about the replication position (bookmark) for the specified subscription.
You can specify an absolute path for the location where you want to create the file. If you do not specify an absolute path, the file is created in the IBM InfoSphere CDC installation directory.
Use the -f parameter in the dmsetbookmark command to read the binary file generated by this parameter.
-x <bookmark_file_name>
Specifies the name of the XML file that will be generated by this command. The generated file contains information about the replication position (bookmark) for the specified subscription.
You can specify an absolute path for the location where you want to create the file. If you do not specify an absolute path, the file is created in the IBM InfoSphere CDC installation directory.
Use the -f parameter in the dmsetbookmark command to read the XML file generated by this parameter.
[-v]
Displays verbose information about the replication position (bookmark), including a hexadecimal-encoded string. The amount of information displayed depends on the type and version of the source engine. The hexadecimal-encoded string is always displayed. It is a subset of what the dmdecodebookmark command (see dmdecodebookmark: Display verbose bookmark information) displays. If not specified, only a hexadecimal-encoded sting is displayed.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Examples
dmshowbookmark -I MYINSTANCE -s MASTER -f bookmark
IBM InfoSphere CDC obtains the replication position (bookmark) information for the specified instance and the MASTER source ID. Replication position (bookmark) information is contained in the bookmark binary file which will be placed in the IBM InfoSphere CDC installation directory since no absolute path has been specified.
dmshowbookmark -I MYINSTANCE -s FINANCE -x mybookmarks
IBM InfoSphere CDC obtains the replication position (bookmark) information for the specified instance and the FINANCE source ID. Replication position (bookmark) information is contained in the mybookmarks XML file which will be placed in the IBM InfoSphere CDC installation directory since no absolute path has been specified.
See also
Database transaction log commands
dmshowlogdependency: Show log dependency
Use this command to display information about the database logs that are used by IBM InfoSphere CDC and are required for replication. Use this command to implement a log retention policy. With this command you can display the following information:
A list of all the database logs that are required for the specified instance.
The earliest open transaction in the database log for the specified instance.
The database log that the specified instance of IBM InfoSphere CDC is currently reading on the source.
The database log for the subscription that the specified instance of IBM InfoSphere CDC is currently applying on the target.
You must issue this command on your IBM InfoSphere CDC source system.
Syntax
dmshowlogdependency -I <instance_name> (-c | -t | -l) (-s <subscription_name> | -A) [-v] [-L <locale>]
Parameters
-I <instance_name>
The name of the IBM InfoSphere CDC instance. You can set the TSINSTANCE environment variable to the name of your IBM InfoSphere CDC instance. After this is complete, you no longer have to specify the instance when issuing commands.
-c
Considers the current position instead of the restart position.
-t
Displays the current database log for a subscription that the specified IBM InfoSphere CDC instance is currently reading. This is the log containing the current position confirmed by the target.
-l
Displays the current source database log that the specified IBM InfoSphere CDC instance is currently reading. This is the log containing the current scraping position.
-s <SUBSCRIPTION_NAME>
Specifies the name of the subscription for which you want to display the database log that IBM InfoSphere CDC is currently reading. Use this parameter in conjunction with the -t parameter to display the database log.
-A
Specifies all subscriptions in the specified IBM InfoSphere CDC instance.
-v
Specifies verbose output (otherwise, the output is formatted for scripting).
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Examples
dmshowlogdependency -I MYINSTANCE -i -s MYSUBSCRIPTIONNAME
Displays the complete list of required database logs for the specified instance and subscription.
dmshowlogdependency -I MYINSTANCE -A
Displays the complete list of required database logs for all subscriptions in the specified instance.
See also
Database transaction log commands