RE: help with my perl script



This tells me there is something not set in your environment. Have you
tried setting the environment like I specified?



rr



________________________________

From: joe bayer [mailto:joebayerii@xxxxxxxxx]
Sent: Friday, March 23, 2007 7:28 PM
To: Reidy, Ron; RaviChandra Chelikam; dbi-users@xxxxxxxx
Subject: RE: help with my perl script



Yes, DB is running. If I run
../test.sh, there is no problem.

The problem comes only when I put it in cron.



"Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx> wrote:

Then there is something wrong with your environment. Have you tried
using oraenv to set you environment vs. setting the %ENV hash? In cron,
it would look like this:



(export ORAENV_ASK=NO && export ORACLE_SID=test && . oraenv &&
/path/to/rman/script)



There are other environment variables that are set in oraenv.



Another question I have to ask - is the DB running?



--

Ron Reidy

Lead DBA

Array BioPharma, Inc.



________________________________

From: joe bayer [mailto:joebayerii@xxxxxxxxx]
Sent: Friday, March 23, 2007 4:25 PM
To: Reidy, Ron; RaviChandra Chelikam; dbi-users@xxxxxxxx
Subject: RE: help with my perl script



Thanks for your prompt response.

I tried
$ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}="test"

It did not work.



"Reidy, Ron" <Ron.Reidy@xxxxxxxxxxxxxxxxxx> wrote:

See below ...



________________________________

From: joe bayer [mailto:joebayerii@xxxxxxxxx]
Sent: Friday, March 23, 2007 3:33 PM
To: Reidy, Ron; RaviChandra Chelikam; dbi-users@xxxxxxxx
Subject: help with my perl script



Dear group, I know it is not DBI related problem, but it is hard to
find some one who knows perl, shell and Oracle.

I am trying to write a RMAN script,
======
#!/usr/bin/perl

my $ORACLE_HOME = "/opt/oracle/product_10g/test/10.2";
$ENV{ORACLE_HOME}=$ORACLE_HOME;
my $ORACLE_SID="test";
$ENV{ORACLE_SID}=test; # what is this? Shouldn't this read
$ENV{ORACLE_SID}=$ORACLE_SID or $ENV{ORACLE_SID}="test"
my $backup_log = "/backup/backup_log.log";

open RMAN, "| /opt/oracle/product_10g/eratest/10.2/bin/rman
target=sys/temp log=$backup_log" or die "Can't pipe to $!";
print RMAN "exit\n";
close RMAN;
======

It works in command line, but when I put it into crontab job, I always
get
===================
connected to target database (not started)
RMAN>
===================
The script does not recognize the sid, what can I do to fix it?

Thanks very much for your help.



________________________________

No need to miss a message. Get email on-the-go
<http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a>
with Yahoo! Mail for Mobile. Get started.
<http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a>

________________________________

size=2 width="100%" align=center>

This electronic message transmission is a PRIVATE communication which
contains information
which may be confidential or privileged. The information is intended to
be for the use of the individual
or entity named above. If you are not the intended recipient, please be
aware that any disclosure,
copying, distribution or use of the contents of this information is
prohibited. Please notify the sender
of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0),
and then delete it from your system.





________________________________

No need to miss a message. Get email on-the-go
<http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a>
with Yahoo! Mail for Mobile. Get started.
<http://us.rd.yahoo.com/evt=43910/*http:/mobile.yahoo.com/mail%0d%0a>





________________________________

TV dinner still cooling?
Check out "Tonight's Picks"
<http://us.rd.yahoo.com/evt=49979/*http:/tv.yahoo.com/> on Yahoo! TV.



Relevant Pages

  • Re: CGI: Execute a perl script inside another perl script
    ... > perl script where I only set environment variables. ... > terminated without a valid CGI header. ...
    (comp.lang.perl.misc)
  • Re: Win32::API and SetEnvironmentVariable
    ... >> Actually, it looks like the SetEnvVar sub I created is working fine, ... >> I have another environment variable issue I am struggling with that I ... >> Perl script is running in is setting the variables I need, ...
    (comp.lang.perl.misc)
  • Re: Win32::API and SetEnvironmentVariable
    ... > Actually, it looks like the SetEnvVar sub I created is working fine, ... > Perl script is running in is setting the variables I need, but MSDEV ... MSDEV.EXE will receive the environment given it by the ...
    (comp.lang.perl.misc)
  • RE: help with my perl script
    ... Then there is something wrong with your environment. ... There are other environment variables that are set in oraenv. ... help with my perl script ... I am trying to write a RMAN script, ...
    (perl.dbi.users)
  • RE: help with my perl script
    ... help with my perl script ... I am trying to write a RMAN script, ... with Yahoo! ... Please notify the sender ...
    (perl.dbi.users)