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

Performing PostgreSQL backups

This topic lists the prerequisites for the backup, describes the procedure to run a backup, and the information to schedule the backup from NetBackup.

Prerequisites

Before you run the backup, ensure that you meet the following prerequisites:

  • Ensure that versions of the PostgreSQL agent and NetBackup are same. If you upgrade NetBackup to newer version, then you must upgrade the agent version also.

  • (Windows) Set the NetBackup\bin directory in the environment variable.

    For example, Path =C:\Program Files\Veritas\Netbackup\bin

  • (Windows) Set the PostgreSQL\bin directory in user environment variable.

    For example, Path=C:\Program Files\PostgreSQL\bin

  • (Linux) Symbolic link: If a symbolic link does not exists, create the symbolic link libpq.so and ensure that it points to the valid libpq .so.<n>, where n is the PostgreSQL library version.

    For more information, See Post-installation requirements for NetBackup for PostgreSQL Agent.

  • Set the following parameters in the nbpgsql.conf file:

    • DB_USER

    • DB_PORT

    • MASTER_SERVER_NAME

    • POLICY_NAME

    • SCHEDULE_NAME

    • (Linux) PGSQL_LIB_INSTALL_PATH

    • (Linux) SNAPSHOT_SIZE

  • Create the archivedir directory and then set the following parameters in the postgresql.conf file:

    • wal_level = archive

    • archive_mode = on

    • archive_timeout =0

    • statement_timeout=0

      Note:

      Ensure that you add the time in milliseconds. The recommended time is 30000 milliseconds (30 seconds).

  • Mention the following changes for archive_command

    • (Windows)'copy ' "%p" "C:\\archivedir\\%f"'

    • (Linux) test ! -f <archive_path>/%f && cp %p <archive_path>/%f

  • (Linux) After creating the archivedir directory, change the group and ownership to PostgreSQL user.

  • Restart the PostgreSQL services.

  • Configure PostgreSQL backups with DataStore policies.

    For more information, See Configuring PostgreSQL backups with DataStore policies.

  • Verify the installation prerequisites and the post-installation requirements.

    For more information, See Installing prerequisites for NetBackup for PostgreSQL Agent.

    For more information, See Post-installation requirements for NetBackup for PostgreSQL Agent.

To run the backup

  1. Run the following command:

    nbpgsql -o backup

    -S master_server

    -P policy_name

    -s schedule_name

    (Linux)-z snapshot_size

    (Linux)-l postgresql_library_path

    [-portnum db_port]

    [-u dbuser]

  2. (Optional) Type the database password, when the command line prompts for a password . NetBackup connects to the database and initiates the backup.

Note:

Ensure that the PostgreSQL agent and NetBackup are of same version for successful backup and restore operations.

Scheduling PostgreSQL backups from NetBackup

You can schedule the PostgreSQL backups from the NetBackup Administration Console using the DataStore policy to call a backup script.

For more information, see https://www.veritas.com/support/en_US/article.100041371