Example: Oracle DB v11
Overview
This guide walks through setting up a custom connector for Oracle Database 11g using a pre-built example implementation.
Oracle 11g requires special handling compared to later Oracle versions — the oracledb Python driver must run in thick mode (thin mode only supports Oracle 12.1+), and identifiers are limited to 30 bytes. This example connector handles these constraints and provides a full-mode connector — Monte Carlo connects directly to Oracle to collect metadata, query logs, and run monitors.
This implementation is available as a reference in the mcd-public-resources repository. You can use it as-is or as a starting point for your own customizations.
Feature support
| Category | Capability | Support |
|---|---|---|
| Table Monitor | Freshness | ✅ (via opt-in row count) |
| Table Monitor | Volume | ✅ |
| Table Monitor | Schema Changes | ✅ |
| Metric Monitor | Metric | ✅ |
| Metric Monitor | Comparison | ✅ |
| Validation Monitor | Custom SQL | ✅ |
| Validation Monitor | Validation | ✅ |
| Lineage | Query log collection | ✅ |
Prerequisites
- A running custom-connector-setup repository — see Custom Connectors for initial setup.
- An Oracle 11g instance with a user that has read access to the schemas and tables you want to monitor.
- The Oracle user must have
SELECTprivileges onV$SQLfor query log collection. - Network connectivity between your build/deployment environment and the Oracle instance.
Setup
1. Scaffold the connector
Use the create_connector script to scaffold the connector directory. This generates a unique identifier for your connector in manifest.json — this ID is how Monte Carlo distinguishes connector types, so it must be generated per-installation.
python scripts/create_connector.py oracle_db_v112. Replace with the example implementation
Clone or download the example from mcd-public-resources and replace the stub files with the pre-built implementation:
cp <path-to-mcd-public-resources>/custom_connectors/oracle_db_v11/connector.py connectors/oracle_db_v11/
cp <path-to-mcd-public-resources>/custom_connectors/oracle_db_v11/Dockerfile.extra connectors/oracle_db_v11/Add the database driver to connectors/oracle_db_v11/requirements.txt:
oracledb==2.5.1The Dockerfile.extra installs Oracle Instant Client 19 (required for thick mode). It handles architecture detection for both arm64 and x64 environments. After copying, regenerate the test Dockerfile:
python scripts/generate_test_dockerfile.py3. Configure credentials
Create connectors/oracle_db_v11/credentials.json using the example as a reference:
{
"connect_args": {
"host": "your-oracle-host.example.com",
"port": 1521,
"service_name": "XE",
"user": "monte_carlo",
"password": "<your-password>"
}
}| Field | Description | Default |
|---|---|---|
| host | Oracle hostname or IP | |
| port | Oracle listener port | 1521 |
| service_name | Oracle service name | |
| user | Database user with read access | |
| password | Password for the database user |
4. Build and run the test suite
Build the test Docker image, then run each test section to validate the connector against your database:
docker compose build
# Verify connection
CONNECTOR=oracle_db_v11 docker compose run --rm test -m connection
# Metadata templates
CONNECTOR=oracle_db_v11 docker compose run --rm test -m metadata
# Custom SQL monitors
CONNECTOR=oracle_db_v11 docker compose run --rm test -m custom_monitors
# Query language prerequisites
CONNECTOR=oracle_db_v11 docker compose run --rm test -m ql_prerequisites
# Metric templates
CONNECTOR=oracle_db_v11 docker compose run --rm test -m ql_metrics5. Export and build the agent image
Once all tests pass, export capabilities and build the deployable image:
# Export capabilities and passing templates
CONNECTOR=oracle_db_v11 docker compose run --rm test --export
# Build the agent image
python scripts/generate_agent_image.py --connector oracle_db_v116. Deploy, register, and connect
From here, follow the standard custom connector workflow:
- Push the image to your container registry and deploy the agent.
- Register the connector by running agent validations in the Monte Carlo UI.
- Add the connection through the UI or API, providing your production Oracle credentials.
- Validate with monitors by creating test monitors once your tables appear in the catalog.
Oracle 11g-specific notes
This connector includes workarounds for Oracle 11g limitations that are worth understanding if you plan to customize it:
FROM DUALinjection — Oracle requires aFROMclause on allSELECTstatements. The connector automatically appendsFROM DUALto bareSELECTexpressions generated by Monte Carlo.- 30-byte identifier limit — Oracle 11g limits identifiers to 30 bytes. The connector automatically shortens long double-quoted identifiers (e.g., metric aliases) and maps them back to the original names in the result set.
- NLS session configuration — The connector sets
NLS_DATE_FORMAT,NLS_TIMESTAMP_FORMAT, andNLS_TIMESTAMP_TZ_FORMATat session initialization to ensure consistent date handling.
Updated about 2 hours ago
