Top
Symfoware Server V12.1.0 Reference
FUJITSU Software

3.5 pgx_rcvall

Name

pgx_rcvall - Recovers the data directory, tablespaces, and configuration files.

Synopsis

pgx_rcvall [option...]

Description

The pgx_rcvall command recovers the data directory, tablespaces, and configuration files using the data that was backed up with pgx_dmpall command and archived Write-Ahead-Log (WAL). If none of the options that indicate the recovery point is specified, all archived WAL are applied and the data will be recovered to the latest point.

Options

-B backupdir

Specify the backup storage directory. If the data directory is damaged, this option cannot be omitted.

-D datadir

Specify the data directory. If this option is omitted, the value of the environment variable PGDATA is used.

-e targetTime

Specify this option to recover the data as of the specified date and time.

targetTime

Specify the time at which the data is recovered. The format is as follows:

"YYYY-MM-DD HH:MM:SS"
-l

This option displays a list of the backup data information in the backup storage directory that was obtained using the pgx_dmpall command.. This cannot be specified together with -p, -e or -n option.

-n restorePoint

Specify this option to recover the data to the specified restore point. Restore points are created with SQL function pg_create_restore_point. If multiple restore points with the same names were created, the first one after the backup was taken is used for recovery. If the specified restore point does not exist, all archived WAL are applied. This cannot be specified together with -e or -p option.

-p

Specify this option to recover the data as of the time when the last backup completed. This cannot be specified together with -e or -n option.

-s connectionString

Construct a standby server from the backup created by pgx_dmpall. Specify as an argument a connection string for connecting to the primary server. This is the same as primary_conninfo parameter in recovery.conf. This option can only be specified together with -D and -B.

-x

Specify this option if you do not want to include transactions committed at the time specified in the -e option as part of the recovery.

--keystore-passphrase

Prompt for the passphrase to open the keystore.

Environment

PGDATA

Specify the data directory. You can overwrite using the -D option.

PGPORT

Specify the port number for connecting to the database.

PGUSER

Specify the user name of the database superuser. This defaults to the name of the effective user running pgx_dmpall.

Diagnosis

0: Normal exit

Other than 0: Abnormal exit

Backup data information

Date

Date the backup data was created using the pgx_dmpall command.

Dir

This is the name of the directory in the backup storage directory that is used to store the backup data.
Directory naming format: Time format (YYYY-MM-DD_HH-MM-SS)

Status

This is the status of the pgx_dmpall command backup data.

COMPLETE: Complete

INCOMPLETE: Incomplete

Notes

This command can only be executed when the database server is stopped, except when it is executed with -l option.

Execute this command as a PostgreSQL user account.

Use backup data that was taken from the recovery target data directory.

Before executing this command, disconnect all application database connections. Additionally, do not connect to the database during recovery.

Hash indexes cannot be recovered correctly in this command. If you are using the hash index, execute REINDEX for the corresponding index after this command finishes.

The configuration files are restored from those files that were taken by the last pgx_dmpall (including -c option).

This command connects to the database to determine whether the recovery has completed. So ensure that you set the port number with PGPORT environment variable in the environment where multiple instances exist.

Match the OS timezone setting when running pgx_dmpall/pgx_rcvall to the timezone specified by timezone parameter in postgresql.conf.

Otherwise, data might be recovered to an unexpected time when -e or -p is specified.

If you recover to a past point, a new timeline (history of database updates) begins at that point. That recovery point is the latest point in the new timeline when the recovery is completed. If you subsequently recover to the latest point, the database updates in the new timeline will be replayed.

Valid restore points are the ones that were created in the timeline where the backup had been taken. That means that if you recover to a past point, those restore points created thereafter are unavailable. Therefore, take a backup when you have restored the past data desired.

Example

In the following example, the data directory, tablespaces, and configuration files are recovered.

    $ pgx_rcvall -B /home/pgsql/Backupdir

In the following example, the data directory and tablespaces are recovered at 10:00:00 on 20-03-2007. The configuration files are recovered at the point at which the last of the data is obtained.

    $ pgx_rcvall -B /home/pgsql/Backupdir -e "2007-03-20 10:00:00"

In the following example, the data directory and tablespaces are recovered upto the time of restore point "before_match_20120705_1". The configuration files are restored from the latest backup.

    $ pgx_rcvall -B /home/pgsql/Backupdir -n before_match_20120705_1

In the following example, the obtained backup data information in the backup storage directory is displayed in a list.

    $ pgx_rcvall -l

Related item

pgx_dmpall