The nzrestore command

Deployment options: Netezza Performance Server for Cloud Pak for Data System Netezza Performance Server for Cloud Pak for Data

You can use the nzrestore command to restore the contents of a database.

To use the restore command, you must have the Restore privilege. The nzrestore command restores complete databases or specific tables.

Restriction: You cannot do a full database restore into an existing database. Instead, specify a new database or drop the existing database first before you proceed with the nzrestore command.

If you are doing parallel restore of two databases with same UDFs installed, then you might see one of the restores is waiting until the other one is complete. It is recommended to perform such restores one after the other.

If you need to grant a user permission to restore a specific database (versus global restore permissions), you can create an empty database and grant the user privilege for that database. The user can then restore that database.

You can pass parameters to the nzrestore command directly on the command line, or you can set parameters as part of your environment. For example, you can set the NZ_USER or NZ_PASSWORD environment variables instead of specifying -u or -pw on the command line.

When you do a full restore into a database, the nzrestore command performs the following actions:
  1. Verifies the username that is given for backup and restore privileges.
  2. Checks to see whether the database exists.
  3. Re-creates the same schema for the new database, including all objects such as tables, views, sequences, and synonyms.
  4. Applies any access privileges to the database and its objects as stored in the backup. If necessary, the command creates any users or groups that might not currently exist on the system to apply the privileges as saved in the database backup. The command also revokes any current user or group privileges to match the privileges that are saved at the time of the backup.
  5. Restores the data.

If you are performing a table-level restore and the table exists in the database, the nzrestore command drops and re-creates the table if you specify -droptables. If you do not specify -droptables, the restore fails.

The nzrestore -noData command does not restore the /nz/data directory; instead, it creates a database or populates an empty database with the schema (definition) from the backed-up database. The command creates the objects in the database, such as the tables, synonyms, sequences, and views, and applies any access permissions as defined in the database. It does not restore data to the user tables in the database; the restored tables are empty.

In rare cases, when a schema (definition) has many objects, the restore might fail with a memory limitation. In such cases, you might adjust how you restore your database. For example, if you attempt to restore a database that includes many columns (such as 520,000), you would likely receive an error message that indicates a memory limitation. The memory limitation error can result from a large number of columns or other object definitions. You would likely perform a no-data restore followed by two or more table-level restore operations.