<commit_before>================
Oracle connector
================

The Oracle connector allows querying and creating tables in an external Oracle
database. Connectors let Trino join data provided by different databases,
like Oracle and Hive, or different Oracle database instances.

Requirements
------------

To connect to Oracle, you need:

* Oracle 12 or higher.
* Network access from the Trino coordinator and workers to Oracle.
  Port 1521 is the default port.

Configuration
-------------

To configure the Oracle connector as the ``oracle`` catalog, create a file named
``oracle.properties`` in ``etc/catalog``. Include the following connection
properties in the file:

.. code-block:: text

    connector.name=oracle
    # The exact format of the connection-url varies by Oracle version. Refer to
    # the Oracle Database documentation for version-specific information on the
    # JDBC Thin driver.
    connection-url=jdbc:oracle:thin:@//example.net:1521/ORCLCDB
    connection-user=root
    connection-password=<PASSWORD>

The ``connection-url`` defines the connection information and parameters to pass
to the Oracle JDBC Thin driver. See the `Oracle Database JDBC driver
documentation <https://docs.oracle.com/cd/B28359_01/java.111/b31224/urls.htm#BEIDHCBA>`_
for more information.

The ``connection-user`` and ``connection-password`` are typically required and
determine the user credentials for the connection, often a service user. You can
use :doc:`secrets </security/secrets>` to avoid actual values in the catalog
properties files.

.. note::
    Oracle does not expose metadata comment via ``REMARKS`` column by default
    in JDBC driver. You can enable it using ``oracle.remarks-reporting.enabled``
    config option. See `Additional Oracle Performance Extensions
    <https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/performance-extensions.html#GUID-96A38C6D-A288-4E0B-9F03-E711C146632B>`_
    for more details.

By default, the Oracle connector uses connection pooling for performance
improvement. The below configuration shows the typical default values. To update
them, change the properties in the catalog configuration file:

.. code-block:: properties

    oracle.connection-pool.max-size=30
    oracle.connection-pool.min-size=1
    oracle.connection-pool.inactive-timeout=20m

To disable connection pooling, update properties to include the following:

.. code-block:: text
<commit_msg>Clarify documentation of the Oracle connection-url string<commit_after>================
Oracle connector
================

The Oracle connector allows querying and creating tables in an external Oracle
database. Connectors let Trino join data provided by different databases,
like Oracle and Hive, or different Oracle database instances.

Requirements
------------

To connect to Oracle, you need:

* Oracle 12 or higher.
* Network access from the Trino coordinator and workers to Oracle.
  Port 1521 is the default port.

Configuration
-------------

To configure the Oracle connector as the ``oracle`` catalog, create a file named
``oracle.properties`` in ``etc/catalog``. Include the following connection
properties in the file:

.. code-block:: text

    connector.name=oracle
    # The correct syntax of the connection-url varies by Oracle version and
    # configuration. The following example URL connects to an Oracle SID named
    # "orcl".
    connection-url=jdbc:oracle:thin:@example.net:1521:orcl
    connection-user=root
    connection-password=<PASSWORD>

The ``connection-url`` defines the connection information and parameters to pass
to the JDBC driver. The Oracle connector uses the Oracle JDBC Thin driver,
and the syntax of the URL may be different depending on your Oracle
configuration. For example, the connection URL is different if you are
connecting to an Oracle SID or an Oracle service name. See the `Oracle
Database JDBC driver documentation
<https://docs.oracle.com/en/database/oracle/oracle-database/21/jjdbc/data-sources-and-URLs.html#GUID-088B1600-C6C2-4F19-A020-2DAF8FE1F1C3>`_
for more information.

The ``connection-user`` and ``connection-password`` are typically required and
determine the user credentials for the connection, often a service user. You can
use :doc:`secrets </security/secrets>` to avoid actual values in the catalog
properties files.

.. note::
    Oracle does not expose metadata comment via ``REMARKS`` column by default
    in JDBC driver. You can enable it using ``oracle.remarks-reporting.enabled``
    config option. See `Additional Oracle Performance Extensions
    <https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/performance-extensions.html#GUID-96A38C6D-A288-4E0B-9F03-E711C146632B>`_
    for more details.

By default, the Oracle connector uses connection pooling for performance
improvement. The below configuration shows the typical default values. To update
them, change the properties in the catalog configuration file:

.. code-block:: properties

    oracle.connection-pool.max-size=30
    oracle.connection-pool.min-size=1
    oracle.connection-pool.inactive-timeout=20m

To disable connection pooling, update properties to include the following:

.. code-block:: text

{'fraction_non_alphanumeric': 0.0946335833814195, 'fraction_numerical': 0.022119638391998462, 'mean_word_length': 4.327868852459017, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4926761', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1338, 'n_words': 556}