The nzbatchbnr command

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

Use the nzbatchbnr command to run batch operations for backup and restore.

With the command, you can:
  • Trigger a batch of backups of all existing databases.
  • Trigger a partial or complete restore of selected or all databases from a batch.
  • Delete backups from cloud stores.
  • List all backup and restore batch operations.
  • Get the status of ongoing batch operations.
  • Get information about errors that you encountered during a batch.
  • Scan backups on the cloud and recover metadata about backups, use it for recovery or migration.

Syntax

The nzbatchbnr has the following syntax:
nzbatchbnr [operation] --destination [s3 | ibm | az] --unique-id <unique-id> <connection args>
Table 1. The nzbatchbnr command operations
Operation  
Backup
backup [-j <json_file>|-J <json_string>]
JSON format for a backup of all databases:
'{"backup_list":[{"db":[{"name":"*"}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
JSON format for a backup of single database and no schema
'{"backup_list":[{"db":[{"name":"DB1"}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
JSON format for a backup of multiple databases and multiple schemas
'{"backup_list":[{"db":[{"name":"DB1","schemas":["SCHEMA_NAME_1","SCHEMA_NAME_2"]},{"name":"DB2","schemas":["SCHEMA_NAME_3","SCHEMA_NAME_4"]}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
Restore
restore [-j <json_file>|-J <json_string>]
JSON format for restoring a batch
'{"batchid": "<batchid>","select": {},"user_name" : "*", "token" : "*"}'
JSON format for restoring select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{},"DB2":{}},"user_name" : "*", "token" : "*"}'
JSON format for restoring select tables from select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{"schemas":{"ADMIN":["T1","T2"]}}},"user_name" : "*", "token" : "*"}'
List
ls [subcommand]
no subcommand specified
Lists all backups and restore batches.
-b <batch_id>
Returns the status of a batch.
scan-cloud [options]
Note: In earlier releases, scan-cloud was called scan-s3. That option is now discontinued. scan-cloud must be used instead.
List of options:
--all
Scans all namespaces from a given destination.
--scan-tables
Scans the backups for a table count. Applicable only for S3/IBM Cloud, works by default for Azure blob storage.
--print-only
Prints whether a new entry will be I (insert), U (updated) or X (no change).
Delete
delete -b <a comma separated list of batches>
 
Errors
errors -b <batch>
 
Example:
{
  "backup_list": [
    {
      "db": [
        {
          "name": "DB1"
        }
      ],
      "type": "FULL",
      "label": {
        "batchtype": "ADHOC",
        "bucket": "concerto-bnr-test-qa"
      }
    }
  ]
}
{
  "batchid": "20251029082815",
  "select": {},
  "user_name": "admin",
  "token": "**********"
}
Table 2. The nzbatchbnr command connection arguments
Destination type Connection arguments
s3
--access-key <>
--secret-key <>
--region <>
--bucket <>
ibm
--access-key <>
--secret-key <>
--region <>
--bucket <>
--endpoint <>
az
--account-name <>
--account-key <>
--container <>
Connection arguments can be mentioned in a credentials file, in the --creds-file option. The format of the credentials file is:
{
  "bucket-name": {
    "access_key_id": "",
    "destination": "",
    "azure_blob_type": "",
    "container": "",
    "bucket": "",
    "account_name": "",
    "user_name": "",
    "secret_key": "",
    "token": "",
    "account_key": "",
    "default_region": "",
    "endpoint": ""
  }
}
Note: The destination key is mandatory in the --creds-file option. The values that it takes are:
  • AWS_S3
  • IBMCLOUD_OBJECT
  • AZURE_BLOB

An empty value is not allowed.