Creating an Archive

The following assumes that the Transparent Huge Pages (THP) setting is disabled on Linux operating systems. For more information on how to disable THP, see Disabling Transparent HugePage (THP).

When creating a NuoDB database, you must first create a database storage archive entry. In NuoDB, a database archive is a copy of the database on disk.

To define an archive object in the NuoDB domain state, use the nuocmd create archive command. The nuocmd create archive command does not pre-allocate storage space to the archive.

nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path <full path>

Example

The following example shows how to create an archive object with a server ID and archive path.

nuocmd create archive --db-name hockey \
   --server-id nuoadmin-0 --archive-path /var/opt/nuodb/production-archives/hockey
Archive(archive_path=/var/opt/nuodb/production-archives/hockey, db_name=hockey, id=0, server_id=nuoadmin-0, state=PROVISIONED)
The nuocmd create archive command invocation above specifies:
- The name of the database for which an archive is required (hockey).
- The server ID of the NuoDB Admin server where the archive is to be stored (nuoadmin-0).
- The location (with archive name appended) of the archive being created (/var/opt/nuodb/production-archive/hockey).
The nuocmd create archive command generates an archive ID for the archive created (id=0 in the example above).

Archive Paths per Installation Type

On Linux systems, the recommended root directory for archives is /var/opt/nuodb/production-archives/.

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

On Windows systems, the recommended root directory for archives %NUODB_HOME%/archives/.

mkdir %NUODB_HOME%/archives
nuocmd create archive --db-name <database name> --server-id <server ID> --archive-path %NUODB_HOME%/archives/<database name>

NuoDB does not require archives to be stored in these locations, but it does require that the nuodb process have read and write permissions to whichever archive directory is used. See Installing NuoDB, for more details.