# Oracle

A robust and widely used enterprise relational database management system with comprehensive SQL features, high availability options, and scalability for large-scale data operations.

## Supported Connection Methods

Available methods for connections to the target system from Lumi AI:

* [x] **Direct**&#x20;

  *The default / typical connection option. Interfaces directly with the target system over the Internet with no mediation. Suitable for most cloud-hosted scenarios or public-facing resources. See* [*Network Configuration*](https://docs.lumi-ai.com/using-lumi/network-configuration) *for more details.*
* [x] **Gateway**\
  \&#xNAN;*An alternative connection method leveraging a Lumi AI Data Gateway. This uses Lumi AI's purpose-built connection agent to mediate communications. Ideal for restricting access to systems within a protected network. For more information, see* [*Data Gateway*](https://docs.lumi-ai.com/product-features/data-gateway)*.*&#x20;

## Supported Limits

The following are limits that can be configured for the system to moderate access and usage from users in Lumi AI:

* [x] **Cost Limit**\
  \&#xNAN;*Before running a query, if the system supports it, the system-specific compute cost (or surrogate) estimate will be processed and compared to an organization-level/admin-set cost limit for systems of this type (if configured/set). If exceeded, the query will not run (and either the workflow will attempt an optimization or the user will be notified).*
* [ ] **Duration Limit**\
  \&#xNAN;*An alternative to cost, queries will be stopped the system supports a duration/timeout limit and one is set/configured at the organization level (across systems).*

## Available Parameters

These properties are the essential source system connection properties that all queries are directed towards.

*\* Required parameters*

{% hint style="info" %}
Note: The Gateway parameter is common to all systems (when supported) and is only available when gateway is the selected connection method.
{% endhint %}

<details>

<summary>Host*</summary>

Domain or IP of the database to allow a connection to Lumi AI.

:thumbsup: **Valid Examples**

* Domain name: *docs.lumi-ai.com*
* IPv4: *55.88.92.101*

:thumbsdown: **Invalid Examples**

* IPv4 with alphanumeric characters: *123.abc.def.456*
* Incomplete domain name resolutions: *lumi-ai.com*

</details>

<details>

<summary>Port*</summary>

Access port to allow for connections to the database.

:thumbsup: **Valid Examples**

* Default PostgreSQL port: *5432*

:thumbsdown: **Invalid Examples**

* Known Port Numbers (0-1023): *80*

</details>

<details>

<summary>Username*</summary>

Username of the generated database user which will be used for interactions and transactions.

**Special Considerations**

* If double quotes are used, then the name will be case sensitive

:thumbsup: **Valid Examples**

* Uses alphanumeric characters : *lumi1*
* Utilizing underscore (\_) in place of spaces: *user\_number*

:thumbsdown: **Invalid Examples**

* Starting with a number: *1lumi*
* Utilizing spaces: *user name*
* Using invalid characters: *user#1*

</details>

<details>

<summary>Password*</summary>

Password of the generated database user which will be used for interactions and transactions.

</details>

<details>

<summary>SID</summary>

System Identifier, most applicable to older systems.

**Special Considerations**

* Either SID or Service Name must be provided.

</details>

<details>

<summary><strong>Service Name</strong></summary>

Standard identifier in modern Oracle systems.

**Special Considerations**

* Either SID or Service Name must be provided.

</details>

## System Permissions & Configuration

The provided Oracle user account should have sufficient privileges to execute queries and retrieve data:

1. **CREATE SESSION** (or equivalent “connect” privilege in newer Oracle versions).\
   Allows the user to log in to Oracle.
2. **SELECT** privileges on the required schema(s) and table(s).
   * If needed, ensure the user has permission on the specific columns.
3. **Resource/Role Configurations** (Optional/As needed).
   * Depending on your use case, you might need privileges beyond just SELECT (e.g., CREATE TABLE, etc.).
   * Make sure any relevant roles (e.g., RESOURCE, CONNECT) are assigned.
4. **Network Access**
   * Ensure the Oracle listener and any firewall settings allow connections from the Lumi AI environment (direct) or from the Lumi AI Gateway agent (gateway method).

## Special Considerations

* **Case Sensitivity & Quoted Identifiers**\
  By default, Oracle stores object names in uppercase unless quoted. If you rely on specific case or special characters in table/column names, enclose them in double quotes (e.g., `"MyTable"`). However, mixing unquoted and quoted identifiers can lead to confusion, so a consistent naming convention is recommended.
* **TNS Names & Connection Strings**\
  In many environments, connections rely on TNS names. Ensure the TNS configuration on your server (and in any gateway environment) is correct if using TNS-based connections.
* **Character Sets**\
  Oracle supports various character sets. If you require specific encodings, ensure both Oracle and Lumi AI are configured to handle them properly (e.g., UTF-8).

## Common Issues

* **Firewall or Listener Restrictions**
  * Make sure port 1521 (or your chosen Oracle listener port) is open for inbound/outbound connections if using the *Direct* method.
  * If using *Gateway*, ensure the Lumi AI Data Gateway has network access to the Oracle instance.
* **Invalid Credentials or Insufficient Privileges**
  * Confirm the user has the **CREATE SESSION** privilege and the necessary **SELECT** privileges on target schemas/tables.
* **Service Name vs. SID Confusion**
  * Some configurations require the SID, others the Service Name. Using the wrong one can lead to authentication failures or “Database not found” errors.
* **TNS Configuration**
  * If TNS entries are misconfigured or missing, the connection may fail with “ORA-12154: TNS: could not resolve...” or similar errors.
* **Case-Sensitive Identifiers**
  * Queries can fail if table or column names are incorrectly cased or unquoted/quoted inconsistently.
