Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

13.16.2 Example 2: Migrating data containing XML-type columns by table

This subsection explains how to migrate data containing XML-type columns by table.

It is assumed that TABLE01 and TABLE02 have the same table definition. Data of TABLE01 is migrated (copied) to TABLE02.

Organization of this subsection
(1) Use the pdhold command to shut down the RDAREAs subject to data unloading and loading
(2) Create a control statements file for the pdrorg command to be executed during unloading
(3) Use the pdrorg command to unload data from TABLE01
(4) Create a control statements file for the pdload command to be executed during data loading
(5) Use the pdload command to load data in TABLE02
(6) Back up the RDAREAs in which data was loaded
(7) Use the pdrels command to release the RDAREAs from shutdown status

(1) Use the pdhold command to shut down the RDAREAs subject to data unloading and loading

 
pdhold -r RDAREA01,RDAREA02,...
 

(2) Create a control statements file for the pdrorg command to be executed during unloading

The following are the contents of the control statements file (/pdrorg/rorg01).

(a) HiRDB single server configuration
 
unload /pdrorg/unfile1                       1
 

Explanation
  1. Specifies the name of the unload data file.
(b) HiRDB parallel server configuration
 
unload bes1:/pdrorg/unfile1                   1
 

Explanation
  1. Specifies the name of the unload data file.

(3) Use the pdrorg command to unload data from TABLE01

 
pdrorg -k unld -W bin -t TABLE01 -g /pdrorg/rorg01
 

Explanation
-k: Specifies unld for unloading.
-W bin: Specifies that the unload data file is to be used as the input file (binary format) for the pdload command.
-t: Specifies the name of the table that is to be unloaded.
-g: Specifies that TABLE01 is row-partitioned between servers in a HiRDB parallel server configuration. Specifying the -g option consolidates the unload data files (into a single file).
/pdrorg/unld01: Specifies the name of the control statements file for the pdrorg command.

(4) Create a control statements file for the pdload command to be executed during data loading

The following are the contents of the control statements file (/pdload/load01).

(a) HiRDB single server configuration
 
source /pdrorg/unfile1                                1
 

Explanation
  1. Specifies the name of the unload data file.
(b) HiRDB parallel server configuration
 
source bes1:/pdrorg/unfile1                           1
 

Explanation
  1. Specifies the name of the unload data file.

(5) Use the pdload command to load data in TABLE02

 
pdload -b -W TABLE02 /pdload/load01
 

Explanation
-b: Specifies that binary data is to be loaded.
-W: Specifies that binary format input data created by the pdrorg command is to be used.
TABLE02: Specifies the name of the table into which data is to be loaded.
/pdload/load01: Specifies the name of the control statements file for the pdload command.

(6) Back up the RDAREAs in which data was loaded

Because you loaded data in the pre-update acquisition mode (default), back up the RDAREAs in which data was loaded. For details about backing up RDAREAs, see 6.4.8 Example 8 (backing up specified RDAREAs).

(7) Use the pdrels command to release the RDAREAs from shutdown status

 
pdrels -r RDAREA01,RDAREA02m,...
 

We recommend that after the command has executed you check whether the execution results are correct. For details about how to check command execution results, see the manual HiRDB Version 9 Command Reference.