cancel
Showing results for 
Search instead for 
Did you mean: 

Crontab - brarchive not found

Former Member
0 Kudos

Hi,

I have oracle 10g on AIX5.2. I wanted to schedule the brarchive job periodically.

So scheduled a job in crontab by calling a script from there.

if the script is executed directly it works.

While in crontab it fails saying brarchive not found.

Can anybody help how to set the environment for this situation.

The entries in the crontab

30 * * * * /oracle/SID/oraarch/brarch.csh

Please suggest.

thx,

venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

vince_laurent
Active Participant
0 Kudos

Some things to check:

MAke sure you have the full path of EVERY program you run in your scipt. DON'T rely on the PATH to find it (ie use '/usr/local/bin/program' not just 'program').

Make sure you include the users environment in the crontab. An example from our HP-UX system is:

01 11 * * 5 (. /oracle/PRD/.sapenv_sapprd.sh ; . /oracle/PRD/.dbenv_sapprd.sh ; /sapsource/dbsize/dbgrowth.sh > /tmp/dbgrowth.err.$$ 2>&1 )

HTH,

Vince

Former Member
0 Kudos

I assume you entered this command in the crontab of the user <sid>adm...

If yes, try to source the .cshrc from <sid>adm's home directory at the beginning of your script:

source ~/.cshrc

or

source <full_path_to_home_directory_of_sidadm>/.cshrc

ora<sid> might work also, use his .cshrc in that case.

Best regards,

Elmar.

Former Member
0 Kudos

Hi Elmar,

Thanks for the message. I have entered this in the "orasid" user only.

i don't think its the problem with the shell..i think.. its for the crontab which is not able to get the env variables of orasid. that's y its not able to get the brarchive.

I am just looking out how to fix this. Please let me know if you have any ideas on this..

Thanks once again.

Regards,

Venkat

Former Member
0 Kudos

Hi Venki

The most simple solution is to write a shell script in which you get the right env variables before launching BrArchive

Regards

François

Former Member
0 Kudos

Hi Yenkat,

<i>> i don't think its the problem with the shell..i think.. its for the crontab which is not able to get the

> env variables of orasid. that's y its not able to get the brarchive.

</i>

The path to brarchive is set in the .dbenv_<hostname> script in the home directory of the user, this script (as well as the .sapenv_<hostname>) are sourced from the <home_of_orasid>/.cshrc.

If you run a script as cron job, the cron daemon will not source the .cshrc file, so the environment is missing (this is valid for Linux, but I belive other Unix system behave the same).

You can test this by running a script which contains the "env" command - compare the result to running "env" directly on the command line.

You should source the .cshrc in your script to set up the whole environment, brarchive will need this environment to run.

Best regards,

Elmar.