This article describes how to create a tenant database in HANA DB. To create a tenant database, first login to SystemDB using the SYSTEM user either by using hdbsql or HANA Studio. Execute the following SQL statement to create the database DB1.
1CREATE DATABASE DB1 SYSTEM USER PASSWORD "your password"
The above create statement will create a new database using the SYSTEM user. Once the database has been created, you can verify its status by executing the following SQL.
1SELECT * FROM SYS.M_DATABASES
Take note of the ACTIVE_STATUS field, if the value for this field is NO, it means the database is not running and must be started. To the start the database, execute the following SQL statement.
1ALTER SYSTEM START DATABASE DB1
You can now connect to the database using hdbsql or HANA Studio. For hdbsql, use the following command parameters.
hdbsql=> \c -n hostname:39013 -u SYSTEM -p password -d DB1 In HANA Studio, you will need to add a New System, select the Multiple containers mode and specify the tenant database name.