Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/ingest/etl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ Use visual data flow and integration frameworks and platforms.
MySQL and MariaDB are well-known free and open-source relational database management
systems (RDBMS), available as standalone and managed variants.

- {ref}`oracle`

Oracle Database (Oracle DBMS, or simply as Oracle) is a proprietary multi-model
database management system produced and marketed by Oracle Corporation.

- {ref}`postgresql`

PostgreSQL is the world's most advanced open source relational database.
Expand Down Expand Up @@ -241,6 +246,7 @@ Load data from datasets and open table formats.
- {ref}`n8n`
- {ref}`nifi`
- {ref}`node-red`
- {ref}`oracle`
- {ref}`postgresql`
- {ref}`risingwave`
- {ref}`sql-server`
Expand Down
1 change: 1 addition & 0 deletions docs/integrate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ mysql/index
n8n/index
nifi/index
node-red/index
oracle/index
plotly/index
postgresql/index
Power BI <powerbi/index>
Expand Down
49 changes: 49 additions & 0 deletions docs/integrate/oracle/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
(oracle)=
# Oracle

```{div} .float-right
[![oracle-logo](https://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Oracle_logo.svg/500px-Oracle_logo.svg.png){height=60px loading=lazy}][Oracle Database]
```
```{div} .clearfix
```

:::{rubric} About
:::

[Oracle Database] (Oracle DBMS, or simply Oracle) is a proprietary 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.

:::{rubric} Synopsis
:::

```shell
uvx 'cratedb-toolkit[io-ingestr]' load table \
"oracle://sys:secret@localhost:1521/?service_name=freepdb1&table=sys.demo&mode=sysdba" \
--cluster-url="crate://crate:crate@localhost:4200/doc/oracle_demo"
```

:::{rubric} Learn
:::

::::{grid}

:::{grid-item-card} Tutorial: Use CrateDB Toolkit
:link: oracle-tutorial
:link-type: ref
Load data from Oracle Database into CrateDB using CrateDB Toolkit.
:::

::::


:::{toctree}
:maxdepth: 1
:hidden:
Tutorial <tutorial>
:::


[Oracle Database]: https://www.oracle.com/database/
95 changes: 95 additions & 0 deletions docs/integrate/oracle/tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
(oracle-tutorial)=
# Load data from Oracle into CrateDB

The tutorial will walk you through starting the [Oracle Database] and CrateDB,
inserting a record into Oracle, loading data into a CrateDB table,
and validating that the data has been stored successfully.
The data transfer is supported by the
{ref}`CrateDB Toolkit Ingestr I/O <ctk:ingestr>` data pipeline elements.

## Prerequisites

Docker is used for running all components. This approach works consistently
across Linux, macOS, and Windows. Alternatively, you can use Podman.

Create a shared network.
```shell
docker network create cratedb-demo
```

Start CrateDB.
```shell
docker run --rm --name=cratedb --network=cratedb-demo \
--publish=4200:4200 --publish=5432:5432 \
docker.io/crate -Cdiscovery.type=single-node
```

Start Oracle DBMS.
```shell
docker run --rm --name=oracle --network=cratedb-demo \
--publish=1521:1521 \
--env=ORACLE_PASSWORD=secret \
docker.io/gvenzl/oracle-free:23-slim
```

Prepare shortcuts for the CrateDB shell, CrateDB Toolkit, and the Oracle client
programs.

::::{tab-set}

:::{tab-item} Linux and macOS
To make the settings persistent, add them to your shell profile (`~/.profile`).
```shell
alias crash="docker run --rm -it --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest crash"
alias ctk-ingest="docker run --rm -i --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest ctk"
alias sqlplus="docker run --rm -it --network=cratedb-demo --volume=$(PWD):/demo --env=ORACLE_PASSWORD=secret --entrypoint=sqlplus docker.io/gvenzl/oracle-free:23-slim"
```
:::
:::{tab-item} Windows PowerShell
To make the settings persistent, add them to your PowerShell profile (`$PROFILE`).
```powershell
function crash { docker run --rm -it --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest crash @args }
function ctk-ingest { docker run --rm -i --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest ctk @args }
function sqlplus { docker run --rm -it --network=cratedb-demo --volume=${PWD}:/demo --env=ORACLE_PASSWORD=secret --entrypoint=sqlplus docker.io/gvenzl/oracle-free:23-slim @args }
```
:::
:::{tab-item} Windows Command
```shell
doskey crash=docker run --rm -it --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest crash $*
doskey ctk-ingest=docker run --rm -i --network=cratedb-demo ghcr.io/crate/cratedb-toolkit-ingest ctk $*
doskey sqlplus=docker run --rm -it --network=cratedb-demo --volume=%cd%:/demo --env=ORACLE_PASSWORD=secret --entrypoint=sqlplus docker.io/gvenzl/oracle-free:23-slim $*
```
:::

::::

## Usage

Write a few sample records to Oracle.
```shell
cat >init.sql <<SQL
CREATE TABLE IF NOT EXISTS demo (id NUMBER, temperature FLOAT, humidity FLOAT);
INSERT INTO demo (id, temperature, humidity) VALUES (1, 42.84, 83.1);
INSERT INTO demo (id, temperature, humidity) VALUES (2, 84.84, 56.99);
SELECT * FROM demo;
exit;
SQL
```
```shell
sqlplus sys/secret@oracle/freepdb1 as sysdba @/demo/init.sql
```

Invoke the data transfer pipeline.
```shell
ctk-ingest load table \
"oracle://sys:secret@oracle:1521/?service_name=freepdb1&table=sys.demo&mode=sysdba" \
--cluster-url="crate://crate:crate@cratedb:4200/doc/oracle_demo"
```

Inspect data stored in CrateDB.
```shell
crash --hosts cratedb -c "SELECT * FROM doc.oracle_demo"
```


[Oracle Database]: https://www.oracle.com/database/