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: Maxim Demenko <mdemenko_at_arcor.de>
Date: Tue, 29 Nov 2005 08:57:29 +0100
Message-ID: <438c0a47$0$20840$9b4e6d93@newsread2.arcor-online.net>


ram schrieb:
> Ok. I am running Oracle 9i.
> the script is
> #! /usr/local/bin/bash
> rman TARGET /
> backup format '/dbs.....' database;
> exit;
>
> It only gives me a rman prompt. then when i type exit i get this
> Recovery Manager complete.
> ../myscript.sh: backup: command not found
>
> Thanks
>

Well, in your script you are trying to execute backup command not by rman but by bash ( obviously , bash don't know such command and you get your errors).
As i said in my previous post, you need to redirect the input in your script to rman or , as proposed by Joel Garry, call rman with a cmdfile parameter pointing to your rman script. Again, redirecting in your example can be done in particular as

#! /usr/local/bin/bash
rman target / <<EOF
backup format '/dbs.....' database;
exit;
EOF If you plan to write more bash scripts in the future, i can recommend you excellent reading ( and a lot of very interesting examples of shell programming ):
http://www.tldp.org/LDP/abs/html/
http://www.tldp.org/LDP/abs/html/here-docs.html

Best regards

Maxim Received on Tue Nov 29 2005 - 01:57:29 CST

Original text of this message

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