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

ORA-12560: TNS:protocol adapter error when connecting to remote oracle DB from node.js #691

Closed
baladreams opened this issue May 10, 2017 · 2 comments
Labels

Comments

@baladreams
Copy link

I have installed oracledb (1.13.1) and trying to connect to a remote oracle database (Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production) from a simple node.js application (7.10.0). Following the installation guide, I have downloaded oracle instantclient_12_1 zip file and extracted it. The environment variables required for oracledb installation have been set to:

OCI_INC_DIR : C:\code\LittleBrother\instantclient_12_1\sdk\include
OCI_LIB_DIR : C:\code\LittleBrother\instantclient_12_1\sdk\lib\msvc
C:\code\LittleBrother\instantclient_12_1; has been added to the beginning of my windows path variable.

I am able to install oracledb package successfully, but when trying to connect to the target database, I keep getting the error:

ORA-12560: TNS:protocol adapter error

I have tried the following connection string formats:

voyager:1523/O12R1A
(DESCRIPTION=(ADDRESS=(PROTOCOL = TCP)(HOST = voyager)(PORT = 1523))(CONNECT_DATA =(SERVICE_NAME = O12R1A)))
(DESCRIPTION=(ADDRESS=(PROTOCOL = TCP)(HOST = voyager)(PORT = 1523))(CONNECT_DATA =(SID = O12R1A)))

But they all result in the same error. I am able to connect to the DB using SQL Developer using the connection strings. What other things could I be missing and need to check?

Sorry for the trouble!! I am new to node.js and oracle databases, so kindly bear with me.

@cjbj
Copy link
Member

cjbj commented May 10, 2017

There could be several causes. I've seen that error reported when the 'client' computer (where Node is running) isn't properly configured and doesn't have a hostname. Recently this issue showed TLS version compatibility was an issue. There could be other causes.

SQLDev generally isn't a good testbed since it commonly uses a JDBC stack. Try with SQL*Plus.

@cjbj cjbj added the question label May 11, 2017
@baladreams
Copy link
Author

Thank you for the response, Christopher! I was not able to find the cause, but I tried removing everything Oracle related and rebuilt the module, and it worked as expected!

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

No branches or pull requests

2 participants