Creating a Database

To create a database (after first creating an archive), run the create database command:

nuocmd create database --db-name database name --dba-user userame --dba-password password --te-server-ids <server ID>

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

About create database Parameters

This section provides supporting information on parameters used with the create database command.

Mandatory Parameters

The following table describes parameters that must be provided when using the create archive command.

Property

Description

Comments

--db-name

The database name associated with the archive previously created (see Creating an Archive for more information).

When specifying the location, include the full path. For example, $NUODB_HOME/var/opt/production-archives/<db-name>.
--dba-user The database administrator running the command. None.
--dba-password The password for the database administrator running the command. None.

Optional Parameters

The following table describes optional parameters that can also be provided when using the create database command.

Property

Description

Comments

--te-server-ids The Transaction Engine(s) (TE) to be started (on each server ID provided). None.

--server-id

The nuoadmin admin process that is configured on the host machine the archive will exist.

When using the --te-server-ids parameter, this is mandatory (except when using the is-external option).

When starting multiple TEs, separate multiple server IDs using a space character.

--default-options Starts the database with the list of database options provided. Separate options values and options using a space character. For more information about the available database options, see Database Options.
--archive-assignment
<archive ID>
<server ID>
Starts a Storage Manager (M) on the server ID and archive ID specified. None.

Example

nuocmd create database --db-name test --dba-user dba --dba-password goalie --te-server-ids server0

Note: The create database command documented here defines:
- The database name (test).
- The DBA user account name (dba).
- The DBA user account password (goalie).
- The starting of a TE on the host running the server0 admin process.
Note also that the above command starts a Storage Manager on the archive previously created.