Recover the database cluster by specifying in the pgx_rcvall command the date and time of the backup you want to read from. Then re-execute the transaction as required to recover the data.
Follow the procedure below to recover the data storage disk.
Stop applications
Stop applications that are using the database.
Stop the instance
Stop the instance. Refer to "2.1.2 Using Server Commands" for information on how to stop an instance.
If the instance fails to stop, refer to "17.11 Actions in Response to Failure to Stop an Instance".
Confirm the backup date and time
Execute the pgx_rcvall command to confirm the backup data saved in the backup data storage destination, and determine a date and time prior to data corruption.
Specify the following values in the pgx_rcvall command:
Specify the data storage destination in the -D option. If the -D option is omitted, the value of the PGDATA environment variable is used by default.
Specify the backup storage directory in the -B option.
The -l option displays the backup data information.
> pgx_rcvall -D /database/inst1 -B /backup/inst1 -l Date Status Dir 2022-03-20 10:00:00 COMPLETE /backup/inst1/2022-03-20_10-00-00
Recover the keystore, and enable automatic opening of the keystore
When the data in the database has been encrypted, restore the keystore to its state at the time of the database backup. Configure automatic opening of the keystore as necessary.
Recover the database cluster
Use the pgx_rcvall command to recover the database cluster.
Specify the following values in the pgx_rcvall command:
Specify the data storage destination in the -D option. If the -D option is omitted, the value of the PGDATA environment variable is used by default.
Specify the backup storage directory in the -B option.
Specify the recovery date and time in the -e option.
In the following examples, "March 20, 2022 10:00:00" is specified as the recovery time.
> pgx_rcvall -D /database/inst1 -B /backup/inst1 -e '2022-03-20 10:00:00'
Note
If recovery fails, remove the cause of the error in accordance with the displayed error message and then re-execute the pgx_rcvall command.
If the message "pgx_rcvall: an error occurred during recovery" is displayed, then the log recorded when recovery was executed is output after this message. The cause of the error is output in around the last fifteen lines of the log, so remove the cause of the error in accordance with the message and then re-execute the pgx_rcvall command.
The following message displayed during recovery is output as part of normal operation of pgx_rcvall command (therefore the user does not need not be concerned).
FATAL: the database system is starting up
Start the instance
Start the instance. Refer to "2.1.2 Using Server Commands" for information on how to start an instance.
If necessary, re-execute transaction processing from the specified recovery time, and then resume database operations.
Resume applications
Resume applications that are using the database.
See
Refer to "pgx_rcvall" in the Reference for information on the pgx_rcvall command.