Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utPLSSQL-cli doesn't find tnsnames.ora #163

Open
maxbernhardt opened this issue Aug 5, 2019 · 1 comment
Open

utPLSSQL-cli doesn't find tnsnames.ora #163

maxbernhardt opened this issue Aug 5, 2019 · 1 comment

Comments

@maxbernhardt
Copy link

maxbernhardt commented Aug 5, 2019

Just like described in #88, if the tnsnames.ora file is not located in ORACLE_HOME/network/admin it is not found, which will result in the error described in #88.

If the Oracle environment variable is TNS_ADMIN is set to any path like
/home/ccuser/oracle
and the normal network config files (sqlnet.ora, ldap.ora, tnsnames.ora) are placed in that directory, Oracle tools like sqlplus and tnsping will work just fine. But utPLSQL-cli doesn't seem to check the TNS_ADMIN setting. Instead I receive this error:
ccuser@adeagibx:~/utPLSQL-cli/utPLSQL-cli/bin$ utplsql reporters ****/****@ddopmdb jdbc:oracle:oci8:****/****@ddopmdb: oracle.jdbc.driver.T2CConnection.t2cSetSessionTimeZone(JLjava/lang/String;)I jdbc:oracle:thin:****/****@ddopmdb: could not resolve the connect identifier "ddopmdb" Could not establish connection to database. Reason: could not resolve the connect identifier "ddopmdb"
While at the same time e.g. tnsping works fine:
ccuser@adeagibx:~/utPLSQL-cli/utPLSQL-cli/bin$ tnsping ddopmdb

TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 05-AUG-2019 16:35:41

Copyright (c) 1997, 2008, Oracle. All rights reserved.

Used parameter files:
/opt/SP/cmi/etc/oracle/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=))) (CONNECT_DATA=(SID=DDOPMDB)))
OK (20 msec)

The relevant environment variables look like this:

ccuser@adeagibx:/home/ccuser/utPLSQL-cli/utPLSQL-cli/bin$ env | grep ORACLE
ORACLE_HOME=/opt/oracle/product/111_cl_64/cl
ccuser@adeagibx:/home/ccuser/utPLSQL-cli/utPLSQL-cli/bin$ env | grep TNS
TNS_ADMIN=/opt/SP/cmi/etc/oracle

They show, that the *.ora files are located outside of the ORACLE_HOME. This is necessary in our environments, because the base Oracle installation is provided by a different team and we can't just place / update the tnsnames.ora inside ORACLE_HOME.

Can you please enable the use of TNS_ADMIN in the search for tnsnames.ora file if it is set.

@pesse
Copy link
Member

pesse commented Aug 16, 2019

Thank you for reporting this and for your patience. It looks like we might already have a solution for this but can't include it so far as to not lose java 9-12 compatibility.
I'm on vacation at the moment but will have a closer look once I'm back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants