Tip
If you already have an Oracle Database instance running, skip the steps to set up and clean up Oracle Database.
-
Start a Oracle Database instance:
docker run -d --rm --name oracle-db -p 1521:1521 -e ORACLE_PWD=password container-registry.oracle.com/database/free:latest
-
Wait about a minute for the database to initialize.
-
The ADBC driver for Oracle is available from Columnar's private driver registry. Create a Columnar Console account and activate a 14-day free trial. Then authenticate to the registry:
dbc auth login
-
Install the ADBC driver for Oracle:
dbc install oracle
-
Install the Oracle Instant Client libraries.
-
Set
LD_LIBRARY_PATH(Linux),DYLD_LIBRARY_PATH(macOS), orPATH(Windows) to make sure the Oracle Instant Client libraries are discoverable by your application. -
Customize the Python script
main.pyas needed:- Change the connection arguments in
db_kwargs.- Format
uriaccording to the the following syntax:oracle://[user[:password]@]host[:port][/serviceName][?param1=value1¶m2=value2], or keep it as is.
- Format
- Change the SQL SELECT statement in
cursor.execute(), or keep it as is.
- Change the connection arguments in
-
Run the Python script:
uv run main.py
Stop the Docker container running Oracle Database:
docker stop oracle-db