3.8.5 Application example 3 (making a backup)

In this application example, a backup is made. The procedure is the same regardless of the number of directories for unload log files that are used.

Organization of this subsection
(1) Verifying that the automatic log unloading facility is operating
(2) Swapping system log files
(3) Verifying that unloading of the system log has been completed
(4) Making a backup of all RDAREAs with the pdcopy command
(5) Checking the name of the unload log file for the current system log files

(1) Verifying that the automatic log unloading facility is operating

Enter the pdlogatul command to verify that the automatic log unloading facility is operating (in the case of a HiRDB/Parallel Server, you must perform this check at all servers for which the backup is to be made):

pdlogatul -d sys

HOSTNAME:host01(105321)
SERVER_NAME:sds1
AUTO_LOG_UNLOAD  NOW_UNLOAD_LOG_GROUP  CREATE_DIR
        ACTIVE               logfg02  /unlddir1/bes1
CURRENT LOG GENERATION INFO.
LOG_GROUP  GEN_NO. SERVER_RUN_ID RUN_ID    UNLOAD_FILE_NAME
logfg03        15   3a765d82      3a765d6d  sds1_3a765d820015_logfg03

Explanation
AUTO_LOG_UNLOAD
Indicates whether or not the automatic log unloading facility is operating. ACTIVE indicates that the facility is operating.
NOW_UNLOAD_LOG_GROUP
Shows the file group name of system log files that are being unloaded. **** is displayed if no files are being unloaded.
CREATE_DIR
Shows the name of the directory for unload log files that is currently being used. In this example, /unlddir1/bes1 is being used.
LOG_GROUP
Shows the file group name of the current system log files.
GEN_NO
Shows the generation number of the current system log files.
SERVER_RUN_ID
Shows the server run ID of the current system log files.
RUN_ID
Shows the run ID of the current system log files.
UNLOAD_FILE_NAME
Shows the unload log file name when the current system log files are unloaded by the automatic log unloading facility.

(2) Swapping system log files

Before a backup is made, use the pdlogswap command to swap the system log files. In the case of a HiRDB/Parallel Server, swap the system log files on all servers for which the backup is to be made.

System log files are swapped in order to physically separate the system log information needed for database restoration. The system log files storing the system log information needed for database restoration are those that become primary from this point on.

pdlogswap -d sys -w

(3) Verifying that unloading of the system log has been completed

Enter the pdlogls command to check the status of the system log files (in the case of a HiRDB/Parallel Server, check the status of the system log files at all servers for which the backup is to be made):

pdlogls -d sys

HOSTNAME : host01(153027)
Group    Type Server   Gen No. Status  Run ID    Block No.
logfg01  sys  sds1           13 os----u 3a765d6d      eff      fc8
logfg02  sys  sds1           14 os----u 3a765d6d      fc9     1092
logfg03  sys  sds1           15 osu-b-u 3a765d6d     1093     115b
logfg04  sys  sds1           16 oc-d--u 3a765d6d     115c     1226

Explanation
  • A file for which u is displayed in the third column under Status is a system log file waiting to be unloaded. When a file's unloading is completed, - is displayed. In this example, file logfg03 is waiting to be unloaded.
  • Wait until there are no more system log files waiting to be unloaded (i.e., execute the pdlogls command until all system log files have been unloaded).

(4) Making a backup of all RDAREAs with the pdcopy command

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

Explanation
-m: Specifies the name of the first HiRDB file in the master directory RDAREA.
-M: Specifies the referencing-permitted mode as the backup acquisition mode.
-a: Specifies that all RDAREAs are to be backed up.
-b: Specifies the name of the backup file.
-z: Specifies the name of the log point information file.
-p: Specifies the file name for the pdcopy command's processing results listing.
Remarks
Specifying the -z option is recommended when the automatic log unloading facility is being used. When the -z option is specified, the following information is output in LOG FILE INFORMATION of the pdcopy command's processing results listing:
  • Name of the server for which the backup was made (SERVER NAME)
  • Server run ID when the backup was made (SERVER RUN ID)
  • Generation number of the current system log files when the backup was made (GENERATION NO)
  • File group name of the current system log files when the backup was made (FILE NAME)
This information makes it possible to identify the unload log file name for the current system log files when the backup was made. Based on this unload log file name, the unload log files required for database restoration are identified. For details on how to identify the unload log files required for database restoration, see 3.8.6 Creating a time series list of unload log files (identifying the unload log files required for database restoration).
Note that because the -z option cannot be specified in the cases listed below, you must in these cases perform the operation explained in (5) below to determine the unload log file name for the current system log files when a backup was made:
  • HiRDB was started with the pdstart -r command
  • Backup is not made on a server-by-server basis

(5) Checking the name of the unload log file for the current system log files

Use the pdlogatul command to check the name of the unload log file for the current system log files (in the case of a HiRDB/Parallel Server, perform this check for all servers for which backup is made):

pdlogatul -d sys

HOSTNAME:host01(105528)
SERVER_NAME:sds1
AUTO_LOG_UNLOAD  NOW_UNLOAD_LOG_GROUP  CREATE_DIR
        ACTIVE                  ****  /unlddir1/bes1
CURRENT LOG GENERATION INFO.
LOG_GROUP  GEN_NO.  SERVER_RUN_ID  RUN_ID    UNLOAD_FILE_NAME
logfg04        16   3a765d82       3a765d6d  sds1_3a765d820016_logfg04

Explanation
UNLOAD_FILE_NAME
Shows the unload log file name when the current system log files are unloaded by the automatic log unloading facility.

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.