> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/sessions/database.md).

# Database sessions

Brokered access to eleven database platforms, through the web console or a native client, with query recording and command control.

## What this is and when to use it

The solution brokers access to databases the same way it brokers access to a server: it holds the credential, opens the session on the user's behalf, records the queries, and applies command control.

Two paths reach the same database:

* the **web console**, where the query interface runs in the browser
* a **native client** — PL/SQL Developer, Oracle SQL Developer, MongoDB Compass, SQL Server Management Studio, and others — connecting through the solution

The second is what makes database access practical for a DBA, who is not going to give up their tooling.

## Before you start

* The database registered as an asset, on the matching platform.
* The credential registered as a managed account.
* For Oracle, the **SID** or **Service Name** configured.

## Supported platforms

| Database       | Note                                                     |
| -------------- | -------------------------------------------------------- |
| **Oracle**     | Requires SID or Service Name                             |
| **MySQL**      |                                                          |
| **MariaDB**    | Its own platform, separate from MySQL                    |
| **PostgreSQL** |                                                          |
| **SQLServer**  | Microsoft SQL Server                                     |
| **MongoDB**    | Document database                                        |
| **Redis**      | Versions before 6                                        |
| **Redis6+**    | Version 6 and later, which have their own users and ACLs |
| **ClickHouse** | Columnar analytical database                             |
| **DB2**        | IBM Db2                                                  |
| **Dameng**     | DM database                                              |

{% hint style="info" %}
**The port is configurable.** The value shown on the Platforms screen is only the product's initial suggestion. The effective port is set in each asset's registration and can be anything, which covers environments that do not use the database's conventional port.
{% endhint %}

{% hint style="warning" %}
Choosing between **Redis** and **Redis6+** matters. From version 6 Redis has per-user authentication; picking the wrong platform prevents login with a named credential.
{% endhint %}

## Notes per database

**MySQL and PostgreSQL** — fully supported, with SQL command recording and the web database interface.

**SQL Server** — supported from version 2012. Integrates with the `GB18030` character set, and handles multi-line queries and HA clusters.

**Oracle** — fully supported. Requires SID or Service Name configured for connection by TNSNames. Suited to long queries and PL/SQL applications. Oracle does not accept insecure connections; when that enforcement is enabled, it needs an adjustment on the Oracle side.

## How to verify it worked

1. Open a session to the database from the console and run a trivial query, `SELECT 1` or its equivalent.
2. Open **Audit › Sessions** and confirm the session is there.
3. Open the session's commands and confirm the query you ran was recorded. If the session appears but the query did not, recording is not capturing that protocol.
4. Repeat from a native client if that is how the team will actually work. The web console succeeding does not prove the native path does.

## Common errors

| Symptom                                                   | Cause                                                 | Fix                                              |
| --------------------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------ |
| Oracle connection fails immediately                       | SID or Service Name not configured                    | Set it in the asset registration                 |
| Oracle refuses the connection when encryption is enforced | Oracle does not accept insecure connections           | Adjust the enforcement on the Oracle side        |
| Redis login with a named user fails                       | The asset is on **Redis** instead of **Redis6+**      | Switch the platform                              |
| The connection is refused although the host is reachable  | The database does not listen on the conventional port | Set the effective port in the asset registration |
| MariaDB behaves unexpectedly under MySQL                  | It was registered on the MySQL platform               | MariaDB has its own platform. Move it            |

## Related pages

* [Platforms](https://wiki.datadike.com/pam/administration/assets/platforms.md)
* [Asset inventory](https://wiki.datadike.com/pam/administration/assets/inventory.md)
* [Connection methods](https://wiki.datadike.com/pam/administration/sessions/connection-methods.md)
* [Session recording](https://wiki.datadike.com/pam/administration/sessions/recording.md)
* [Command inspection](https://wiki.datadike.com/pam/administration/access/command-filtering.md)
