dbt-oracle Adapter

1.10.0 · active · verified Fri Apr 17

dbt-oracle is a dbt (data build tool) adapter that enables dbt to connect to and transform data within Oracle Autonomous Database. It allows users to leverage dbt's powerful data transformation capabilities on their Oracle data warehouses. The library is actively maintained, with frequent patch releases within minor versions following dbt-core's release cadence. The current version is 1.10.0.

Common errors

Warnings

Install

Quickstart

To use dbt-oracle, you configure your Oracle connection details in a `profiles.yml` file, typically located in `~/.dbt/profiles.yml`. This configuration defines how dbt connects to your Oracle database. After setting up the profile, you can initialize a dbt project and run your models using standard dbt CLI commands like `dbt run`.

import os

# Configure dbt profile in profiles.yml (e.g., ~/.dbt/profiles.yml)
# Replace with your actual database details and environment variables
profiles_yml_content = f"""
my_oracle_project:
  target: dev
  outputs:
    dev:
      type: oracle
      user: "{os.environ.get('DBT_ORACLE_USER', 'your_user')}"
      password: "{os.environ.get('DBT_ORACLE_PASSWORD', 'your_password')}"
      host: "{os.environ.get('DBT_ORACLE_HOST', 'localhost')}"
      port: {os.environ.get('DBT_ORACLE_PORT', '1521')}
      sid: "{os.environ.get('DBT_ORACLE_SID', '')}" # or service_name
      service_name: "{os.environ.get('DBT_ORACLE_SERVICE_NAME', 'your_service_name')}"
      schema: "{os.environ.get('DBT_ORACLE_SCHEMA', 'your_schema')}"
      threads: 4
      # Optional: tns_name, wallet_location, connect_string
"""

# Example of how you would set up your dbt project and run it via command line
# This code snippet only shows the profile configuration setup conceptually.
# Actual dbt operations are typically run from the terminal.
print("dbt-oracle profile configuration ready. Next, run dbt commands:")
print("1. Initialize a dbt project: `dbt init <project_name>`")
print("2. Test connection: `dbt debug`")
print("3. Run transformations: `dbt run`")

view raw JSON →