Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Posts
    3

    Unanswered: special characters(#,$) in oracle password

    Hi Experts,
    Oracle Database : 10g
    OS : HP Unix

    Above are my environment details.
    I'm trying to connect to oracle by keeping username/password@dbname in a particular file and trying to read the login string from that file.

    For example,
    username : scott
    password : tiger12#$
    database : orcl

    when i connect from unix as below it works..
    $sqlplus scott/tiger12#\$@orcl (observer "\")
    or
    $sqlplus "scott/tiger12#$ @orcl" (observer space)

    But, when i keep the same value in a file and read, it says...
    ORA-12545: Connect failed because target host or object does not exist
    for example i'm doing like
    #file1.sh
    #here i'm storing only username/password@dbname
    scott/tiger12#\$@orcl

    In my script...
    #script.sh
    #!/usr/bin/sh

    login=`cut -f1 file1.sh`

    sqlplus -s $login <<EOF
    select * from table;
    exit;
    EOF

    when i run the script.sh, i was hit with above error ORA-12545.

    Can anyone suggest a way to find solution.
    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    In order to find the error, you need to do some experiments.
    First, change your password so that it does not contain any meta characters, and then change the contents of file1.sh to suit.
    If this connection string fails then you need to look at how $login is evaluated.
    If the simplified password passes then you need to further test the use of meta characters and back slashes or the lack thereof, in your script.
    Also it would help to know what operating system you are using, and whether you are using ksh, ksh93, or bash, or ???.

  3. #3
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Quote Originally Posted by learn_unix View Post
    Can anyone suggest a way to find solution.
    Thanks.
    Try it like this:
    Code:
    $ cat oracle_access
    scott/tiger12#$@orcl
    
    
    $ cat script.sh
    login=`cat oracle_access`
    
    sqlplus -s $login <<EOF
    select * from table;
    exit;
    EOF

Posting Permissions

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