On Thu, Nov 29, 2001 at 11:15:43AM -0800, [EMAIL PROTECTED] wrote:
I've seen a number of suggestions for sourcing .profile
in the cron jobs, but this is not always a good idea, as
.profile often contains script that will not execute when
not attached to a tty.
I think sourcing .profile is
Tim,
Sourcing a .profile within cron jobs is not a good way doing a shell
scripting. One big reason --- A .profile might contain a lot of functions
which are OK if you are loggin in with that specific user id. And those
functions might be doing some job that might affect the cron job.
In my
:
Sent by: Subject: Re: Crontabs and Oracle
[EMAIL PROTECTED
What I did is create a file that sets the environment for each database.
This file is sourced in my profile as well as any script I create.
Therefore,
when it comes time to put a script in cron I do nothing but place it
in there. Plus, that gives me one spot I ever have to change when I
upgrade.
Good idea.
Rao
-Original Message-
Sent: Friday, November 30, 2001 12:52 PM
To: Multiple recipients of list ORACLE-L
What I did is create a file that sets the environment for each database.
This file is sourced in my profile as well as any script I create.
Therefore,
when it comes time
Thanks David, and everyone else for all your help.
Unfortunately, I've done all this, specifying the variables etc and it still
doesn't appear to like it much! I don't know whether it's because it's
written in the CSH and not for KSH...I'll keep looking.
Thanks again,
Kev.
Some mornings it
Kevin,
Here's a trick to get all you need in a shell script for a cron job.
This is useful for situations such as yours where you just can't
seem to get the environment set correctly.
Run your job from the command line to make sure it works. I
assume that you've already done this.
Now set
Kevin
One thing you mentioned concerned me, the CSH and not for KSH. I
assume you are referring to Unix C shell and Korn shell script languages. I
don't know if this is your problem, but I wanted to make the following
points:
1. The #! /bin/ksh mentioned earlier will make sure the script
Does this run from Oracles crontab ??
I would suggest that you need to set up some environment variables in the
script.
Export your ORACLE_HOME in the script
and add the following to your path variable
export PATH=$PATH:$ORACLE_HOME/bin
HTH
Lee
-Original Message-
Sent: 28 November
Title: RE: Crontabs and Oracle
I don't know if it is relevant but on Compaq Tru64 we have to su - oracle even within the oracle cron
so a sample entry looks looks as follows.
10 19 * * * su - oracle -c '/usr/local/bin/tidy_listener_log.sh' etc etc
Your message_is mentions Sun in which
Thanks John. Unfortunately I can't do an SU either :o(
Cheers,
Kev.
hit any user to continue
__
Kevin Thomas
Technical Analyst
Deregulation Services
Calanais Ltd.
(2nd Floor East - Weirs Building)
Tel: 0141 568 2377
Fax: 0141 568 2366
http://www.calanais.com
You need to set the profile. In the beginning of the script call your
.profile to set the path and variables. Then set your SID if necessary.
. /opt/oracle/.profile
. envora SID
sqlplus / @somesql.sql
exit
Michael Koniszewski
D.B.A. FairPoint Communications
518-242-5922
-Original
Also, in the crontab entry, make sure u have an entry somewhat like this :
20 8 * * * su - oracle -c '/path of the script/name of the script'
/dev/null 21
which means that the script will run at 8:30 every morning on all days of
the week.
Samir Sarkar
Oracle DBA - Lennon Team
SchlumbergerSema
sounds like the path got overwritten in cron
try to do the full path specification to the sqlplus binary and see if
that fixes it
--- Thomas, Kevin [EMAIL PROTECTED] wrote:
Guys,
I have a Unix shell script that runs and does some things with
sqlplus. The
script runs fine when I start it
Thomas,
I got called to task before on this, but I didn't save the note, so whoever
corrected me, please do so again. In any case, cron jobs in UNIX are (and
this is where I was corrected - although what follows should solve your
problem) executed by root. This is why Mike suggested running
Cron jobs will not exec the profile of the user as a job executed from a
tty in UNIX...
So one could have an Oracle Cron job-but it will not exec the .profile for
the user.. And one has to perform what Mike suggested earlier
greg
-Original Message-
[mailto:[EMAIL PROTECTED]]
Sent:
Looking at my crontabs I have two solutions for this.
1) execute multiple commands via one line in crontab
e.g. 0 23 0 0 0 . /usr/local/bin/set_env;
/usr/local/bin/sql_call
or
2) execute a command as root that calls 'su' to change to the desired user
e.g. 0 23 0 0 0
17 matches
Mail list logo