Re: can't run sql script inside ksh script

From: Robert Freeman <robertgfreeman_at_yahoo.com>
Date: Fri, 20 Nov 2009 14:14:55 -0800 (PST)
Message-ID: <296825.96506.qm_at_web113206.mail.gq1.yahoo.com>



Just a side-note, this is called a here document (the use of the <<SQLPLUS tag).

More on here documents if you are interested:

http://en.wikipedia.org/wiki/Here_document

 Robert G. Freeman
Oracle ACE
Ask me about on-site Oracle Training! RMAN, DBA, Tuning, you name it! Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON IT'S WAY SOON! OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex) Oracle Database 11g New Features (Oracle Press) Oracle Database 10g New Features (Oracle Press) Other various titles
Blog: http://robertgfreeman.blogspot.com



From: Masha Gurenich <gurenich_at_gmail.com> To: Martin Ruthner <ruthner_at_pythian.com> Cc: pegramrg_at_yahoo.com; Oracle L <oracle-l_at_freelists.org> Sent: Fri, November 20, 2009 2:59:13 PM
Subject: Re: can't run sql script inside ksh script

Thank you all!!!
The issue was resolved by copy/pasting the sql script and running it between the <<SQLPLUS tags. it won't run "_at_script.sql" way for some reason..

Thanks again,
M

On Fri, Nov 20, 2009 at 8:01 AM, Martin Ruthner <ruthner_at_pythian.com> wrote:

>
>
>
>
>
>>Did you try this already?
>
>/u01/app/oracle/product/bin/sqlplus dwmgr/u_pick_it_at_pds1_PURPLE
><<SQLPLUS
>
>>_at_/home/dwadmin/scripts/bannerstudents.sql
>
> exit
>>SQLPLUS
>
>>Martin Ruthner
>>Oracle DBA
>>The Pythian Group
>
>
>>Robert Pegram wrote:
>
>>>
>>This may be a long shot, but check /tmp. We just had a very
>>similar issue the other day on a solaris machine, and /tmp was 100%.
>>
>>>>Rob Pegram
>>>>Duke University
>>
>>
>>
>>



From: >>Masha Gurenich <gurenich_at_gmail.com>
>>To: Oracle L
>><oracle-l_at_freelists.org>
>>Sent: Thu, November
>>19, 2009 5:11:09 PM
>>Subject: can't run sql
>>script inside ksh script
>>
>>>>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
>>
>--
>Martin Ruthner
>Database Administrator - The Pythian Group, Inc.
>Email : ruthner_at_pythian.com
>Work : 1.877.PYTHIAN x250
>Mobile : 1.613.218.8402
>IM : pythianruthner
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Nov 20 2009 - 16:14:55 CST

Original text of this message