15.7.2 Example

This example adds a user RDAREA (RDAREA1) to which the automatic extension facility is applied.

Procedure
  1. Use the pdfmkfs command to create a HiRDB file system area for the RDAREA.
  2. Create a control statements file for the pdmod command.
  3. Use the pdmod command to add the RDAREA.
  4. Use the pdcopy command to back up data.
  5. Use the pdbufmod command to allocate a global buffer.
  6. Update the pdbuffer operand.
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 pdfmkfs command to create a HiRDB file system area for the RDAREA
(2) Create the control statements file for the pdmod command
(3) Use the pdmod command to add the RDAREA
(4) Use the pdcopy command to make a backup
(5) Use the pdbufmod command to allocate a global buffer
(6) Update the pdbuffer operand

(1) Use the pdfmkfs command to create a HiRDB file system area for the RDAREA

pdfmkfs -n 100 -l 10 -e 230 -k DB -i /rdarea/area01

Explanation
Creates a HiRDB file system area (/rdarea/area01) for RDAREAs.
-n: Specifies the size (in megabytes) of the HiRDB file system area.
-l: Specifies the maximum number of HiRDB files that can be created in the HiRDB file system area.
-e: Specifies the maximum number of extensions.
-k: Specifies DB because the HiRDB file system area is to be used for RDAREAs.
-i: Specifies that the HiRDB file system area is to be initialized.
/rdarea/area01: Specifies a name for the HiRDB file system area that is to be created.

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

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

create rdarea RDAREA1                              1
  globalbuffer gbuf01                             2
  for user used by PUBLIC                         3
  server name bes1                                4
  page 4096 characters                            5
  storage control segment 10 pages                6
  extension use 500 segments                      7
  file name "/rdarea/area01/file01"               8
     initial 1000 segments;                       9

Explanation
  1. Specifies that an RDAREA named RDAREA1 is to be created.
  2. Specifies the global buffer (gbuf01) to be allocated for RDAREA1. Because a global buffer specified with this operand is not allocated when HiRDB is started subsequently, you must change the value specified in the pdbuffer operand. Note that if you allocate a global buffer in step (5) below, you need not specify this operand.
  3. Specifies that RDAREA1 is to be a public user RDAREA.
  4. In the case of a HiRDB/Parallel Server (only), specifies the name of the server where the RDAREA is to be added.
  5. Specifies the page size.
  6. Specifies the segment size.
  7. Specifies use of the automatic extension facility and the number of segments to be added in each iteration of automatic extension.
  8. Specifies the HiRDB file comprising the RDAREA.
    /rdarea/area01 is the HiRDB file system area created in step (1).
  9. Specifies the number of HiRDB file segments.

(3) Use the pdmod command to add the RDAREA

pdmod -a /pdmod/create01

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

(4) Use the pdcopy command to make a backup

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 added, the contents of the master directory and data dictionary RDAREAs are updated, so all RDAREAs are backed up.
-b: Specifies a name for the backup file.
-p: Specifies the output destination for the pdcopy command's processing results listing.

(5) Use the pdbufmod command to allocate a global buffer

This step adds a new global buffer (gbuf01) and allocates it for RDAREA1.

pdbufmod -k add -a gbuf01 -r RDAREA1 -n 1000

Explanation
-k add: Specifies that a global buffer is to be added.
-a: Specifies the name of the global buffer being added.
-r: Specifies the RDAREA for which the global buffer is being allocated.
-n: Specifies the sector count of the global buffer.

Note, however, that both the following conditions must be satisfied in order to use the pdbufmod command:

(6) Update the pdbuffer operand

The global buffer allocated in this procedure becomes invalid if HiRDB is terminated normally or through a planned termination. Therefore, change the pdbuffer operand specification while HiRDB is stopped. An example of the pdbuffer operand specification follows:

                        :
pdbuffer -a gbuf01 -r RDAREA1,RDAREA2,RDAREA3 -n 1000
                        :

Explanation
The added RDAREA (RDAREA1) is assigned to a global buffer (gbuf01).

You can use the system reconfiguration command (pdchgconf command) to change the pdbuffer operand specification while HiRDB is running. Note that HiRDB Advanced High Availability must be installed in order to use the system reconfiguration command. For details about changing HiRDB system definitions using the system reconfiguration command, see 9.2 Modifying HiRDB system definitions while HiRDB is running (system reconfiguration command).

It is recommended that after the command has executed you check whether or not the execution results are correct. For details on how to check command execution results, see the manual HiRDB Version 8 Command Reference.