Question:
I need to automate a script that allows me to sign-on to RMAN
via a batch script. I can easily sign-on to SQL*Plus as SYSDBA but I
cannot use the same syntax with RMAN.
Answer: The trick for
signing-on to the RMAN command interpreter is to use the following
set-up for the environment and commands. You can use bash,
ksh, csh or sh.
Also see these related
RMAN scripts, including RMAN backup scripts from
Windows DOS scripts for RMAN automated backups. Here is yet another RMAN script that will
monitor the progress of your RMAN script.
#!/bin/sh
. /u01/app/oracle/.profile1
${ORACLE_HOME}/bin/rman <<EOF
connect target sys/syspassword@cricprod_prim
connect
auxiliary sys/syspassword@cricprod_logstdby
show all;
EOF
[http://www.dba-oracle.com/include_rman_book.htm]