[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

SQLPLUS Command Line with Password

Posted on 2016-08-06
8
Medium Priority
?
71 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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…

650 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