NetBackup105 WebUIGuide PostgreSQLAdmin
NetBackup105 WebUIGuide PostgreSQLAdmin
PostgreSQL Administrator's
Guide
Release 10.5
Last updated: 2024-09-23
Legal Notice
Copyright © 2024 Veritas Technologies LLC. All rights reserved.
Veritas, the Veritas Logo, and NetBackup are trademarks or registered trademarks of Veritas
Technologies LLC or its affiliates in the U.S. and other countries. Other names may be
trademarks of their respective owners.
This product may contain third-party software for which Veritas is required to provide attribution
to the third party (“Third-party Programs”). Some of the Third-party Programs are available
under open source or free software licenses. The License Agreement accompanying the
Software does not alter any rights or obligations you may have under those open source or
free software licenses. Refer to the Third-party Legal Notices document accompanying this
Veritas product or available at:
https://www.veritas.com/about/legal/license-agreements
The product described in this document is distributed under licenses restricting its use, copying,
distribution, and decompilation/reverse engineering. No part of this document may be
reproduced in any form by any means without prior written authorization of Veritas Technologies
LLC and its licensors, if any.
The Licensed Software and Documentation are deemed to be commercial computer software
as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19
"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq.
"Commercial Computer Software and Commercial Computer Software Documentation," as
applicable, and any successor regulations, whether delivered by Veritas as on premises or
hosted services. Any use, modification, reproduction release, performance, display or disclosure
of the Licensed Software and Documentation by the U.S. Government shall be solely in
accordance with the terms of this Agreement.
http://www.veritas.com
Technical Support
Technical Support maintains support centers globally. All support services will be delivered
in accordance with your support agreement and the then-current enterprise technical support
policies. For information about our support offerings and how to contact Technical Support,
visit our website:
https://www.veritas.com/support
You can manage your Veritas account information at the following URL:
https://my.veritas.com
If you have questions regarding an existing support agreement, please email the support
agreement administration team for your region as follows:
Japan [email protected]
Documentation
Make sure that you have the current version of the documentation. Each document displays
the date of the last update on page 2. The latest documentation is available on the Veritas
website:
https://sort.veritas.com/documents
Documentation feedback
Your feedback is important to us. Suggest improvements or report errors or omissions to the
documentation. Include the document title, document version, chapter title, and section title
of the text on which you are reporting. Send feedback to:
[email protected]
You can also see documentation information or ask a question on the Veritas community site:
http://www.veritas.com/community/
https://sort.veritas.com/data/support/SORT_Data_Sheet.pdf
Contents
Index .................................................................................................................... 47
Chapter 1
Overview
This chapter includes the following topics:
Step 1 ■ Open a web For more information on Sign In see the Sign into the
browser and go NetBackup web UI in NetBackup Web UI
to the URL Administrator’s Guide.
■ Enter your Note: To perform the PostgreSQL administrator tasks,
credentials and the Default PostgreSQL Administrator role should
click Sign in. have the minimum required RBAC permissions.
■ On the left, click
Security > See “Default PostgreSQL Administrator” on page 18.
RBAC > Add.
■ Select Default
PostgreSQL
Administrator
and provide a
Role name,
Role
description,
required
permissions and
assign a webUI
user to this role.
Step 3 Add and manage See “Manage credentials for an instance” on page 14.
credentials.
Deploy NetBackup to protect PostgreSQL On a very high level to protect PostgreSQL instances and databases
instances and databases. you need:
■ NetBackup primary server
■ NetBackup media server (Recommended)
■ NetBackup client that can act as a backup machine
PostgreSQL installed bin directory path should Verify if PostgreSQL installation bin path is set in environment variable.
be added to path environment variable. For Example:
Protecting PostgreSQL instances and See “Protect PostgreSQL instances and databases” on page 22.
databases.
Note: Add these environment variables to the user for which NetBackup backup is
to be run.
■ (optional) path - Add PostgreSQL bin path to this environment variable for running
queries and connecting to databases.
■ (optional) LIB_PQ_PATH - For Windows set this environment variable to provide
the location of libpq.dll library. For Linux set this environment variable to
provide the location of libpq.so library.
■ (optional) PG_PRO_BACKUP_DUMP_DIRECTORY - Set this environment
variable as temporary backup dump directory for non streaming backup. For
example, On Linux computer, user can set this environment variable to required
location using the command:
echo "export
PG_PRO_BACKUP_DUMP_DIRECTORY=/home/custom_dump_dir_location/" > >
~/.bashrc
For Windows, user can create new environment variable and add path of folder
location as:PG_PRO_BACKUP_DUMP_DIRECTORY=C:\custom_dump_dir_location
Managing PostgreSQL instances and databases 13
Add a PostgreSQL instance
3 Enter or use the up, down arrow keys to add details of Port number.
4 Click Next.
Note: You will be redirected to the Permissions page and you can also manage
credentials of the created instance.
5 Click Finish.
Note: The tab lists the names of instances that you have access to.
Note: If you delete an instance, all databases that are associated with the
removed PostgreSQL instance will also get deleted.
4 If you are sure that you want to delete the PostgreSQL Instance, click Remove.
Note: The range from which you may choose is 1 hour to 24 hours. To set the
autodiscovery frequency in minutes or seconds or to disable autodiscovery,
you must use the PostgreSQL autodiscovery API.
Chapter 3
Managing PostgreSQL
environment credentials
This chapter includes the following topics:
4 Click Next.
5 Select PostgreSQL server from the Category drop-down.
6 Enter Instance username and Instance user password and click Next.
18 Managing PostgreSQL environment credentials
Default PostgreSQL Administrator
Type Permissions
Jobs View
Type Permissions
Assets
Note: NetBackup verifies the current credentials for the selected PostgreSQL
instance.
If the credentials are not valid, NetBackup indicates Invalid under Credentials.
For auto-discovered cluster instances, assign credentials for PostgreSQL primary
or standby node instance.
Note: When you update PostgreSQL instances, this action automatically starts
the discovery of the PostgreSQL instance.
Warning: Apply another credential to any asset that uses the credential you want
to delete or else backup and restore may fail for those assets.
User Privileges
To set the database user privileges, run the following command at PostgreSQL
command line:
ALTER USER "username" WITH SUPERUSER;
22 Protecting PostgreSQL instances and databases
Protect PostgreSQL instances and databases
Note: The RBAC role assigned to a user must have access to the assets that you
want to manage and also to the protection plans you want to use.
■ Backup options
Adjust the Database options like Job limit and Backup method.
■ Snapshot: This option is used to take the snapshot of an instance. For
Windows - VSS snapshot method is used. For Linux - LVM snapshot
method is used.
■ pg_basebackup: This utility of PostgreSQL performs the backup of an
instance. It is recommended in the case of non-LVM deployment.
■ pg_dumpall: This utility of PostgreSQL performs logical backup of
instance. It is recommended in the case of non-LVM deployment.
■ pg_dump: This utility of PostgreSQL performs logical backup of an
individual database.
Protecting PostgreSQL instances and databases 23
Customize protection settings for the PostgreSQL assets
5 Click Protect.
Note: If the PostgreSQL instance is deployed on the root LVM, then Snapshot
backup method is not recommended.
In case of cluster deployment of PostgreSQL, instances can be protected of
primary or standby node.
Note: This action allows custom protection for the asset and removes it from
the original protection plan. Any future changes to the original plan are not
applied to the asset. The customization operation cannot be reversed.
5 Click Protect.
24 Protecting PostgreSQL instances and databases
Remove protection from PostgreSQL instances
Note: When you unsubscribe an asset from a protection plan, there is a possibility
that the asset displays Classic policy in the Protected By column on the web UI.
This situation can happen when an asset is subscribed to a protection plan and a
backup runs for that asset. Such assets get unsubscribed from the protection plan.
The web UI then displays Classic policy, that may or may not have an active policy
protecting the asset.
Note: If the asset has been backed up, but status indicates that it has not, See
“Error during the PostgreSQL instances and databases discovery phase”
on page 38.
3 If the asset is not protected, click Add protection to select a protection plan.
Chapter 5
Restoring PostgreSQL
Instances and Databases
This chapter includes the following topics:
■ Things to know before you restore the PostgreSQL instances and databases
■ Steps to perform after Restore and Recovery for PostgreSQL cluster deployment
■ Limitations
Note: In the calendar view, dates with available backups are indicated with a
green dot.
5 From the listed Backup images/ Recovery points, select the desired image
or recovery point.
Note: The backup images or recovery points are listed in rows with the
respective backup timestamp.
6 Click Actions and then select either Perform complete instance recovery
or Perform point in time recovery.
Note: Point in time recovery option is only available for incremental backup.
Note: Select the point in time which is post the previous full backup and
includes a time through selected incremental recovery point.
7 Click the search icon in the Host field, select the desired host and click Save.
■ If the recovery is to an alternate host, then select the corresponding valid
credentials from the displayed list.
For more information, See “Restore target options” on page 30.
8 Select the appropriate instance directory path from one of the following options:
■ Restore everything to original location: Files are restored to the location
where they were originally backed up from.
■ Restore everything to a different location: Files are restored to the
specified alternate location. The folder structure of the restored data within
the alternate location is the same as the original data that is same folder
and subfolder setup.
■ Directory for Restore – PostgreSQL full backup data is restored to the
specified path.
■ Write Ahead logging Directory – PostgreSQL WAL files are restored
in this directory. PostgreSQL incremental backup data is restored to the
specified path.
Note: If the instance is added manually and not discovered automatically, then
only Restore everything to a different location option can be selected.
Note: WAL files will be restored in the data directory when Restore option is
selected, whereas, in case of Restore and Recovery, WAL files will be restored
to path mentioned in WAL directory for restore option.
Note: For point in time recovery, Restore and recovery option is triggered
automatically.
28 Restoring PostgreSQL Instances and Databases
Restore PostgreSQL instance and database
Note: For LVM and VSS if the Restore and recovery option is selected, then
contents of the target data directory is deleted by recovery operation.
Note: In the Restore and recovery option, the PostgreSQL service must be
up and running. If the service is stopped, the restore will fail.
The data folder must be empty to run the Restore option on the same path. If
the folder is not empty, then, the data will not restored.
13 Click Next.
14 On the Review tab, review the details and click Start recovery.
To restore a PostgreSQL database
1 On the left, click Workloads > PostgreSQL.
2 On the Databases tab, select the database that you want to recover.
3 Click Recover from the top bar.
4 On the Recovery points tab, select the date with available backup.
Note: In the calendar view, dates with available backups are indicated with a
green dot.
5 From the listed Backup images/ Recovery points, select the desired image
or recovery point.
Note: The backup images or recovery points are listed in rows with the
respective backup timestamp.
8 Select the appropriate Database directory paths from one of the following
options:
■ Restore everything to original location: Files are restored to the location
where they were originally backed up from.
■ Restore everything to a different location: Files are restored to the
alternative location which you can specify. The folder structure of the
restored data within the alternate location is the same as the original data
that is same folder and subfolder setup.
■ Directory for Restore – The PostgreSQL data directory. PostgreSQL
full backup data is restored to the specified path.
■ Write Ahead logging Directory – PostgreSQL WAL files are restored
in this directory. PostgreSQL incremental backup data is restored to the
specified path.
13 Click Next.
14 On the Review tab, review the details. For any changes you can edit the
recovery target, recovery source and recovery options or click Start recovery.
30 Restoring PostgreSQL Instances and Databases
Restore target options
Target client Checks if target client is Target client and Target client name
connectivity accessible from restore client.
Target client Checks if the required space Target client alternate location
location space is available on target client
alternate location.
Note: Required space is total
size of selected file with space
required for restore and space
needed for logs and other
files.
Restore and recovery Restore backup images of PostgreSQL Global > NetBackup Assets >
asset. management > PostgreSQL
NetBackup backup Assets > Restore
This permission is required on PostgreSQL.
images > View to alternate
location
Global > NetBackup
management >
NetBackup backup
images > View
contents
Assets >
PostgreSQL assets
> Restore
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.
Restoring PostgreSQL Instances and Databases 33
Steps to perform recovery after restore operation
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"'.
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"'.
Note: When the recovery is done from backup of PostgreSQL primary node to
PostgreSQL standby node, then the standby node becomes an independent primary
node.
36 Restoring PostgreSQL Instances and Databases
Limitations
Limitations
■ Cross-platform recovery of individual files is not supported. The restore client
must be the same platform as the instances that you want to restore. Windows
instances can be restored using Windows operating systems and Linux instances
can be restored only using Linux operating systems.
■ For client platform and file system support and limitations, see
https://www.veritas.com/content/support/en_US/doc/NB_70_80_VE .
■ If a backup and a restore occur simultaneously on the same database, one or
both jobs can have unexpected results.
Note: If a backup or a restore exits with a non-zero NetBackup status code, one
possible cause is simultaneous jobs occurring on the same instance.
■ Restore job fails, if NetBackup does not have sufficient privileges or if there is
insufficient space in the client memory.
■ NetBackup does not support non-ASCII characters in target client location path.
Chapter 6
Troubleshooting
PostgreSQL operations
This chapter includes the following topics:
Credential validation failed. The host name is not valid NetBackup client. Ensure that the
Provide correct host name. hostname is registered client of NetBackup and it is white
listed.
Table 6-2 Error run into during the PostgreSQL instance and database
discovery phase
The PostgreSQL assets are not Run discover database and retry the database discovery manually.
discovered after the correct
■ Ensure that the update permission assigned to the logged in web UI user.
PostgreSQL instance credentials are
■ Contact Veritas Technical support and share nbwebservice logs from
added.
NetBackup master server and ncfnbcs logs from NetBackup client.
A plan with this name already exists. Protection plan with same name is already
present.
■ Please create protection plan with another
name.
Storage disk pool is not present. Before adding protection, we need to add
storage unit.
This subscription must be reset to protection If subscription has been already modified, the
plan defaults before it can be customized. below warning message will be displayed.
■ User can reset subscription using 'Restore
original settings' button and then try to
customize subscription again.
Storage disk pool is not present Before adding protection, we need to add
storage unit.
The backup failed to back up the Verify the PostgreSQL service is up and running on client.
requested files
■ Contact Veritas Technical support and share bphdb and nbpgsql logs
from backup client.
Unable to change the Host while modifying If you cannot see the list of the host, you
the restore target or destination. might not have access to NetBackup Host in
RBAC.
Restore failed with below error: Restore If the database user provided for restore
initiated from XBSA Failed to query the operation is different from the backup
object... 17 operation database user. The permission of
file differs in the NetBackup file system and
hence restore fails.
Restore Image not found at alternate location No image was found on recovery host
on recovery host. alternate location.
GET
/netbackup/admin/discovery/workloads
/postgresql/status
POST
/netbackup/admin/discovery/workloads
/postgresql/allclientsdiscovery
API for PostgreSQL instances and databases 45
Using APIs to manage, protect or restore PostgreSQL
■ policyType is DataStore.
POST ■ Add scheduleName can have values like FULL_AUTO
/netbackup/servicecatalog/slos or INCR_AUTO for adding PostgreSQL instance.
■ keyword can have the following values to back up an
instance or database using different backup options:
POST
■ pg_dump
/netbackup/servicecatalog/slos/{sloId}
/subscriptions ■ pg_basebackup
■ Snapshot
■ pg_dumpall
POST
■ sloId is the identifier to protection plan
/netbackup/servicecatalog/slos/{sloId}
/backup-now ■ selectionId is the AssetId which needs to be
subscribed with given sloId
After you create a protection plan, other processes like creating the schedule for
the policy or triggering the policy backup remain the same.
GET
/netbackup/wui/workloads/postgresql
/recovery-point-calendar-summary
46 API for PostgreSQL instances and databases
Using APIs to manage, protect or restore PostgreSQL