Thursday 2 October 2014

RMAN Automatic Script : Recover & Restore Control File

export ORACLE_SID=TEST2

sqlplus /nolog <<EOF
connect rman/rman_oracledba as sysdba
startup nomount
exit
EOF
echo 'Restoring Controlfile using RMAN'   
rman <<EOF
connect target rman/rman_oracledba@test2
connect catalog rman/rman_oracledba@test1
run { allocate channel d1 type disk;
restore controlfile;
alter database  mount;
alter database  open resetlogs;
}
EOF

No comments:

Post a Comment