Connecting+Firing plsql to Oracle DB in one go

Hi,

I am using the below command to connect to a remote Oracle DB from my unix shell script.

sqlplus -s user1/password1@remotedbhost:1252/demo @/tmp/PROC_MS.prc

But I get the below error.

  1. Can you confirm if my code is correct ?

  2. Can you help me overcome the error ?

Firstly, I would say that this is a bad plan. If you connection opens, then until you close it a simple ps will reveal the user1/password1 clearly on the command line.

Anyway, this looks like a TNS definition error. What do you have for remotedbhost in your tnsnames.ora file?

Additionally, can you confirm that the other end is listening on that port too? Normally, the Oracle TNS port is 1521 and you wouldn't normally specify it.

Robin
Liverpool/Blackburn
UK

Host port number is correct for sure.

See ...

Anyway, this looks like a TNS definition error. What do you have for remotedbhost in your tnsnames.ora file?

Its a Huge file, what's exactly that i need to check in there ??

On the server side, do you have lsof installed? If so, can you share the output of:-

netstat -na | grep 1252
lsof -i tcp:1252

For the tnsmanes.ora file, if you can edit it are search for the remotedbhost strings and paste the whole logical record that would be good. You don't say what Oracle version, but there would need to be a listener process too that you should be able to query on the remotedbhost, hopefully with lsnrctl status and the output from that would be useful too.

Robin