0
votes
call sqlplus UNAME/PASSWD@DBNAME@\\FILELOCATION\SQLFILENAME.sql

ERROR:
ORA-01017: invalid username/password; logon denied

CALL sqlplus UNAME@DBNAME/PASSWD@\\FILELOCATION\SQLFILENAME.sql

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

3
Why are you using Call? is sqlplus a batch file? if it isn't, remove the Call statement and try again!Compo
Yes. It is batch file I calling from. Now I can able to connect when I am giving password in the next line but I am unable to connect if I mention Password in the same line.SUNITH
Just to confirm, I asked if sqlplus was a batch file, and your answer was yes; So you are sending a username, password and .sql file as arguments to a batch script named sqlplus.bat or sqlplus.cmd!Compo
Okay. I am not using SQLPLUS.BAT. I am using CALL SQLPLUS from a bat file. Issue was with connection identifier after setting path in command prompt it is working and I have & symbol in my password so it is getting into a new line it seemsSUNITH
You should first consider removing the Call command, or possibly replacing it with the Start command. As for your arguments, you should use quotes to protect them and any potentially problematic characters, or escape the characters before you use them.Compo

3 Answers

0
votes

Try adding a space between the connection string and file (e.g. put a space before the @\FILELOCATION\SQLFILENAME.sql).

call sqlplus UNAME/PASSWD@DBNAME @\FILELOCATION\SQLFILENAME.sql

The other thing to try is to fully qualify your DBNAME. You can look in your tnsnames.ora file (check your Oracle installation folder, and then go to the network\admin folder to find the tnsnames.ora). In there, search for the DBNAME you're trying to connect to, and see what the full name of it is. (ex: DBNAME.SRV.YOURCOMPANY.COM would be an example).

0
votes

Try with below braces :

CALL sqlplus {UNAME}@{DBNAME}/{PASSWD}@\\FILELOCATION\SQLFILENAME.sql
0
votes

Based on your latest comment:

SQLPlus "UNAME@DBNAME/PASSWD" @\\FILELOCATION\SQLFILENAME.sql

Or:

Start "" SQLPlus "UNAME@DBNAME/PASSWD" @\\FILELOCATION\SQLFILENAME.sql

Please also enclose your file path with doublequotes, if you wish to protect characters within that too!