Open topic with navigation
To restore a copy of the current state of a database, you can invoke the
nuodbmgr restore database command to create a new database from your backup copy. The procedure is the same regardless of how you obtained the backup copy. That is, you can invoke
nuodbmgr database restore on an archive created from a redundant storage manager, or a running database by means of a hot copy operation.
restore command takes a database name as an argument. Specify the name of the archive that was the result of copying the database's current state.
Before you invoke the
restore command, you must ensure that the archive is in the required location. The required location is identified by the host's
archive_base host tag key . By default, the
archive_base host tag key has this value:
/var/opt/nuodb/production-archives. The associated journal must be in the default location, which is the
journal directory inside the archive directory. Thus, the location of the archive that you want to restore is as follows:
For example, for a database named
test when the
archive_base host tag key has the default value, the archive location must be:
When the archive you want to restore is not in the required location you must move or copy it to that location. Likewise, if the journal directory is not in the archive directory then you must move or copy it there.
When using the
restore command, you may specify database options and template variables.
The example below creates a database called
test_backup_oct16 based on the backup that was created in the example in Copying the Archive and Journal of the Shutdown Storage Manager. In the following example, you could alternatively specify, for example,
test_archive_hotcopy050515 as the archive you want to restore and that would create the
test_archive_hotcopy050515 database in the default archive directory (
nuodb [domain] >
restore databaseDatabase Name:
test_backup_oct16Host (required for template: Single Host):
ip-172-31-40-24Database Options (optional):
mem 3gTemplate Variables (optional): nuodb [domain] >
show domain summaryHosts: [broker] * ip-172-31-40-24/22.214.171.124:48004 (us-east-1) [broker] ip-172-31-46-122/126.96.36.199:48004 (us-east-1) Database: test, (unmanaged), processes [2 TE, 2 SM], ACTIVE [SM] ip-172-31-40-24/188.8.131.52:48005 (us-east-1) [ pid = 23781 ] [ nodeId = 9 ] RUNNING [TE] ip-172-31-40-24/184.108.40.206:48006 (us-east-1) [ pid = 23120 ] [ nodeId = 4 ] RUNNING [SM] ip-172-31-46-122/220.127.116.11:48007 (us-east-1) [ pid = 8151 ] [ nodeId = 1 ] RUNNING [TE] ip-172-31-46-122/18.104.22.168:48008 (us-east-1) [ pid = 8167 ] [ nodeId = 2 ] RUNNING Database: test_backup_oct16, (unmanaged) processes [1 TE, 1 SM], ACTIVE [SM] ip-172-31-40-24/22.214.171.124:48007 (us-east-1) [ pid = 23845 ] [ nodeId = 1 ] RUNNING [TE] ip-172-31-40-24/126.96.36.199:48008 (us-east-1) [ pid = 23860 ] [ nodeId = 2 ] RUNNING nuodb [domain] >