In our environment, tnsname.ora has many entries of form:
service_alias1.domain,
service_alias2.domain =
(DESCRIPTION
...
)
This works fine with sqlplus, many clients, and python-oracledb in thick mode. However, it doesn't work in thin mode which is required by python-oracledb for concurrent APIs.
The problem part is net_service_alias1, net_service_alias2 =, it causes a DPY-4000: unable to find "net_service_alias1" in /opt/instantclient/network/admin/tnsnames.ora error when trying to resolve net_service_alias1. It seems that python-oracledb doesn't support a list of comma separated net_service_name values.
A temporary workaround, creating "shadow" copy of tnsname.ora and removing second net_service_name:
service_alias1.domain =
(DESCRIPTION
...
)
...
, makes thin mode name resolution work. Please let me know if more details are needed! This enhancement would be a great improvement, thanks in advance!
Platform:
- RHEL9, other Linux x86_64 systems
- Python 3.12.4
python-oracledb 2.2.1