Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN command from script

Re: RMAN command from script

From: Joel Garry <joel-garry_at_home.com>
Date: 28 Nov 2005 15:05:59 -0800
Message-ID: <1133219159.060626.238850@z14g2000cwz.googlegroups.com>

ram wrote:
> Hello,
> I am trying to run the RMAN backup from a script (unix). i wrote a
> small script (sh) with following commands:
> rman TARGET /
> RUN { backup database;
> }
> when i run it gives errors RUN, backup commands not found.
> Do i need to store this file under some specific dir? am i missing
> something?
> Thanks

Another way is to put the rman commands in another file and call it from the shell script, ie:

. /usr/local/bin/oradbenv
THE_DATE=`date +%y%m%d`
export FLASH_AREA="/oradata/flash"
rman nocatalog cmdfile ~/scripts/backup.rcv trace ~/logs/backup${THE_DATE}.log

and the rcv file in the scripts directory under your login directory would have:

connect target
run {
  backup
  full
  skip inaccessible
  filesperset 4
  tag full_db
  format '$FLASH_AREA/df_%U'
  database;
sql "alter system archive log current";
sql "alter database backup controlfile to trace"; backup archivelog all format '$FLASH_AREA/al_%U'; }

With maybe some allocate, set limit, release, include, etc. commands, depending on your version and setup.

jg

--
@home.com is bogus.
Shocking, just shocking.
http://www.signonsandiego.com/uniontrib/20051128/news_1n28judge.html
Received on Mon Nov 28 2005 - 17:05:59 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US