Creating an Archive

Note: 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 Determining Whether THP is Enabled.

When creating a NuoDB database, you must first create a database storage archive entry. In a NuoDB domain, an archive is a copy of the database on disk. To define the persistent disk storage archive properties within the NuoDB Durable State machine (DSM) for a particular database, use the create archive command:

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

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.

Note: NuoDB does not enforce the location of the database archive directories; the locations documented in this section are recommendations.

Note: The create archive command doesn’t pre-allocate storage space to the archive.

Parameters

This section describes parameters that can be provided when using the create archive command.

Parameter

Description

Comments

--db-name <DB_NAME> The database this archive will be associated with. -

--server-id <SERVER_ID>

The NuoDB Admin server that is configured on the host machine where the archive will exist.

This parameter is mandatory except when using the is-external option.

--archive-path <ARCHIVE_PATH> The database archive directory location on disk. When specifying the location, include the full path. For example, /var/opt/production-archives/<db-name>.
--journal-path <JOURNAL_PATH> The database journal directory location on disk When specifying the location, include the full path. For example, $NUODB_HOME/var/opt/production-archives/<db-name-journal>.
--snapshot-archive-path <SNAPSHOT_ARCHIVE_PATH> The database snapshot archive directory location on disk When specifying the location, include the full path. For example, /var/opt/production-archives/<db-name-snaphot>.
--restored Creates an archive entry based on an existing archive. For more information, see Restoring a Database Using an Archive.

Example

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

nuocmd create archive --db-name test --server-id server0 --archive-path /var/opt/nuodb/production-archives/test
Archive(archive_path=/var/opt/nuodb/production-archives/test, db_name=test, id=0, server_id=server0, state=PROVISIONED)

Note: The create archive command documented here specifies:
- The name of the database for which an archive is required (test).
- The ID of the NuoDB Admin server where the archive is to be stored (server0).
- The location (with archive name appended) of the archive being created (/var/opt/nuodb/production-archive/test).

Note: The create archive command generates an archive ID for the archive created (id=0).

Archive Paths per Installation Type

Depending on how NuoDB has been installed, ensure the archive path is set appropriately.

For a TAR installation

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

For a RPM / DEB installation

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

For a Windows installation

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