jajs_dbrestore
- Organization of this page
Format
jajs_dbrestore [-id embedded-database-setup-ID] -i backup-data
Description
Restores an embedded database by using backup data that was created by using the jajs_dbbackup command.
This command is available when the backup enhancement function is enabled.
After the embedded database is restored by using this command, the scheduler service that runs on the restored embedded database starts in disaster recovery mode only for the first time after recovery. In disaster recovery mode, job execution is suppressed and the statuses of jobs and jobnets change. For details on disaster recovery mode, see 6.2.1 Temporarily changing the start mode of JP1/AJS3 in the JP1/Automatic Job Management System 3 Administration Guide.
Execution privileges
In Windows: Administrators privilege
In UNIX: Superuser privilege
Arguments
-id embedded-database-setup-ID
Use four characters, _JFn (n is 0 to 9 or A to Z), to specify the setup identifier of the embedded database to be restored. For this option, specify the value that was specified in the -id option of the jajs_dbbackup command when the backup data to be specified for the -i option was created. To check the value specified in the -id option of the jajs_dbbackup command, see the backup information file (backupinfo.txt) contained in the backup data.
If you omit this option, the system assumes _JF0.
If the value specified for this option does not match the embedded database setup identifier described in the backup information file in the backup data to be specified for the -i option, the command terminates abnormally.
-i backup-data
Specify the directory containing the backup data that was output by the jajs_dbbackup command. Use an absolute path to specify the backup data. In Windows, to include space characters in the specified absolute path, enclose the path in double quotation marks (").
You can specify a character string of 1 to 223 bytes.
If you specify the backup data that was incorrectly output as a result of, for example, the abnormal termination of the jajs_dbbackup command, the command terminates abnormally. To check whether the backup data was normally output, you can use the backup information file (backupinfo.txt) contained in the backup data.
Notes
-
When this command is executed, all execution result details of units and temporary change information for the scheduler services that run in the embedded database of the specified setup identifier are deleted.
-
Before executing this command, make sure that the embedded database is stopped.
-
Do not execute multiple instances of this command concurrently on the same host. If you do so, any subsequently executed commands terminate abnormally.
-
If an error occurs during the execution of this command, the database is returned to the status before the command was executed. In this case, however, database recovery might be incomplete. If an error occurs, correct the cause of the error without starting JP1/AJS3, and then perform restore again.
-
If an error occurs during the restoration of an embedded database, the database area of the embedded database might be blocked. If you re-execute jajs_dbrestore 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. After the blocked status is released, execute the jajs_dbrestore command to restore the embedded database:
-
Check the status of the target embedded database.
ajsembdbstatus -s ust -id embedded-database-setup-ID
-
If the target embedded database is running, stop it normally.
ajsembdbstop -id embedded-database-setup-ID
-
Start the target embedded database.
ajsembdbstart -id embedded-database-setup-ID
-
Set the environment variables required to execute commands for the embedded database.
For details about the environment variables you must set, see the table that describes them in 9.2.3(2) Using a script to reorganize the database in the JP1/Automatic Job Management System 3 Administration Guide.
-
Release the blocked status of the database area.
pdrels -r ALL -o
-
Stop the target embedded database normally.
ajsembdbstop -id embedded-database-setup-ID
-
-
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.
The expansion procedure is as follows.
In 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.
-
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.
-
Recovering data of the embedded database.
For details, see 2.5.3(2) Recovering data of the embedded database in the JP1/Automatic Job Management System 3 Administration Guide.
In 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.
-
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.
-
Recovering data of the embedded database.
For details, see 2.5.3(2) Recovering data of the embedded database in the JP1/Automatic Job Management System 3 Administration Guide.
- #
-
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.
-
-
Do not execute this command concurrently with the following commands on the same logical host:
-
ajsprofalter command
-
ajsembdbstart command
-
ajsembdbstop command
-
ajsstart command
-
ajsstop command
-
jajs_hstd command
-
jajs_hstd_stop command
-
jajs_spmd command
-
jajs_spmd_status command
-
jajs_spmd_stop command
-
jajs_start command (UNIX only)
-
jajs_start.cluster command (UNIX only)
-
jajs_stop command (UNIX only)
-
jajs_stop.cluster command (UNIX only)
-
Return values
0 |
Normal end |
Values other than 0 |
Abnormal end |
Example
The following command restores the embedded database (_JF0) by using the backup data (/BK_JF0_20190101_000000) in the backup data storage directory (/backup).
jajs_dbrestore -id _JF0 -i /backup/BK_JF0_20190101_000000