Nonstop Database, HiRDB Version 9 System Operation Guide

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

15.9.5 Example 4 (Moving RDAREAs containing a row-partitioned table)

In this example, RDAREAs are moved to a back-end server created on a new server machine. A table that is row-partitioned within a server (TABLE1) is converted to one that is row-partitioned among servers.

Organization of this subsection
(1) Add unit 2
(2) Use the pdcopy command to back up the RDAREAs
(3) Use DROP INDEX to delete the non-partitioning key index
(4) Use the pdhold command to place the RDAREAs being moved in shutdown and closed status
(5) Create a control statements file for the pdmod command
(6) Use the pdmod command to move the RDAREAs
(7) Use the pdstop command to terminate HiRDB normally
(8) Transfer the HiRDB files comprising the RDAREAs being moved
(9) Use the pdstart command to start HiRDB normally
(10) Use CREATE INDEX to re-create the non-partitioning key index
(11) Use the pdcopy command to back up the RDAREAs

(1) Add unit 2

For details about adding a unit, see 11.1 Adding a unit.

(2) Use the pdcopy command to back up the RDAREAs

 
pdcopy -m /rdarea/mast/mast01 -M r -a -b /pdcopy/backup01 -p /pdcopy/list01
 

Explanation
-m: Specifies the name of the first HiRDB file in the master directory RDAREA.
-M: Specifies the backup acquisition mode.
-a: Specifies that all RDAREAs are to be backed up. Because the master directory RDAREA and the data dictionary RDAREAs are updated when an RDAREA is moved, we recommend that you back up all RDAREAs at this time.
-b: Specifies the name of the backup file.
-p: Specifies the output destination of the pdcopy command's processing results listing.
For details about making backups, see 6. Backup Procedures.

(3) Use DROP INDEX to delete the non-partitioning key index

 
DROP INDEX INDEX2;
 

Because you cannot move an RDAREA that contains a non-partitioning key index, use DROP INDEX to delete INDEX2 (the non-partitioning key index).

(4) Use the pdhold command to place the RDAREAs being moved in shutdown and closed status

 
pdhold -r RDAREA2,RDAREA4,RDAREA6 -c
 

(5) Create a control statements file for the pdmod command

Create a control statements file (/pdmod/move01) containing a move rdarea statement for the pdmod command. The following shows the contents of this control statements file:

 
move rdarea RDAREA2,RDAREA4,RDAREA6                           1
   to bes2;                                                   2
 

Explanation
  1. Specifies the names of the RDAREAs being moved.
  2. Specifies the name of the target server.

(6) Use the pdmod command to move the RDAREAs

 
pdmod -a /pdmod/move01
 

Explanation
-a: Specifies the name of the control statements file for the pdmod command.

(7) Use the pdstop command to terminate HiRDB normally

 
pdstop
 

(8) Transfer the HiRDB files comprising the RDAREAs being moved

Use one of the methods explained below to transfer the HiRDB files of the RDAREAs being moved to the new server machine.

(a) Transfer by HiRDB file system area

This method requires that the following be satisfied:

Use the operating system's rcp or ftp command to transfer the HiRDB file system areas.

 
rcp /area2 host2:/area2
rcp /area4 host2:/area4
rcp /area6 host2:/area6
 

Explanation
Transfers the HiRDB file system areas for RDAREA2, RDAREA4, and RDAREA6.
(b) Transfer by HiRDB file

If you cannot use the method described in (a), use the procedure described below to move the HiRDB files.

[Figure] Operations on the source machine
  1. Use the pdfbkup command to back up the HiRDB files to be moved.
  2. Use the rcp or ftp command to move the backups you made of the HiRDB files.
  3. Use the pdfrm command to delete the originals of the HiRDB files that you moved.

Example
 
pdfbkup /area2/rdarea2 /tmp/bk_rdarea2          1
pdfbkup /area4/rdarea4 /tmp/bk_rdarea4          1
pdfbkup /area6/rdarea6 /tmp/bk_rdarea6          1
rcp /tmp/"bk_*" host2:/tmp/                     2
pdfrm /area2/rdarea2                            3
pdfrm /area4/rdarea4                            3
pdfrm /area6/rdarea6                            3
 

Explanation
  1. Backs up the HiRDB files of RDAREA2, RDAREA4, and RDAREA6.
  2. Moves the backups of the HiRDB files.
  3. Deletes the HiRDB files of RDAREA2, RDAREA4, and RDAREA6.

[Figure] Operations on the target machine
  1. Use the pdfmkfs command to create HiRDB file system areas.
  2. Use the pdfrstr command to restore the HiRDB files that you moved.

Example
 
pdfmkfs -n 30 -l 10 -k DB /area2               1
pdfmkfs -n 30 -l 10 -k DB /area4               1
pdfmkfs -n 30 -l 10 -k DB /area6               1
pdfrstr /tmp/bk_rdarea2 /area2                 2
pdfrstr /tmp/bk_rdarea4 /area4                 2
pdfrstr /tmp/bk_rdarea6 /area6                 2
 

Explanation
  1. Creates the HiRDB files system areas RDAREA2, RDAREA4, and RDAREA6. Use the same path name as was used on the source machine. If you cannot use the same path name, create a symbolic link aliasing the original path to the directory on the target machine that contains the files.
  2. Lists the HiRDB files of RDAREA2, RDAREA4, and RDAREA6

(9) Use the pdstart command to start HiRDB normally

 
pdstart
 

(10) Use CREATE INDEX to re-create the non-partitioning key index

 
CREATE INDEX INDEX2 on TABLE1(C2) IN ((RDAREA3),(RDAREA4));
 

Re-create the non-partitioning key index that you deleted in step (3).

(11) Use the pdcopy command to back up the RDAREAs

 
pdcopy -m /rdarea/mast/mast01 -M r -a -b /pdcopy/backup02 -p /pdcopy/list02
 

Explanation
-m: Specifies the name of the first HiRDB file in the master directory RDAREA.
-M: Specifies the backup acquisition mode.
-a: Specifies that all RDAREAs are to be backed up. Because the master directory RDAREA and the data dictionary RDAREAs are updated when an RDAREA is moved, we recommend that you back up all RDAREAs at this time.
-b: Specifies the name of the backup file.
-p: Specifies the output destination of the pdcopy command's processing results listing.
For details about making backups, see 6. Backup Procedures.