nzreplrestore command
Syntax
nzreplrestore -simulate [ -verbose ] -recoveryfile <fileName>
[ -dir <dirList> | -dirfile <fileName> | -connector <connName>
[ -connectorArgs <list> ] ] [ -u <userName> ] [ -pw <password> ]
[ -secret <secret> ]nzreplrestore -recoveryfile <fileName> [ -u <userName> ]
[ -pw <password> ] [ -secret <secret> ] [ -verbose ]nzreplrestore -recoveryfile <fileName> [ -dir <dirList> |
-dirfile <fileName> | -connector <connName>
[ -connectorArgs <list> ] ] [ -u <userName> ] [ -pw <password> ]
[ -secret <secret> ] [ -verbose ]Options
- -recoveryfile <fileName>
- Specifies the name and location of the recovery file that the nzreplanalyze command created. If you used the -rqm option for the nzreplbackup command, specify the path name that was supplied in the output of the command. If you used the -dir or -dirfile option for the nzreplbackup command, specify the location to which you manually moved the recovery files.
- -simulate
- Determines the recovery needs without restoring from a backup. Results are output to the screen.
- -dir <dirList>
- Specifies the path names where the backup directories are stored. Enter full directory path names as a space-separated list.
- -dirfile <fileName>
- Specifies a file that contains a list of the backup source directories, one per line.
- -connector <connName>
- Names the connector from which you are retrieving the backup. These are the same connector options as those available to the nzbackup command. For details, see IBM Netezza System Administration. The default connector is the file system (used for the -dir or -dirfile option).
- -connectorArgs <argList>
- Specifies a colon-separated list of passthrough arguments for the connector. You must enclose the argument string in double quotation marks.
- -u <username>
- Specifies the Netezza® user name to connect to the database (NZ_ USER). If you do not set the NZ_USER variable in the environment, it must be specified, or the system reports an error.
- -pw <password>
- Specifies the user’s password (NZ_PASSWORD).
- -secret <secret>
- Specifies the string value that is needed to generate the 256-bit symmetric key that is used to decrypt the host key in the backed-up data. If you enter a string, it must be the same secret that you used for the nzreplbackup command. If you do not enter a string but used a secret for the nzreplbackup command, the nzreplrestore command fails.
- -v[erbose]
- Displays detailed command output, including internal SQL queries, analysis, and conclusions.
Usage
If you specified the -rqm option for the nzreplbackup command, the recovery file is copied into the /var/nzrepl directory on the replication queue manager. The path name is supplied in the nzreplbackup command output with the restore instructions. In this case, you do not need to specify a location option (-dir, -dirfile, or -connector) for the nzreplrestore command. By default, the system does the restore with the same number of streams that were used for the backup.
- Reactivates the node if the node state was active before you began the restore
- Displays the command syntax that is required to set the replica to an active state if the node state was suspended when you began the restore
For a complete example of replication backup and restore, see Examples in the nzreplanalyze command topic.
Examples
[nz@PTS100]$ nzreplrestore -recoveryfile /var/nzrepl/nzreplbackup/
2364/1378735450/my_recovery_file
2013-07-30 16:08:35.697208 EDT Info: Completed restores.
2013-07-30 16:08:35.697232 EDT Info: To restart replication, run:
nzsql -c "alter replication node myREPLSET.myNode state active[nz@PTS100]$ nzreplrestore -recoveryfile /var/nzrepl/nzreplbackup/
2364/1378735450/my_recovery_file[nz@cdcntza1 ~]$ nzreplrestore -recoveryfile /var/nzrepl/
nzreplbackup/31244/1379613349/subrestore.xml
Suspending myREPLSET.myNode.
Dropping database DB_FST.
NOTICE: Database "DB_FST" is no longer replicated
Starting restore: -globals
Restore of global objects completed successfully.
Starting restore: -db DB_FST
Warning: User and group creation is skipped when restoring to a
replication replica node, or to a non-replicated database on a
primary node.
Restore of increment 1 from backupset 20130919175552 to database 'DB_
FST' committed.
Activating myREPLSET.myNode.
Completed restores.