cx_Oracle is a Python extension module that enables access to Oracle Database. It conforms to the Python database API 2.0 specification with a considerable number of additions and a couple of exclusions.
cx_Oracle 8.3 has been tested with Python versions 3.6 through 3.10. Older versions of cx_Oracle may be used with previous Python releases. You can use cx_Oracle with Oracle 11.2, 12, 18, 19 and 21 client libraries. Oracle's standard client-server version interoperability allows connection to both older and newer databases. For example Oracle 19c client libraries can connect to Oracle Database 11.2.
Getting StartedSee Quick Start: Developing Python Applications for Oracle Database.
InstallationSee cx_Oracle Installation for detailed instructions.
TutorialThe Python and Oracle Database Tutorial: Scripting for the Future is also runnable in Oracle Cloud.
SamplesSee the /samples directory. You can also look at the scripts in cx_OracleTools and the modules in cx_PyOracleLib.
TestsSee the test suite.
Easily installed from PyPI.
Support for Python 3.6 and higher. Older versions of cx_Oracle may be used with previous Python releases.
Support for Oracle Client 11.2, 12, 18, 19 and 21. Oracle's standard cross-version interoperability, allows easy upgrades and connectivity to different Oracle Database versions.
Connect to Oracle Database 9.2, 10, 11, 12, 18, 19 or 21 (depending on the Oracle Client version used).
SQL and PL/SQL Execution. The underlying Oracle Client libraries have significant optimizations including compressed fetch, pre-fetching, client and server result set caching, and statement caching with auto-tuning.
Full use of Oracle Network Service infrastructure, including encrypted network traffic and security features.
Extensive Oracle data type support, including large object support (CLOB and BLOB).
Direct binding to SQL objects. One great use case is binding Python objects to Oracle Spatial SDO objects.
JSON datatype support.
SODA (Simple Oracle Document Access).
Array operations for efficient INSERT and UPDATEs.
Array row counts and batch error handling for array operations.
Fetching of large result sets.
REF CURSOR support.
Support for scrollable cursors. Go back and forth through your query results.
Fetch PL/SQL Implicit Results. Easily return query results from PL/SQL.
Row Prefetching. Efficient use of the network.
Client Result Caching. Improve performance of frequently executed look-up statements.
Support for Advanced Queuing. Use database notifications to build micro-service applications.
Continuous Query Notification (CQN). Get notified when data changes.
Support for Edition Based Redefinition. Easily switch applications to use updated PL/SQL logic.
Support for setting application context during the creation of a connection, making application metadata more accessible to the database, including in LOGON triggers.
End-to-end monitoring and tracing.
Session Pooling, with tagging and session state fix-up callback.
Database Resident Connection Pooling (DRCP).
Database startup and shutdown.
Oracle Database High Availability Features, such as FAN notifications, Application Continuity, and Transaction Guard support.
DB API specification exclusions: The time data type is not
supported by Oracle and is therefore not implemented. The method
cursor.nextset() is not implemented either as the DB API
specification assumes an implementation of cursors that does not fit
well with Oracle's implementation of cursors and implicit results. See
for more information.
cx_Oracle is licensed under a BSD license which you can find here. The cx_Oracle project is open source and maintained by Oracle Corp.