Veritas NetBackup™ for PostgreSQL Administrator's Guide
- Introduction to NetBackup for PostgreSQL
- Installing the NetBackup for PostgreSQL Agent
- Configuring NetBackup for PostgreSQL
- NetBackup for PostgreSQL backup and restore
- About PostgreSQL backups
- Troubleshooting for PostgreSQL
- Appendix A. NetBackup for PostgreSQL commands and conventions
- Appendix B. NetBackup for PostgreSQL commands
Recovering the restores
After a successful restore, to recover the restore, copy the recovery.conf.sample
file to the PostgreSQLdata directory. The recovery.conf.sample
is available at the PostgreSQL install path. Ensure that after you copy the recovery file, remove the .sample
extension.
When you set the parameters and restart the PostgreSQL services, the server goes into the recovery mode and reads the archived WAL files. If the recovery gets terminated, you can restart the server to continue the recovery process.
After successful completion, the server renames the recovery.conf
file to recovery.done
to prevent re-entering into the recovery mode.
In Linux operating system, the owner and group defaults to postgres
after a successful restore. You must change the ownership to PostgreSQL owner and modify the settings according to your environment.
The recovery.conf
file contains the parameters that you must set to enable archive recovery or act as a replication standby. The parameters must be set again for the subsequent recovery that you must perform.
Table: The recovery.conf
file parameters lists the parameters that you must set to enable archive recovery.
Table: The recovery.conf
file parameters
Parameters | Description |
---|---|
restore_command | This parameter specifies the shell command that is executed to copy log files back from archival storage. This parameter is required for archival storage but is optional for streaming replication. The command string may contain %f that is replaced by the name of the desired log file and %p is replaced by the absolute path to copy the log file to. |
recovery_target | This parameter stops the roll-forward at a specific point. By default, the recovery rolls forward to the end of the WAL log. |
To recover the restore
- Stop the PostgreSQL services.
- Copy the restore data into the PostgreSQL data directory.
- (Linux) Change the ownership to PostgreSQL user.
- Copy the
recovery.conf
file to the PostgreSQL data directory and remove the.sample
extension . - (Linux) Change the ownership to the PostgreSQL user and modify the settings according to your environment.
- Edit the
recovery.conf
file to set the following:(Windows) Mention the restore_command parameter as cp "<PostgreSQL-data-directory>\\pgarchive\\%f" "%p"
(Linux) Mention the restore_command as cp <PostgreSQL-data-directory>/pgarchive/%f %p
Remove the pause_recovery_target parameter.
- Start the PostgreSQL services.
- After successful recovery, delete the
pgarchive
directory and therecovery.done
file.