how to write restore script for this rman script attached.
434306Nov 12 2007 — edited Nov 13 2007Hi Friends,
I have following script written for talking rman backup for an ASM instance. The files are backedup to an folder which is outside ASM. Script is as follows:
#!/bin/ksh
echo Starting Fullbackup ..............
rman target=sys/password@sidname << EOF > '/oracle/dump/ODPTDB/rmanbackup/fullbck.log'
run {
allocate channel ch00 type disk;
backup incremental level 0
format '/oracle/dump/ODPTDB/rmanbackup/dbbkup_u%u_p%p_s%s_t%t.bak' database;
backup
format '/oracle/dump/ODPTDB/rmanbackup/ctlbkup_u%u_s%s_t%t.bak' CURRENT CONTROLFILE;
crosscheck archivelog all;
sql 'alter system switch logfile';
backup
format '/oracle/dump/ODPTDB/rmanbackup/arcbkup_u%u_s%s_t%t.bak' ARCHIVELOG ALL;
release channel ch00;
}
exit;
EOF
echo Completed Fullbackup .............
~
#!/bin/ksh
echo Starting Incremental Backup
rman target=sys/password@sidname <<EOF > '/oracle/dump/ODPTDB/rmanbackup/incrbck.log'
run {
allocate channel ch00 type disk;
backup incremental level 1 tag 'Incr'
format '/oracle/dump/ODPTDB/rmanbackup/dbbkup_u%u_s%s_p%p.bak' database;
#Control file
backup
format '/oracle/dump/ODPTDB/rmanbackup/ctlbkup_s%s_p%p_t%t.bak' CURRENT CONTROLFILE;
#Archivelog files
crosscheck archivelog all;
sql 'alter system archive log current';
backup
format '/oracle/dump/ODPTDB/rmanbackup/arcbkup_s%s_p%p_t%t.bak' ARCHIVELOG ALL;
release channel ch00;
}
exit;
EOF
echo Completed Incremental Backup
I will like to write a script that will restore the backedup files to the database. This should enable for the correct recovery of the database in case of eventualities. I am going to test the script by bringing down the database and restoring the backed up files and starting the DB in managed recovery mode. If the process is wrong please correct me how to do the testing of the same.
Thanks in advance for helping me.
Thanks
Shiva