NetBackup™ for PostgreSQL Administrator's Guide

Last Published:
Product(s): NetBackup & Alta Data Protection (10.1)

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 the user has administrator (Windows) or root (Linux) access.

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

    For example, Path =C:\Program Files\Veritas\Netbackup\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.

  • 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,

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

To run the backup

  1. Run the following command:

    nbpgsql -o backup

    -S primary_server

    -P policy_name

    -s schedule_name

    (Linux)-z snapshot_size

    (Linux)-l postgresql_library_path

    [-portnum db_port]

    [-u dbuser]

    (Linux)[-b backup_type]

  2. (Optional) Type the database password, when the command line prompts for a password . NetBackup connects to the database and initiates the backup.
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