Some days, I hate the iPhone spell checker--I should be more careful. For clarification, I mean "...your interactive shell environment..." and "Cron jobs..." Hope that helps. English is my primary (and only, really) language, but I still struggle ;). dn On Tue, Feb 24, 2009 at 12:38 PM, Dan Norris <dannorris@xxxxxxxxxxxxx>wrote: > But first, make sure you set those variables. Your script probably works > interactively because you have your O_H, O_SID, and PATH set in tour > interactive shell environment. From jobs start without any environment set. > So, it is common to either set them in the script or source your profile > (like ". $HOME/.bash_profile") if the variables are set in there. > > Dan > > Sent from my iPhone > > On Feb 24, 2009, at 12:25 PM, "Xu, Roger" <Roger.Xu@xxxxxxxx> wrote: > > Make sure you export all the environment variables: ORACLE_SID > ORACLE_HOME .. etc. > > > ------------------------------ > > *From:* oracle-l-bounce@xxxxxxxxxxxxx [ > mailto:oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx>] *On > Behalf Of *Eugene Pipko > *Sent:* Tuesday, February 24, 2009 12:15 PM > *To:* 'oracle-l@xxxxxxxxxxxxx' > *Subject:* Why isn't my script running? > > > > Hi all, > > I am new to shell. I need to calculate stats for a schema using cron > (oracle linux 4). > > For some reason my script is not running. > > -------------------------------------- > > #!/bin/ksh > > USER=SYSTEM > > PASSWORD=pwd > > sqlplus -s $USER/$PASSWORD <<EOF > > set feed off > > set head off > > set pagesize 0 > > exec > dbms_stats.gather_schema_stats('TEST',ESTIMATE_PERCENT=>30,CASCADE=>TRUE); > > / > > exit 0; > > EOF > > ------------------- > > > > Then in Linux: > > 00 01 * * 7 /home/oraprd/scripts/test_schema_stats.sh 1&2 >> > /home/oraprd/scripts/logs/test_schema_stats.log > > > > Thanks, > > Eugene Pipko > > P Please consider the environment before printing this e-mail. > > > > > > *Click here <http://www.drpeppersnapplegroup.com/about/corporate>* to > learn more about Dr Pepper Snapple Group’s commitment to corporate* * > social* *responsibility. > > Please be conscious of the environment and print this email only if > absolutely necessary. > > This e-mail (including any attachments) is confidential and may contain > privileged information of Dr Pepper Snapple Group, Inc. and/or its > subsidiaries ("Dr Pepper Snapple Group"). If you are not the intended > recipient or receive it in error, you may not use, distribute, disclose or > copy any of the information contained within it and it may be unlawful to do > so. If you are not the intended recipient, please notify us immediately by > returning this e-mail to us at mailerror@xxxxxxxx and destroy all > copies. Any views expressed by individuals within this e-mail do not > necessarily reflect the views of Dr Pepper Snapple Group. This e-mail does > not constitute a binding offer, acceptance, amendment, waiver or other > agreement, unless the intent that an e-mail will constitute such is clearly > stated in the body of the email. Recipients are advised to subject this > e-mail and attachments to their own virus checking, in keeping with good > computing practice. Please note that e-mail received by Dr Pepper Snapple > Group may be monitored in accordance with applicable law. > >