Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Unanswered: how hide password when connect to oracle server?

    hello,
    when i type : connect scott/tiger@10.0.10.5:1521/orcl.local ---> connection is successful,
    but when type: connect scott@10.0.10.5:1521/orcl.local ---> "ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"

    please tell me how to hide password on command line.
    Thanks!

  2. #2
    Join Date
    Apr 2007
    Location
    Egypt
    Posts
    1

    try to help

    Hi limitmoon,

    About ur question First r u using tnsnames.ora to resolve the ORACLE SID or not
    if so then.

    For windows:
    set ORACLE_SID=DBNAME
    sqlplus USRNAME --->Enter
    then this will prompt u to enter hidden password

    for unix is the same

  3. #3
    Join Date
    Jul 2006
    Posts
    49
    To hide a password at the sqlplus command line you can use the ACCEPT command with the HIDE option. See the SQL*Plus Users Guide and Reference for more information about using this command.

    Option 2 is to issue the CONNECT command without a password, and then let Oracle prompt you for the password. This does not work well for scripts that contain CONNECT commands.

    Option 3 is to put the whole connect statement in a file, and call the file in sqlplus. Sqlplus always runs file ./login.sql whenever you launch sqlplus, so consider using that file name. For example, in your home directory or other private location create a text file and add your full connection string. You can add any sqlplus settings you like such as "set lines 100 pages 200 timing on trimspool on serveroutput on size 1000000". Whenever you launch sqlplus from the directory containing this file, Oracle automatically looks for and reads the file login.sql. If you need to re-connect, just call the file manually using the syntax @/path/filename.

  4. #4
    Join Date
    May 2006
    Posts
    132
    On Windoze, you can connect as:

    Code:
    sqlplus scott@'10.0.10.5:1521/orcl.local'
    and on *NIX:

    Code:
    sqlplus scott@\"10.0.10.5:1521/orcl.local\"
    you will then be prompted for the password and therefore avoid having the password on the command line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •