19.3.1 Example 1: Recovering all RDAREAs
(1) Use the pdlogls command to check for the current system log file
In the case of a HiRDB/Parallel Server, check for the system log file at the dictionary server and back-end server.
(2) Use the pdlogswap command to swap system log files
To unload the contents of the current file, swap the system log files. In the case of a HiRDB/Parallel Server, swap the system log files at the dictionary server and back-end server.
(3) Use the pdlogunld command to unload what was the current file
Unload the contents of the current system log file checked in step (1). In the case of a HiRDB/Parallel Server, unload the contents of the current system log file at the dictionary server and back-end server.
pdlogunld -d sys -s bes1 -g log01 -o /unld/unldlog02 |
- When the automatic log unloading facility is used
- In this case, this step is not necessary. Use the pdlogatul command to confirm that the automatic log unloading facility is functioning. Also, use the pdlogls command to check if unloading has been completed.
(4) Use the pdstop command to terminate HiRDB normally
If HiRDB cannot be terminated normally, initialize the status files. First, delete the status files with the pdstsrm command, then re-create status files with the pdstsinit command.
(5) Use the pdstart -r command to start HiRDB
(6) Use the pdrstr command to recover the master directory RDAREA to the most recent synchronization point
pdrstr -m /rdarea/mast/mast01 -b /pdcopy/backup01
-l /unld/unldlog01,/unld/unldlog02 -w /tmp/sortwork -r rdmast |
- Explanation
- -m: Specifies the name of the first HiRDB file in the master directory RDAREA.
- -b: Specifies the name of the backup file that stores the backup of the master directory RDAREA (rdmast).
- -l: Specifies the names of the unload log files.
- -w: Specifies the name of the work directory for sorting.
- -r: Specifies the name of the master directory RDAREA (rdmast).
(7) Use the pdrstr command to recover the data directory RDAREA, etc., to the backup acquisition point
The following RDAREAs are recovered to the backup acquisition point:
- Data directory RDAREA
- Data dictionary RDAREA
- Data dictionary LOB RDAREA (for storing sources)
- Registry RDAREA
- Registry LOB RDAREA
If HiRDB was started with the pdstart -r command, do not execute multiple pdrstr commands at the same time.
pdrstr -m /rdarea/mast/mast01 -b /pdcopy/backup01
-r rddir,rddic,diclob,regrd,reglob |
- Explanation
- -m: Specifies the name of the first HiRDB file in the master directory RDAREA.
- -b: Specifies the name of the backup file that stores the backup.
- -r: Specifies the names of the RDAREAs that are to be recovered.
(8) Use the pdstop command to terminate HiRDB normally
(9) Use the pdstart command to start HiRDB
(10) Use the pdhold command to close RDAREAs by shutting them down
Shut down and close all RDAREAs except the master directory RDAREA and data dictionary RDAREA.
pdhold -r rddir,diclob,regrd,reglob,rdarea01,rdarea02,... -c |
(11) Use the pdhold command to close the data dictionary RDAREA by shutting it down
The data dictionary RDAREA must be shut down and closed last.
(12) Use the pdrstr command to recover RDAREAs other than the master directory RDAREA to the most recent synchronization point
pdrstr -m /rdarea/mast/mast01 -b /pdcopy/backup01
-l /unld/unldlog01,/unld/unldlog02 -w /tmp/sortwork
-r rddir,rddic,diclob,regrd,reglob,rdarea01,rdarea02,... |
- Explanation
- -m: Specifies the name of the first HiRDB file in the master directory RDAREA.
- -b: Specifies the name of the backup file.
- -l: Specifies the names of the unload log files.
- -w: Specifies the name of the work directory for sorting.
- -r: Specifies the names of the RDAREAs to be recovered.
(13) Use the pdrels command to open the data dictionary RDAREA by releasing it from shutdown status
The data dictionary RDAREA must be released from shutdown status and opened first.
(14) Use the pdrels command to open other RDAREAs by releasing them from shutdown status
Open all RDAREAs except the master directory RDAREA and data dictionary RDAREA by releasing them from shutdown status.
pdrels -r rddir,diclob,regrd,reglob,rdarea01,rdarea02,... -o |
(15) Use the pdcopy command to back up all RDAREAs
pdcopy -m /rdarea/mast/mast01 -M r -a -b /pdcopy/backup01
-z /pdcopy/logpoint01 -p /pdcopy/list01 |
- Explanation
- -m: Specifies the name of the first HiRDB file in the master directory RDAREA.
- -M: Specifies the updatable mode as the backup acquisition mode.
- -a: Specifies that all RDAREAs are to be backed up.
- -b: Specifies a name for the backup file.
- -z: Specifies the name of the log point information file. This option is specified when the automatic log unloading facility is used.
- -p: Specifies the output destination for the pdcopy command's processing results listing.
(16) Use the pdstop command to terminate HiRDB normally
(17) Use the pdstart command to start HiRDB
(18) Recover the data dictionary LOB RDAREA for storing objects
The procedure for recovering the data dictionary LOB RDAREA for storing objects is described below.
- Procedure
- To recover the data dictionary LOB RDAREA:
- Use the pdmod command to re-initialize the data dictionary LOB RDAREA for storing objects:
pdmod -a /pdmod/mod01
- Use ALTER ROUTINE to re-create the SQL objects of all stored routines and triggers.
ALTER ROUTINE ALL
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.