Re: Why isn't my script running?
Date: Tue, 24 Feb 2009 12:38:06 -0600
Message-Id: <074E3883-C865-4467-9346-5DD55EEF8B26_at_dannorris.com>
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_at_dpsg.com> wrote:
> Make sure you export all the environment variables: ORACLE_SID
> ORACLE_HOME .. etc.
>
>
>
> From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org
> ] On Behalf Of Eugene Pipko
> Sent: Tuesday, February 24, 2009 12:15 PM
> To: 'oracle-l_at_freelists.org'
> 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 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_at_dpsg.com 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.
>
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Feb 24 2009 - 12:38:06 CST