Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: RMAN command from script
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
![]() |
![]() |