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.html

.



Relevant Pages

  • Re: cmd.exe rename of root directory fails with file not found
    ... allows for space to backup even if problems are encountered...such as this ... error came to light while debugging a command script backup procedure ... Is there a bug in cmd.exe with regard to dynamic disks ... Did you try some basic commands such ...
    (microsoft.public.windows.server.general)
  • Re: command line vs grid control
    ... Why would you continue to use a 'backup tool' which isn't integrated ... Rman has been around since 1998. ... If you use storage vendor replication/mirror/clone features (which are ... it bad practice to use rman from within a shell script? ...
    (comp.databases.oracle.server)
  • Re: Is It Scripting or Not
    ... I'm considering VB Script. ... Many tasks that can be done using batch scripts or directly from the command ... reasonably be carried out with a series of batch commands. ... run backup batch file for computer backups ...
    (microsoft.public.scripting.vbscript)
  • Re: command line vs grid control
    ... Perform block media recovery ... with Oracle at all, which does generate *more* redo during backup, ... Rman has been around since 1998. ... it bad practice to use rman from within a shell script? ...
    (comp.databases.oracle.server)
  • howto tell RMAN to start from one archive log number
    ... I am trying to use RMAN script (this script work in other machine, ... But there is a small instance which is running archive log mode, ... RMAN-03013: command type: backup ...
    (comp.databases.oracle.server)