Skip to Main Content

Oracle Developer Tools for VS Code

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can't connect to Oracle Database via tnsnames on VS Code

Anshuman KumarAug 5 2022 — edited Aug 5 2022

Hi,
I'm trying to connect to my company's enterprise Oracle database via VS Code but I keep getting the following error:
ORA-12545: Network Transport: Unable to resolve connect hostname

I'm on an Arm M1 Mac. To test my tnsnames configuration, I installed instant client drivers and SQL*Plus and I'm able to successfully connect to the database. I've put all the required wallet files along with sqlnet.ora and tnsnames.ora file under /Users/%USERPROFILE%/Oracle/network/admin folder. I've also set the environment variables $ORACLE_HOME, $TNS_ADMIN, $OCI_LIB_DIR, $OCI_INC_DIR, and DYLD_LIBRARY_PATH.
If I use SQL Developer, I don't need wallets or tnsnames as I'm using the jdbc connection string and this method also successfully connects to the database. Not sure if it's relevant, but my company uses Oracle Connection manager to avoid direct connections to the DB.
I'm guessing since I can successfully connect via SQL*Plus and SQLDeveloper, I'm missing some configuration in VS Code. I really like VS Code as my universal editor, so would like to configure it for Oracle DB.
I would be grateful if someone can help me solve this issue.

Comments

Timo Hahn

***Moderator note (Timo): Vladimir

Please don't just answer by giving a link. Provide some more information on how you think the link will help to solve the problem. The Oracle Community – General FAQ state:

I have an excellent blog entry that answers a very complex user question. Can I just post a link as the answer?

Unfortunately, a link is not an answer. It’s a location of relevant and correct material to answer the question. And while the link to the blog is probably very useful, it will be flagged for review by the system moderators who are dedicated to ensuring the Community Platform is not susceptible to spam or any forms of promotion.

The best approach is always to “Answer in the Discussion” and in this case, that would mean providing enough content to address the question and answer it completely--if not in absolute detail at least to the extent that it achieves content correctness. Additional resources such as links to relevant and correct material can be offered as “for more information” or further explanation, but the answer should be complete. If an external blog entry is being linked, please provide a substantive quote from the blog entry to add context for users.

***

1 - 2

Post Details

Added on Aug 5 2022
8 comments
4,989 views