Create a Database

This article explains how to manually create a database in an Exasol deployment.

When you deploy Exasol, a database is automatically created on all the active nodes. In some scenarios you may want to create an additional database for testing or maintenance. You will also have to create a new database if you have deleted the existing database in order to do a deployment reconfiguration.

We recommend that you do not run multiple Exasol databases on the same node on a production system. Since each database instance assumes it has full control over the node resources (storage, CPUs, network), running multiple databases on the same node may result in unpredictable behavior and performance issues.

The combined DB RAM of all databases on a given node must not exceed the recommended maximum DBRAM for a single database.

If multiple databases are using block storage volumes that are backed by the same storage disk and neither database has a volume quota defined, both databases may crash if either of them produces too much temporary data.

Prerequisites

A database with the same name or UUID must not already exist.

Procedure

The following examples use the command-line tool confd_client, which is available on all database nodes. For more information, see ConfD.

Placeholder values are indicated with UPPERCASE characters. Replace the placeholders with your own values.

  1. Connect to EXAClusterOS (COS) on the cluster using c4 connect -t <DEPLOYMENT>[.<NODE>]/cos. For example:

    ./c4 connect -t 1.11/cos

    If you do not specify a node, c4 will connect to the first active node in the deployment.

    For more information about how to use c4 connect, see How to use c4.

  2. To create a database, use the ConfD job db_create.

    The following parameters are required when you manually create a database:

    Parameter name Data type Description
    db_name string A unique name for the new database.
    version string The database version, for example 8.32.0
    data_volume_name string

    The name of the data volume to use for the database. The specified volume must exist.

    For more information about data volumes, see Create Data Volume.

    mem_size string

    The amount of memory (RAM) allocated to the database.

    The value is a string that must consist of an integer and a unit (MiB, GiB, or TiB). For example: 2048 MiB.

    For guidelines on how to determine the amount of RAM to allocate, see Sizing Guidelines.

    nodes list

    A list of active and reserved node IDs for this database. The node IDs are integers.

    num_active_nodes integer

    The number of active nodes in the database.

    This value must match the num_master_nodes value for the specified data volume. It must be equal to or less than the total number of nodes, which also includes reserve nodes.

    For more information about data volumes, see Create Data Volume.

    For more information about reserve nodes, see Add Reserve Nodes.

    Additional parameters may be required depending on your installation environment. For more details, see db_create.

Password hashes

The database will be created with the default password for the SYS user using a hash in the parameter default_sys_passwd_hash. You can change the default authentication by adding a new hash in this parameter. You can also add additional password hashes as a semicolon-separated list in the parameter additional_sys_passwd_hashes to allow authentication as SYS independent of the default SYS password.

To generate password hashes, use the c4 command c4 pwdhash. For example:

c4 pwdhash -i
mysecretpassword
9B37963C9904E08B4516711AAA5840206B3817F9B671C385F00BFC2E

For detailed help about this c4 command, use c4 pwdhash --help.

Example:

The following example creates a new database with 4 active nodes and one reserve node.

confd_client db_create \
    db_name: MY_DEV_DATABASE \
    version: 8.32.0 \
    data_volume_name: DATA_VOLUME_1 \
    mem_size: '2048 MiB' \
    nodes: '[11, 12, 13, 14, 15]' \
    num_active_nodes: 4 \
    default_sys_passwd_hash: '9B37963C9904E08B4516711AAA5840206B3817F9B671C385F00BFC2E'

Verification

To verify that the new database was created, use the ConfD job db_list.

confd_client db_list
- MY_DEV_DATABASE