> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/o/oracle-db-adapter.md).

# Oracle DB Adapter

Oracle Database can hold an asset list in a table or view. OctoXLabs queries a view that you prepare and turns each row into a device. It can also collect installed software from the same view.

## Use cases

* List devices that come from the Oracle view.

```
Adapters = oracle-db-adapter
```

* Find devices not seen for 30 days, when the view has a `LastSeen` column.

```
Adapters = oracle-db-adapter AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination              | Port                | Protocol         |
| ------------------- | ------------------------ | ------------------- | ---------------- |
| OctoXLabs connector | Oracle database listener | 1521 (configurable) | Oracle Net (TCP) |

### Required permissions

| Scope or role | Permission            | Needed for          |
| ------------- | --------------------- | ------------------- |
| Database user | Read, Select and List | The configured view |

## Create credentials in Oracle DB Adapter

{% stepper %}
{% step %}

### Create a database user

Create a user for OctoXLabs on the Oracle database.
{% endstep %}

{% step %}

### Grant read access

Grant it Read, Select and List privileges on the view or tables OctoXLabs queries.
{% endstep %}

{% step %}

### Prepare the view

OctoXLabs needs a view. The column that holds the hostname must be named `Hostname`. Name other columns with OctoXLabs field names to map them automatically.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                | Required                           | Type    | Default | Description                                                                     |
| ------------------------ | ---------------------------------- | ------- | ------- | ------------------------------------------------------------------------------- |
| IP                       | Yes                                | String  |         | IP address of the host.                                                         |
| Port                     | No                                 | Integer | 1521    | Listener port.                                                                  |
| SID or Service Name      | No                                 | String  | protect | SID or service name of the Oracle database.                                     |
| Username                 | Yes                                | String  |         | Database user.                                                                  |
| Password                 | Yes                                | String  |         | Password of the user.                                                           |
| View Name                | Yes                                | String  |         | View to query. Unquoted names and quoted identifiers are accepted.              |
| Use Service Name         | No                                 | Boolean | False   | Connect with a service name instead of a SID.                                   |
| Fetch Installed Software | No                                 | Boolean | False   | Collect installed software per device from the view.                            |
| Device Identifier Field  | Only with Fetch Installed Software | String  |         | Column that matches each software row to its device, for example `SERVER_NAME`. |
| Name Field               | Only with Fetch Installed Software | String  |         | Column with the software name.                                                  |
| Version Field            | No                                 | String  |         | Column with the software version.                                               |
| Date Field               | No                                 | String  |         | Column with the installation date.                                              |

## Troubleshooting

| Error message | Cause | Fix |
| ------------- | ----- | --- |

## Change history
