Thursday, April 29, 2010

Run rman scripts with prompting rman password !

Linux :
=======

read -s -p "Enter password:" mypass
rman target sys/$mypass <run
{
allocate channel t1 type disk;
backup format 'df_%t_%s_%p'
(database);}

AIX
====

echo "password please:\c"
stty -echo
read mypass
stty echo
rman target sys/$mypass@onlinete << !
run
{
allocate channel t1 type disk;
backup format 'df_%t_%s_%p'
(database);}


RMAN runs from hidden password :
================================

1) create /home/oracle/.passwd
vi .passwd
sys123


2) vi rmanback.sh

export ORACLE_HOME=/orafs/app/oracle/10.2.0/db_1
pwd=`cat /home/oracle/.passwd`
$ORACLE_HOME/bin/rman target sys/$pwd@onlinete << !
run
{
allocate channel t1 type disk;
backup format 'df_%t_%s_%p'
(database);}

No comments:

Post a Comment