ORA-12560: TNS:protocol adapter error
Hi, I have used the driver, but everytime I get "** ORA-12560: TNS:protocol adapter error**" when I try to connect using oracledb.getConnection. Can anyone please let me know what Im missing in installation.
Thanks
@harrydroid it's hard to know what to suggest since we don't know what you have done, what platforms you did it on, and what you want to do.
The error is not specific to node-oracledb, so info you can google is likely to help.
Hi - I too am getting the same error - I am running on windows 64 bit. please let me know if u need any more info. Help is much much appreciated. I have installed as per instructions and my require oracledb is successful. But when I attempt to connect I get the error. My connection string is as follows:
(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = server12345)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = TEST))) You say error is not specific to node-oracledb - I do not have oracle client installed - I am connecting via oracle sql developer successful. i have the environment variables as per oracle/nodejs window setup.
What else am I missing?
Thanks a mil
Still not enough information to go on - versions, what's in the sqlnet.ora file (if there is one) etc. If you google you can find a bunch of suggestions that might point you to a solution.
@ukris You will have a client (probably the full client) or you wouldn't be able to run node-oracledb applications. Are you able to run SQL*Plus? Are you able to use thick-connections in SQL Developer (see http://www.thatjeffsmith.com/archive/2014/01/oracle-sql-developer-4-and-the-oracle-client/)?
One tip: I would suggest you use the connection string "server12345/test" which is easier to type than the old style string.
@cjbj Hello sir, I'm a newbie with Node JS so please forgive my ignorance. I'm also encountering this error. I successfully installed (at least i think so) node-oracledb with my project (a simple folder with an app.js file). I'm running Windows 10 64 bit. I followed the installation guide and there were no errors except that my project lacks package.json. Here is a complete details of my machine:
- Windows 10 64-bit
- node v4.3.0
- npm 3.7.5
I am connecting on a remote server. I think the problem is instantclient somehow can't locate my local tnsnames.ora file. I do have a PL/SQL developer installed, so the tnsnames.ora is located on the default location (C:\app\User\product\11.2.0\client_1\Network\Admin)
Any help would be great, thanks!
@jaybeemind If you are having issues locating tnsnames.ora, check https://github.com/oracle/node-oracledb/blob/master/doc/api.md#connectionstrings You could set TNS_ADMIN but if your connection string is simple, you might find it easier to use the Easy Connect syntax. However the error doesn't seem to be a file location issue. The problem might ultimately be because you seem to have a full client and instant client installed.
@cjbj I'm completely new to this Oracle thing, and you are probably right, I do have a PL/SQL Developer installed, but it connects to a remote db. Also I followed the install guide for windows. Setting the TNS_ADMIN didn't help, unfortunately. I tried using SQL PLUS and I was able to login using username@connection (not including @connection fails) I found something on stackoverflow that says set LOCAL env to the connection string so I won't have to use it (LOCAL=connection)
Anyhow, this is getting long sorry, this problem occurred because of my lack of knowledge about how Oracle does things. I managed to solve this by setting LOCAL env to the "connection".
So somewhere above my code before oracledb intantiation, i do
process.env.LOCAL = 'connection';
Thanks for replying though, hope this helps others.
Instead of setting LOCAL you could probably have done:
oracledb.getConnection(
{
user : "hr",
password : "welcome",
connectString : "connection"
},
hi @cjbj, that is the first thing I did, and it outputs "ORA-12560: TNS:protocol adapter error". Anyhow, I could access the db now, thanks!
Hi @jaybeemind , @cjbj I am facing similar issue like you. I have oracle12c installed on windows 2016 on VM and node oracledb with oracle client libraries on other vm. I can connect to remote oracle12c using sql developer tool but can find a way to connect using oracledb.getConnection function. Here what I am using module.exports = { database: { user: 'hr', password: 'welcome', //connectString : "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle12ca)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb.yisxy5xz2hwedjr1gukytxocee.bx.internal.cloudapp.net)))"
//connectString: 'publicIP:1521/servicename'
} };
Please guide me to right direction. Thanks