HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide
With Datareplicator, there is a time delay between updating of the source database and updating of the target database. If an error occurs at the source database during import processing, inconsistency might occur between the source and target databases.
The update-SQL output facility outputs the information from the source database that has not been transmitted (information that has not been imported into the target database) as SQL statements. This facility enables you to determine the unimported information.
This subsection describes how to use the update-SQL output facility.
To use the update-SQL output facility, the following conditions must be satisfied:
To execute the update-SQL output facility, execute the hdestart command with the -s -L options specified. For details about the command, see the hdestart command.
When you use the update-SQL output facility, the update-SQL output process starts. The following describes the details of the update-SQL output process:
| Process name | Start method | Termination method |
|---|---|---|
| hdesqlput | hdestart -s -L | hdestop |
The actions of the update-SQL output process are the same as of the transmission process except for the following:
This subsection describes the update-SQL file that is output by the update-SQL output facility.
The update-SQL file is output to the following destination:
| Item | Output target |
|---|---|
| Output target node | Each node at which the source database is to be updated |
| Output target directory | Source Datareplicator directory |
| File name | SQLTXT_server-name_transmission-target-identifier |
If any existing file has this name, the information is added to that file.
If there is no untransmitted information in the extraction information queue file, no update-SQL file is created.
One row of untransmitted information is output to the update-SQL file as one SQL statement. The data output as SQL statements includes only the transactions that were committed; no data is output for any transaction that was rolled back. The output transactions are sorted in the order they were committed. Update information for which processing is underway is not output.
The following shows the format of the data that is output:
/* update-date */ INSERT INTO authorization-identifier.table-name(column-name,column-name,...) VALUES(value#1,value,...); |
/* update-date */ UPDATE authorization-identifier.table-name SET3 column-name=value#1,column-name=value, ... WHERE#4 column-name=value AND column-name=value ...; |
/* update-date */ DELETE FROM authorization-identifier.table-name WHERE#4 column-name=value#1 AND column-name=value ...; |
/* update-date */ PURGE TABLE authorization-identifier.table-name; |
/* ****-**-** **:**:** */ /* HDEEVENT event-code */ |
/* ****-**-** **:**:** */ COMMIT; |
| Column attribute | Character set | -H option in the hdestart command | Output format | Output value | Remarks |
|---|---|---|---|---|---|
| CHAR or VARCHAR | Omitted | Omitted | Character format (Example: 'aaa') |
Value in the corresponding column | A control code is output as a period. |
| Specified | Hexadecimal format (Example: X'C3C3C3') |
-- | |||
| Specified | Omitted | Character format (Example: 'aaa') |
Value obtained by converting the character codes of the corresponding column's value to the database locale | A control code is output as a period. | |
| Specified | Hexadecimal format (Example: X'C3C3C3') |
-- | |||
| MCHAR or MVARCHAR | -- | Omitted | Character format (Example: M' |
Value in the corresponding column | A control code is output as a period. |
| Specified | Hexadecimal format (Example: X'81C141') |
-- | |||
| NCHAR or NVARCHAR | -- | Omitted | Character format (Example: N' |
A control code is output as a period. | |
| Specified | Hexadecimal format (Example: X'81C181C2') |
-- | |||
| INTEGER or SMALLINT | -- | -- | Decimal format (Example: 100) |
-- | |
| DECIMAL | -- | -- | Decimal format (Example: 100) |
If an error occurs while data in packed format is being converted to a character string, that column is output in hexadecimal format. | |
| FLOAT or SMALLFLT | -- | -- | Floating-point number format (Example: 1.0...0E+02) |
-- | |
| DATE | -- | -- | Character format (Example: '2008-04-15') |
If an error occurs while data in packed format is being converted to a character string, that column is output in hexadecimal format. | |
| TIME | -- | -- | Character format (Example: '16:15:30') |
||
| TIMESTAMP | -- | -- | Character format (Example: '2008-04-15 16:15:30') |
||
| INTERVAL YEAR TO DAY | -- | -- | Decimal format (Example: +12340102.) |
||
| INTERVAL HOUR TO SECOND | -- | -- | Decimal format (Example: +112233.) |
||
| BLOB | -- | -- | Fixed character string | "*BLOB*" |
|
| BINARY | -- | -- | "*BINARY*" | ||
| ADT | -- | -- | Fixed character string | "*ADT*" | The corresponding fixed character string "*ADT*" is output regardless of whether the value is the null value or a non-null value. |
| Operand specification | Operation |
|---|---|
| Specified | The facility outputs the event with the number specified in the prg_eventno operand, and then resumes processing. |
| Omitted | The facility ignores the corresponding PURGE TABLE. |
The following shows an output example of an update-SQL file:
/* 2004-12-29 19:18:00 */ INSERT INTO "USR1"."T1"("C1","C2") VALUES(1,'a');
/* 2004-12-29 19:18:30 */ UPDATE "USR1"."T1" SET "C1"=2,"C2"='b' WHERE "C1"=2;
/* 2004-12-29 19:19:00 */ DELETE FROM "USR1"."T1" WHERE "C1" IS NULL;
/* 2004-12-29 19:19:30 */ PURGE TABLE "USR1"."T1";
/* ****-**-** **:**:** */ /* HDEEVENT 200 */
/* ****-**-** **:**:** */ COMMIT;
|
To execute update-SQL output:
hdsstop -t immediate |
hdestart -e |
hdemodq |
$ pdlogls -d sys -s flora370 HOSTNAME : flora370(151739) Group Type Server Gen No. Status Run ID Block No. log10 sys sds01 1 oc-d--u 3e6835a9 1 40 log11 sys sds01 0 os----- 00000000 0 0 |
$ pdls -d rpl -j -s flora370 SYSTEMID : HRD1(150621) Data replication : Y UNITID : unt1(150621) Data replication : Y SERVER NAME : sds01 Extract Database : Y Extract Status : C System Log Extract Point : Run ID Group Gen No. BLock No. 3e6835a9 log10 1 41 System Log Sync Info : Run ID Group Gen No. BLock No. 3e6835a9 log10 1 13 |
hdestop |
hdestart -s -L |
hdestop |
In the messages displayed by Datareplicator, the transmission and output processes are both indicated as Sender process. To determine whether a message was intended for the transmission process or the output process, check the message output process name that is displayed in the message.
Table 9-16 Datareplicator processing when system switchover occurs during execution of the update-SQL output facility
| System switchover status | Datareplicator processing |
|---|---|
| System switchover occurs at the system where MST is located | After system switchover is completed, MST is started, but it rejects a connection request from NMT that is running in the update-SQL output status. As a result, all NMTs and MSTs are terminated. |
| System switchover occurs at the system where NMT is located | After system switchover is completed, NMT is started,# but it rejects a connection request from MST that is running in the update-SQL output status. As a result, the NMT where system switchover occurred is terminated. |
All rights reserved. Copyright (C) 2007, 2013, Hitachi, Ltd.