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;
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
with Yahoo! Mail for Mobile. Get started.

Relevant Pages

  • Re: How I run a shell script from the scheduler on 10.2.0.2.0 ?
    ... "The script runs fine from a shell owned by oracle." ... I have a feeling that no one is using the scheduler to run RMAN ... the user 'nobody' has no shell so I cannot use nobody. ... Puget Sound Oracle Users Group ...
    (comp.databases.oracle.server)
  • RMAN: Syntax for including datestamp in output filename
    ... I am trying to get my RMAN to include the date/time in its output ... First I tried declaring a variable in the environment: ... in the channel declaration of the RMAN script I assigned the ... connection between the variable I'm creating and any libraries. ...
    (comp.databases.oracle.server)
  • Re: howto tell RMAN to start from one archive log number
    ... > I am trying to use RMAN script (this script work in other machine, ... > it has been doing backup every day in other production machine,which is ... > (it fail in backing up the archive log part). ...
    (comp.databases.oracle.server)
  • Re: RMAN: Syntax for including datestamp in output filename
    ... >I am trying to get my RMAN to include the date/time in its output ... >First I tried declaring a variable in the environment: ... in the channel declaration of the RMAN script I assigned the ... The backup command has it own format modifiers to include date and ...
    (comp.databases.oracle.server)
  • Re: Export/Import oracle 10g db to another machine
    ... That's just one pointer for database copying I've found over the ... I've come across RMAN but, correct me if i'm wrong, that requires the ... that is export and import oracle db to another ... EXPORT/IMPORT if the point is to clone the database? ...
    (comp.databases.oracle.server)