?
Solved

SQLPLUS Command Line with Password

Posted on 2016-08-06
8
Medium Priority
?
58 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 1336 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 5

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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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 5

Assisted Solution

by:Abhimanyu Suri
Abhimanyu Suri earned 664 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 38

Expert Comment

by:Gerwin Jansen, EE MVE
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 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 1336 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

777 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