code error : sql EOF
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: code error : sql EOF

  1. #1
    Join Date
    Dec 2013
    Posts
    1

    Exclamation code error : sql EOF

    Hi ,

    iam using this script to connect to all db . first grep from oratab and use those sid as $dbname as alias ..

    where is the error : pls help

    egrep -i ":Y|:N" $ORATAB | egrep -v "9.2" | cut -d":" -f1 | grep -v "\#" | grep -v "\*" | while read dbname
    do
    echo $dbname
    export ORACLE_SID="$dbname"
    . /dba/scripts/.dba.profile
    $ORACLE_HOME/bin/sqlplus -S oracle/mysecretpassword!!!@"$dbname" <
    show user;
    EOF1
    done

    -------------------but getting error ----------------------
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
    where ::= [/][@]
    ::= [][/][@]
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    DV2ACT
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified


    ERROR:
    ORA-01017: invalid username/password; logon denied


    please help me on this..........
    Last edited by gandolf989; 12-31-2013 at 08:58 AM.

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,021
    Of course you started with making sure that your grep was not bringing in extra garbage
    and duplicate records. This really looks like a classic case of garbage in garbage out.

    I saw a few things that looked suspicious. Possibly the issue was the special character in the
    "Password" that you posted on the internet.

    Code:
    egrep -v "^#|^$|9.2" $ORATAB | cut -d":" -f1 | while read dbname
    do
    echo ${dbname}
    export ORACLE_SID="${dbname}"
    . /dba/scripts/.dba.profile
    $ORACLE_HOME/bin/sqlplus -S '/as sysdba' << EOF
    select * from v\$instance;
    show user;
    EOF
    done
    this space intentionally left blank

  3. #3
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Cool

    Just adding a bit to gandolf's post: "^+" to omit asm instances and "^*" to omit default.
    Code:
    ORATAB=/ect/oratab
    egrep -v "^#|9.2|^\+|^\*" $ORATAB |cut -d":" -f1 |\
    while read dbname
    do
      echo "++++ $dbname"
      export ORACLE_SID="$dbname"
    . /dba/scripts/.dba.profile
    $ORACLE_HOME/bin/sqlplus -S /nolog <<EOF1
      conn oracle/mysecretpassword!!!@$dbname
      show user;
    EOF1
    done
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,021
    Quote Originally Posted by LKBrwn_DBA View Post
    Just adding a bit to gandolf's post: "^+" to omit asm instances and "^*" to omit default.
    An +ASM instance is still an instance with an sga and some fixed views.
    So you can query an +ASM instance, just in a more limited way.
    this space intentionally left blank

Posting Permissions

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


Click Here to Expand Forum to Full Width