engine = create_engine("oracle+oracledb://scott:tiger@tnsalias")
-The Oracle dialect uses the obsolete cx_Oracle driver as the default DBAPI::
+For historical reasons, the Oracle dialect uses the obsolete cx_Oracle driver
+as the default DBAPI::
engine = create_engine("oracle://scott:tiger@127.0.0.1:1521/?service_name=freepdb1")
# mypy: ignore-errors
-r""".. dialect:: oracle
+r"""
+.. dialect:: oracle
:name: Oracle
:normal_support: 11+
:best_effort: 9+
with a 'BY DEFAULT' identity column.
* ``oracle_order``: when ``True``, renders the ORDER keyword, indicating the
identity is definitively ordered. May be necessary to provide deterministic
- ordering using Oracle RAC.
+ ordering using Oracle Real Application Clusters (RAC).
Using a SEQUENCE (all Oracle Database versions)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ``oracle_order``: when ``True``, renders the ORDER keyword, indicating the
sequence is definitively ordered. May be necessary to provide deterministic
- ordering using Oracle Real Application Clusters (RAC).
+ ordering using Oracle RAC.
.. versionchanged:: 1.4 Added :class:`_schema.Identity` construct
in a :class:`_schema.Column` to specify the option of an autoincrementing
.. note:: The implementation for the
:meth:`_engine.Connection.get_isolation_level` method as implemented by the
- Oracle Database dialects necessarily force the start of a transaction using
- the Oracle Database DBMS_TRANSACTION.LOCAL_TRANSACTION_ID function;
- otherwise no level is normally readable.
+ Oracle Database dialects necessarily force the start of a transaction using the
+ Oracle Database DBMS_TRANSACTION.LOCAL_TRANSACTION_ID function; otherwise no
+ level is normally readable.
Additionally, the :meth:`_engine.Connection.get_isolation_level` method will
raise an exception if the ``v$transaction`` view is not available due to
Note the following caveats:
* When using the :meth:`_reflection.Inspector.get_check_constraints` method,
- Oracle Database dialects build a special "IS NOT NULL" constraint for columns
- that specify "NOT NULL". This constraint is **not** returned by default; to
+ Oracle Database builds a special "IS NOT NULL" constraint for columns that
+ specify "NOT NULL". This constraint is **not** returned by default; to
include the "IS NOT NULL" constraints, pass the flag ``include_all=True``::
from sqlalchemy import create_engine, inspect
if dbapitype is CLOB:
del inputsizes[bindparam]
-.. _cx_oracle_returning:
-
-RETURNING Support
------------------
-
-The cx_Oracle dialect implements RETURNING using OUT parameters.
-The dialect supports RETURNING fully.
-
.. _cx_oracle_lob:
LOB Datatypes
``auto_convert_lobs=False`` may be passed to :func:`_sa.create_engine`,
which takes place only engine-wide.
+.. _cx_oracle_returning:
+
+RETURNING Support
+-----------------
+
+The cx_Oracle dialect implements RETURNING using OUT parameters.
+The dialect supports RETURNING fully.
+
Two Phase Transactions Not Supported
------------------------------------
}
)
+The Easy Connect syntax has been enhanced during the life of Oracle Database.
+Review the documentation for your database version. The current documentation
+is at `Understanding the Easy Connect Naming Method
+<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-B0437826-43C1-49EC-A94D-B650B6A4A6EE>`_.
+
+The general syntax is similar to::
+
+ [[protocol:]//]host[:port][/[service_name]][?parameter_name=value{¶meter_name=value}]
+
Note that although the SQLAlchemy URL syntax ``hostname:port/dbname`` looks
-like Oracle's Easy Connect syntax, it is different. It requires a system
-identifier (SID) for the ``dbname`` component of the URL::
+like Oracle's Easy Connect syntax, it is different. SQLAlchemy's URL requires a
+system identifier (SID) for the ``dbname`` component::
engine = create_engine("oracle+oracledb://scott:tiger@hostname:port/sid")
-Easy Connect syntax does not support SIDs. It uses services names, which are
-the preferred choice for connecting to Oracle Database
+Easy Connect syntax does not support SIDs. It uses services names, which are
+the preferred choice for connecting to Oracle Database.
Passing python-oracledb connect arguments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
with engine.connect() as conn:
print(conn.scalar(text("select 1 from dual")))
+Refer to the python-oracledb documentation for `oracledb.create_pool()
+<https://python-oracledb.readthedocs.io/en/latest/api_manual/module.html#oracledb.create_pool>`_
+for the arguments that can be used when creating a connection pool.
+
.. _drcp:
Using Oracle Database Resident Connection Pooling (DRCP)
if dbapitype is CLOB:
del inputsizes[bindparam]
-.. _oracledb_returning:
-
-RETURNING Support
------------------
-
-The oracledb dialect implements RETURNING using OUT parameters. The dialect
-supports RETURNING fully.
-
.. _oracledb_lob:
LOB Datatypes
buffered objects with a ``read()`` method, the parameter
``auto_convert_lobs=False`` may be passed to :func:`_sa.create_engine`.
+.. _oracledb_returning:
+
+RETURNING Support
+-----------------
+
+The oracledb dialect implements RETURNING using OUT parameters. The dialect
+supports RETURNING fully.
+
Two Phase Transaction Support
-----------------------------
.. versionchanged:: 2.0.32 added support for two phase transactions
-.. versionadded:: 2.0.0 added support for the python-oracledb driver.
-
.. _oracledb_numeric:
Precision Numerics
been reworked to take advantage of newer driver features as well as better
integration of outputtypehandlers.
+.. versionadded:: 2.0.0 added support for the python-oracledb driver.
+
""" # noqa
from __future__ import annotations