Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2003
    Posts
    35

    Question Unanswered: Strange error message but it works

    Hi I have a unix shell script that generate execute sqlplus as follows(i include the line number):


    99 `sqlplus $s'@'$u <<-EOD
    100 Set termout off linesize 500 pagesize0 verify off feedback off;
    101 Clear Buffer
    102 Clear Columns
    103 Spool $opdate/sourcetablecount.log
    104 @checknumobj.sql
    105 exit;
    106 /
    107 EOD`


    When i run the script, it generates error message as follows:

    ./migrate.sh[107]: SQL*Plus:: not found



    When i took a look at file sourcetablecount.log(my spool file),it can generate the number of record as desired.


    Do you guys encounter this problem before? What i expect is Oracle/Unix should not return any error message because it can generate the file accordingly.

    Any idea about this problem is appreciated.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    are you running this as Root or as Oracle user OR are you running this as a cronjob?

    Try calling sqlplus and all your files with the full path:

    /$ORACLE_HOME/bin/sqlplus $s@$u @run_my_script.sql
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Sep 2002
    Location
    Ohio
    Posts
    204

    Re: Strange error message but it works

    Originally posted by msetjadi
    Hi I have a unix shell script that generate execute sqlplus as follows(i include the line number):


    99 `sqlplus $s'@'$u <<-EOD
    100 Set termout off linesize 500 pagesize0 verify off feedback off;
    101 Clear Buffer
    102 Clear Columns
    103 Spool $opdate/sourcetablecount.log
    104 @checknumobj.sql
    105 exit;
    106 /
    107 EOD`


    When i run the script, it generates error message as follows:

    ./migrate.sh[107]: SQL*Plus:: not found



    When i took a look at file sourcetablecount.log(my spool file),it can generate the number of record as desired.


    Do you guys encounter this problem before? What i expect is Oracle/Unix should not return any error message because it can generate the file accordingly.

    Any idea about this problem is appreciated.
    I'd bet that the "not found" error is coming from within SQL*Plus. The message is not that sqlplus is not found, but that SQL*Plus didn't find something it was looking for. Look at the syntax of the SQL*Plus portion. Something about this part doesn't look right, but I'll leave it to you to debug:

    105 exit;
    106 /
    107 EOD

    HTH,
    Patrick

  4. #4
    Join Date
    Jun 2003
    Posts
    35
    Hi Patrick,

    if i simplified the script as followed:

    sqlplus $s'@'$u <<-EOD
    Set feedback off;
    Clear Buffer;
    exit;
    EOD


    The problem still exists, so must be in unix side?

  5. #5
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    try this in your shell script

    NOTE Dont use `command...` just do command...


    $ORACLE_HOME/bin/sqlplus $user/$password@$db <<EOD
    Set feedback off;
    select * from v\$instance;
    exit;
    EOD

Posting Permissions

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