Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help, what's going wrong?
When you schedule a job using at, the job copies all the evironment variables from the invoking shell into the job definition. When you schedule a job using crontab this is not done.
So, add at the beginning of the script you want to start with crontab :
. /etc/profile
. ~/.profile
This will initialize the evironment as if you are on a shell prompt. Normally all the necessary oracle variable are set using this 2 scripts.
Hope this helps
Gert
In article <92c1p5$s3m129_at_imsp212.netvigator.com>,
"Stanley" <stanley_woo_at_yahoo.com> wrote:
> Hi,
> I'm newbie to oracle, just wrote a perl script to insert some data
into
> database daily. It doesn't work and with error message as below. But
worked
> fine if executed the script under ksh. Enclosed with
>
> part of code :-
> sub connect_DB
> {
> use DBI;
> $DSN = "DBI:Oracle:CCS1";
> $user = "ccsdba";
> $pw = "ccsdba";
> $dbh = DBI->connect($DSN, $user,$pw)
> || die "cannnot connect: $DBI::errstr\n" unless $dbh;
> return;
> }
>
> Error message :-
> From ccs Wed Dec 27 14:00:01 2000
> Date: Wed, 27 Dec 2000 14:00:01 +0800
> From: ccs (calling card statistics)
> Message-Id: <200012270600.OAA29065_at_ccshost.>
> To: ccs
> Subject: Output from "cron" command
> Content-Length: 403
>
> Your "cron" job on ccshost
> /opt/ccs/bin/insertlog > /export/home/iLife/insertlog.log
>
> produced the following output:
>
> ORACLE_HOME environment variable not set!
> DBI->connect failed: Error while trying to retrieve text for error
ORA-12154
> (DBD ERROR: OCIServerAttach) at /opt/ccs/bin/insertlog line 96
> cannnot connect: Error while trying to retrieve text for error ORA-
12154
> (DBD ERROR: OCIServerAttach)
>
> ?
>
> Could someone tell what going wrong, I have check environment
varibles under
> ksh is good.
> Any words would be appreciated.
>
> Stanley
>
>
Sent via Deja.com
http://www.deja.com/
Received on Wed Dec 27 2000 - 02:29:05 CST
![]() |
![]() |