19.4.2 Options
(1) -m [host-name:]name-of-first-HiRDB-file-in-master-directory-RDAREA
~<identifier:pathname>
Specifies the name of the first HiRDB file in the master directory RDAREA. Specify the name of the host containing the master directory RDAREA and the path name, separated by a colon (:). This is the name specified in the pd_master_file_name operand in the system common definitions.
- Example
- -m host01:C:\sysarea\rdsys02\rdmast
- Rules
- You can omit the host name if the master directory RDAREA is located at the server machine where the database recovery utility is executed (where the pdrstr command is entered). In this case, specify only the path name.
- If you specify a host name, make sure that it is a host name specified in the -x option of the pdunit operand in the system definition.
- If you are using the system switchover facility, be sure to specify the host name of the primary system.
- HiRDB-file-system-area-name is not case sensitive, but HiRDB-file-name is case sensitive. For example, for C:\hirdb\rdarea\master\master01, C:\hirdb\rdarea\master is not case sensitive, but master01 is case sensitive.
(2) -b {[host-name:]backup-file-name[,backup-file-name]...|[host-name:]policy-name}
~<identifier: path name> ((up to 167 characters when -k i is specified))
Specifies the names of the backup files or the name of a NetBackup policy.
- When specifying a backup file name
- Specify the name of the host that will contain the backup files, separated by a colon (:) from the names of the backup files, or from the device symbolic name, or from the device group name. Specify a pathname for a backup filename, and an identifier for a device symbolic name or device group name.
- Example
- -b host01:C:\hirdb\pdcopy\backup01
- You can use the DAT access facility for the backup files. For details about the tape device access facility, see 1.4.3 Tape device access facility.
- When specifying a policy name of NetBackup
- When using NetBackup, specify the name of the host that contains the NetBackup client, separated by a colon (:) from a policy name.
- Example
- -b host01:POLICY01
- Rules
- If the backup file is located at the server machine where the database recovery utility is executed (where the pdrstr command is entered), you can omit the host name; in which case, specify the path name only.
- If you specify a host name, make sure that it is a host name specified in the -x option of the pdunit operand in the system definition.
- If the server machine used to execute the database recovery utility (where the pdrstr command is entered) has a NetBackup client, you can omit the host name.
- If you are using the system switchover facility, make sure that the host name of the primary system is specified. Note, however, that the actual backup file or the NetBackup client must be on the running system.
- If the server machine used to execute the database recovery utility has a NetBackup client (where the pdrstr command is entered), you can omit the host name.
- If you are using the system switchover facility, make sure that the host name of the primary system is specified. The actual backup file or NetBackup client must at in the running system.
- When re-creating the log point information file, specify only the first file or first volume, even if multiple backup files or volumes are to be used (the utility references only the first file or volume, even if multiple files or volumes are specified).
- If you specify multiple backup files that were acquired individually by RDAREA, only the first backup file specified is recognized. No other backup file is recognized.
- You can use the pd_utl_file_buff_size operand in the system definition to change the buffer size used for backup file input/output processing.
- If you specify a backup file that was made with -M s specified in the -b option, make sure that you specify the -l, -L, or -d option here.
- The following table shows the relationship between the -b and -k options:
-k option specification | Specifiable backup file |
---|
-k u | You can specify a file name. If a single backup was created in multiple files, specify the names of all such backup files in the order they were created. |
-k i | You can specify a backup file in the format "HiRDB-file-system-area-name\HiRDB-file-name". If a single backup was created in multiple files, specify the names of all such backup files in the order they were created. Note that a HiRDB file system area name is not case sensitive, but an HiRDB file name is case sensitive. |
-k n | Specify the policy name of NetBackup that was obtained by pdcopy. For the host name, specify the name of the host that has both NetBackup client and HiRDB. HiRDB retrieves only the most recent backup of NetBackup. |
(3) -l [host-name:]unload-log-filename [,unload-log-filename]...
~<identifier: pathname>
Specifies the names of unload log files created after the last backup file was created. Specify the name of the host containing the unload log files separated from the path names by a colon.
- Example
- -l host01:C:\hirdb\pdlogunld\unld01
- Rules
- When the -l option is specified, the -L, -c, and -d options cannot be specified.
- If the backup file is located at the server machine where the database recovery utility is executed (where the pdrstr command is entered), you can omit the host name; in which case, specify the path name only.
- If you are using the system switchover facility, make sure that the host name of the primary system is specified. Note that the actual backup file must be located in the running system.
- If a HiRDB file was used to create the unload log file, specify the unload log file name in the format "HiRDB-file-system-area-name\HiRDB-file-name". Make sure that "HiRDB-file-system-area-name\HiRDB-file-name" does not exceed 167 characters.
- Notes
- If there are multiple unload log files, you need to specify all of them in the chronological order of their generations, starting with the oldest one. In this case, specify the host name only once at the beginning. This means that all unload log files must be located at the specified host.
- To use unload log files for recovery, you must specify all required unload log files. If any required unload log file is missing, the utility issues a message (KFPR16203-E or KFPR16301-E) and terminates with an error.
(4) -L
When the system operation does not involve unloading of the system log, this option specifies that the system log files are to be input directly for database recovery.
- Rules
- When you are specifying this option, you also need to specify the name of the backup file with the -b option. This backup file must have been created by the pdcopy command specifying the -z option.
- When this option is specified, the -l, -c, and -d options cannot be specified.
(5) -d [host-name:]unload-log-file-storage-directory-name[,unload-log-file-storage-directory-name]...
~<identifier: path name>
Specifies the names of the directories that contain all the unload log files required for recovery. Separate the name of the host containing the unload log files and the path names with a colon (:).
- Criteria
- Use this option when many unload log files are needed for recovery (such as when there are too many unload log files to be specified on the command line for a single execution of pdrstr).
- Rules
- Make sure that the total length of the name of an unload log file storage directory and the file names in the directory does not exceed 1,023 bytes. You can specify a maximum of 128 directories.
- Make sure that the specified directories do not contain any files other than unload log files. The utility ignores any file that is not an unload log file.
- This option cannot be specified together with the -l or -L option.
- When this option is specified, the utility reads the unload log files in the order they were created (in chronological order of the system log allocation times); therefore, make sure that an unload log file created before or after the machine time was changed is not mixed in in a directory.
- A HiRDB file system area cannot be specified in this option.
- The input start position of the unload log files in a specified directory (unload log files to be loaded) depends on the backup acquisition mode of the backup file and the options specified during recovery. The following table describes the input start position of the unload log files:
Condition | Input start position of unload log files |
---|
Backup file that is used was made in the updatable mode (pdcopy -M s). | The utility inputs all unload log files in the directory. |
Backup file that is used was made in the referencing-possible mode (pdcopy -M r) or reference/update-impossible mode (pdcopy -M x). | Of the unload log files in the directory, the utility inputs all log information starting with the unload log file that includes the backup file acquisition start time. If there is any unload log file that needs to be input before the backup acquisition start time due to a time difference between machines, use the -T option to specify the recovery start time. Obtain the recovery start time based on the time difference between the backup destination host and the recovery target host. |
RDAREAs are recovered from unload log files only; backup files are not used. | The utility inputs all unload log files in the directory. |
The recovery start time is specified in the -T option during recovery. | The utility inputs the unload log files that fall on or after the recovery start time. |
In-memory RDAREAs are recovered | - Recovering an in-memory RDAREA from a backup and unload log files
The utility inputs the unload log files whose timestamps are at or after the time when the in-memory data buffer and the in-memory RDAREA were synchronized. If there are multiple in-memory RDAREAs, the utility inputs the unload log files created at or after the earliest synchronization time among the in-memory RDAREAs. For example, if backup files include a backup copy of RDAREAs RD01 and RD02, and the synchronization time for RD01 is 2013-12-15 at 13:45:23 and the synchronization time for RD02 is 2013-12-15 at 14:05:55, the utility inputs the unload log files created at or after 2013-12-15 at 13:45:23.
- Recovering in-memory RDAREAs from unload log files only without using backup files
Same as above.
- Recovering in-memory RDAREAs and other RDAREAs together
The utility inputs all unload log files under the directory.
|
- An error results if the specified directory contains an unload log file created when a UAP or utility was executed in the no-log mode or the pre-update log acquisition mode. In such a case, specify in the T option a backup start time that is after the execution in the no-log mode or the pre-update log acquisition mode to exclude the system logs in the no-log mode or the pre-update log acquisition mode.
(6) -p process-results-output-file-name
~<pathname>
Specifies the name of the file to which the processing result of the database recovery utility is to be output.
- Example
- -p C:\hirdb\pdrstr\list01
- Rules
- Specify the path name of the server machine at which the database recovery utility is executed (where the pdrstr command is entered).
- When this option is omitted, the database recovery utility outputs its processing results output file to the directory shown below on the server where the utility was executed:
-p option | pd_tmp_directory operand in the system definition |
---|
Specified | Omitted |
---|
TMP environment variable# |
---|
Specified | Omitted |
---|
Specified | Directory specified in the -p option |
Omitted | Directory specified in pd_tmp_directory | Directory specified in TMP | %PDDIR%\tmp directory |
- #: Environment variable specified in the command execution environment
The utility displays the output destination in the KFPR26222-I message.
- Regardless of the specification of this option, the utility outputs all error messages to the system log file and standard output, and the final processing result to the standard output. However, error messages may not be output to the system log file and to the standard output in the same order.
(7) -w name-of-work-directory-for-sorting
~<pathname>
When the -l, -L, or -d option is specified, use this option to specify the name of the directory under which the temporary file is to be created. If the RDAREAs subject to recovery processing are located on multiple server machines, the specified directory must be in each of the server machines. When this option is omitted, the following directory is assumed:
-w option | pd_tmp_directory operand in the system definition |
---|
Specified | Omitted |
---|
TMP environment variable# |
---|
Specified | Omitted |
---|
Specified | Directory specified in the -w option |
Omitted | Directory specified in pd_tmp_directory | Directory specified in TMP | %PDDIR%\tmp directory |
- #: Specification of system environment variable
At least the following amount of free space must be available in the work directory for sorting:
a + (a
130
36)
- a: max {min total-amount-of-input-log-information, 1,536,000,000),amount-of-log information-at-maximum-interval-between-synchronization-points} (bytes)
- total-amount-of-input-log-information:
- Total capacity of the unload log file or system log file that is specified during execution of pdrstr
- amount-of-log information-at-maximum-interval-between-synchronization-points:
- Amount of log information that is acquired up to the next synchronization point since the last synchronization point. You can obtain this value from the following formula:
- Maximum number of times the processing for enabling a synchronization-point dump was skipped
(size of output system log information specified in pd_log_sdinterval![[Figure]](figure/zueng005.gif)
pd_log_max_data_size value
pd_log_rec_leng value![[Figure]](figure/zueng010.gif)
pd_log_rec_leng value)
(8) -y work-buffer-size-for sorting
(9) -k {u|i|n}
Specifies the type of backup file.
- u
- Specifies that a backup file is to be input.
- i
- Specifies that the input is a backup file created in a HiRDB file system area. This option is applicable when the backup file is shared by the running system and a standby system, and the standby system is to be recovered using the backup made by the running system.
- n
- Specifies that the database is to be recovered using NetBackup. In this case, specify the policy name of NetBackup in the -b option.
(10) -U {backup-search-condition-start-time,backup-search-condition-end-time|,backup-search-condition-end-time}
Specifies that the database is to be recovered from a backup made at the specified time from among all the backups made with the same policy name. This option is applicable when the NetBackup linkage facility is used (-k n is specified). Otherwise, the utility ignores this option, if specified.
If both a backup search condition start time and a backup search condition end time are specified, the utility uses the most recent backup within the specified period for recovery. If only a backup search condition end time is specified, the utility uses the backup in effect at the specified end time for recovery.
- Rules
- When this option is omitted, the utility uses the most recent backup from among the backups made with the same policy name.
- You can use the bpimagelist command (with the -policy option specified) to check the dates and times at which backups were made.
- For the backup search condition start time and backup search condition end time, connect the date and time by an underscore (_), shown below. If the time is omitted, the utility assumes 000000 for the start time and 235959 for the end time.
-U YYYYMMDD[_hhmmss],YYYYMMDD[_hhmmss] |
- YYYY: Year ~<unsigned integer> ((1990-2037))
- Specifies the calendar year.
- MM: Month ~<unsigned integer> ((01-12))
- DD: Date ~<unsigned integer> ((01-31))
- hh: Hour ~<unsigned integer> ((00-23))
- mm: Minute ~<unsigned integer> ((00-59))
- ss: Second ~<unsigned integer> ((00-59))
- To specify only the end time, specify a comma immediately followed by the desired end time.
(11) -g differential-backup-group-name
~<alphanumerics> ((1-30))
If you are using the differential backup facility, use this option to specify the differential backup group name used with pdcopy.
(12) -K name-of-HiRDB-file-system-area-storing-differential-backup-management-file
~<pathname>
If you are using the differential backup facility, use this option to specify the name of the HiRDB file system area that contains the differential backup management file used with pdcopy.
Make sure that "name-of-HiRDB-file-system-area-storing-differential-backup-management-file\differential-backup-group-name" does not exceed 167 characters.
(13) -Y write-buffer-size
~<unsigned integer> ((4-131072))
Specifies the buffer size (in kilobytes) when recovery data is written during database recovery processing. Specifying this option reduces the number of write operations because the amount of data written at one time increases.
- Criteria
- Hitachi recommends that you specify this option when the following conditions are satisfied, to improve performance.
Data to be used for recovery | Condition |
---|
Differential backup file | The only data update operation performed after the previous differential backup was addition (INSERT statement) or deletion of all data (DELETE or PURGE TABLE statement). |
Unload log file or system log file | The principal update operation performed by the database updating application is addition (INSERT statement). |
- Specification guidelines
- You should specify a value in the range from 1024 to 2048.
- As a guideline for the value, specify a common multiple of the page length of all RDAREAs that are subject to database recovery processing.
- Rules
- When this option is omitted, the following value is assumed:
When the recovery processing uses a differential backup file, unload log file, or system log file, the page length of each RDAREA that is to be recovered
Otherwise, 60
- If the specified value is less than the maximum page length of the RDAREA to be recovered, the specified value is ignored and the default value is used.
(14) -R
Specifies that checking for related RDAREAs is to be suppressed. Specify this option when you intend to recover individual RDAREAs.
(15) -f control-statement-file-name
~<pathname>
Specifies the name of the control information file.
- Example
- -f C:\hirdb\pdrstr\cont01
You can specify options (3) through (5) and (16) through (21) in the control statement file. You can also specify these options directly in the pdrstr command.
- The format of the control statement file is as follows:
{{-l flag-argument|-L|-d flag-argument}|{-a|-c|-u flag-argument|-s flag-argument|-r flag-argument}[-T flag-argument]}
[{{-l flag-argument|-L|-d flag-argument}|{-u flag-argument|-s flag-argument|-r flag-argument}[-T flag-argument]}]
[{{-l flag-argument|-L|-d flag-argument}|{-u flag-argument|-s flag-argument|-r flag-argument}[-T flag-argument]}]
.
.
. |
- Notes
- Create the control statement file at the server machine where the database recovery utility was executed (where the pdrstr command was entered).
- In the control statement file, you must specify the combination of target RDAREA specification options and the -T option on a single line.
- A line in the control statement file must not exceed 32,768 bytes.
- You can enter comments in the control statement file. However, a row containing only comments cannot be specified.
- For details about the option flags, see the explanations of the individual options.
- If the -u, -s, or -r option consists of multiple lines, you can specify on the subsequent lines only those option flags specified on the first line (except for the -a and -c options). For example, if you specify the -u option on the first line, you can specify the -u option on any subsequent line.
- If the -l option is specified on multiple lines, the last specification takes effect; the same applies to the -d option.
- An option specified on the command line cannot also be specified in the control statement file. However, the -T option can be specified on both the command line and in the control statement file, in which case the -T option specification on the command line applies to any item for which the -T option is omitted in the control statement file.
- Specification of a control statement file may not be supported depending on the combination of options specified on the command line. The following table shows the combinations of options and whether or not a control statement file can be specified:
-l, -L, or -d option | -a, -c, -u, -s, or -r option |
---|
Omitted | Specified |
---|
Omitted | Y#1 | Y#2 |
Specified | Y#3 | N |
- Legend:
- Y: Can be specified
- N: Cannot be specified
- #1: All options specifiable in the control statement file can be specified.
- #2: The -l, -L, or -d option can be specified.
- #3: The -a, -c, -u, -s, or -r option and the -T option can be specified.
- Example of correct control statement
-r pdbuser1 -T 20040809,20040810
-r pdbuser2 -T 20040809
-l C:\hirdb\unldlog\unld01,C:\hirdb\unldlog\unld02,
C:\hirdb\unldlog\unld03,C:\hirdb\unldlog\unld04 |
- This example uses the database update history stored in the unload log files unld01, unld02, unld03, and unld04 to recover the database. To recover the RDAREA pdbuser1, the example uses the database update history from 2004-08-09 00:00:00 to 2004-08-10 24:59:59. To recover the RDAREA pdbuser2, the example uses the database update information starting at 2004-08-09 00:00:00.
- Example of incorrect control statement (1)
-r pdbuser1 -T 20040809,20040810
C:\hirdb\unldlog\unld01,C:\hirdb\unldlog\unld02 Error |
- A line containing the -l, -L, or -d option cannot contain any other option.
- Example of incorrect control statement (2)
-r pdbuser1 -T 20040809,20040810
-r pdbuser2 -T 20040809
-l C:\hirdb\unldlog\unld01
,C:\hirdb\unldlog\unld02 Error |
- Because there is a limit to the length of a single line (maximum of 32,768 bytes including linefeed code), when the -l or -d option has a long argument, you can enter a linefeed code and continue specification onto the next line. The linefeed code can be entered only after the comma (,) that separates the path name of an unload log file. If the line specifying the -l or -d option ends with a character other than the comma, the utility treats it as the end of the line.
(16) -a
Specifies that all RDAREAs are to be restored (except for list RDAREAs and temporary table RDAREAs).
- Rule
- If you specify the -a option, the control statement file can contain only one line of control statement.
(17) -c
Specifies that all RDAREAs in the backup files specified with the -b option (except the list RDAREAs) are to be restored.
- Rules
- If the -c option is specified, the control statement file can contain only one line of control statement.
- If you are specifying the -c option, be sure to also specify the -b option. However, when using the differential backup facility, you do not need to specify the -b option (if the -b option is specified, the utility assumes manual recovery; if the -b option is omitted, the utility assumes automatic recovery).
- If you are specifying the -c option, do not specify the -l option.
- If you made a backup copy with the pdcopy command with the -J option specified and the KFPR26063-I was issued, recovery processing using that backup copy will not result in normal termination (because the skipped RDAREAs are also subject to recovery processing).
(18) -u unit-identifier[,unit-identifier]...
~<identifier> ((4 characters))
If all RDAREAs under specified units are to be restored (except for list RDAREAs and temporary table RDAREAs), use this option to specify the unit identifiers.
- Rules
- If specifying multiple unit identifiers, make sure none of them is duplicated.
- When using a control statement file, make sure that each specified unit identifier is unique among all the control statements.
(19) -s server-name[,server-name]...
~<identifier> ((1-8 characters))
If all RDAREAs under specified servers are to be restored (except for list RDAREAs and temporary table RDAREAs), use this option to specify the server names.
- Rules
- If specifying multiple server names, make sure none of them is duplicated.
- When using a control statement file, make sure that each specified server name is unique among all the control statements.
(20) -r RDAREA-name[,RDAREA-name]...
~<identifier> ((1-30 characters))
Specifies the names of the RDAREAs to be restored.
- Rules
- When a directly specified RDAREA name is duplicated.
- The following specifications will result in the KFPR26007-E error (boldface indicates the duplications):
-r LOB1,USER1 -T 20081125_000000,20081125_240000
-r DDIC,USER1 -T 20081126_000000,20081126_240000
- When an RDAREA name specified in the batch mode is duplicated.
- In the following example, the first value is effective (boldface indicates the duplications):
-r LOB1,USER* -T 20081125_000000,20081125_240000...This specification is effective
-r DDIC,USER* -T 20081126_000000,20081126_240000
- When a directly specified RDAREA name duplicates an RDAREA name specified in the batch mode.
- In the example shown below, the directly specified value is effective for USER1 (boldface indicates the duplications).
-r LOB1,USER1 -T 20081125_000000,20081125_240000...This specification is effective
-r DDIC,USER* -T 20081126_000000,20081126_240000
- List RDAREAs and temporary table RDAREAs cannot be specified.
(21) -T{recovery-start-time,recovery-end-time|recovery-start-time |recovery-end-time}
Use this option to specify a recovery range.
When the -l, -d, or -L option is specified, specifies the output times of the first and last log information items to be used for database recovery.
- Rules
- If the -l, -d, or -L option is specified but this option is omitted, the first and last log output times in the system log files or unload log files are assumed.
- If the -l, -d, or -L option is omitted, this option is ignored. However, if the differential backup facility is used and this option is specified, this option takes effect.
- The recovery start time must be earlier than the recovery end time. If the specified recovery start time is later than the recovery end time, an error results and processing terminates. When you are specifying this option, make sure that a recovery start time, a recovery end time, or both are specified.
- The recovery start time and recovery end time are expressed as a date and time separated by an underscore (_), as shown below. If the time is omitted, the utility assumes 000000 for the recovery start time and 235959 for the recovery end time.
-T YYYYMMDD[_hhmmss],YYYYMMDD[_hhmmss] |
- YYYY: year ~<unsigned integer> ((1990-2037))
- MM: month ~<unsigned integer> ((01-12))
- DD: Date ~<unsigned integer> ((01-31))
- hh: hour ~<unsigned integer> ((00-23))
- mm: minute ~<unsigned integer> ((00-59))
- ss: second ~<unsigned integer> ((00-59))
- If the recovery end time only is specified, it must be preceded by a comma (,); if the recovery start time only is specified, it must not be followed by a comma.
- Notes
- When executing recovery with a time range specified, be sure to specify the time of the server machine that contains the RDAREAs being recovered because the time differs from one server to another.
- When using a backup file to execute recovery with a time range specified, there is no need to specify the recovery start time. The utility ignores the recovery start time, if specified, and assumes the backup start time. For the recovery end time, specify a time that falls after the backup end time.
- When restoring multiple individual RDAREAs updated by a single transaction with a time range specified, specify a time that falls after the transaction end time (synchronization point) for the recovery end time. An error results if the specified time falls before the transaction end time, in which case you need to specify the correct time (which falls after the transaction end time) again.
- The following shows an example of the pdrstr command specifying the -T option and the control statement file specifying the -T option in the -r option:
Command specification
pdrstr ...
-T X1,Y1
...
-f control-statement-file-1 |
Contents of control statement file 1
-r pduser1
-r pduser2 -T X2,Y2
-r pduser3 -T X3
-r pduser4 -T ,Y4 |
![[Figure]](figure/zu190046.gif)
- If the database recovery utility (pdrstr) is executed multiple times, make sure that the recovery start and end times of all related RDAREAs match. For details about related RDAREAs, see RDAREAs to be backed up together in the HiRDB Version 9 System Operation Guide.
(22) -z log-point-information-file-name
~<pathname>
When re-creating the log point information file, use this option to specify the name of the file. This file is created at the host where the pdrstr command is entered.
- Rules
- If specifying this option, you need to specify the backup file name with the -b option. This backup file must have been created by the pdcopy command specifying the -z option.
- If the specified file already exists, the utility deletes this file before re-creating the log point information file.