Restoring a Database Using an Archive

On occasion, it may be desirable to start a database using an existing database archive (database on disk), for example:

To restore an existing database archive for a specific host, use the create archive command with the --restored option.

Note: It is not possible to restore into a running database. The process documented here creates a new database.

When restoring a database archive, the archive must be physically present on the host running the admin processNuoDB Archive (nuoarchive) is a command line utility that can do the following: (1) Clean, validate, and (if needed) repair archives (nuoarchive check). (2) Restore an archive from a hot copy backup set (nuoarchive restore). specified by the --server-id argument.

nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path /var/opt/nuodb/production-archives/<database name> --restored

For example, to restore an archive identified for the test database that physically resides on the host running the server1 admin process, run the following command:

nuocmd create archive --db-name test --server-id server1  --archive-path /var/opt/nuodb/production-archives/test --restored

Note: The --restored option specifies that the archive being created already contains data, and that an SM started on it does not require the --initialize option.

The test database can then be started by running the following commands:

nuocmd create database --db-name test --dba-user test --dba-password test
nuocmd start process --db-name test --engine-type TE --server-id server1

Note: The create archive command is issued using NuoDB Command (nuocmd). For more information on NuoDB Command and other command line tools, see Command Line Tools.