oracle icon
Download icon
CsvToIon icon
Query icon
Batch icon
Assert icon
Log icon
SlackIncomingWebhook icon

Extract a CSV from HTTP and bulk load it into Oracle

Extract a CSV over HTTP and bulk load it into an Oracle staging table with Kestra. Truncate-and-reload with named-column JDBC batches, then assert the row count.

Categories
Data

Load CSV data into Oracle Database on a reliable, re-run-safe schedule. This blueprint extracts a CSV over HTTP, bulk inserts it into an Oracle staging table with named-column JDBC batches, and asserts the row count before declaring success, giving you a verified Oracle ETL pipeline for orders, reference data, or any flat-file feed without hand-written load scripts.

How it works

  1. download_csv (io.kestra.plugin.core.http.Download) pulls the source CSV from the HTTP(S) endpoint in inputs.source_url into Kestra internal storage, with a constant retry on transient network failures.
  2. csv_to_ion (io.kestra.plugin.serdes.csv.CsvToIon) converts the CSV into the ION format the Oracle Batch task consumes.
  3. create_table (io.kestra.plugin.jdbc.oracle.Query) runs idempotent DDL to create the staging table, swallowing ORA-00955 (name already used) so re-runs are safe.
  4. truncate_staging (io.kestra.plugin.jdbc.oracle.Query) truncates the table so a re-run or backfill reloads cleanly instead of doubling rows.
  5. bulk_insert (io.kestra.plugin.jdbc.oracle.Batch) inserts the rows using prepared-statement batches with chunk: 1000 and explicit named columns.
  6. verify_load (io.kestra.plugin.jdbc.oracle.Query with fetchType: FETCH_ONE) reads the row count back, and assert_load (io.kestra.plugin.core.execution.Assert) fails the run if zero rows landed or the count does not match the inserted count.
  7. log_summary (io.kestra.plugin.core.log.Log) surfaces rows read versus rows inserted so a silently dropped row is obvious.

What you get

  • A verified extract-load pipeline: the load fails loudly instead of reporting false success.
  • Idempotent re-runs: truncate-and-reload always leaves exactly the current CSV in the table.
  • Safe concurrency: concurrency.limit is 1, so two runs never interleave against the same table.
  • Slack alerting on any failure via the flow-level errors block.

Who it's for

  • Data engineers loading flat files or extracts into Oracle staging tables.
  • Teams migrating brittle PL/SQL or shell-based load jobs to declarative, observable workflows.
  • Analytics and platform teams that need a verified, repeatable Oracle ingestion step.

Why orchestrate this with Kestra

Oracle has no built-in scheduler for pulling a remote file, validating the load, and alerting on failure. Kestra adds event and schedule triggers, per-task retries, an Assert gate that turns a bad load into a failed execution, full run lineage and logs, and Slack alerting, all in declarative YAML. The truncate-first design plus concurrency.limit makes every run reproducible in a way a cron-driven SQL script cannot guarantee.

Prerequisites

  • A reachable Oracle Database instance. The JDBC URL uses the thin driver service form: jdbc:oracle:thin:@//host:1521/service.
  • A database user with CREATE TABLE, TRUNCATE, and INSERT privileges on the target schema.

Secrets

  • ORACLE_USERNAME: the Oracle user used for the DDL, truncate, bulk insert, and verification query.
  • ORACLE_PASSWORD: the password for that Oracle user.
  • SLACK_WEBHOOK: the Slack Incoming Webhook URL the failure alert is posted to.

Quick start

  1. Create the ORACLE_USERNAME, ORACLE_PASSWORD, and SLACK_WEBHOOK secrets.
  2. Update the oracle_url variable to point at your instance and service name.
  3. Optionally change the source_url input or add a table name to the target_table allow-list (keep the column list in the DDL, columns, and INSERT aligned with your CSV).
  4. Execute the flow.

Note on the table name: target_table is a SELECT input restricted to an allow-list, not free-text. Oracle cannot bind a table identifier as a parameter, so the name is concatenated into the DDL, TRUNCATE, and INSERT. Keeping it an enum makes that concatenation safe, so only operator-trusted names should be added to the values list.

How to extend

  • Add a Schedule trigger to run the load nightly, or an event trigger to fire when a new file arrives.
  • Point source_url at S3, GCS, or an SFTP-fronted endpoint, or swap Download for a storage-specific task.
  • Promote the staging rows into curated tables with an additional Query task, or branch into dbt.
  • Widen the target_table allow-list and column mapping to cover more feeds.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.