Re: Using sqlplus without typing a password in the command line (with Instant Cient)?

From: <sybrandb_at_yahoo.com>
Date: 28 Oct 2004 00:48:56 -0700
Message-ID: <a1d154f4.0410272348.11803c9a_at_posting.google.com>


Richard <grin_at_unice.fr> wrote in message news:<417FD9B4.5020700_at_unice.fr>...
> Hello,
>
> I have just installed for the first time Oracle Server 9i (under Windows
> 2003) and Instant Client under Linux.
>
> I can't understand how not to type my password in the command line.
>
> Here is the story:
>
> 1. When I type
> /usr/bin/sqlplus john/mypassword_at_//sirocco.nice.com:1521/DB
> it works; I am connected to the DB database.
>
> 2. But I don't want to type my password in the command line, so I type
> /usr/bin/sqlplus john_at_//sirocco.nice.com:1521/DB
>
> And I receive the following message:
>
> SQL*Plus: Release 10.1.0.2.0 - Production on Wed Oct 27 18:38:27 2004
>
> Copyright (c) 1982, 2004, Oracle. All rights reserved.
>
> Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
> where <option> ::= -H | -V | [ [-C <v>] [-L] [-M <o>] [-R <n>] [-S] ]
> <logon> ::= <username>[/<password>][_at_<connect_identifier>] | / |
> /NOLOG
> <start> ::= _at_<URL>|<filename>[.<ext>] [<parameter> ...]
> "-H" displays the SQL*Plus version banner and usage syntax
> "-V" displays the SQL*Plus version banner
> "-C" sets SQL*Plus compatibility version <v>
> "-L" attempts log on just once
> "-M <o>" uses HTML markup options <o>
> "-R <n>" uses restricted mode <n>
> "-S" uses silent mode
>
>
> 3. If I type a bad password (to type the good one after):
> /usr/bin/sqlplus john/badpassword_at_//sirocco.nice.com:1521/DB
> it doesn't work :
> SQL*Plus: Release 10.1.0.2.0 - Production on Wed Oct 27 18:34:15 2004
>
> Copyright (c) 1982, 2004, Oracle. All rights reserved.
>
> ERROR:
> ORA-01017: invalid username/password; logon denied
>
>
> Enter user-name: john
> Enter password: // I type the good password here
> ERROR:
> ORA-12162: TNS:net service name is incorrectly specified
>
>
> Enter user-name:
> ERROR:
> ORA-12162: TNS:net service name is incorrectly specified
>
>
> SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
>
> Someone can help me, please ?
>
> Thanks in avance for your answers.
>
> Richard

Read the error message ora-12162 *carefully*, set up a correct tnsnames.ora and use a correct service name when connecting, and not this undocumented crap.

Sybrand Bakker
Senior Oracle DBA Received on Thu Oct 28 2004 - 09:48:56 CEST

Original text of this message