Nonstop Database, HiRDB Version 9 System Operation Guide

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

15.4.10 Example 9 (changing the disk layout for RDAREAs)

In this example, two user RDAREAs (RDAREA1 and RDAREA2) and three user LOB RDAREAs (RDAREA3, RDAREA4, and RDAREA5) are initialized, and the disk layout for the RDAREAs is changed from /rdarea to /rdarea2.

Procedure
  1. Prepare a HiRDB file system area.
  2. Use the pdhold command to shut down RDAREA1 through RDAREA5.
  3. Use the pdlogswap -d sys -w command to swap the system log files.
  4. Use the pdcopy command to back up data.
  5. Create a control statements file for the pdrorg command.
  6. Use the pdrorg command to unload the data from TABLE1.
  7. Use the pdclose command to close RDAREA1 through RDAREA5.
  8. Create a control statements file for the pdmod command.
  9. Use the pdmod command to reinitialize RDAREA1 through RDAREA5.
  10. Use the pdopen command to open RDAREA1 through RDAREA5.
  11. Create a control statements file for the pdrorg command.
  12. Use the pdrorg command to reload data for TABLE1.
  13. Use the pdlogswap -d sys -w command to swap the system log files.
  14. Use the pdcopy command to back up data.
  15. Use the pdrels command to release RDAREA1 through RDAREA5 from shutdown status.
The procedure step numbers correspond to the paragraph numbers in the explanation that follows. For example, step 3 above is explained in paragraph (3) below.
Organization of this subsection
(1) Prepare a HiRDB file system area
(2) Use the pdhold command to shut down RDAREA1 through RDAREA5
(3) Use the pdlogswap -d sys -w command to swap the system log files
(4) Use the pdcopy command to back up data
(5) Create a control statements file for the pdrorg command
(6) Use the pdrorg command to unload the data from TABLE1
(7) Use the pdclose command to close RDAREA1 through RDAREA5
(8) Create a control statements file for the pdmod command
(9) Use the pdmod command to reinitialize RDAREA1 through RDAREA5
(10) Use the pdopen command to open RDAREA1 through RDAREA5
(11) Create a control statements file for the pdrorg command
(12) Use the pdrorg command to reload data for TABLE1
(13) Use the pdlogswap -d sys -w command to swap the system log files
(14) Use the pdcopy command to back up data
(15) Use the pdrels command to release RDAREA1 through RDAREA5 from shutdown status

(1) Prepare a HiRDB file system area

Prepare a HiRDB file system area on the disk where the new RDAREAs are to be placed (/rdarea2).

 
pdfmkfs -n 100 -l 10 -k DB -i /rdarea2/area11
pdfmkfs -n 100 -l 10 -k DB -i /rdarea2/area12
pdfmkfs -n 100 -l 10 -k DB -i /rdarea2/area13
pdfmkfs -n 100 -l 10 -k DB -i /rdarea2/area14
pdfmkfs -n 100 -l 10 -k DB -i /rdarea2/area15
 

For the -n and -l options, specify a value that is equal to or greater than the value for the HiRDB file system area that was created on the disk (/rdarea) before the change.

(2) Use the pdhold command to shut down RDAREA1 through RDAREA5

 
pdhold -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
 

(3) Use the pdlogswap -d sys -w command to swap the system log files

 
pdlogswap -d sys -w
 

(4) Use the pdcopy command to back up data

 
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. When an RDAREA is reinitialized, other RDAREAs are also updated, as explained in 6.3 RDAREAs to be backed up together. Therefore, you must also back up other RDAREAs, as shown in Section 6.3. In this example, all RDAREAs are backed up.
-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.

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

A control statements file containing the pdrorg command's unload statement (/pdrorg/unld01) is created. The following are the contents of the control statements file:

 
unload /unld/unldfile
 

Explanation
The name of the unload file is specified.

(6) Use the pdrorg command to unload the data from TABLE1

 
pdrorg -k unld -j -t TABLE1 /pdrorg/unld01
 

Explanation
-k: Specifies unld in order to unload.
-j: Specifies that the following tables are to be unloaded:
[Figure] Table with a LOB column
[Figure] Table for which an abstract data type with the LOB attribute has been defined
-t: Specifies the name of the table to be unloaded.
/pdrorg/unld01: Specifies the name of the control statements file for the pdrorg command created in step (5).

(7) Use the pdclose command to close RDAREA1 through RDAREA5

 
pdclose -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
 

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

A control statements file that contains the pdmod command's initialize rdarea statement (/pdmod/init01) is created. The following are the contents of the control statements file:

 
initialize rdarea RDAREA1                               1
   with reconstruction                                  2
   file name "/rdarea2/area11/file01"                   3
      initial 3000 segments;                            4
initialize rdarea RDAREA2
   with reconstruction
   file name "/rdarea2/area12/file01"
      initial 3000 segments;
initialize rdarea RDAREA3
   with reconstruction
   file name "/rdarea2/area13/file01"
      initial 3000 segments;
initialize rdarea RDAREA4
   with reconstruction
   file name "/rdarea2/area14/file01"
       initial 3000 segments;
initialize rdarea RDAREA5
   with reconstruction
   file name "/rdarea2/area15/file01"
       initial 3000 segments;
 

Explanation
The newly created HiRDB file system area is allocated for the RDAREAs that are to be reinitialized.
  1. Specifies an RDAREA to be reinitialized.
  2. Because the file structure is being changed from what it was before reinitialization, specify with reconstruction.
  3. Specifies the HiRDB file that is to constitute the RDAREA. This example specifies the new disk on which the RDAREA is to be placed (/rdarea2).
  4. Specifies the number of segments for the HiRDB file. This value must be equal to or greater than the value for the HiRDB file that had been created on the disk before the change (/rdarea).

(9) Use the pdmod command to reinitialize RDAREA1 through RDAREA5

 
pdmod -a /pdmod/init01
 

Explanation
-a: Specifies the name of the control statements file for the pdmod command created in step (8).
Reference note
When RDAREA1 is reinitialized, the KFPX14255-W, KFPX24231-W, and KFPX24242-W messages are issued, warning that there is an invalid RDAREA. However, because you are reinitializing RDAREA2 through RDAREA5 at the same time, this does not pose a problem. In addition, when RDAREA2, RDAREA4, and RDAREA5 are being reinitialized, the abstract data type with the LOB attribute is denied access to the index, because the index is incomplete. However, reloading the data in step (12) releases these RDAREAs, so this does not pose a problem either.

(10) Use the pdopen command to open RDAREA1 through RDAREA5

 
pdopen -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
 

(11) Create a control statements file for the pdrorg command

A control statements file (/pdrorg/reld01) is created for the unload, index, and sort statements of the pdrorg command. The following are the contents of the control statements file:

 
unload /unld/unldfile                      1
index INDEX1 /unld/index_inf               2
sort /tmp/sortwork                         3
 

Explanation
  1. Specifies the name of the unload file.
  2. Specifies an index identifier (INDEX1) and the name of the index information file (/unld/index_inf).
  3. Specifies the name of the work directory for sorting.

(12) Use the pdrorg command to reload data for TABLE1

 
pdrorg -k reld -j -t TABLE1 /pdrorg/reld01
 

Explanation
-k: Specifies reld in order to reload.
-j: Specifies that the following tables are to be reloaded:
[Figure] Table with a LOB column
[Figure] Table for which an abstract data type with the LOB attribute has been defined
-t: Specifies the name of the table to be reloaded.
/pdrorg/reld01: Specifies the name of the control statements file for the pdrorg command created in step (11).

(13) Use the pdlogswap -d sys -w command to swap the system log files

 
pdlogswap -d sys -w
 

(14) Use the pdcopy command to back up data

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

When an RDAREA is reinitialized, other RDAREAs are also updated, as explained in 6.3 RDAREAs to be backed up together. Therefore, you must also back up other RDAREAs, as shown in Section 6.3. In this example, all RDAREAs are backed up. For details about making backups, see 6. Backup Procedures.

(15) Use the pdrels command to release RDAREA1 through RDAREA5 from shutdown status

 
pdrels -r RDAREA1,RDAREA2,RDAREA3,RDAREA4,RDAREA5
 

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