I am writing a Node.js application that pulls data from an Oracle database. The DBA recently migrated the database to another machine, and everything broke.
I've tried re-creating the tnsnames.ora and sqlnet.ora files. I'm fairly sure that they are correct, because sqlplus can connect to the service just fine. But node-oracle keeps reporting the error: "ORA-12154: TNS:could not resolve the connect identifier specified".
This is inexplicable to me. It seems to me that if I have my ORACLE_HOME environment variable set, then both node-oracle and sqlplus should function identically. What am I doing wrong?
I've tried switching to node-db-oracle instead, but it reports the same problem. I'm stumped.
EDIT: This is how I connect:
database = new oracle.Database({
hostname: Preferences["oracle_host"], // FQDN of the database
port: Preferences["oracle_port"],
user: Credentials["oracle_login"],
password: Credentials["oracle_password"],
database: Preferences["oracle_database"]
});
connection = database.connect(function(error) {
if(error) {
Utilities.logger.error(error);
}
else {
Utilities.logger.info("Connected to Oracle database " + Preferences["oracle_host"]);
if(callback) callback.call(this, collection, options);
connection = this;
}
});
connect
; so are you sure they even refer to thetnsnames.ora
? (I've never used either, clearly!) Can you post how you connect? – Alex Poole Jul 19 '12 at 22:04oracle_host
in wherever it's getting thePreferences
values, so that it points to the new server? This is not going throughtnsnames.ora
. – Alex Poole Jul 24 '12 at 14:55