0

I have installed instantclient 12c x86 on Windows 8.1

I am able to connect from cmd.exe:

C:\Users\vagrant>sqlplus user@\"hostname:1521/SERVICE_NAME\"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 3 06:22:31 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options

SQL>

Now when I try the same from Powershell:

I want to be prompted for password. It does not work.

PS C:\Users\vagrant> sqlplus user@\"hostname:1521/SERVICE_NAME\"

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 3 06:30:12 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

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


Enter user-name:

Here I provide my password and it works

PS C:\Users\vagrant>sqlplus user/password@hostname:1521/SERVICE_NAME

SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 3 06:24:48 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> 

What is the correct syntax for being prompted for password logging in with sqlplus from Powershell?

Bjarte Brandt
  • 4,191
  • 2
  • 23
  • 25

0 Answers0