All Products
Search
Document Center

Lindorm:CREATE DATABASE

Last Updated:Mar 28, 2026

Creates a database in a Lindorm instance. Use the WITH clause to set data lifecycle attributes such as time to live (TTL) and cold storage boundaries.

Applicable engines and versions

EngineSupported versions
LindormTable2.2.16 and later
LindormTSDBAll versions
LindormTable versions earlier than 2.2.16 support only CREATE SCHEMA [ IF NOT EXISTS ] schema_identifier. LindormTable 2.2.16 and later versions also support the equivalent syntax CREATE SCHEMA [ IF NOT EXISTS ] schema_identifier. SCHEMA and DATABASE are equivalent. After you create a database, it is identified by the DATABASE keyword.

Syntax

CREATE DATABASE [ IF NOT EXISTS ] database_identifier
  [ WITH ( attribute_definition [, attribute_definition]* ) ]

attribute_definition ::= attr_identifier = attr_val

Supported parameters

ParameterLindormTableLindormTSDB
Database name (database_identifier)SupportedSupported
Database attributes (attribute_definition)Not supportedSupported

Parameters

database_identifier

The database name must meet the following requirements:

  • Length: 4–16 characters

  • Allowed characters: letters, digits, hyphens (-), and underscores (_)

  • Reserved words not allowed as names: lindorm, default, global

attribute_definition

Supported only by LindormTSDB. Use the WITH keyword to set one or more attributes.

AttributeTypeMandatoryDefaultDescription
cold_boundaryBIGINTNo0 (cold storage disabled)Number of days after which data moves to cold storage. To use this attribute, first enable cold storage in the Lindorm console. If set alongside ttl, cold_boundary must be less than ttl.
partition_intervalBIGINTNoSee note belowNumber of days per data partition. Data and indexes within the same interval are stored together.
ttlBIGINTNo0 (data kept indefinitely)Number of days before data is automatically deleted. If set alongside cold_boundary, ttl must be greater than cold_boundary.

Default values for partition_interval by LindormTable version:

LindormTable versionDefault value
3.4.19 and later30
Earlier than 3.4.190

Examples

Create a database

CREATE DATABASE DB1;

Run SHOW DATABASES; to confirm the database was created.

Create a database with data lifecycle attributes

Create a database where data moves to cold storage after 30 days and is deleted after 60 days:

CREATE DATABASE DB1 WITH (cold_boundary=30, ttl=60);

To verify:

  • Run SHOW DATABASES; to confirm the database was created.

  • Run DESCRIBE DATABASE DB1; to confirm the attribute values.