Resolving a Failed nzrestore | Smart Associates

Troubleshooting the failed nzrestore

  • Show available backups for your database:

[nz@netezza ~]$ nzbackup -history -db MYDB

nzbackup screen output
  • Restore database or tables

[nzrestore -db MYDB -tables MYTABLE -backupset 2019112709360

  • Check the status of the restore for your database

[nz@netezza md]$ nzrestore -history -db MYDB

nzrestore output
  • Examine logs and investigate/resolve any errors

grep -i error /nz/kit/log/restoresvr/restoresvr.4361.2019-11-29.log

Manually restore a table from a backupset with suspected corrupt metadata

  • Create a restore database

nzsql -c "create database MYDB_RESTORE;"

  • Create table schema (either from existing table or saved DDL)

nzsql -d MYDB_RESTORE -c "create table MYTABLE as select * from MYDB..MYTABLE limit 0;"

  • Backup the newly created database

[nz@netezza FULL]$ nzbackup -db MYDB_RESTORE -dir /tmp

nzbackup output
  • Navigate and list contents of backup dir, which is in the format of


The files correspond to the object IDs for each table in that particular database e.g. {objid}.full.1.1

[nz@netezza data]$ cd /tmp/Netezza/netezza/MYDB_RESTORE/20191129100508/1/FULL/data [[nz@netezza data]$ ls -[nz@netezza data]$ ls -l

  • Get object ID for the table you need to restore

[nz@netezza md]$ nzrestore -dir /tmp -db MYDB -backupset 20191127093609 -contents

nzrestore screen output
  • List the data file available for that object ID

[nz@netezza md]$ nzrestore -dir /tmp -db MYDB -backupset 20191127093609 -extract

nzrestore screen output
  • Extract data file to local filesystem

[nz@netezza data]$ nzrestore -dir /tmp -db MYDB -backupset 20191127093609 -extract data/200290.full.1.1

nzrestore more screen output
  • Replace the current backup data file (of the empty table) with the extracted data file. Note the object IDs are different so this needs to match the backupset metadata

mv 200290.full.1.1 212183.full.1.1

  • Now you can restore the table to the new database from the manually updated backupset

[nz@netezza data]$ nzrestore -dir /tmp -db MYDB_RESTORE -tables MYTABLE -backupset 20191129100508 -droptables

nzresore screen output

Expect this process to take between 1 and 2 days.


Year / Month