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"}}]}'
JSON format for a backup of single database and no schema
'{"backup_list":[{"db":[{"name":"DB1"}],"type":"FULL","label":{"batchtype":"ADHOC"}}]}'
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"}}]}'
Restore
restore [--j <json_file>|-J <json_string>]
JSON format for restoring a batch
'{"batchid": "<batchid>","select": {}}'
JSON format for restoring select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{},"DB2":{}}}'
JSON format for restoring select tables from select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{"schemas":{"ADMIN":["T1","T2"]}}}}'
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>
 
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:
{
    "access_key_id": "",
    "default_region": "",
    "bucket": "",
    "secret_key": "",
    "endpoint": "",
    "user_name": "",
    "token": "",
    "account_name": "",
    "account_key": "",
    "container": "",
    "destination": ""
}
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.