Re: can't run sql script inside ksh script

From: David Lord <dlordster_at_gmail.com>
Date: Fri, 20 Nov 2009 08:42:10 +0000
Message-ID: <649030d80911200042j3de1f932h3c893732b37d569b_at_mail.gmail.com>



Hi,

I think the problem is that you are using a 'here document' when you don't need to and it's overriding the execution of the script. If you want to run the script, do it like this:

/u01/app/oracle/product/bin/sqlplus dwmgr/u_pick_it_at_pds1_PURPLE _at_/home/dwadmin/scripts/bannerstudents.sql

Alternatively, if you want to put a script directly in the shell script, do it like this:

/u01/app/oracle/product/bin/sqlplus dwmgr/u_pick_it_at_pds1_PURPLE <<SQLPLUS select * from dual;
exit;
SQLPLUS Regards
David Lord

2009/11/19 Masha Gurenich <gurenich_at_gmail.com>:
> Hi all,
>
> This one just drives me nuts..
> I have a shell script that works OK while I am running it manually. It runs
> OK via cron up to the point where sql script should be executed:
>
> <<<bla-bla>>>
>
> /u01/app/sghe/dw/dwprod/app/scripts/dapstart
> /u01/app/sghe/dw/dwprod/app/scripts/webstart
>
> /u01/app/oracle/product/bin/sqlplus dwmgr/u_pick_it_at_pds1_PURPLE
> _at_/home/dwadmin/scripts/bannerstudents.sql <<SQLPLUS
> exit
> SQLPLUS
>
> the bannerstudents.sql is not being executed.. this is what i see in log
> file:
>
> <<<bla-bla>>>
>
> ===== DegreeWorks Web Message Queue: Key: 513 = 0x201 =====
> MsgQ Key MsgId Owner Perms #Bytes #Msgs
> 0x00000201 2326529 dwadmin 666 0 0
>
> SQL*Plus: Release 10.2.0.4.0 - Production on Thu Nov 19 15:13:08 2009
>
> Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
>
> Connected to:
> Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
> With the Partitioning, OLAP, Data Mining and Real Application Testing
> options
>
> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
> - 64bit Production
> With the Partitioning, OLAP, Data Mining and Real Application Testing
> options
>
> ~
>
> that's it!! it connects to sqlplus, but doesn't execute the script. WHY???
> Please, help me. I have tons of scripts like that and all of them are
> working. what is wrong with that one??
>
> thanks beforehand,
> M

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Nov 20 2009 - 02:42:10 CST

Original text of this message