Veritas NetBackup™ for PostgreSQL Administrator's Guide

Last Published:
Product(s): NetBackup (8.2)
  1. Introduction to NetBackup for PostgreSQL
    1.  
      About NetBackup for PostgreSQL Agent
    2.  
      Features supported by NetBackup for PostgreSQL Agent
    3.  
      The NetBackup for PostgreSQL Agent package
    4.  
      About the License for NetBackup for PostgreSQL Agent
  2. Installing the NetBackup for PostgreSQL Agent
    1.  
      Planning the installation of NetBackup for PostgreSQL Agent
    2.  
      Verifying the operating systems and platforms
    3.  
      Installing prerequisites for NetBackup for PostgreSQL Agent
    4.  
      Post-installation requirements for NetBackup for PostgreSQL Agent
    5.  
      Describing the NetBackup for PostgreSQL Agent package
    6.  
      Installing the NetBackup for PostgreSQL Agent
    7.  
      Authenticating the password
    8.  
      Uninstalling the NetBackup for PostgreSQL Agent
  3. Configuring NetBackup for PostgreSQL
    1.  
      The nbpgsql.conf configuration file
    2.  
      Configuring PostgreSQL backups with DataStore policies
  4. NetBackup for PostgreSQL backup and restore
    1. About PostgreSQL backups
      1.  
        The postgresql.conf configuration file
    2.  
      Performing PostgreSQL backups
    3.  
      Validating the PostgreSQL backups
    4.  
      Querying the PostgreSQL backups
    5.  
      Deleting backup information from the NetBackup catalog files
    6.  
      About PostgreSQL restore
    7.  
      Performing the PostgreSQL restores
    8.  
      Redirected restores
    9.  
      Recovering the restores
    10.  
      Disaster recovery
  5. Troubleshooting for PostgreSQL
    1.  
      Troubleshooting errors when using NetBackup for PostgreSQL Agent
  6. Appendix A. NetBackup for PostgreSQL commands and conventions
    1.  
      About NetBackup for PostgreSQL Agent commands
    2.  
      NetBackup for PostgreSQL Agent command conventions
  7. Appendix B. NetBackup for PostgreSQL commands
    1.  
      nbpgsql -o backup
    2.  
      nbpgsql -o restore
    3.  
      nbpgsql -o query
    4.  
      nbpgsql -o delete

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 configuration file

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.

Performing the restore recovery

To recover the restore

  1. Stop the PostgreSQL services.
  2. Copy the restore data into the PostgreSQL data directory.
  3. (Linux) Change the ownership to PostgreSQL user.
  4. Copy the recovery.conf file to the PostgreSQL data directory and remove the .sample extension .
  5. (Linux) Change the ownership to the PostgreSQL user and modify the settings according to your environment.
  6. 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.

  7. Start the PostgreSQL services.
  8. After successful recovery, delete the pgarchive directory and the recovery.done file.