ajsembdbrstr
- Organization of this page
Format
ajsembdbrstr [-mh logical-host-name] [-M] [-i embedded-database-practical-directory] -d data-area-name -bf backup-file [-l unload-log-file-1,unload-log-file-2,...| -ld unload-log-storage-directory] -e output-result-file-storage-directory [-id embedded-database-setup-ID]
Description
Backs up the embedded database, or restores the embedded database using the backup and the unload log file.
Execution privileges
In Windows: Administrators privileges
In UNIX: Superuser privileges
Storage directory
- In Windows:
-
JP1/AJS3 - Manager-installation-folder\tools\
- In UNIX:
-
/opt/jp1ajs2/tools/
Arguments
-mh logical-host-name
Specification of this option is no longer necessary. The logical host name specified by this option is ignored.
-M
Specify this argument to restore the system area.
The system area stores the internal information about the embedded database system.
To restore the system area of the embedded database, you must start the embedded database in a special mode that allows the restoration of the system area.
In this mode, you cannot restore the data area. Once you complete restoration of the system area, you must execute the ajsembdbstop command to stop the embedded database, and then execute the ajsembdbstart command, without options, to restart the embedded database.
When you want to restore the system area and the data area, specify the same options other than -M, the same backup file, and the same unload file.
If you specify different options, or a different backup file or unload file, data might be damaged. Use caution.
In the following case, restore the data area after you restore the system area by specifying -M:
-
The embedded database server stops due to a failure, and does not start even if you attempt to restart it.
-
Resolve the problem in the embedded database.
-
Execute the ajsembdbstart command with the -r option to start the embedded database in the status where the system area can be restored.
-
Execute the ajsembdbrstr command with the -M option to restore the system area of the embedded database.
-
If step 3 ends normally, execute the ajsembdbstop command to stop the embedded database that has started in the status where the system area can be restored.
-
Execute the ajsembdbstart command for the embedded database, to start the embedded database in the normal status.
-
Execute ajsembdbrstr to restore the data area in the embedded database.
-
For details about the ajsembdbstart and ajsembdbstop commands, see ajsembdbstart in 2. Commands and ajsembdbstop in 2. Commands.
-i embedded-database-practical-directory
Specify the embedded database directory. Use an absolute path to specify the directory. In Windows, to include space characters in the specified absolute path, enclose the path in double quotation marks ("). You must specify the same directory that you specify in the -i option of the ajsembdbbuild command. In UNIX. If you omit the -i option of the ajsembdbbuild command during the setup, you can omit this option.
If you omit this argument, /opt/jp1ajs2/emdbd/_JF0/ is assumed.
If you specify both the -i option and the -id option, the value specified for the -i option takes precedence.
-d data-area-name
Specify the data area name of the embedded database. Use an absolute path to specify the directory. In Windows, to include space characters in the specified absolute path, enclose the path in double quotation marks ("). If you have specified the embedded database directory in the -d option of the ajsembdbbuild command, specify as follows:
- For Windows:
-
directory-name-specified-in-the-d-option\ajssys02
- For UNIX:
-
directory-name-specified-in-the-d-option/ajssys02
If you have specified the RD area partition in the -a option of the ajsembdbbuild command, specify as follows:
- For Windows:
-
data-area-partition-specified-in-the-a-option
- For UNIX:
-
data-area-partition-specified-in-the-a-option
If you want to operate an embedded database created by using the jajs_setup or jajs_migrate command, use the ajsembdbidlist command to check the directory that contains the embedded database. For details on the ajsembdbidlist command, see ajsembdbidlist in 2. Commands Used during Setup in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 2.
- For Windows:
-
[directory-name-displayed-by-the-ajsembdbidlist-command]\dbarea\ajssys02
- For UNIX:
-
/var/opt/jp1ajs2/embdb/_JFn#/dbarea/ajssys02
If you operate the embedded database in a logical host environment set up by using the jajs_setup_cluster command, specify the value specified for the -d option.
- For Windows:
-
[directory-name-specified-in-the-d-option]\jp1ajs2\embdb\_JFn#\dbarea\ajssys02
- For UNIX:
-
[directory-name-specified-in-the-d-option]/jp1ajs2/embdb/_JFn#/dbarea/ajssys02
If you operate the embedded database in a logical host environment set up by using the jajs_setup command, specify the value specified for the -D option.
- For Windows:
-
[directory-name-specified-in-the-d-option]\jp1ajs2\embdb\_JFn#\dbarea\ajssys02
- For UNIX:
-
[directory-name-specified-in-the-d-option]/jp1ajs2/embdb/_JFn#/dbarea/ajssys02
- #
-
Specify the value specified for the -id option of this command. If you omit the -id option, specify _JF0.
-bf backup-file
Specify the backup file that is acquired using ajsembdbbackup command.
Use an absolute path to specify the directory. In Windows, to include space characters in the specified absolute path, enclose the path in double quotation marks (").
-l unload-log-file-1,unload-log-file-2,...
Specify this argument to use the acquired unload log file to restore the embedded database. You specify this argument when you specify the -bl option of the ajsembdbbuild command to create an embedded database.
Use an absolute path to specify an unload log file. In Windows, to include space characters in the specified absolute path, enclose the path in double quotation marks ("). Specify the unload log files in the sequence they are acquired. When you specify two or more unload log files, enclose the path after -l in double quotation marks (").
If you do not specify -s option when you acquire the backup, you can omit the input of the unload log file. In such a case, the database is restored up to the point when the backup is acquired.
-ld unload-log-storage-directory
In the same way as the -l option, you can specify this option if you want to use unload log files for restoration. Specify the absolute path name of the directory that contains the unload log files.
In Windows, if you specify an absolute path that contains spaces, enclose the entire path in double quotation marks (").
-e output-result-file-storage-directory
Specify the directory that stores the output result of the restoration. In Windows, use an absolute path to specify the directory. To include space characters in the specified absolute path, enclose the path in double quotation marks ("). You must create the directory you are going to specify beforehand. If the specified directory does not exist, an error occurs.
The following file is stored in the specified directory:
-
Processing output result file
The file name is automatically assigned based on the following rules:
-
Output result file: RSTR_XXXXYYZZVVWW.log
XXXX: Year
YY: Month
ZZ: Day
VV: Hour
WW: Minutes
-id embedded-database-setup-ID
Specify the setup identifier that identifies the embedded database in the _JFn format (n: 0-9 or A-Z). The value specified in this argument must be the same as the value specified in the -id option of the ajsembdbbuild command.
If you want to operate an embedded database created by using the jajs_setup, jajs_setup_cluster, and jajs_migrate commands, use the ajsembdbidlist command to check the setup identifier of the embedded database. For details on the ajsembdbidlist command, see ajsembdbidlist in 2. Commands Used during Setup in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 2.
If you omit this option, the system assumes _JF0.
If you specify both the -id option and the -i option, the -i option takes precedence.
Notes
-
If the unload log is used in an embedded-database environment that has been created by using advanced setup, before executing the ajsembdbrstr command, execute the ajsembdboplog command with the -w option specified. Doing this unloads the current system log file. If the ajsembdbrstr command fails, you do not need to execute the ajsembdboplog command again before re-executing the ajsembdbrstr command.
-
Execute the command when the scheduler service is inactive.
-
If an error occurs during restoration, the database recovery might be incomplete. If an error occurs, do not start the scheduler service immediately.
-
When you execute ajsembdbbackup command with the -s option to acquire the backup, the restoration using the ajsembdbrstr command script requires the unload log file as input information.
-
If you execute ajsembdbbackup command without the -s option to acquire the backup, the ajsembdbrstr command script can restore the embedded database using only the backup file, and does not use the unload log file. In such a case, the database can be restored up to the point when the backup is acquired.
-
When restoration ends normally, acquire the backup.
-
The execution results of the command are output to the log file. The log file is stored in the following directories:
- For Windows Server 2012 or Windows Server 2008, if the installation folder is in the default folder or a folder protected by the system:
-
%ALLUSERSPROFILE%\Hitachi\JP1\JP1_DEFAULT\JP1AJS2\log
The default of the %ALLUSERSPROFILE% value is system-drive\ProgramData.
A folder protected by the system is the path to a folder in any of the following:
- system-drive\Windows
- system-drive\Program Files
- system-drive\Program Files (x86) (For 64-bit Windows)
- For Windows Server 2012 or Windows Server 2008 in which an installation folder other than the above is used:
-
JP1/AJS3-Manager-installation-folder\log
- For Windows Server 2003:
-
JP1/AJS3-Manager-installation-folder\log
- For UNIX
-
/var/opt/jp1ajs2/log
The file name is ajsembdbrstr.log. Since the contents of this file are not overwritten, the file size increases indefinitely. Evacuation or delete the contents of this file as necessary.
When this file does not exist, execute ajsembdbrstr to create a new one.
-
If an error occurs when ajsembdbrstr command is executed, the database area of the embedded database is blocked. If you re-execute ajsembdbrstr command in this status, an error occurs. In such a case, execute the following command for the embedded database to release the blocked status of the database area:
pdrels -r ALL -o
Note that before you execute the pdrels command, you need to set environment variables from the command prompt. For details about the environment variables you need to set, see the table that describes the applicable environment variables in 10.2.2(2) Using a script to reorganize the database in the Job Management Partner 1/Automatic Job Management System 3 Administration Guide.
-
To delete the environment of the embedded database, re-create the environment of the embedded database, and then restore the data, complete ajsembdbsetup command, and then execute ajsembdbrstr command.
If the embedded database area has been expanded by using the ajsembdbaddarea command, the same expansion is also necessary before you execute the ajsembdbrstr command. However, if the unload log is used in an embedded database environment created by using advanced setup, make sure that you execute the ajsembdboplog command with the -w option specified before performing the expansion.
The expansion procedure is as follows.
For Windows:
-
Back up the following folder:
embedded-database-practical-folder #\CONF\embrm
-
Execute the ajsembdbunset command.
-
Execute the ajsembdbbuild command.
-
Execute the ajsembdbsetup command.
-
In the folder you backed up in step 1, rename the addarea file to addarea.bat, and then execute the file.
-
Execute the ajsembdbrstr command.
-
Change the name of the file you renamed in step 5 back to addarea.
-
Restore the folder you backed up in step 1 to the following folder:
embedded-database-practical-folder #\CONF
-
Delete the folder you backed up in step 1.
For UNIX:
-
Back up the following directory:
embedded-database-practical-directory #/conf/embrm
-
Execute the ajsembdbunset command.
-
Execute the ajsembdbbuild command.
-
Execute the ajsembdbsetup command.
-
In the folder you backed up in step 1, add execute permission to the access permissions of the addarea file, and then execute the file.
-
Execute the ajsembdbrstr command.
-
Restore the directory you backed up in step 1 to the following directory:
embedded-database-practical-directory #/conf
-
Delete the directory you backed up in step 1.
- #
-
You can check the embedded database practical folder or directory by using the ajsembdbidlist command. For details on the ajsembdbidlist command, see ajsembdbidlist in 2. Commands Used during Setup in the manual Job Management Partner 1/Automatic Job Management System 3 Command Reference 2.
-
-
Specifying the -l option causes an error in ajsembdbrstr command if update information is not stored in the actually specified unload log file.
-
Do not execute multiple instances of this command concurrently. If you do so, the command instances might incorrectly result in an error.
Return values
0 |
Normal end |
Values other than 0 |
Abnormal end |
Actions to be taken if an error occurs
An error might occur when ajsembdbrstr command is executed. If an error occurs, read the following table and take appropriate action.
Message |
Cause |
Action to be taken |
---|---|---|
KFPR26227-E |
The unload log file is not specified. |
Execute the following embedded database commands such as pdstop or pdstart, specify the unload log file in -l option, and then re-execute the ajsembdbrstr command. pdrels -r ALL -o |
KAVS0996-E |
|
Review the specified arguments and re-execute the command. |
KFPR00765-I Pdrstr terminated, return code=8 or KFPR00765-I Pdrstr terminated, return code=12 |
|
Review the specified path, execute the following embedded database command, and re-execute the command. pdrels -r ALL -o |
KFPR26203-E |
There is no permission for the path specified in the -e option or -ld option. |
Check the permissions for the specified path, and then re-execute the command. If AJS administrators operate the system, make sure that the AJS administrators have the appropriate privileges. |
KFPS01984-E |
The path specified in -i option is not a absolute path. |
Revise the specified path, execute the pdstart command, and then re-execute the ajsembdbrstr command. |
KFPH27006-E |
There is no permission for the path specified in the -d option. |
Check the permissions for the specified path, and then re-execute the command. If AJS administrators operate the system, make sure that the AJS administrators have the appropriate privileges. |
KFPH27008-E |
Referencing is not possible, because the database area is blocked. |
Execute the following embedded database command, and then re-execute the ajsembdbrstr command. pdrels -r ALL -o |
Bad directory specified in -i option |
The path specified in the -i option is not the path for the embedded database practical directory, or the user does not have the appropriate privileges. Alternatively, the system has not been set up correctly. |
Specify the correct embedded database directory in -i option. Alternatively, check the permissions and then re-execute the command. If the embedded database directory is specified correctly, retry set up of the embedded database. If AJS administrators operate the system, make sure that the AJS administrators have the appropriate privileges. |
KAVS2104-E |
The setup ID specified in -id option is invalid or the embedded database is not set up. |
Check whether the setup ID specified in -id option is correct. Alternatively, use ajsstatus to check whether the embedded database is set as the database for the scheduler service. |