The nzhostbackup command

Use the nzhostbackup command to back up the IBM® Netezza® data directory and system catalog on the host.

In the rare situations when a Netezza host server or disk fails, but the SPUs and their data are still intact, you can restore the /nz/data directory (or whatever directory you use for the Netezza data directory) from the host backup without the additional time to restore all of the databases. For more information, see Host backup and restore.

Before you run the nzhostbackup command, you must do one of the following:
  • Pause the system.
  • Set the NZ_USER and NZ_PASSWORD environment variables to a user who has permission to pause the system.
  • Set NZ_USER to a user who has permission to pause the system, and cache that user's password.

If you run the nzhostbackup command, then change a user's password and then run the nzhostrestore command, the old password is replaced.


The nzhostbackup command uses the following syntax:
nzhostbackup [-g GRACE_PERIOD] [-D DATA_DIR] [--nokeydb] [-sklm] FILE 
nzhostbackup -h


The nzhostbackup command takes the following inputs:
Table 1. The nzhostbackup input options
Input Description
-h Displays online help for this command.
-g GRACE_PERIOD Specifies the maximum time to wait (in seconds) for queries (or any system action, such as a load) to finish before the system begins the backup. After the system waits this amount of time, it cancels any remaining queries and starts the backup. The default is 60 seconds.
-D DATA_DIR Specifies the path name of the system data directory to back up. The default is the NZ_DATA_DIR, which is usually /nz/data.
--nokeydb Specifies not to back up the keystore for self-encrypting drives (IBM PureData® System for Analytics N3001 systems).
--sklm If the host uses the IBM Security Key Lifecycle Manager keystore to hold the SED key, retrieves the AEKs from ISKLM and creates a GSKit keystore, which is included in the host backup. Cannot be used in combination with the --nokeydb option.
FILE Specifies the path name of the archive file that you want to create. This file is a compressed tar file.


The nzhostbackup command does the following:
Privileges required
You must specify a database user account that has Manage System privileges.
Common tasks
You can run the nzhostbackup command when the system is online, paused, offline, or stopped.
  • If you run the nzhostbackup command while the system is online, the nzhostbackup command pauses the system for the duration of the backup.
  • All currently running queries run to completion before the backup begins, subject to the time_out value you specify, or 60 seconds if you do not specify time_out. The system queues new queries until the backup completes.

Determine the data directory

The nzhostbackup command uses the same logic as the nzstart command to determine the data directory. The command uses the following settings in order:
  1. -D on command line
  2. NZ_DATA_DIR environment variable
  3. NZ_DIR/data, where NZ_DIR is determined from NZ_KIT_DIR or relative to the location of the script itself.

In addition, if you unset NZ_DIR and NZ_KIT_DIR and then run the nzhostbackup backup_dir command, the command works because it internally determines the location of NZ_KIT_DIR, NZ_DIR and NZ_DATA_DIR.


The following provides some same usage:
  • To back up the default data directory, enter:
    nzhostbackup /home/host/backup.tar.gz
  • To specify a timeout period of 5 minutes, rather than the default 60 seconds, enter:
    nzhostbackup -g 300 /home/host/backup.tar.gz
  • To specify a timeout period of 5 minutes, rather than the default 60 seconds, enter:
    nzhostbackup -g 300 /home/host/backup.tar.gz