chore: import upstream snapshot with attribution
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Oracle"
|
||||
weight: 1
|
||||
---
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: "Prebuilt Configs"
|
||||
type: docs
|
||||
description: "Prebuilt configurations for Oracle."
|
||||
---
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "Oracle"
|
||||
type: docs
|
||||
description: "Details of the Oracle prebuilt configuration."
|
||||
---
|
||||
|
||||
## Oracle
|
||||
|
||||
* `--prebuilt` value: `oracledb`
|
||||
* **Environment Variables:**
|
||||
|
||||
* `ORACLE_CONNECTION_STRING`: The connection string for the Oracle server (e.g., "hostname:port/servicename").
|
||||
* `ORACLE_USERNAME`: The database username.
|
||||
* `ORACLE_PASSWORD`: The password for the database user.
|
||||
* `ORACLE_WALLET`: The path to the Oracle DB Wallet file for databases that support this authentication type.
|
||||
* `ORACLE_USE_OCI`: A boolean flag (`true` or `false`) indicating whether to use the OCI-based driver. Setting to `true` is required for features like Oracle Wallet and requires the Oracle Instant Client libraries to be installed.
|
||||
* **Permissions:**
|
||||
* Database-level permissions (e.g., `SELECT`, `INSERT`) are required to execute queries.
|
||||
* For queries on DBA views like `dba_data_files` and `dba_free_space`, access typically requires elevated database privileges (like `SELECT_CATALOG_ROLE` or direct grants) that a standard user may not have.
|
||||
* **Tools:**
|
||||
* `execute_sql`: Executes a SQL query.
|
||||
* `list_tables`: Lists tables in the database.
|
||||
* `list_active_sessions`: Lists active database sessions.
|
||||
* `get_query_plan`: Generate a full execution plan for a single SQL statement.
|
||||
* `list_top_sql_by_resource`: Lists top SQL statements by resource usage.
|
||||
* `list_tablespace_usage`: Lists tablespace usage.
|
||||
* `list_invalid_objects`: Lists invalid objects.
|
||||
@@ -0,0 +1,170 @@
|
||||
---
|
||||
title: "Oracle Source"
|
||||
linkTitle: "Source"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
Oracle Database is a widely-used relational database management system.
|
||||
no_list: true
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
[Oracle Database][oracle-docs] is a multi-model database management system
|
||||
produced and marketed by Oracle Corporation. It is commonly used for running
|
||||
online transaction processing (OLTP), data warehousing (DW), and mixed (OLTP &
|
||||
DW) database workloads.
|
||||
|
||||
[oracle-docs]: https://www.oracle.com/database/
|
||||
|
||||
|
||||
## Available Tools
|
||||
|
||||
{{< list-tools >}}
|
||||
|
||||
## Requirements
|
||||
|
||||
### Database User
|
||||
|
||||
This source uses standard authentication. You will need to [create an Oracle
|
||||
user][oracle-users] to log in to the database with the necessary permissions.
|
||||
|
||||
[oracle-users]:
|
||||
https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/CREATE-USER.html
|
||||
|
||||
### Oracle Driver Requirement (Conditional)
|
||||
|
||||
The Oracle source offers two connection drivers:
|
||||
|
||||
1. **Pure Go Driver (`useOCI: false`, default):** Uses the `go-ora` library.
|
||||
This driver is simpler and does not require any local Oracle software
|
||||
installation, but it **lacks support for advanced features** like Oracle
|
||||
Wallets or Kerberos authentication.
|
||||
|
||||
2. **OCI-Based Driver (`useOCI: true`):** Uses the `godror` library, which
|
||||
provides access to **advanced Oracle features** like Digital Wallet support.
|
||||
|
||||
If you set `useOCI: true`, you **must** install the **Oracle Instant Client**
|
||||
libraries on the machine where this tool runs.
|
||||
|
||||
You can download the Instant Client from the official Oracle website: [Oracle
|
||||
Instant Client
|
||||
Downloads](https://www.oracle.com/database/technologies/instant-client/downloads.html)
|
||||
|
||||
### Connection Methods
|
||||
|
||||
You can configure the connection to your Oracle database using one of the
|
||||
following three methods. **You should only use one method** in your source
|
||||
configuration.
|
||||
|
||||
#### Basic Connection (Host/Port/Service Name)
|
||||
|
||||
This is the most straightforward method, where you provide the connection
|
||||
details as separate fields:
|
||||
|
||||
- `host`: The IP address or hostname of the database server.
|
||||
- `port`: The port number the Oracle listener is running on (typically 1521).
|
||||
- `serviceName`: The service name for the database instance you wish to connect
|
||||
to.
|
||||
|
||||
#### Connection String
|
||||
|
||||
As an alternative, you can provide all the connection details in a single
|
||||
`connectionString`. This is a convenient way to consolidate the connection
|
||||
information. The typical format is `hostname:port/servicename`.
|
||||
|
||||
#### TNS Alias
|
||||
|
||||
For environments that use a `tnsnames.ora` configuration file, you can connect
|
||||
using a TNS (Transparent Network Substrate) alias.
|
||||
|
||||
- `tnsAlias`: Specify the alias name defined in your `tnsnames.ora` file.
|
||||
- `tnsAdmin` (Optional): If your configuration file is not in a standard
|
||||
location, you can use this field to provide the path to the directory
|
||||
containing it. This setting will override the `TNS_ADMIN` environment
|
||||
variable.
|
||||
|
||||
## Example
|
||||
|
||||
This example demonstrates the four connection methods you could choose from:
|
||||
|
||||
```yaml
|
||||
kind: source
|
||||
name: my-oracle-source
|
||||
type: oracle
|
||||
|
||||
# --- Choose one connection method ---
|
||||
# 1. Host, Port, and Service Name
|
||||
host: 127.0.0.1
|
||||
port: 1521
|
||||
serviceName: XEPDB1
|
||||
|
||||
# 2. Direct Connection String
|
||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||
|
||||
# 3. TNS Alias (requires tnsnames.ora)
|
||||
tnsAlias: "MY_DB_ALIAS"
|
||||
tnsAdmin: "/opt/oracle/network/admin" # Optional: overrides TNS_ADMIN env var
|
||||
|
||||
user: ${USER_NAME}
|
||||
password: ${PASSWORD}
|
||||
|
||||
# Optional: Set to true to use the OCI-based driver for advanced features (Requires Oracle Instant Client)
|
||||
```
|
||||
|
||||
### Using an Oracle Wallet
|
||||
|
||||
Oracle Wallet allows you to store credentails used for database connection. Depending whether you are using an OCI-based driver, the wallet configuration is different.
|
||||
|
||||
#### Pure Go Driver (`useOCI: false`) - Oracle Wallet
|
||||
|
||||
The `go-ora` driver uses the `walletLocation` field to connect to a database secured with an Oracle Wallet without standard username and password.
|
||||
|
||||
```yaml
|
||||
kind: source
|
||||
name: pure-go-wallet
|
||||
type: oracle
|
||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||
user: ${USER_NAME}
|
||||
password: ${PASSWORD}
|
||||
# The TNS Alias is often required to connect to a service registered in tnsnames.ora
|
||||
tnsAlias: "SECURE_DB_ALIAS"
|
||||
walletLocation: "/path/to/my/wallet/directory"
|
||||
```
|
||||
|
||||
#### OCI-Based Driver (`useOCI: true`) - Oracle Wallet
|
||||
|
||||
For the OCI-based driver, wallet authentication is triggered by setting tnsAdmin to the wallet directory and connecting via a tnsAlias.
|
||||
|
||||
```yaml
|
||||
kind: source
|
||||
name: oci-wallet
|
||||
type: oracle
|
||||
connectionString: "127.0.0.1:1521/XEPDB1"
|
||||
user: ${USER_NAME}
|
||||
password: ${PASSWORD}
|
||||
tnsAlias: "WALLET_DB_ALIAS"
|
||||
tnsAdmin: "/opt/oracle/wallet" # Directory containing tnsnames.ora, sqlnet.ora, and wallet files
|
||||
useOCI: true
|
||||
```
|
||||
|
||||
{{< notice tip >}}
|
||||
Use environment variable replacement with the format ${ENV_NAME}
|
||||
instead of hardcoding your secrets into the configuration file.
|
||||
{{< /notice >}}
|
||||
|
||||
## Reference
|
||||
|
||||
| **field** | **type** | **required** | **description** |
|
||||
|------------------|:--------:|:------------:|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| type | string | true | Must be "oracle". |
|
||||
| user | string | true | Name of the Oracle user to connect as (e.g. "my-oracle-user"). |
|
||||
| password | string | true | Password of the Oracle user (e.g. "my-password"). |
|
||||
| host | string | false | IP address or hostname to connect to (e.g. "127.0.0.1"). Required if not using `connectionString` or `tnsAlias`. |
|
||||
| port | integer | false | Port to connect to (e.g. "1521"). Required if not using `connectionString` or `tnsAlias`. |
|
||||
| serviceName | string | false | The Oracle service name of the database to connect to. Required if not using `connectionString` or `tnsAlias`. |
|
||||
| connectionString | string | false | A direct connection string (e.g. "hostname:port/servicename"). Use as an alternative to `host`, `port`, and `serviceName`. |
|
||||
| tnsAlias | string | false | A TNS alias from a `tnsnames.ora` file. Use as an alternative to `host`/`port` or `connectionString`. |
|
||||
| tnsAdmin | string | false | Path to the directory containing the `tnsnames.ora` file. This overrides the `TNS_ADMIN` environment variable if it is set. |
|
||||
| useOCI | bool | false | If true, uses the OCI-based driver (godror) which supports Oracle Wallet/Kerberos but requires the Oracle Instant Client libraries to be installed. Defaults to false (pure Go driver). |
|
||||
| walletLocation | string | false | Path to the directory containing the wallet files for the pure Go driver (`useOCI: false`). |
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Tools"
|
||||
weight: 2
|
||||
---
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "oracle-execute-sql"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
An "oracle-execute-sql" tool executes a SQL statement against an Oracle database.
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
An `oracle-execute-sql` tool executes a SQL statement against an Oracle
|
||||
database.
|
||||
|
||||
`oracle-execute-sql` takes one input parameter `sql` and runs the sql
|
||||
statement against the `source`.
|
||||
|
||||
> **Note:** This tool is intended for developer assistant workflows with
|
||||
> human-in-the-loop and shouldn't be used for production agents.
|
||||
|
||||
## Compatible Sources
|
||||
|
||||
{{< compatible-sources >}}
|
||||
|
||||
## Example
|
||||
|
||||
```yaml
|
||||
kind: tool
|
||||
name: execute_sql_tool
|
||||
type: oracle-execute-sql
|
||||
source: my-oracle-instance
|
||||
description: Use this tool to execute sql statement.
|
||||
```
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "list_tables"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
Lists all tables in the current user's schema
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
An `oracle-sql` tool executes a pre-defined SQL statement against an
|
||||
Oracle database.
|
||||
|
||||
The specified SQL statement is executed using [prepared statements][oracle-stmt]
|
||||
for security and performance. It expects parameter placeholders in the SQL query
|
||||
to be in the native Oracle format (e.g., `:1`, `:2`).
|
||||
|
||||
By default, tools are configured as **read-only** (SAFE mode). To execute data modification
|
||||
statements (INSERT, UPDATE, DELETE), you must explicitly set the `readOnly`
|
||||
field to `false`.
|
||||
|
||||
[oracle-stmt]: https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html
|
||||
|
||||
## Compatible Sources
|
||||
|
||||
{{< compatible-sources >}}
|
||||
|
||||
## Example
|
||||
|
||||
> **Note:** This tool uses parameterized queries to prevent SQL injections.
|
||||
> Query parameters can be used as substitutes for arbitrary expressions.
|
||||
> Parameters cannot be used as substitutes for identifiers, column names, table
|
||||
> names, or other parts of the query.
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
list_tables:
|
||||
kind: oracle-sql
|
||||
source: my-oracle-instance
|
||||
statement: |
|
||||
SELECT table_name from user_tables;
|
||||
description: |
|
||||
Lists all table names in the current user's schema.
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
title: "oracle-sql"
|
||||
type: docs
|
||||
weight: 1
|
||||
description: >
|
||||
An "oracle-sql" tool executes a pre-defined SQL statement against an Oracle database.
|
||||
---
|
||||
|
||||
## About
|
||||
|
||||
An `oracle-sql` tool executes a pre-defined SQL statement against an
|
||||
Oracle database.
|
||||
|
||||
The specified SQL statement is executed using [prepared statements][oracle-stmt]
|
||||
for security and performance. It expects parameter placeholders in the SQL query
|
||||
to be in the native Oracle format (e.g., `:1`, `:2`).
|
||||
|
||||
By default, tools are configured as **read-only** (SAFE mode). To execute data modification
|
||||
statements (INSERT, UPDATE, DELETE), you must explicitly set the `readOnly`
|
||||
field to `false`.
|
||||
|
||||
[oracle-stmt]: https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html
|
||||
|
||||
## Compatible Sources
|
||||
|
||||
{{< compatible-sources >}}
|
||||
|
||||
## Example
|
||||
|
||||
> **Note:** This tool uses parameterized queries to prevent SQL injections.
|
||||
> Query parameters can be used as substitutes for arbitrary expressions.
|
||||
> Parameters cannot be used as substitutes for identifiers, column names, table
|
||||
> names, or other parts of the query.
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
search_flights_by_number:
|
||||
kind: oracle-sql
|
||||
source: my-oracle-instance
|
||||
statement: |
|
||||
SELECT * FROM flights
|
||||
WHERE airline = :1
|
||||
AND flight_number = :2
|
||||
FETCH FIRST 10 ROWS ONLY
|
||||
description: |
|
||||
Use this tool to get information for a specific flight.
|
||||
Takes an airline code and flight number and returns info on the flight.
|
||||
Do NOT use this tool with a flight id. Do NOT guess an airline code or flight number.
|
||||
Example:
|
||||
{{
|
||||
"airline": "CY",
|
||||
"flight_number": "888",
|
||||
}}
|
||||
parameters:
|
||||
- name: airline
|
||||
type: string
|
||||
description: Airline unique 2 letter identifier
|
||||
- name: flight_number
|
||||
type: string
|
||||
description: 1 to 4 digit number
|
||||
|
||||
update_flight_status:
|
||||
kind: oracle-sql
|
||||
source: my-oracle-instance
|
||||
readOnly: false # Required for INSERT/UPDATE/DELETE
|
||||
statement: |
|
||||
UPDATE flights
|
||||
SET status = :1
|
||||
WHERE airline = :2 AND flight_number = :3
|
||||
description: Updates the status of a specific flight.
|
||||
parameters:
|
||||
- name: status
|
||||
type: string
|
||||
- name: airline
|
||||
type: string
|
||||
- name: flight_number
|
||||
type: string
|
||||
|
||||
Reference in New Issue
Block a user