Skip to content

Commit 08117db

Browse files
Expand ADB documentation.
1 parent 440163e commit 08117db

File tree

1 file changed

+37
-18
lines changed

1 file changed

+37
-18
lines changed

doc/src/user_guide/connection_handling.rst

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,40 +1350,59 @@ of the function :meth:`cx_Oracle.connect()` constructor:
13501350
13511351
.. _autononmousdb:
13521352

1353-
Connecting to Autononmous Databases
1354-
===================================
1353+
Connecting to Oracle Cloud Autononmous Databases
1354+
================================================
13551355

13561356
To enable connection to Oracle Autonomous Database in Oracle Cloud, a wallet
1357-
needs be downloaded from the cloud GUI, and cx_Oracle needs to be configured to
1358-
use it. A database username and password is still required. The wallet only
1359-
enables SSL/TLS.
1357+
needs be downloaded from the cloud, and cx_Oracle needs to be configured to use
1358+
it. The wallet gives mutual TLS which provides enhanced security for
1359+
authentication and encryption. A database username and password is still
1360+
required for your application connections.
13601361

13611362
Install the Wallet and Network Configuration Files
13621363
--------------------------------------------------
13631364

1364-
From the Oracle Cloud console for the database, download the wallet zip file. It
1365-
contains the wallet and network configuration files. Note: keep wallet files in
1366-
a secure location and share them only with authorized users.
1365+
From the Oracle Cloud console for the database, download the wallet zip file.
1366+
It contains the wallet and network configuration files. Note: keep wallet
1367+
files in a secure location and share them only with authorized users.
13671368

1368-
Unzip the wallet zip file.
1369-
1370-
For cx_Oracle, only these files from the zip are needed:
1369+
Unzip the wallet zip file. For cx_Oracle, only these files from the zip are needed:
13711370

13721371
- ``tnsnames.ora`` - Maps net service names used for application connection strings to your database services
13731372
- ``sqlnet.ora`` - Configures Oracle Network settings
13741373
- ``cwallet.sso`` - Enables SSL/TLS connections
13751374

1376-
The other files and the wallet password are not needed.
1375+
There are now two options:
1376+
1377+
- Move the three files to the ``network/admin`` directory of the client
1378+
libraries used by your application. For example if you are using Instant
1379+
Client 19c and it is in ``$HOME/instantclient_19_11``, then you would put the
1380+
wallet files in ``$HOME/instantclient_19_11/network/admin/``.
1381+
1382+
- Alternatively, move them to any accessible directory, for example
1383+
``/opt/OracleCloud/MYDB``.
1384+
1385+
Then edit ``sqlnet.ora`` and change the wallet location directory to the
1386+
directory containing the ``cwallet.sso`` file. For example::
1387+
1388+
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/opt/OracleCloud/MYDB")))
1389+
SSL_SERVER_DN_MATCH=yes
13771390

1378-
Place these files as shown in :ref:`Optional Oracle Net Configuration Files <optnetfiles>`.
1391+
Since the ``tnsnames.ora`` and ``sqlnet.ora`` files are not in the default
1392+
location, your application needs to indicate where they are, either with
1393+
``config_dir`` parameter to :meth:`cx_Oracle.init_oracle_client()`, or using
1394+
the ``TNS_ADMIN`` environment variable. See :ref:`Optional Oracle Net
1395+
Configuration Files <optnetfiles>`. Neither of these settings are needed,
1396+
and you don't need to edit ``sqlnet.ora``, if you have put all the files in
1397+
the ``network/admin`` directory.
13791398

13801399
Run Your Application
13811400
--------------------
13821401

13831402
The ``tnsnames.ora`` file contains net service names for various levels of
13841403
database service. For example, if you create a database called CJDB1 with the
13851404
Always Free services from the `Oracle Cloud Free Tier
1386-
<https://www.oracle.com//cloud/free/>`__, then you might decide to use the
1405+
<https://www.oracle.com/cloud/free/>`__, then you might decide to use the
13871406
connection string in ``tnsnames.ora`` called ``cjdb1_high``.
13881407

13891408
Update your application to use your schema username, its database password, and
@@ -1394,14 +1413,14 @@ a net service name, for example:
13941413
connection = cx_Oracle.connect(user="scott", password=userpwd,
13951414
dsn="cjdb1_high", encoding="UTF-8")
13961415
1397-
Once you have set Oracle environment variables required by your application,
1398-
such as ``TNS_ADMIN``, you can start your application.
1416+
Once you have set optional Oracle environment variables used by your
1417+
application, such as ``TNS_ADMIN``, you can start your application.
13991418

14001419
If you need to create a new database schema so you do not login as the
14011420
privileged ADMIN user, refer to the relevant Oracle Cloud documentation, for
14021421
example see `Create Database Users
1403-
<https://docs.oracle.com/en/cloud/paas/atp-cloud/atpud/manage.html>`__ in the
1404-
Oracle Autonomous Transaction Processing Dedicated Deployments manual.
1422+
<https://docs.oracle.com/en/cloud/paas/autonomous-database/adbdu/managing-database-users.html#GUID-5B94EA60-554A-4BA4-96A3-1D5A3ED5878D>`__
1423+
in the Oracle Autonomous Database manual.
14051424

14061425
Access Through a Proxy
14071426
----------------------

0 commit comments

Comments
 (0)