Nonstop Database, HiRDB Version 9 System Operation Guide

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

15.4.6 Example 5 (abstract data type is defined)

In this example, a user RDAREA (RDAREA1) is reinitialized and, at the same time, the capacity of the RDAREA is increased.

Procedure
  1. Use the pdfstatfs command to determine if the HiRDB file system area has free space.
  2. Prepare a HiRDB file system area.
  3. Use the pdhold command to shut down RDAREA1 and RDAREA2.
  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 pdrorg command.
  7. Use the pdrorg command to unload the data from TABLE1.
  8. Use the pdclose command to close RDAREA1.
  9. Create a control statements file for the pdmod command.
  10. Use the pdmod command to reinitialize (increase the size of) RDAREA1.
  11. Use the pdopen command to open RDAREA1.
  12. Create a control statements file for the pdrorg command.
  13. Use the pdrorg command to reload data for TABLE1.
  14. Use the pdlogswap -d sys -w command to swap the system log files.
  15. Use the pdcopy command to back up data.
  16. Use the pdrels command to release RDAREA1 and RDAREA2 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) Use the pdfstatfs command to determine if the HiRDB file system area has free space
(2) Prepare a HiRDB file system area
(3) Use the pdhold command to shut down RDAREA1 and RDAREA2
(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 pdrorg command
(7) Use the pdrorg command to unload data from TABLE1
(8) Use the pdclose command to close RDAREA1
(9) Create the control statements file for the pdmod command
(10) Use the pdmod command to reinitialize (extend the size of) RDAREA1
(11) Use the pdopen command to open RDAREA1
(12) Create the control statements file for the pdrorg command
(13) Use the pdrorg command to reload data into TABLE1
(14) Use the pdlogswap -d sys -w command to swap the system log files
(15) Use the pdcopy command to back up data
(16) Use the pdrels command to release shutdown status of RDAREA1 and RDAREA2

(1) Use the pdfstatfs command to determine if the HiRDB file system area has free space

 
pdfstatfs /rdarea/area01
 

(2) Prepare a HiRDB file system area

Assume you determined in step (1) that the HiRDB files system area has no free space. In order to increase the size of the RDAREA when you reinitialize it, you must use one of the following methods to prepare a HiRDB file system area:

  1. Allocate a new HiRDB file system area that is larger than the existing HiRDB file system area.
  2. Allocate a new HiRDB file system area in addition to the existing HiRDB file system area.
  3. Expand the existing HiRDB file system area.

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

 
pdfmkfs -n 100 -l 10 -k DB -i /rdarea/area02
 

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

 
pdhold -r RDAREA1,RDAREA2
 

(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 pdrorg command

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

 
unload /unld/unldfile1
 

Explanation
Specifies the name of the unload file.

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

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

Explanation
-k: Specifies unld for unloading.
-j: Specifies that one of the following types of tables is to be unloaded:
  • Table containing a LOB column
  • Table in which is defined an abstract data type with the LOB attribute
-t: Specifies the name of the table that is to be unloaded.
/pdrorg/unld01: Specifies the name of the control statements file for the pdrorg command created in step (6).

(8) Use the pdclose command to close RDAREA1

 
pdclose -r RDAREA1
 

(9) 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 RDAREA1                               1
   with reconstruction                                  2
   file name "/rdarea/area02/file01"                    3
      initial 3000 segments;                            4
 

Explanation
The newly created HiRDB file system area is allocated for RDAREA1.
  1. Specifies the RDAREA (RDAREA1) 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 (extend the size of) RDAREA1

 
pdmod -a /pdmod/init01
 

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

(11) Use the pdopen command to open RDAREA1

 
pdopen -r RDAREA1
 

(12) Create the 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 log 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.

(13) Use the pdrorg command to reload data into TABLE1

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

Explanation
To also create the index (INDEX1) at the same time, the -i option is omitted and the index is created in the batch mode.
-k: Specifies reld for reloading.
-j: Specifies that one of the following types of tables is to be reloaded:
  • Table containing a LOB column
  • Table in which is defined an abstract data type with the LOB attribute
-t: Specifies the name of the table that is to be reloaded.
/pdrorg/reld01: Specifies the name of the control statements file for the pdrorg command created in step (12).

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

 
pdlogswap -d sys -w
 

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

(16) Use the pdrels command to release shutdown status of RDAREA1 and RDAREA2

 
pdrels -r RDAREA1,RDAREA2
 

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.