Nonstop Database, HiRDB Version 9 System Operation Guide

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

15.4.9 Example 8 (using a UAP, all RDAREAs associated with a table are reinitialized, and data is recovered)

In this example, two user RDAREAs (RDAREA1 and RDAREA2) and three user LOB RDAREAs (RDAREA3, RDAREA4, and RDAREA5) are reinitialized and, at the same time, the capacities of the RDAREAs are increased.

Procedure
  1. Use the pdfstatfs command to determine if the HiRDB file system areas have free space.
  2. Prepare the HiRDB file system areas.
  3. Use the pdhold command to shut down and close RDAREA1 to RDAREA5.
  4. Use the pdlogswap -d sys -w command to swap the system log files.
  5. Use the pdcopy command to back up data.
  6. Create a control statements file for the pdmod command.
  7. Use the pdmod command to reinitialize RDAREA2 to RDAREA5.
  8. Use the pdrels command to release RDAREA2 to RDAREA5 from shutdown status, and to place them in open status.
  9. Create a control statements file for the pdmod command.
  10. Use the pdmod command to reinitialize RDAREA1.
  11. Use the pdrels command to release RDAREA1 from shutdown status, and to place it in open status.
  12. Execute the UAP.
  13. Use the pdlogswap -d sys -w command to swap the system log files.
  14. Use the pdcopy command to back up data.
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) Use the pdfstatfs command to determine if the HiRDB file system areas have free space
(2) Prepare the HiRDB file system areas
(3) Use the pdhold command to shut down and close RDAREA1 to RDAREA5
(4) Use the pdlogswap -d sys -w command to swap the system log files
(5) Use the pdcopy command to back up data
(6) Create the control statements file for the pdmod command
(7) Use the pdmod command to reinitialize RDAREA2 to RDAREA5
(8) Use the pdrels command to release RDAREA2 to RDAREA5 from shutdown status and place them in open status
(9) Create the control statements file for the pdmod command
(10) Use the pdmod command to reinitialize RDAREA1
(11) Use the pdrels command to release RDAREA1 from shutdown status and place it in open status
(12) Execute the UAP
(13) Use the pdlogswap -d sys -w command to swap the system log files
(14) Use the pdcopy command to back up data

(1) Use the pdfstatfs command to determine if the HiRDB file system areas have free space

 
pdfstatfs /rdarea/area01
pdfstatfs /rdarea/area02
pdfstatfs /rdarea/area03
pdfstatfs /rdarea/area04
pdfstatfs /rdarea/area05
 

Check all the HiRDB files system areas containing the RDAREAs to be initialized.

(2) Prepare the HiRDB file system areas

Assume you determined in step (1) that the HiRDB files system areas have no free space. In order to increase the sizes of the RDAREAs when you reinitialize them, you must use one of the following methods to prepare the HiRDB file system areas:

  1. Allocate new HiRDB file system areas that are larger than the existing HiRDB file system areas.
  2. Allocate new HiRDB file system areas in addition to the existing HiRDB file system areas.
  3. Expand the existing HiRDB file system areas.

This example uses method 1 to prepare a HiRDB file system areas.

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

(3) Use the pdhold command to shut down and close RDAREA1 to RDAREA5

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

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

 
pdlogswap -d sys -w
 

(5) 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.

(6) Create the control statements file for the pdmod command

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

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

Explanation
The newly created HiRDB file system area is allocated for the RDAREAs being reinitialized.
  1. Specifies the RDAREAs being initialized.
  2. Because the file structure is being changed from what it was before reinitialization, specify with reconstruction.
  3. Specifies the HiRDB file comprising the RDAREA.
  4. Specifies the number of HiRDB file segments.

(7) Use the pdmod command to reinitialize RDAREA2 to RDAREA5

 
pdmod -a /pdmod/init01
 

Explanation
-a: Specifies the name of the control statements file for the pdmod command created in step (6).
Reference note
When RDAREA2, RDAREA4, and RDAREA5 are reinitialized, the abstract data type with the LOB attribute is denied access to the index, because the index is incomplete. However, reinitializing RDAREA1 in step (10) releases these RDAREAs, so this does not pose a problem.

(8) Use the pdrels command to release RDAREA2 to RDAREA5 from shutdown status and place them in open status

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

(9) Create the control statements file for the pdmod command

A control statements file (/pdmod/init02) is created for the initialize rdarea statement of the pdmod command. The following are the contents of the control statements file:

 
initialize rdarea RDAREA1                               1
   with reconstruction                                  2
   file name "/rdarea/area11/file01"                    3
      initial 3000 segments;                            4
 

Explanation
The newly created HiRDB file system area is allocated for RDAREA1.
  1. Specifies the RDAREA (RDAREA2) that is 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 comprising the RDAREA.
  4. Specifies the number of HiRDB file segments.

(10) Use the pdmod command to reinitialize RDAREA1

 
pdmod -a /pdmod/init02
 

Explanation
-a: Specifies the name of the control statements file for the pdmod command created in step (9).

(11) Use the pdrels command to release RDAREA1 from shutdown status and place it in open status

 
pdrels -r RDAREA1 -o
 

(12) Execute the UAP

Execute the UAP that inserts data into TABLE1 to recover the data.

(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.

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