HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
(1) Handling procedure for re-creating the target database
If you performed any of the operations listed below before linkage of all data had been completed, you must synchronize the data linkage environments at the source and target, initialize them, and then create the target database:
- Initializing the source Datareplicator's environment (executing the hdestart -i command)
- Initializing the target Datareplicator's environment (executing the hdsstart -i command)
- Re-creating the target database
- Stopping data linkage
- Initializing a system log file or data linkage file
For details about the initialization procedure when initialization is performed after verifying that linkage of all data has been completed and there is no need to re-create the target database, see 6.8 Changing the configuration of HiRDB and Datareplicator.
For details about how to handle errors, see 9.2.2 Error handling methods.
The following figure shows the handling procedure for re-creating the target database.
Figure 6-11 Handling procedure for re-creating the target database
![[Figure]](FIGURE/RZ06S070.GIF)
The following explains the handling procedure steps shown in the figure; the numbers 1 to 17 below correspond to the numbers in the figure. If the source HiRDB is a parallel server, execute the hdeprep and hdestart commands at the server where the system manager is located.
- Terminate applications at the source HiRDB in order to maintain conformity between the source and target databases that are subject to data linkage.
- Shut down the source database subject to data linkage with the pdhold command and suppress updating of the database subject to data linkage.
- Terminate the source Datareplicator.
- Terminate applications at the target HiRDB.
- Terminate the target Datareplicator.
- Create the target database on the basis of the source database. You can use the HiRDB Dataextractor to create a target database from the source database efficiently.
- Terminate the source HiRDB.
- If necessary, modify the following definition files:
- Extraction system definition file
- Transmission environment definition file
- Extraction environment definition file
- Initialize the source Datareplicator's environment (execute the hdestart -i command).
- Specify pd_rpl_init_start=Y in the source HiRDB's system common definition, and then start the source HiRDB.
- If necessary, modify the extraction definition.
- Analyze the extraction definition with the hdeprep command and create an extraction definition preprocessing file.
- If necessary, modify the following definition files:
- Import system definition file
- Import environment definition file
- Import definition file
- Initialize the target Datareplicator's environment, and then start the target Datareplicator (execute the hdsstart -i command).
- Start the source Datareplicator.
- Use the pdrels command to release the source database subject to data linkage from shutdown status.
- Restart applications at the source and target HiRDBs.
(2) Handling procedure for continuing execution of data linkage
When pd_rpl_init_start=Y is specified in HiRDB's system common definition, HiRDB Datareplicator linkage inherits the status in which data linkage information was output to the system log at the previous source HiRDB and the system log's extraction status at the source Datareplicator regardless of whether the source HiRDB is started or restarted. Therefore, if the source Datareplicator is started with the hdestart command when pd_rpl_init_start=Y is specified, execution of data linkage continues from the previous status.
Note that if the pdrplstop command is executed, the database needs to be re-created even when pd_rpl_init_start=Y is specified because the extraction status is cancelled.
The following shows the handling procedure for continuing execution of data linkage (when pd_rpl_init_start=Y is specified in the system common definition):
- Start the source HiRDB (specify pd_rpl_init_start=Y in the system common definition).
- Start the source Datareplicator with the hdestart command.
- Terminate the source HiRDB as required.
- When syncterm=true is specified in the extraction system definition for the source Datareplicator, the source Datareplicator terminates when the source HiRDB terminates normally. If this option is not specified, execute the hdestop command to terminate the source Datareplicator.
(3) Handling procedure for modifying the source table definition and source definition
The following explains the handling procedure for modifying the table definition of the source database subject to data linkage and the source Datareplicator's extraction definition. You must execute the procedure described here in order to re-execute CREATE TABLE, even if no change has been made to the table definition of the database subject to linkage. If you modify the definitions, you must extract all of the source HiRDB's system logs at all back-end servers subject to extraction processing, and then send them to the target systems (including the update information in the extraction information queue files).
When you modify the definitions, the handling procedure depends on the circumstances, as listed below.
- syncterm=true is specified in the extraction system definition and the source HiRDB can be terminated normally
- syncterm=true is not specified in the extraction system definition or the source HiRDB cannot be terminated normally
- syncterm=true is specified in the extraction system definition and the source HiRDB can be terminated normally
- Terminate the source HiRDB normally. The source Datareplicator extracts all system log information from the source HiRDB, sends it to the target system, and then terminates itself automatically when transmission is completed.
- Start the source HiRDB normally. Specify pd_rpl_init_start=N in the system common definition, and then execute normal start. In this case, do not execute a transaction that updates the database subject to data linkage before you start HiRDB Datareplicator linkage.
- Modify the definitions at the source.
Table definition: Use ALTER TABLE and definition SQL statements to modify the definition.
Extraction definition: Modify the extraction definition.
- If the source HiRDB is a parallel server and a table subject to extraction has been added or deleted, check and, if necessary, revise the value of extsuppress in the extraction environment definition.
If you have modified only within one back-end server the table definition for the database subject to linkage that is located at the source HiRDB, you can skip this step.
If you change the extsuppress option, initialize the source Datareplicator's environment (by executing the hdestart -i command) and the target Datareplicator's environment (by executing the hdsstart -i command).
- Use the hdeprep command to analyze the modified source definitions and create the extraction definition preprocessing file. You must execute the hdeprep command even when changes are made only to the table definition at the source. You can execute the hdeprep command only while the source HiRDB is active.
- Start the source Datareplicator with the hdestart command.
- Terminate the source HiRDB normally, change the pd_rpl_init_start value from N to Y, and then start the source HiRDB normally.
- syncterm=true is not specified in the extraction system definition or the source HiRDB cannot be terminated normally
- Shut down the database subject to data linkage using the pdhold command to suppress database updating.
- Have the source Datareplicator extract all system log information from the source HiRDB and send it to the target system (including all update information in the extraction information queue file).
Check the extraction and transmission status with the following commands:
- pdls command
- hdestate command
- Messages output by the source Datareplicator
- Check that all system log information has been extracted and transmitted from the source HiRDB, and then terminate the source Datareplicator with the hdestop command.
For details about how to check for completion of system log extraction and transmission, see Step 2 in 6.8.2 Changing the configuration of the source system.
- If you make either of the following changes, cancel HiRDB Datareplicator linkage at the source HiRDB with the pdrplstop command:
- You add a table to a back-end server that contains no tables subject to extraction processing
- You delete a table subject to extraction processing.
- Modify the definitions at the source.
Table definition: Use ALTER TABLE and definition SQL statements to modify the definition.
Extraction definition: Modify the extraction definition.
- If the source HiRDB is a parallel server and a table subject to extraction has been added or deleted, check and, if necessary, revise the value of extsuppress in the extraction environment definition.
If you have modified only within one back-end server the table definition for the database subject to linkage that is located at the source HiRDB, you can skip this step.
If you change the extsuppress option, initialize the source Datareplicator's environment (by executing the hdestart -i command) and the target Datareplicator's environment (by executing the hdsstart -i command).
- Use the hdeprep command to analyze the modified source definitions and create the extraction definition preprocessing file. You must execute the hdeprep command even when changes are made only to the table definition at the source. You can execute the hdeprep command only while the source HiRDB is active.
- Start the source Datareplicator with the hdestart command.
- If HiRDB Datareplicator linkage is cancelled at the source HiRDB, restart it with the pdrplstart command.
- Use the pdrels command to release the database subject to data linkage from shutdown status.
(4) Handling procedure for executing the pdrplstart command
The following describes the handling procedure for executing the pdrplstart command:
- Use the pdhold command to shut down the database subject to data linkage in order to suppress database updating.
- If the target database has not been created or conformity between the source and target databases has been lost, synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
- Run the pdrplstart command at the source HiRDB to begin data linkage.
- Start the source Datareplicator using the hdestart command.
- Use the pdrels command to release the database subject to data linkage from shutdown status.
(5) Handling procedure for executing the pdrplstop command
The following describes the handling procedure for executing the pdrplstop command to cancel HiRDB Datareplicator linkage:
- Cancel HiRDB Datareplicator linkage with the pdrplstop command.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(6) Handling procedure for executing the pdlogchg command
The following describes the handling procedure for using the pdlogchg command to forcibly change a system log file's extraction status. If you change the extraction status with the pdlogchg command while HiRDB Datareplicator linkage is executing, you need to re-create the target database.
- Cancel HiRDB Datareplicator linkage with the pdrplstop command.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Use the pdlogchg command with the -R option specified to change the system log file from extracting status to extraction completed status. Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(7) Handling procedure for re-creating a database subject to extraction processing
The following describes the handling procedure for re-creating a database subject to extraction processing:
- Cancel HiRDB Datareplicator linkage with the pdrplstop command.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Re-create the database subject to extraction processing.
- Use the pdhold command to shut down the database subject to data linkage in order to suppress database updating.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(8) Handling procedure for reconstructing the system at the source HiRDB
The following describes the handling procedure for reconstructing the system at the source HiRDB:
- Terminate the source HiRDB normally.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Reconstruct the system at the source HiRDB, specify pd_rpl_init_start=N in the system common definition, and then execute normal start on the source HiRDB (with the -i option specified).
- Re-create the source database.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(9) Handling procedure for modifying the system definition at the source HiRDB
The following describes the handling procedure for modifying the system definition at the source HiRDB:
- Terminate the source HiRDB normally.
- Terminate the source Datareplicator with the hdestop command.
- Modify the source HiRDB's system definition.
- Start the source HiRDB.
- Start the source Datareplicator with the hdestart command.
(10) Handling procedure when none of the system log files can be swapped in
The following explains the handling procedure when none of the system log files can be swapped in and there is a system log file that cannot be swapped due to its extracting status. The following figure shows the handling procedure when none of the system log files can be swapped in.
Figure 6-12 Handling procedure when none of the system log files can be swapped in
![[Figure]](FIGURE/RZ06S080.GIF)
The following explains the handling procedure steps shown in the figure; the numbers 1 to 8 below correspond to the numbers in the figure:
- The source HiRDB takes action according to the specification of pd_log_rpl_no_standby_file_opr in the system common definition.
- If you have specified stop or omitted pd_log_rpl_no_standby_file_opr, the corresponding unit at the source HiRDB is terminated forcibly.
- If the source Datareplicator is stopped, start it.
- Check that the source Datareplicator has started using another log file (extraction from at least one file has been completed). Use the pdlogls command to check the extraction status of each system log, and use the pdls -d rpl -j command to check the progress of extraction processing.
- Restart the unit at the source HiRDB.
- If you have specified continue, cancel HiRDB Datareplicator linkage and resume processing only at the source HiRDB. When there are no more files that can be swapped in due to the extracting status, the source HiRDB cancels HiRDB Datareplicator linkage and continues operation only at the source HiRDB. When there are no more files that can be swapped in, the source HiRDB releases the extraction status of all system log files.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(11) Handling procedure for cancelling data linkage when the source HiRDB unit is terminated forcibly
This subsection describes the handling procedure for cancelling data linkage and continuing processing only at the source HiRDB when the source HiRDB unit is terminated forcibly according to HiRDB's system common definition because the system log file is in extracting status and the problem cannot be resolved by starting the source Datareplicator.
The following figure shows the handling procedure for cancelling data linkage when the source HiRDB unit is terminated forcibly.
Figure 6-13 Handling procedure for cancelling data linkage when the source HiRDB unit is terminated forcibly
![[Figure]](FIGURE/RZ06S090.GIF)
The following explains the handling procedure steps shown in the flowchart in Figure 6-9; the numbers 1 to 7 below correspond to the numbers in the figure:
- If possible, change the pd_log_rpl_no_standby_file_opr operand specification to continue in the system common definition.
- Restart the source HiRDB.
- If it is not possible to change the definition, execute the pdlogchg command with the -R option specified on all log files to forcibly change the status from extracting to extraction completed.
- Restart the source HiRDB.
- Use the pdrplstop command to cancel HiRDB Datareplicator linkage.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(12) Handling procedure when the source HiRDB terminates abnormally
The following figure shows the handling procedure when the source HiRDB terminates abnormally.
Figure 6-14 Handling procedure when the source HiRDB terminates abnormally
![[Figure]](FIGURE/RZ06S100.GIF)
The following explains the handling procedure steps shown in the flowchart in Figure 6-10; the numbers 1 to 7 below correspond to the numbers in the figure:
- Eliminate the cause of the abnormal termination of the source HiRDB.
- Restart the source HiRDB.
- Terminate the source Datareplicator with the hdestop command and the target Datareplicator with the hdsstop command. You can terminate the source and target Datareplicators at any time before initialization of data linkage.
- Forcibly start the source HiRDB normally.
- Use the pdrplstop command to cancel HiRDB Datareplicator linkage.
- Re-create the source database.
- Synchronize the data linkage environments at the source and target, initialize them, and then create the target database on the basis of the source database; for details, see (1) above.
(13) Handling procedure for adding and deleting a transmission target
The following figure shows the handling procedure for adding and deleting a transmission target to and from the source Datareplicator.
Figure 6-15 Handling procedure for adding and deleting a transmission target
![[Figure]](FIGURE/RZ06S105.GIF)
The following explains the handling procedure steps shown in the figure. Numbers 1 through 4 correspond to the numbers in the figure.
- Use the pdhold command to shut down the database subject to data linkage and suppress updating of the database.
- Extract all of the source HiRDB's system logs at the source Datareplicator and make sure that all necessary data has been sent to the target (including the update information in the extraction information queue files).
To check the extraction and transmission status, use the following methods:
- pdls command
- hdestate command
- Messages issued by the source Datareplicator
- Make sure that all of the source HiRDB's system logs have been extracted and transmitted, and then terminate the source Datareplicator with the hdestop command.
For details about how to check for completion of system log extraction and transmission, see Step 2 in 6.8.2 Changing the configuration of the source system.
- Change the definitions at the source.
- When adding a transmission target:
- If the extraction system definition contains a missing number for a transmission target definition, change the corresponding definition to the transmission target to be added. If there is no such missing number, add a definition for the new transmission target (sendid and senddef operands).
- When deleting a transmission target:
- Change the applicable transmission target definition to a missing number in the extraction system definition.
The subsequent portion of the procedure depends on whether a new transmission target was added to the extraction system definition in step 4 (whether new sendid and senddef operands were added to the extraction system definition).
If you did not add a new transmission target, follow procedure A; if you added a new transmission target, follow procedure B.
- Procedure A
- Execute partial initialization on the source Datareplicator for the transmission target whose definition was changed.
- Execute the hdeprep command to create an extraction definition preprocess.
- Create a target database for the new transmission target on the basis of the source database.
- Initialize the environment of the target Datareplicator at the new transmission target.
Before initializing the target Datareplicator environment, you must create the following definition files:
Import system definition file
Import environment definition file
Import definition file
- Execute the hdestart command to start the source Datareplicator.
- Execute the pdrels command to release the source database subject to data linkage from shutdown status.
- Restart applications at the source HiRDB.
- Procedure B
- Make sure that all data sent from the source has been imported into the target Datareplicators at all existing transmission targets.
Execute the hdsstate command to verify that the update information in the import information queue files has been imported. All update information has been imported when write position in COMMUNICATION INFORMATION and read position in REFLECTION INFORMATION are the same in the status information obtained by executing the hdsstate command.
- Terminate the target Datareplicators at all existing transmission targets with the hdsstop command.
- Create a target database for the new transmission target on the basis of the source database.
- Initialize the environment of the target Datareplicators at all existing transmission targets as well as the new transmission target.
Before initializing the environment of the target Datareplicator at the new transmission target, you must create the following definition files:
Import system definition file
Import environment definition file
Import definition file
- Use the pdstop command to terminate the source HiRDB normally.
- Execute the hdsstart -i command to initialize the source Datareplicator's environment.
- Execute the pdstart command to start the source HiRDB.
- Execute the hdeprep command to create an extraction definition preprocess.
- Execute the hdestart command to start the source Datareplicator.
- Restart applications at the source HiRDB.
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.