Question & Answer
Question
What does the error "Database "ADMIN" does not exist" mean?
Answer
If the error "Database "ADMIN" does not exist," appears when executing the nzhostbackup or nzrestore commands, the NZ_DATABASE environment variable is not defined correctly. Typically you need to define NZ_DATABASE for the user. The backup and restore scripts are based on the assumption that NZ_DATABASE is set, and therefore they try to access the database that is defined by the environment variable. Without defining it, you might encounter the following error message when running the command:
$ nzhostbackup file
Starting host backup. System state is 'online'.
Pausing the system ...>
Warning: system state timed out changing to 'Paused'..
Checkpointing host catalog ....
Archiving system catalog ....
nzsql: FATAL 1: Database "ADMIN" does not exist..
If running from a crontab, you need to define NZ_DATABASE as follows:
$ export NZ_DATABASE=system
$ nzhostbackup file1
Starting host backup. System state is 'pausedNow'.
Checkpointing host catalog ...
Archiving system catalog ...
Host backup completed successfully. System state is 'pausedNow'.
$
If you run the command as root user (via sudo) without the environment variable defined correctly, you'll receive the same error:
$ sudo /nz/kit/bin/nzhostbackup file2
Password: (######)
Starting host backup. System state is 'pausedNow'.
Checkpointing host catalog ...
Archiving system catalog ...
nzsql: FATAL 1: Database "ADMIN" does not exist.
To fix it, define the variable like this:
$ export NZ_DATABASE=system
$ sudo /nz/kit/bin/nzhostbackup file3
Starting host backup. System state is 'pausedNow'.
Checkpointing host catalog ...
Archiving system catalog ...
Host backup completed successfully. System state is 'pausedNow'.>
$
Historical Number
NZ632433
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21569957