The nzrestore command syntax
Syntax
usage: nzrestore [-h|-rev] [-hc conname] [<options>]
[-v][-db database] [-dir directory list] [-dirfile dir file]
[-connector conname] [-connectorArgs "args"] [-backupset ID]
[-sourcedb dbname] [-npshost host] [-tables tablenames]
[-tablefile filename] [-sourceschema schema_name] [-droptables]
[-increment ID] [-increment NEXT] [-increment REST] [-lockdb] [-unlockdb] [-globals]
[-noUsers] [-noAcl] [-u username] [-pw password]
[-secret value] [-streams AUTO] [-streams N] [-noData] [-allincs]
[-contents] [-history] [-incrementlist] [-suspendMViews] [-disableGroom]
[-disableSecurityCheck] [-enableSecurityCheck][-disableSecurityRestore]
[-enableSecurityRestore] [-extract [file]] [-extractTo path]
Argument | Description | Example |
---|---|---|
-h | Displays the help for the command. | |
-rev | Displays the software revision of the command. | |
-hc conname | Provide details about all possible arguments that can be used with connectorArgs for different connectors (for example, networker, netbackup, netbackup8-64, tsm, s3). | nzrestore -hc networker |
-v[erbose] | Specifies the verbose mode, lists the objects that are being restored. | |
-db database | Restores the specified database and all its objects and the users, groups, and permissions
that are referenced by those objects. If you specify this option, you cannot specify -globals. For more information, see Back up and restore users, groups, and permissions. |
|
-dir directory list | For a restore from a file system, specifies the path names of the backup directories. You can
specify full path name or path names, or the backup “root” directories. For example, if
you used the root directory /usr/backups when you created the backup, specify
/usr/backups when you restore from that backup. If you saved the backup to multiple file system locations, specify the roots of all the locations in this argument. For example, if a backup was written to /home/backup1, /home/backup2, and /home/backup3, you can restore the data in a single operation by specifying all three locations. |
|
-dirfile | Specifies a file with a list of the backup source directories, one per line. | |
-connector conname | Names the connector to which you are sending the backup. Valid values are:
If you have both the 32-bit and 64-bit clients that are installed for either TSM, NetBackup or NetWorker, the system defaults to using the 32-bit client. You can force the system to use the 64-bit client by specifying the name (tsm6-64, netbackup7-64, or networker7-64) in the -connector option. If only the 64-bit client is installed, the system uses the 64-bit client to do the restore. The system “discovers” the backup software that
is based on the connector name that you specify. If you have multiple versions of a backup connector
installed (for example, Tivoli Storage Manager 5 and Tivoli Storage Manager 6), you can use a
specific version by using one of these values instead of the previous generic arguments:
|
|
-connectorArgs “args” | Specifies a colon-separated list of pass-through arguments for the connector. The argument string must be enclosed in double quotation marks. | |
-backupset ID | Specifies the backup set, overriding the default. | |
-sourcedb dbname | Specifies the backup set database, overriding the default. The nzrestore command restores the most recent backup of -db unless you specify a different backup set with the option -sourcedb. |
|
-npshost host | By default, restores look for backup sets that were created by the local host. If you use nzrestore to migrate databases, schemas, or user backups that are made on a different Netezza Performance Server host, use this option to specify the host that created the backup set. | |
-tables table_list | Restores the table or tables as specified in the table_list argument, which is a space-separated list of tables. The table names are case-sensitive, and you must specify a table name as it appears in the backup set. You can use the nzrestore -contents option to display the names of objects in the backup set. | |
-tablefile filename | Restores the tables that are listed in the table file, which is a file that contains a list of tables with one table per line. The table names are case-sensitive, and you must specify a table name as it appears in the backup set. | |
-sourceschema schema_name | On systems that support multiple schemas, a database backup contains all the
objects in all the schemas in that database. Users might create tables that have the same name in
different schemas. To uniquely identify the table that you want to restore in the
-tables or -tablefile argument, use the
-sourceschema option to specify the schema in the backup set where the table is
defined. The -sourceschema argument is optional, but the command returns an error if it finds more than one table of that name in the backup set. The schema name is case-sensitive, and you must specify a schema name as it appears in the backup set. You can use the nzrestore -contents option to display the names of objects in the backup set. If the -tables or -tablefile argument contains a list of tables, the -sourceschema value applies to all of the tables. To restore tables from different schemas of the same backup set, use a separate nzrestore command to restore the table or tables in each -sourceschema. |
|
-droptables | Drops the tables in the table list before it restores them during a table-level restore. | |
-increment [ID | NEXT | REST] | If you specify an increment ID, the command runs a partial restore up to
the user-specified increment number. After you run a partial restore, you can specify NEXT to restore the next increment from the backup set. If you specify REST, the command restores the remaining increments from the backup set. |
|
-lockdb | Makes the database read-only to prevent modifications during the restore. Any of the following can represent “true”: 1, t, T, y, Y, true, TRUE, yes, Yes, or YES. Any of the following can represent “false”: 0, f, F, n, N, false, False, FALSE, no, No, or NO. If you do not specify this option, the database remains unlocked, which does not allow subsequent incremental restore operations. |
|
-unlockdb | Unlocks the database without performing another restore. This option is useful in cases where a restore is aborted or fails because the target database might remain locked. Use this option to unlock the database. | |
-globals | Restores the users, groups, and global permissions, and multi-level security information such
as categories, cohorts, and levels. For more information, see Back up and restore users, groups, and permissions. You cannot specify -db
when you specify -globals. The creation of the users, groups, and global permissions is nondestructive; that is, if a user or group exists, the system does not overwrite it. If you specify verbose mode, the nzrestore command displays at least one user or group creation error message and directs you to the restore log for details. When you are transferring data to a new system, use nzrestore -globals first to ensure that the users, groups, permissions, and security information is present before you restore the data. |
|
-noUsers | Disables the restoration of users or groups. | |
-noAcl | Disables the restoration of permissions. | |
-u username | Specifies the username for connecting to the database to perform the restore. | |
-pw password | Specifies the user password. | |
-secret value | Specifies a string value that is needed to generate a 256-bit symmetric key, which is used to decrypt the host key in the data. | |
-streams [AUTO | N] | Specifies the number of streams to use when restoring the database archive.
For more information, see Multi-stream restore. If you specify AUTO, the command chooses the number of streams for the restore. The number of streams is typically the same number of streams that were used by the nzbackup command that created the backup archive. You can specify a stream count for the command using the -stream N option. If you do not specify a -streams value, the restore process uses the number of streams that are defined by the host.bnrRestoreStreamsDefault registry setting. |
|
-noData | Restores only the database schema (the definitions of objects and access permissions), but not the data in the restored tables. | |
-allIncs | Used with -noData, restores the user-defined objects (functions, aggregates) in every increment. | |
-contents | Lists the name and type of each database object in a backup archive. For file system backup locations, you must also specify -dir for the location of the backup archive and -db for a specific database. |
|
-history | Prints a restore history report. | |
-incrementlist | Prints a report of the available backup sets and increments. You must specify -connector. You can also specify -npshost, -sourcedb, or both. |
|
-suspendMViews | Leave materialized views suspended after a table-level or incremental restore. | |
-disableGroom | Disables the automatic groom of versioned tables at the end of the restore operation. | |
-disableSe-curityCheck | For nzrestore -db operations, the command confirms that the target system has all the security metadata in the backup set. The target must have a compatible MLS model with the levels, categories, and cohorts that are defined in the backup set. In some instances, the backup set can include older, unused metadata that is not present in the target database; by default, nzrestore -db fails in this case. You can use this switch to bypass the overall metadata check, but if the backup set has data that includes a label that is not in the target system, the restore fails and is rolled back. | |
-enableSe-curityCheck | Checks but does not restore any security metadata in the backup set. | |
-disableSe-curityRestore | When you use nzrestore -globals, this option ignores (does not restore) security metadata if the backup set contains any. | |
-enableSe-curityRestore | For nzrestore -db operations, restores the security metadata in the backup set to the target system. | |
-extract [file] | Extracts the specified file from the specified backup set. If you do not specify a file, the
option lists all the files in the backup set. With the -extract option, the restore command does not restore the specified backup set or files. The -extract option causes the command to skip the restore operation and output the requested file or list. |
|
-extractTo path | Specifies the name of a file or a directory where you want to save the extracted output. If you do not specify directory, the -extract option saves the file in the current directory where you ran the nzrestore command. | |
-forceCreateViews | Forces the recreation of views during an incremental restore even if the view exists and the definition is unchanged. |
Environment settings for nzrestore
Name | Corresponding command-line parameter |
---|---|
NZ_USER | Same as -u. |
NZ_PASSWORD | Same as -pw. |
Restore errors
The nzrestore command writes errors to the /nz/kit/log/restoresvr/restoresvr.pid.date.log file. For more information about the log files, see System logs.