Managing Netezza Backups and Restores Using Hybrid File Store

Updated

You can use Hybrid File Store as a repository for your Netezza backups.

After you perform the initial Hybrid File Store configuration, you can mount the Hybrid File Store on the Netezza client, and then perform backup and restore operations by using the Netezza native command line interface.

Configuration

  1. If you have not already done so, perform the Hybrid File Store configuration. For more information, see Getting Started with Hybrid File Store.

  2. Mount the Hybrid File Store share on the Netezza client.

Backups

Netezza supports the following backup types:

  • Full

  • Incremental: You must have a full backup in order to perform either of the following incremental backups:

    • Differential: A differential backup contains only the data that is new or has changed since the last full backup.

    • Cumulative: A cumulative backup contains the changes that were made to the database since the last full backup. Cumulative backups consolidate, and then replace any differential backups that ran since the last full backup.

Perform all backups from the command line in Hybrid File Store mount path by using the Netezza nzbackup command. For more information, see the IBM Knowledge Center article, Command Line Syntax for nzbackup.

Full Backup

  • On the command line, type the following command:

    nzbackup -dir <nfs_object_store_mounted_path> -db <database_name_to_backup>

    where:

    dir: The Hybrid File Store mount path.

    db: The database that you want to back up.

    Example

    The following command backs up the gk database. In this example, the Hybrid File Store mount path is /export/home/nz/nz_backup_test.

    nzbackup -dir /export/home/nz/nz_backup_test -db gk

Differential Backup

  • On the command line, type the following command:

    nzbackup -dir <nfs_object_store_mounted_path> -db <database_name_to_backup> -differential

    where:

    dir: The Hybrid File Store mount path.

    db: The database that you want to back up.

    Example

    The following command backs up the gk database. In this example, the Hybrid File Store mount path is /export/home/nz/nz_backup_test.

    nzbackup -dir /export/home/nz/nz_backup_test -db gk- differential

Cumulative Backup

  • On the command line, type the following command:

    nzbackup -dir <nfs_object_store_mounted_path> -db <database_name_to_backup>-cumulative

    where:

    dir: The Hybrid File Store mount path.

    db: The database that you want to back up.

    Example

    The following command backs up the gk database. In this example, the Hybrid File Store mount path is /export/home/nz/nz_backup_test.

    nzbackup -dir /export/home/nz/nz_backup_test -db gk - cumulative

Restores

You can perform the following types of restores:

  • Database

  • Table-level restore

Perform all restore operations from the Hybrid File Store mount path using the Netezza nzrestore command. For more information, see the IBM Knowledge Center article, The nzrestore command syntax.

Database Restore

  • On the command line, type the following command:

    nzrestore -backupset <backup_set_id> -increment <specify_the_increment to_use> -dir <nfs_object_store_mounted_path_used _for_backup> -db <database_name_to_restore>

    where:

    backupset: The backup set ID.

    dir The Hybrid File Store mount path.

    db: The database that you want to back up.

    increment: The increment that you want to restore. You can specify any of the following:

    • An ID: Restore a to the increment.

    • NEXT: Restore the next increment.

    • REST: Restore the remaining increments that are part of the backup set.

      Example

      The following command restores increment 2 of the gk database. In this example, the Hybrid File Store mount path is /export/home/nz/nz_backup_test.

      nzrestore -backupset 20180228110458 -increment 2 -dir /export/home/nz/nz_backup_test -db gk

Table-level Restore

  • On the command line, type the following command:

    nzrestore -backupset <backup_set_id> -increment <specify_the_increment to_use> -dir <nfs_object_store_mounted_path_used _for_backup> -tables <tables_name_list> -db <database_name_to_restore> -droptables

    where:

    backupset: The backup set ID.

    dir The Hybrid File Store mount path.

    db: The database that you want to back up.

    increment: The increment that you want to restore. You can specify any of the following:

    • An ID: Restore a to the increment.

    • NEXT: Restore the next increment.

    • REST: Restore the remaining increments that are part of the backup set.

      tables: The list of tables to restore.

      droptables: The software drops the tables in the tables list before the restore.

      Example

      The following command restores tables T1 and T2 in the gk database. In this example, the Hybrid File Store mount path is /export/home/nz/nz_backup_test.

      nzrestore -backupset 20180228110458 -increment 2 -dir /export/home/nz/nz_backup_test -tables T1 T2 -db gk -droptables