Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN command from script
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.htmlReceived on Mon Nov 28 2005 - 17:05:59 CST
![]() |
![]() |