NetBackup™ Web UI PostgreSQL Administrator's Guide

Last Published:
Product(s): NetBackup & Alta Data Protection (10.4)
  1. Overview
    1.  
      Overview of configuring and protecting PostgreSQL assets in the NetBackup web UI
  2. Managing PostgreSQL instances and databases
    1.  
      Quick configuration checklist to protect PostgreSQL instances and databases
    2.  
      Configure PostgreSQL instance
    3.  
      Add a PostgreSQL instance
    4.  
      Manage credentials for an instance
    5.  
      Discover PostgreSQL databases
    6.  
      Remove PostgreSQL instances
    7.  
      Change the autodiscovery frequency of PostgreSQL assets
  3. Managing PostgreSQL environment credentials
    1.  
      Add new PostgreSQL credentials
    2.  
      Default PostgreSQL Administrator
    3.  
      Validate credentials of PostgreSQL instance
    4.  
      View the credential name that is applied to an asset
    5.  
      Edit or delete a named credential
  4. Protecting PostgreSQL instances and databases
    1.  
      Things to know before you protect PostgreSQL instances and databases
    2.  
      Protect PostgreSQL instances and databases
    3.  
      Customize protection settings for the PostgreSQL assets
    4.  
      Remove protection from PostgreSQL instances
    5.  
      View the protection status of PostgreSQL instance
  5. Restoring PostgreSQL Instances and Databases
    1.  
      Things to know before you restore the PostgreSQL instances and databases
    2.  
      About the pre-restore check
    3.  
      Restore PostgreSQL instance and database
    4.  
      Restore target options
    5.  
      Pre-restore checks for PostgreSQL
    6.  
      Steps to perform recovery after restore operation
    7.  
      Steps to perform after Restore and Recovery for PostgreSQL cluster deployment
    8.  
      Limitations
  6. Troubleshooting PostgreSQL operations
    1.  
      Troubleshooting tips for NetBackup for PostgreSQL
    2.  
      Error during PostgreSQL credential addition
    3.  
      Error during the PostgreSQL instances and databases discovery phase
    4.  
      Error during the PostgreSQL Protection Plan Creation
    5.  
      Error while subscribing protection plan to PostgreSQL asset
    6.  
      Error while removing PostgreSQL asset
    7.  
      Error while backup of PostgreSQL asset
    8.  
      Error while restoring PostgreSQL asset image
  7. API for PostgreSQL instances and databases
    1.  
      Using APIs to manage, protect or restore PostgreSQL
  8.  
    Index

Steps to perform recovery after restore operation

The procedure to perform post-recovery is as follows for various platforms:

For Windows (VSS):

  1. Go to Control Panel > System and Security > Administrative Tools > Services.
  2. Select PostgreSQL service and stop it.
  3. Delete or move everything from the PostgreSQL data directory.

    Note:

    Post restores, change the attributes of the restored data directory and files by using the following command:

    attrib -S restore_path/*.* /S /D

  4. Copy all the contents of the restored data directory to PostgreSQL data directory.
  5. Edit the postgresql.conf file from the PostgreSQL data directory and edit the restore_command parameter as restore_command = 'copy "restored_WAL_directory\\%f" "%p"'.

    For precise point-in-time recovery, specify the timestamp up to which recovery is performed. Update the recovery_target_time parameter as recovery_target_time = 'yyyy-mm-dd hh:mm:ss'

  6. Create an empty file in the data directory and name it recovery.signal.
  7. Start PostgreSQL service.

For Linux (LVM):

  1. Stop PostgreSQL services.
  2. Delete or move everything from the PostgreSQL data directory.
  3. Extract and copy the data directory and WAL directory contents to respective location.
  4. Create an empty file with name recovery.signal in data directory.
  5. Edit the postgresql.conf file from the PostgreSQL data directory and edit the restore_command parameter as restore_command = 'copy "restored_WAL_directory\\%f" "%p"'.

    For precise point-in-time recovery, specify the timestamp up to which recovery is performed. Update the recovery_target_time parameter as recovery_target_time = 'yyyy-mm-dd hh:mm:ss'

  6. Change ownership of PostgreSQL data directory and permission to 700.

    For example:

    chown -R postgres:postgres /full/path/of/PostgreSQL/Data/Dir

    chmod - R 700 /full/path/of/PostgreSQL/Data/Dir

  7. Start PostgreSQL service.

Recovery steps for backup done by pg_basebackup utility

  1. Stop PostgreSQL services.
  2. Delete or move everything from the PostgreSQL data directory.
  3. Extract and copy the data directory and WAL directory contents to respective location.
  4. Create an empty file with name recovery.signal in data directory.
  5. Edit the postgresql.conf file from the PostgreSQL data directory and edit the restore_command parameter as restore_command = 'copy "restored_WAL_directory\\%f" "%p"'.

    For precise point-in-time recovery, specify the timestamp up to which recovery is performed. Update the recovery_target_time parameter as recovery_target_time = 'yyyy-mm-dd hh:mm:ss'

  6. (For Windows) Provide access to data directory for network service.
  7. (For Linux) Change ownership of PostgreSQL data directory and permission to 700.

    For example:

    chown -R postgres:postgres /full/path/of/PostgreSQL/Data/Dir
    chmod  - R 700 /full/path/of/PostgreSQL/Data/Dir
    
  8. Start PostgreSQL service.

    Note:

    Remove the restore data from the restored path /full/path/of/restore/directory after successful recovery, else the next backup job may fail.

Database recovery steps for backup done by pg_dumpall utility
  • For Windows: psql.exe -h localhost -p port_num -U username -f full\path\to\dumpall\file\filename.out

  • For Linux: psql -h localhost -p port_num -U username -f full/path/to/dumpall/file/filename.out

Database recovery steps for backup done by pgdump utility
  • For Windows: pg_restore -U username -d dbname full\path\to\dump\file\filename.dump

  • For Linux: pg_restore -U username -d dbname full/path/of/dump/file/filename.dump