---
title: Databases
slug: UY5c-databases
description: Learn about the SQL syntaxes for managing databases in Ocient for efficient data organization.
docTags: 
createdAt: Mon Aug 11 2025 18:02:19 GMT+0000 (Coordinated Universal Time)
updatedAt: Mon Mar 30 2026 18:52:28 GMT+0000 (Coordinated Universal Time)
---

This group of DDL SQL statements allows database administrators to manage databases. Database administrators can create and modify databases, including SSO authentication settings. You can view information about databases using the `sys.databases` system catalog table.&#x20;

For information on database components, see the pages on [Schemas](./Schemas.md), [Tables](./Tables.md), [Views](./Views.md), and [Indexes](./Indexes.md).

# CREATE DATABASE

`CREATE DATABASE` creates a new database. The database name must be distinct from the name of any existing database in the system.

To create a database, you must have the `CREATE DATABASE` privilege for the current system.

**Syntax**

```sql
CREATE DATABASE [ IF NOT EXISTS ] database_name
```

| **Parameter**   | **Type** | **Description**                                                                                                                                                                        |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `database_name` | string   | A unique identifier for the database. The system generates an error if you specify a duplicate name.<br />`system` is a reserved database name and can neither be created nor dropped. |

**Example**

Create a new database named `ocient`.

```sql
CREATE DATABASE ocient;
```

# DROP DATABASE

`DROP DATABASE` removes an existing database. This SQL statement also disconnects all users currently connected to the database.

To remove a database, you must have the `DROP DATABASE` privilege for the current database.

You cannot drop a database while it has any `PIPELINE` in a running status.

:::hint{type="warning"}
The `DROP DATABASE` SQL statement removes the existing database and all created users, tables, and views.

This action cannot be undone.&#x20;
:::

**Syntax**

```sql
DROP DATABASE [ IF EXISTS ] database_name [, ...]
```

| **Parameter**   | **Type** | **Description**                                                                                                                                                                                                                                |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `database_name` | string   | An identifier for the database to be dropped.<br />You can drop multiple databases by specifying additional database names and separating each with commas. <br />`system` is a reserved database name and can neither be created nor dropped. |

**Example**

Remove an existing database named `ocient`.

```sql
DROP DATABASE ocient;
```

# ALTER DATABASE

## ALTER DATABASE RENAME

`ALTER DATABASE RENAME` renames an existing database.

To rename a database, you must have the `ALTER DATABASE` privilege for the database.

**Syntax**

```sql
ALTER DATABASE old_database_name RENAME TO new_database_name
```

| **Parameter**       | **Type** | **Description**                                     |
| ------------------- | -------- | --------------------------------------------------- |
| `old_database_name` | string   | The old identifier of the database for the rename.  |
| `new_database_name` | string   | The new identifier of the database for the rename.  |

**Example**

Rename an existing database named `oracle` to `ocient`.

```sql
ALTER DATABASE oracle RENAME TO ocient;
```

## ALTER DATABASE SET SSO INTEGRATION

`ALTER DATABASE SET SSO INTEGRATION` configures the database to authenticate using an external SSO provider. This SSO integration is the default for connections unless you use a connectivity pool or specify a different provider.&#x20;

To set a connection, you must be a system-level user or a database administrator and have an open connection to the database.

This SQL statement is an alias for [ALTER DATABASE ALTER SSO INTEGRATION](./#alter-database-alter-sso-integration).

See [Configuring the Ocient Database](<./././Database Administration/Authentication Methods.md>) for details about configuring SSO protocols.

:::hint{type="info"}
If your Ocient® System is version 25.0 or later, you can create multiple SSO integrations for each database. An SSO integration assigned to the database by the `ALTER DATABASE` SQL statement is the primary SSO connection, unless you connect to the database with a connectivity pool that has a different SSO integration assigned to it.
:::

**Syntax**

```sql
ALTER DATABASE database
    ALTER SSO INTEGRATION sso_name
```

| **Parameter** | **Type** | **Description**                                   |
| ------------- | -------- | ------------------------------------------------- |
| `database`    | string   | The identifier of the database for configuration. |
| `sso_name`    | string   | The identifier of the SSO integration to use.     |

**Example**

This example sets an example database to use the SSO integration named `sso_test`.

```sql
ALTER DATABASE example_database
    SET SSO INTEGRATION sso_test; 
```

## ALTER DATABASE ALTER SSO INTEGRATION

`ALTER DATABASE ALTER SSO CONNECTION` configures the database to authenticate using an external SSO provider. This SSO integration is the default for connections unless you use a connectivity pool or specify a different provider.&#x20;

To alter a connection, you must be a system-level user or a database administrator and have an open connection to the database.

This SQL statement is an alias for [ALTER DATABASE SET SSO INTEGRATION](./#alter-database-set-sso-integration).

See [Configuring the Ocient Database](<./././Database Administration/Authentication Methods.md>) for details about configuring SSO protocols.

:::hint{type="info"}
If your Ocient System is version 25.0 or later, you can create multiple SSO integrations for each database. An SSO integration assigned to the database by the `ALTER DATABASE` SQL statement is the primary SSO connection, unless you connect to the database with a connectivity pool that has a different SSO integration assigned to it.
:::

**Syntax**

```sql
ALTER DATABASE database
    ALTER SSO INTEGRATION sso_name
```

| **Parameter** | **Type** | **Description**                                    |
| ------------- | -------- | -------------------------------------------------- |
| `database`    | string   | The identifier of the database for configuration.  |
| `sso_name`    | string   | The identifier of the SSO integration to use.      |

**Example**

This example alters an example database to use the SSO integration named `sso_test`.

```sql
ALTER DATABASE example_database
    ALTER SSO INTEGRATION sso_test; 
```

## ALTER DATABASE REMOVE SSO INTEGRATION

`ALTER DATABASE REMOVE SSO INTEGRATION` removes an existing SSO integration as the default connection protocol for the database. This action effectively undoes the  [ALTER DATABASE ALTER SSO INTEGRATION](./#alter-database-alter-sso-integration) SQL statement.&#x20;

To remove a connection, you must be a system-level user or a database administrator.

**Syntax**

```sql
ALTER DATABASE database REMOVE SSO INTEGRATION
```

| **Parameter** | **Type** | **Description**                               |
| ------------- | -------- | --------------------------------------------- |
| `database`    | string   | The identifier of the database for deletion.  |

**Example**

Remove the default connection from the database named `example_database`.

```sql
ALTER DATABASE example_database REMOVE SSO INTEGRATION;
```

## ALTER DATABASE ALTER SECURITY

Sets the security settings at the database level using the `ALTER DATABASE ALTER SECURITY` SQL statement. Replace `<security_setting>` with the security setting and `<value>` with the value.

**Syntax**

```sql
ALTER DATABASE database ALTER SECURITY <security_setting> [=] <value>
```

| **Parameter**      | **Data** **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `database`         | string            | The identifier of the database for setting security settings.                                                                                                                                                                                                                                                                                                              |
| `security_setting` | string            | The security setting with values:<br />* `password_minimum_length`
* `password_complexity_level`
* `password_no_repeat_count`
* `password_lifetime_days`
* `password_invalid_attempt_limit`<br />For details about these values, see [Database Password Security Settings](<./././Database Administration/Authentication Methods/Database Password Security Settings.md>). |
| `value`            | numeric           | An integer to represent one of the security settings. For details about this value, see [Database Password Security Settings](<./././Database Administration/Authentication Methods/Database Password Security Settings.md>).                                                                                                                                              |

**Example**

Set the password lifetime to 20 days for the database `example_db`.

```sql
ALTER DATABASE example_db 
    ALTER SECURITY password_lifetime_days = 20;
```

# Related Links

[Core Elements of an Ocient System](<./././Ocient Architecture/Core Elements of an Ocient System.md>)&#x20;

[General SQL Syntax](<./././Query Ocient/General SQL Syntax.md>)

[Database Password Security Settings](<./././Database Administration/Authentication Methods/Database Password Security Settings.md>)

[System Catalog](https://docs.ocient.com/system-catalog)

