지금 지원 담당자와 채팅
지원 담당자와 채팅

NetVault Plug-in for PostgreSQL 13.1 - User Guide

Restoring data

Selecting data for a restore

1
When you select a saveset, the following details are displayed in the Saveset Information area: Job ID, job title, server name, client name, plug-in name, saveset date and time, retirement setting, Incremental Backup or not, Archive or not, saveset size, and snapshot-based backup or not.

CA FULL FILESYSTEM

CA INCREMENTAL WAL

SQL FULL DB CLUSTER ARCHIVE

SQL FULL DB CLUSTER PLAIN

SQL INDIVIDUAL ARCHIVE

SQL INDIVIDUAL PLAIN

SQL GLOBAL OBJECT ONLY

4
Click Restore.
5
On the Create Selection Set page, select the data that you want to restore.
Full Database Cluster: The following nodes are displayed for this type:
Configuration Files, if included in the backup
Individual Database Cluster: The following nodes are displayed for this type:
Configuration Files, if included in the backup

Setting restore options

Select the applicable topic:

1
On the Create Selection Set page, click , and configure the applicable parameters on the Options tabs.
2
If you are restoring a Plain-Text SQL Script File backup, select the applicable options in the Pre-Restore Options section to specify what actions should be taken before the plug-in begins the restoration of a database:
Drop and Recreate Database: Select this option if you want to drop an existing database before restoring it from the backup. The database is created using the template specified in the Configure dialog box, Template Database Used during CREATE Database option. All existing data is discarded if this option is selected.
IMPORTANT: Regardless of whether the Drop and Recreate Database option is selected, the plug-in performs this action if you are restoring Template Databases.
Create Database Only: Select this option if you want to create a nonexistent database or to write data to the existing database. If the database is not found during restore, a new database is created. If the database is present, tables that are not part of the current restore job are not modified in any manner. If the selected tables are present in the database, the action is based on whether the Include Drop Object Commands option was selected during backup:
Include Drop Object Commands was selected: The table is dropped and re-created. The restored table only contains records that were present at the time of backup.
Include Drop Object Commands was not selected: For existing tables, you can use the Truncate Table(s) option to truncate existing records before restoring.
If Truncate Table(s) is not enabled, the plug-in attempts to insert all the backed-up records into the existing table. For tables on which the unique or primary keys have been defined, this action might result in constraint errors.
Truncate Table(s): Select this option if you want to delete all existing records from the tables and restore the records present in the backup saveset. After restoration, the tables only contain records that were present at the time of backup. Be aware of the following:
For existing tables, the “create table” command during psql execution fails. If the Stop on Error option is selected, the restore stops immediately on encountering this error. Select the Continue with Warnings option if the selected tables are present to ignore these errors and continue with table truncation and data restoration.
3
If you are restoring a Plain-Text SQL Script File backup, select the applicable options in the Restore Options section:
Stop on Error: Select this option if you want the restore to stop immediately when an error occurs. Changes made before the error are not rolled back, which leaves the database in an inconsistent state.
If the Disable Triggers option was enabled for backup and the restoration of the database stops in between, the plug-in does not enable triggers defined for the last table that caused the failure.
Restore as Single Transaction: Select this option if all commands in the database backup must complete successfully; otherwise, no changes are applied. The changes made are rolled back if an error occurs.
Continue Restore with Warnings: Select this option if you want the plug-in to ignore the errors and continue with the restore. The errors encountered during job execution are recorded as warning messages in the NetVault logs and the job status is reported as “Completed with Warnings.”
IMPORTANT: If you select this option, review the logs after the job is complete to confirm that they only contain warnings pertaining to the following:

Primary or Unique Key Constraints Database Object (like table, language, user, role, and others) Already Exists

You can ignore these errors. However, if any other type of error message is noted, take corrective action, such as restoring the database again by selecting Drop and Recreate Database or Truncate Table(s).
4
If you are restoring a TAR Archive File or Custom Archive File backup, select the applicable options:
Stop on Error: Select this option if you want the restore to stop immediately when an error occurs. Changes made before the error are not rolled back, which leaves the database in an inconsistent state.
IMPORTANT: If this option is not selected, the plug-in ignores the errors and continues the job. The errors encountered during job execution are recorded as warning messages in the NetVault logs and the job status is reported as “Completed with Warnings.” Review the logs after the job is complete to confirm that they only contain warnings pertaining to the following:

Primary or Unique Key Constraints Database Object (like table, language, user, role, and others) Already Exists

You can ignore these errors. However, if any other type of error message is noted, take corrective action, such as restoring the database again by selecting Drop and Recreate Database or Do Not Restore Data for Failed Create Table Commands.
Drop and Recreate Database: Select this option if you want to drop an existing database before restoring it from the backup. The database is created using the template specified in the Configure dialog box, Template Database Used during CREATE Database option.
You can also use the Exclude Access Privileges option with Create Database Only. To prevent restoration of access privileges, grant and revoke commands, select this option. Without this option selected, the restoration fails if the required users or roles do not exist.
IMPORTANT: Regardless of whether the Drop and Recreate Database option is selected, the plug-in performs this action if you are restoring Template Databases.
Create Database Only: Select this option if you want to create a nonexistent database or to write data to the existing database. If the database is not found during restore, a new database is created. If the database is present, tables that are not part of the current restore job are not modified in any manner. If the selected tables are present in the database, the action is based on the following options:
Drop Database Objects: To drop the existing table and restore it from the backup, select this option. If you select this option, you lose the existing records. The restored table only contains records that were present at the time of backup.
Restore Data for Failed Create Table Commands: If you want the plug-in to insert all the backed-up records into the existing table, select this option. For tables on which the unique or primary keys have been defined, this action might result in constraint errors.
If Stop on Error option is selected, the restoration of the database stops.
Do Not Restore Data for Failed Create Table Commands: With this option enabled, the existing tables are not restored.
You can also use the Exclude Access Privileges option with Create Database Only. To prevent restoration of access privileges, grant and revoke commands, select this option. Without this option selected, the restoration fails if the required users or roles do not exist.
Restore Data Only (No Schema Definitions): Select this option if you want to restore only the data from the backup and exclude the schema definitions. The restore fails if the target database or table does not exist.
IMPORTANT: Template Databases are not restored if you select this option.
You can also use the Disable Triggers option with Restore Data Only. Select this option if there are referential integrity checks or other triggers on the tables. This option temporarily disables triggers on the target tables during restore. After successful data restoration, the triggers are enabled. If Stop on Error is selected and the restoration of the database stops in between, the plug-in does not enable triggers defined for the last table that caused the failure.
5

Setting restore options for a File-Level Data Copy

1
On the Create Selection Set page, click .
2
On the Restore Options tab, if you want to select a different location to restore the files to, select the Relocate all restored files to the directory check box, and enter the new path in the text box.
4
On the Base Data Files tab, select the applicable options:
Include Backup Label File with Restore: If you want to generate a file named “backup_label” in the target directory during the restore of a Base Backup, select this option. This file contains information generated by PostgreSQL during the backup, which is useful during recovery. The predefined contents of the “backup_label” file are shown in the Backup Label field. If you select this option and the Tablespace Map field has content, an additional file, “tablespace_map,” is also generated during the restore of a Base Backup.
Do not Restore WAL Directory Contents (recommended): If you want to exclude the contents of the WAL directory during a restore of a Base Backup, select this option. The WAL directory is pg_wal for PostgreSQL 10.x and later and pg_xlog for PostgreSQL Server 9.x and earlier.
Do not Restore pg_replslot Directory Contents: If you want to exclude the contents of the replication slots directory, pg_replslot, during a restore of a Base Backup, select this option.
Do not Restore postmaster.pid and postmaster.opts Files: If you want to exclude the “postmaster.pid” and “postmaster.opts” files, during a restore of a Base Backup, select this option.
Backup Label: This field displays information related to a Base Backup that is included in the “backup_label” file described previously. For Offline Backups, this field does not display anything. Unless directed to do so by Quest, do not modify the contents of this field.
Stop Log Sequence Number: This field shows the log sequence number when the stop backup command was issued.
Tablespace Map: This field displays information related to a Base Backup. If you select the Include Backup Label File with Restore option described previously, this information is included in the “tablespace_map” file. For Offline Backups, this field is null. Unless directed to do so by Quest, do not modify the contents of this field.
IMPORTANT: Tablespace Map contains tuples of symbolic link names and directories. Before starting a recovery process, if this field displays a tuple, ensure that the database cluster data pg_tblspc directory contains a symbolic link with the listed name that points to the directory listed in the tuple.

Examples of creating the link:

Linux or UNIX: ln -s /postgresdata/my_postgre_tbs_01 /opt/postgres/11/data/pg_tblspc/16405

Windows: mklink /J "C:\Program Files\PostgreSQL\11\data\pg_tblspc\16405" "P:\postgresdata\my_postgre_tbs_01"

5
On the Point in Time Recovery tab, select the applicable options:
Include Recover Command File with Restore: If you want to generate a Recovery Command file, select this option. In the Recovery Command File Location box, enter the complete path to the location where the Recovery Command file should be placed. If you plan to perform a recovery procedure, PostgreSQL requires that you use the “recovery.conf” filename and that the file is located in the database cluster Data directory.
Restore Command: In this box, enter the WAL Log restore command to use when PostgreSQL needs to access a specific log during the recovery process. Use a restore command that copies WAL Log files from the staging directory, You can use the wildcards %f, which represents the filename, and%p, which represents the full path.
Include Recovery Target Time: If you want to identify a specific point in time from which recovery be captured, select this option. In the text box, use the recovery_target_time='<DateAndTime>' command. For example, you might enter recovery_target_time='2019-05-30 13:22:00 PDT'.
Do not select this option if you intend to recover up to the last WAL (write-ahead log) file available for recovery.
NOTE: For PostgreSQL version 13 and later, the Point in Time Recovery will stop resulting in the PostgreSQL Services failing to start if the specified point in time is past the time of the last committed transaction. The PostgreSQL Server will not be able to reach a recovery time after the last committed transaction. Either recovery has to replay to the end of the WAL files, or Point in Time Recovery has to be done before (or inclusive) the last committed transaction.
Recovery Target Inclusive: If the Recovery Command file contains the recovery_target_inclusive command, select this option. This command attempts to recover all data up to the specified time. If cleared, the process recovers data to the nearest instant prior to the targeted time, which might be a specified time or the current time.
6
관련 문서

The document was helpful.

평가 결과 선택

I easily found the information I needed.

평가 결과 선택