python-oracledb/samples at main · oracle/python-oracledb

Python-oracledb Examples

This directory contains samples for python-oracledb.

Basic Examples

  1. The schemas and SQL objects that are referenced in the samples can be created by running the Python script create_schema.py. The script requires SYSDBA privileges and will prompt for these credentials as well as the names of the schemas and edition that will be created, unless a number of environment variables are set as documented in the Python script sample_env.py. Run the script using the following command:

  2. Run a Python script, for example:

  3. After running python-oracledb samples, the schemas and SQL objects can be dropped by running the Python script drop_schema.py. The script requires SYSDBA privileges and will prompt for these credentials as well as the names of the schemas and edition that will be dropped, unless a number of environment variables are set as documented in the Python script sample_env.py. Run the script using the following command:

Examples in a Container

The containers directory has Dockerfiles for building a container with the samples and a running Oracle Database, and for creating a development environment.

Notebooks

The notebooks directory has Jupyter notebooks with runnable examples.