28.Appendix A: Oracle Database Features Supported by python-oracledb

By default, python-oracledb runs in a ‘Thin’ mode which connects directly toOracle Database. This mode does not need Oracle Client libraries. However,some additional functionality is available when python-oracledb uses them.Python-oracledb is said to be in ‘Thick’ mode when Oracle Client libraries areused. Both modes have comprehensive functionality supporting the PythonDatabase API v2.0 SpecificationPEP 249. SeeInitializing python-oracledb for how toenable Thick mode.

The following table summarizes the Oracle Database features supported bypython-oracledb Thin and Thick modes, and by the obsolete cx_Oracle driver.For more details seeAppendix B: Differences between python-oracledb Thin and Thick Modes andUpgrading from cx_Oracle 8.3 to python-oracledb.

Table 28.1Features Supported by python-oracledb and cx_Oracle 8.3

Oracle Feature

python-oracledb Thin Mode

python-oracledb Thick Mode

cx_Oracle 8.3

Oracle Client version

Not applicable

Release 11.2 and later

Release 11.2 and later

Oracle Database version

Release 12.1 and later

Release 9.2 and later depending on Oracle Client library version

Release 9.2 and later depending on Oracle Client library version

Standalone connections (seeStandalone Connections)

Yes - must use keyword arguments

Yes - must use keyword arguments

Yes

Connection Pooling - Heterogeneous and Homogeneous (seeConnection pooling)

Homogeneous only - must use keyword arguments

Yes - must use keyword arguments

Yes

Named Connection Pools (seeUsing the Connection Pool Cache)

Yes

Yes

No

Connection Pool Connection Load Balancing (CLB) (seeClient-Side Load Balancing)

Yes

Yes

Yes

Connection Pool Runtime Load Balancing (RLB) (seeRuntime Connection Load Balancing)

No

Yes

Yes

Connection Pool draining (seePrepare Applications for Planned Maintenance)

Yes

Yes

Yes

Connection Pool session state callback (seeSession Callbacks for Setting Pooled Connection State)

Yes - Python functions but not PL/SQL functions

Yes

Yes

Connection pool session tagging (seeConnection Tagging)

No

Yes

Yes

Password authentication

Yes

Yes

Yes

External authentication (seeConnecting Using External Authentication)

No

Yes

Yes

Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) Tokens (seeConnecting Using OCI IAM Token-Based Authentication)

Yes

Yes

Yes - in connection string with appropriate Oracle Client

Open Authorization (OAuth 2.0) (seeConnecting Using OAuth 2.0 Token-Based Authentication)

Yes

Yes

Yes - in connection string with appropriate Oracle Client

Kerberos and Radius authentication

No

Yes

Yes

Lightweight Directory Access Protocol (LDAP) connections (seeLDAP Directory Naming)

Yes - via a user function enabled withoracledb.register_protocol()

Yes

Yes

Proxy connections (seeConnecting Using Proxy Authentication)

Yes

Yes

Yes

Socket Secure (SOCKS) Proxy connections

No

No

No

Connection mode privileges (seeConnection Authorization Modes)

Yes

Yes - onlyAUTH_MODE_SYSDBA is supported

Yes - onlyAUTH_MODE_SYSDBA is supported

Preliminary connections

No

Yes

Yes

Set the current schema using an attribute

Yes

Yes

Yes

Oracle Cloud Database connectivity (seeConnecting to Oracle Cloud Autonomous Databases)

Yes

Yes

Yes

Real Application Clusters (RAC)

Yes

Yes

Yes

Oracle Globally Distributed Database - previously known as Oracle Sharded Databases (seeConnecting to Oracle Globally Distributed Database)

No

Yes - No TIMESTAMP support

Yes - No TIMESTAMP support

Oracle Database Native Network Encryption (NNE) (seeNative Network Encryption)

No - useTLS instead

Yes

Yes

Connection health check APIs (seeis_healthy() andping())

Yes

Yes

Yes

Oracle Net Servicestnsnames.ora file (seeOptional Oracle Net Configuration Files)

Yes

Yes

Yes

Oracle Net Servicessqlnet.ora file (seeOptional Oracle Net Configuration Files)

No - many values can be set at connection time

Yes

Yes

Oracle Client library configuration fileoraaccess.xml (seeOptional Oracle Client Configuration File)

Not applicable

Yes

Yes

Easy Connect connection strings (seeEasy Connect Syntax for Connection Strings)

Yes - mostly supported. Unknown settings are ignored and not passed to Oracle Database.

Yes

Yes

Centralized Configuration Providers (seeCentralized Configuration Providers)

Yes

Yes

No

One-way TLS connections (seeOne-way TLS Connection to Oracle Autonomous Database)

Yes

Yes

Yes

Mutual TLS (mTLS) connections (seeMutual TLS (mTLS) Connection to Oracle Autonomous Database)

Yes

Yes

Yes

Secure External Password Store (SEPS) wallet (e.g. wallets created by mkstore)

No

Yes

Yes

Oracle Database Dedicated Servers, Shared Servers andDatabase Resident Connection Pooling (DRCP).

Yes

Yes

Yes

Oracle Database 23ai Implicit Connection Pooling withDRCP and PRCP (seeImplicit Connection Pooling)

Yes

Yes

No

Multitenant Databases

Yes

Yes

Yes

CMAN and CMAN-TDM connectivity

Yes

Yes

Yes

Password changing (seeConnection.changepassword())

Yes

Yes

Yes

Statement break/reset (seeConnection.cancel())

Yes

Yes

Yes

Edition Based Redefinition (EBR) (seeEdition-Based Redefinition (EBR))

Yes

Yes

Yes

SQL execution (seeExecuting SQL)

Yes

Yes

Yes

PL/SQL execution (seeExecuting PL/SQL)

Yes for scalar types. Yes for collection types using array interface.

Yes

Yes

Simple Oracle Document Access (SODA) API (seeSODA)

No

Yes

Yes

Bind variables for data binding (seeUsing Bind Variables)

Yes

Yes

Yes

Array DML binding for bulk DML and PL/SQL (seeBatch Statement and Bulk Copy Operations)

Yes

Yes

Yes

SQL and PL/SQL type and collections (seeFetching Oracle Database Objects and Collections)

Yes

Yes

Yes

Query column metadata (seeQuery Column Metadata)

Yes

Yes

Yes

Client character set support (seeCharacter Sets and Globalization)

UTF-8

UTF-8

Yes - can use Python encodings. Default in 8.0 is UTF-8

Globalization support (seeCharacter Sets and Globalization)

Yes - via Python globalization support

Yes - Oracle Database NLS environment variables are respected, excluding the character set in NLS_LANG

Yes - Oracle Database NLS environment variables are respected, excluding the character set in NLS_LANG

Row prefetching on first query execute (seeTuning Fetch Performance)

Yes - unless the row contains LOBs or similar types

Yes - unless the row contains LOBs or similar types

Yes - unless the row contains LOBs or similar types

Array fetching for queries (seeTuning Fetch Performance)

Yes

Yes

Yes

Statement caching (seeStatement Caching)

Yes - new driver also supports dropping from the cache

Yes - new driver also supports dropping from the cache

Yes

Client Result Caching (CRC) (seeClient Result Caching (CRC))

No

Yes

Yes

Oracle Database 23ai JSON-Relational Duality Views (seeJSON-Relational Duality Views)

Yes

Yes

No

Continuous Query Notification (CQN) (seeWorking with Continuous Query Notification (CQN))

No

Yes

Yes

Oracle Transactional Event Queues and Advanced Queuing (AQ) (seeUsing Oracle Transactional Event Queues and Advanced Queuing)

Yes - only “Classic” queues are supported (RAW, named Oracle object, and JSON payloads)

Yes

Yes

Call timeouts (seeConnection.call_timeout)

Yes

Yes

Yes

Scrollable cursors (seeScrollable Cursors)

Yes

Yes

Yes

Oracle Database startup and shutdown (seeStarting and Stopping Oracle Database)

No

Yes

Yes

Transaction management (seeManaging Transactions)

Yes

Yes

Yes

Events mode for notifications

No

Yes

Yes

Fast Application Notification (FAN) (seeFast Application Notification (FAN))

No

Yes

Yes

In-band notifications

Yes

Yes

Yes

Transparent Application Failover (TAF)

No

Yes - no callback

Yes - no callback

Transaction Guard (TG) (seeTransaction Guard)

Yes

Yes

Yes

Data Guard (DG) and Active Data Guard (ADG)

Yes

Yes

Yes

Application Continuity (AC) and Transparent Application Continuity (TAC) (seeApplication Continuity (AC))

No

Yes

Yes

Concurrent programming with asyncio (seeConcurrent Programming with asyncio)

Yes

No

No

Oracle Database 23ai Pipelining (seePipelining Database Operations)

Yes

No

No

End-to-end monitoring and tracing attributes (seeTracing python-oracledb)

Yes

Yes

Yes

Automatic Diagnostic Repository (ADR) (seeAbout Fault Diagnosability in OCI)

No

Yes

Yes

Java Debug Wire Protocol for debugging PL/SQL (seeDebugging PL/SQL with the Java Debug Wire Protocol)

Yes

Yes

Yes

Two-phase Commit (TPC) (seeUsing Two-Phase Commits (TPC))

Yes

Yes

Yes - limited support

REF CURSORs and Nested Cursors

Yes

Yes

Yes

Pipelined tables

Yes

Yes

Yes

Implicit Result Sets

Yes

Yes

Yes

Application Contexts (seeConnection Metadata and Application Contexts)

Yes

Yes

Yes

Persistent and Temporary LOBs

Yes

Yes

Yes

LOB length prefetching

Yes

Yes

Yes

LOB locator operations such as trim

Yes

Yes

Yes

28.1.Supported Oracle Database Data Types

The following table lists the Oracle Database types that are supported in thepython-oracledb driver. SeeOracle Database TypesandPL/SQL Types. The python-oracledb constant shownis the common one. In some python-oracledb APIs you may use other types, forexample when binding numeric values.

Table 28.2Oracle Database Data Types Supported

Oracle Database Type

python-oracledb Constant Name

Supported Python Types

Notes

VARCHAR2

DB_TYPE_VARCHAR

bytes, str

No relevant notes

NVARCHAR2

DB_TYPE_NVARCHAR

bytes, str

No relevant notes

NUMBER, FLOAT

DB_TYPE_NUMBER

bool, int, float, decimal.Decimal

No relevant notes

DATE

DB_TYPE_DATE

datetime.date, datetime.datetime

No relevant notes

BOOLEAN (PL/SQL and Oracle Database 23ai SQL)

DB_TYPE_BOOLEAN

Any type convertible to bool

No relevant notes

BINARY_DOUBLE

DB_TYPE_BINARY_DOUBLE

bool, int, float, decimal.Decimal

No relevant notes

BINARY_FLOAT

DB_TYPE_BINARY_FLOAT

bool, int, float, decimal.Decimal

No relevant notes

TIMESTAMP

DB_TYPE_TIMESTAMP

datetime.date, datetime.datetime

No relevant notes

TIMESTAMP WITH TIME ZONE

DB_TYPE_TIMESTAMP_TZ

datetime.date, datetime.datetime

No relevant notes

TIMESTAMP WITH LOCAL TIME ZONE

DB_TYPE_TIMESTAMP_LTZ

datetime.date, datetime.datetime

No relevant notes

INTERVAL YEAR TO MONTH

DB_TYPE_INTERVAL_YM

oracledb.IntervalYM

No relevant notes

INTERVAL DAY TO SECOND

DB_TYPE_INTERVAL_DS

datetime.timedelta

No relevant notes

RAW

DB_TYPE_RAW

bytes, str

No relevant notes

LONG

DB_TYPE_LONG

bytes, str

No relevant notes

LONG RAW

DB_TYPE_LONG_RAW

bytes, str

No relevant notes

ROWID

DB_TYPE_ROWID

bytes, str

No relevant notes

UROWID

DB_TYPE_ROWID,DB_TYPE_UROWID (only supported in python-oracledb Thin mode)

bytes, str

May showDB_TYPE_UROWID in metadata. SeeQuery Metadata Differences.

CHAR

DB_TYPE_CHAR

bytes, str

No relevant notes

BLOB

DB_TYPE_BLOB

oracledb.LOB, bytes, str

No relevant notes

CLOB

DB_TYPE_CLOB

oracledb.LOB, bytes, str

No relevant notes

NCHAR

DB_TYPE_NCHAR

bytes, str

No relevant notes

NCLOB

DB_TYPE_NCLOB,DB_TYPE_LONG_NVARCHAR (if fetching NCLOB as a string)

oracledb.LOB, bytes, str

No relevant notes

BFILE

DB_TYPE_BFILE

oracledb.LOB, bytes

Can fetch a BFILE object and insert that object in a table. Cannot create BFILE objects.

JSON

DB_TYPE_JSON

Any type convertible to Oracle JSON

No relevant notes

REF CURSOR (PL/SQL OR nested cursor)

DB_TYPE_CURSOR

oracledb.Cursor

No relevant notes

PLS_INTEGER

DB_TYPE_BINARY_INTEGER

bool, int, float, decimal.Decimal

No relevant notes

BINARY_INTEGER

DB_TYPE_BINARY_INTEGER

bool, int, float, decimal.Decimal

No relevant notes

REF

n/a

n/a

Not supported in python-oracledb Thin mode

XMLType

DB_TYPE_XMLTYPE

bytes, str

May need to usexmltype.getclobval() to fetch in python-oracledb Thick mode. SeeUsing XMLTYPE Data

User-defined types (object type, VARRAY, records, collections, SDO_*types)

DB_TYPE_OBJECT

OBJECT of specific type

No relevant notes

VECTOR

DB_TYPE_VECTOR

array.array

No relevant notes

Binding of contiguous PL/SQL Index-by BINARY_INTEGER arrays of string, number, and date aresupported in python-oracledb Thin and Thick modes. UseCursor.arrayvar() to buildthese arrays.

When fetchingdata frames, seeData Frame TypeMapping for type information.