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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

Processing

Post Details

Added on Aug 5 2022
8 comments
3,757 views