Solved

SQLPLUS Command Line with Password

Posted on 2016-08-06
8
42 Views
Last Modified: 2016-09-23
I am attempting to run a sqlplus commandline connect, but my database password has a "@" symbol. For example,  
sqlplus username/P@ssword@123.45.67.111:1521/SID123 @myscript.sql

I suspect that it is failing at the @.  How can I get this to work?
0
Comment
Question by:abuhaneef
  • 2
  • 2
  • 2
  • +1
8 Comments
 

Author Comment

by:abuhaneef
ID: 41745845
I keep getting
ORA-12154 : TNS: could not resolve the connect identifier specified.  

I have verified that I can connect to the database via SQL Developer.
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 334 total points
ID: 41745870
Double quote the password and make sure the password is in the correct case:
sqlplus username/"P@ssword"@123.45.67.111:1521/SID123 @myscript.sql
0
 
LVL 4

Expert Comment

by:Abhimanyu Suri
ID: 41745879
sqlplus /nolog

SQL> conn asuri/"a@suri"
Connected.

or if in Shell, " is a special character so you have to escape it

sqlplus asuri/\"a@suri\"@DBNAME

SQL*Plus: Release 11.2.0.3.0 Production on Sat Aug 6 21:28:06 2016

SQL>
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:abuhaneef
ID: 41746211
When I used the escape characters, I get

ERROR:
ORA-12638: Credential retrieval failed

Then it give s me the username: prompt.  After I type in the username and password I get

Enter user-name: myusername
Enter password:
ERROR:
ORA-12154: TNS: could not resolve the connect identifier specified

I am beginning to think the problem is with the tnsnames.ora file.
0
 
LVL 4

Assisted Solution

by:Abhimanyu Suri
Abhimanyu Suri earned 166 total points
ID: 41746231
tnsping TNSENTRY
tnsping "(ADDRESS= .. (PORT=))" --- Just the address part from TNS description

Check parameter "AUTHENTICATION SERVICES" in SQLnet and try setting it to NONE

If all looks good, try establishing  a connection using a test username/pwd

Also, are you passing password as static value or trying to pull it from a variable/file
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 41746392
Change the password, remove the @, retry script. If script works, @ is the issue, consider using a password without @. If script is not working, then you have another issue, If you have another issue than the base for this question isn't really there...
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 334 total points
ID: 41746548
>>I am beginning to think the problem is with the tnsnames.ora file.

It isn't.

Check the sqlnet.ora file and change/add SQLNET.AUTHENTICATION_SERVICES to:
SQLNET.AUTHENTICATION_SERVICES= (NONE)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article describes some very basic things about SQL Server filegroups.
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now