# Oracle Database

Bobby Tables connects to Oracle Database through Oracle Instant Client, which you install separately, and opens each connection in a SQL workspace with PL/SQL highlighting.

## Where to find it

| Action | How |
| --- | --- |
| Choose Oracle | `New connection`, `⌘N` (`Ctrl+N`), then `Oracle Database` under `Choose a provider` |
| Fill the form from a URL | `Use connection URL` with an `oracle://`, `oracle+tcps://` or `oracle+tns://` URL, then `Fill fields` |
| Set the client folder | `Oracle Client and network`, then `Instant Client directory` |
| Default port | `1521` |

## Instant Client

Install the Oracle Instant Client Basic package for this computer's architecture: Apple Silicon on macOS, x86_64 on Linux. In the form, open `Oracle Client and network` and enter the client folder in `Instant Client directory`, which may stay empty only when the client is already on the operating system library path. The directory applies to the whole app, so restart Bobby Tables before connecting with a different one. When the library cannot be loaded, `Test connection` says Oracle Instant Client could not be loaded and names the platform package it needs.

## Connecting

Choose `Service name`, `SID` or `TNS alias` in `Address with`, then fill `Host`, `Port`, `User`, the matching name and `Password`. A TNS alias hides host and port and reads `tnsnames.ora` from `Network config directory`. `Protocol` offers `TCP` or `TCPS with certificate verification`, which adds `Wallet directory` and `Expected server DN`, and an `SSH tunnel` works with a service name or SID, as described in [SSH and TLS](https://bobbytables.app/docs/ssh-and-tls). `Open in read-only mode` blocks writes before SQL reaches Oracle and disables editing.

## What works

- Browse schemas, tables, views, materialized views, sequences, triggers and routines the user can read in the [table grid](https://bobbytables.app/docs/table-data).
- Stage edits by primary key, or by `ROWID` on a heap table without one, as described in [Editing](https://bobbytables.app/docs/editing).
- Change structure in the [Structure](https://bobbytables.app/docs/structure) tab, where the preview warns that Oracle commits before and after each DDL statement.
- [Snapshots](https://bobbytables.app/docs/snapshots) are not available, so `Create snapshot...` does not appear.
- Draw a [schema diagram](https://bobbytables.app/docs/schema-diagram) from declared foreign keys.
- Format result columns with [result directives](https://bobbytables.app/docs/result-directives).
- Stop a running statement with `Cancel`, `⌘.` (`Ctrl+.`), which calls the client's break operation.
- Run `Explain`, `⌘⇧E` (`Ctrl+Shift+E`), in the [SQL editor](https://bobbytables.app/docs/sql-editor); `Explain Analyze` is unavailable and says so.

## Engine notes

`NUMBER` and `FLOAT` values arrive as exact decimal text, and `RAW` and `BLOB` values show as hex. Oracle treats an empty string as `NULL`, so the grid cannot tell them apart. A `TIMESTAMP WITH TIME ZONE` keeps its offset but not its region name. User and password is the only sign-in method.

## Good to know

- A connection opens one service, so `Switch database` is not available. Create another connection for another service.
- Views, materialized views and index-organized tables stay read-only in the grid.

## Related

- [SSH and TLS](https://bobbytables.app/docs/ssh-and-tls.md)
- [Editing](https://bobbytables.app/docs/editing.md)
- [Connections](https://bobbytables.app/docs/connections.md)
- [Engines, file sources and platforms](https://bobbytables.app/docs/engines.md)
