Top
Enterprise Postgres 17 Operation Guide

17.3.2 Using the pgx_rcvall Command

The pgx_rcvall command recovers database clusters to the restore point created with the server command. Refer to "Setting a restore point" in "3.2.2 Using Server Commands" for information on how to create a restore point.

Follow the procedure below to recover the data in the data storage disk.

  1. Stop applications

    Stop applications that are using the database.

  2. 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".

  3. Confirm the restore point

    Execute the pgx_rcvall command to confirm the backup data saved in the backup data storage destination, and use a restore point recorded in an arbitrary file, as explained in "3.2.2 Using Server Commands", to determine a restore point prior to the erroneous operation.

    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 data storage destination in the -B option.

    • The -l option displays the backup data information.

    Example
    > pgx_rcvall -D /database/inst1 -B /backup/inst1 -l 
    Date                    Status          Dir
    2022-03-01 10:00:00     COMPLETE        /backup/inst1/2022-03-01_10-00-00
  4. 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.

  5. 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 data storage destination in the -B option.

    • The -n option recovers the data to the specified restore point.

    Example

    The following example executes the pgx_rcvall command with the restore point "batch_20220303_1".

    > pgx_rcvall -D /database/inst1 -B /backup/inst1 -n batch_20220303_1

    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 (therefore the user does not need not be concerned).

    FATAL: the database system is starting up
  6. Start the instance

    Start the instance.

    Refer to "2.1.2 Using Server Commands" for information on how to start an instance.

  7. Restart operation of the database

    If necessary, re-execute transaction processing from the specified recovery time to the point when an erroneous operation was performed, and then resume database operations.

See

Refer to "pgx_rcvall" in the Reference for information on the pgx_rcvall command.