Examples of the nzbackup command

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

The following are several examples of the nzbackup command:

  • To back up the contents of the database db1 to disk in the /home/user/backups directory, enter:
    nzbackup -dir /home/user/backups -u user -pw password -db db1
    The nzbackup command saves the schema of the database (its definition), data, and access permissions for all the objects and user data in the database. Sample output follows:
    Backup of database db1 to backupset 20120319201321 completed 
    successfully.
    You can use the -v (verbose) command option to display more detail about the backup:
    [Backup Server] : Starting the backup process
    [Backup Server] : Backing up to base directory '/home/user/backups'
    [Backup Server] : Backing up libraries
    [Backup Server] : Backing up functions
    [Backup Server] : Backing up aggregates
    [Backup Server] : Transferring external code files
    [Backup Server] : Start retrieving the schema
    [Backup Server] : Backing up metadata to 
    /home/user/backups/Netezza/hostid/DB1/20120319201402/1/FULL
    [Backup Server] : Retrieving host key information
    [Backup Server] : Retrieving user information
    [Backup Server] : Backing up sequences
    [Backup Server] : Backing up table schema.
    [Backup Server] : Backing up External Tables.
    [Backup Server] : Backing up External table settings.
    [Backup Server] : Backing up External table zone settings.
    [Backup Server] : Backing up Table Constraints
    [Backup Server] : Backing up synonyms
    [Backup Server] : Backing up stored procedures
    [Backup Server] : Backing up materialized views
    [Backup Server] : Backing up view definitions.
    [Backup Server] : Retrieving group information
    [Backup Server] : Retrieving group members
    [Backup Server] : Backing up ACL information
    [Backup Server] : Start retrieving the data.
    [Backup Server] : Backing up table AAA
    [Backup Server] : Backing up table BBB
    [Backup Server] : Backing up table sales %
    [Backup Server] : Operation committed
    Backup of database db1 to backupset 20120319201402 completed 
    successfully.
  • To back up the contents of the database db2 to file system locations in the /export/backups1 and /export/backups2 directories, enter:
    nzbackup -dir /export/backups1 /export/backups2 -u user -pw password 
    -db db2

    The nzbackup command saves the schema of the database (its definition), data, and access permissions for all the objects and user data in the database. The database is saved in the two specified file system locations.

  • To back up only the object definitions and access privileges of the database db1 to disk in the /home/user/backups directory, enter:
    nzbackup -dir /home/user/backups -noData -u user -pw password 
    -db db1
    The nzbackup command saves the schema, which is the definition of the objects in the database and any access permissions that are defined in the database to a file. The following is an example that also uses the -v option:
    [Backup Server] : Starting the backup process
    [Backup Server] : Backing up to base directory '/home/user/backups'
    [Backup Server] : Backing up libraries
    [Backup Server] : Backing up functions
    [Backup Server] : Backing up aggregates
    [Backup Server] : Transferring external code files
    [Backup Server] : Backing up to 
    /home/user/backups/Netezza/hostid/DB1/20120319202016/1/SCHEMA/md
    [Backup Server] : Retrieving host key information
    [Backup Server] : Retrieving user information
    [Backup Server] : Backing up sequences
    [Backup Server] : Backing up table schema.
    [Backup Server] : Backing up External Tables.
    [Backup Server] : Backing up External table settings.
    [Backup Server] : Backing up External table zone settings.
    [Backup Server] : Backing up Table Constraints
    [Backup Server] : Backing up synonyms
    [Backup Server] : Backing up stored procedures
    [Backup Server] : Backing up materialized views
    [Backup Server] : Backing up view definitions.
    [Backup Server] : Retrieving group information
    [Backup Server] : Retrieving group members
    [Backup Server] : Backing up ACL information
    [Backup Server] : Operation committed
    Backup of schema for database db1 completed successfully.
  • To back up the global objects in the /home/user/backups directory, enter:
    nzbackup -dir /home/user/backups -globals -u user -pw password
    The nzbackup command saves the users, groups, global permissions, and security categories, cohorts, and levels for multi-level security. It does not capture user privileges that are granted in specific databases. Those permissions are captured in database backups.
    [Backup Server] : Starting the backup process
    [Backup Server] : Backing up to base directory '/home/user/backups'
    [Backup Server] : Backing up security metadata
    [Backup Server] : Start retrieving the schema
    [Backup Server] : Backing up metadata to 
    /export/home/nz/backups/Netezza/hostid/SYSTEM/20120319202355/1/USE
    RS/md
    [Backup Server] : Retrieving host key information
    [Backup Server] : Retrieving user information
    [Backup Server] : Retrieving group information
    [Backup Server] : Retrieving group members
    [Backup Server] : Backing up ACL information
    [Backup Server] : Operation committed
    Backup of global objects completed successfully.