Wikipedia

Search results

Monday, 23 June 2014

IBM Rman Database Restore Script

export ORACLE_HOME=/FMS1/11G/DB/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/bin/rman:$PATH
export ORACLE_SID=PROD
rman nocatalog log='/home/oratest/scripts/cloning_scripts/rman_scr/tst_restore_4mar.log' << EOF
connect target /
run {
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system11.dbf' TO '/TESTDB/R12/db/apps_st/data/system11.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system10.dbf' TO '/TESTDB/R12/db/apps_st/data/system10.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system09.dbf' TO '/TESTDB/R12/db/apps_st/data/system09.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system08.dbf' TO '/TESTDB/R12/db/apps_st/data/system08.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system07.dbf' TO '/TESTDB/R12/db/apps_st/data/system07.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system06.dbf' TO '/TESTDB/R12/db/apps_st/data/system06.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system05.dbf' TO '/TESTDB/R12/db/apps_st/data/system05.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system04.dbf' TO '/TESTDB/R12/db/apps_st/data/system04.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system03.dbf' TO '/TESTDB/R12/db/apps_st/data/system03.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system02.dbf' TO '/TESTDB/R12/db/apps_st/data/system02.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/system01.dbf' TO '/TESTDB/R12/db/apps_st/data/system01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/undo01.dbf' TO '/TESTDB/R12/db/apps_st/data/undo01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_archive01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_archive01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_int01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_int01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_media01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_media01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_nolog01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_nolog01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_queue01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_queue01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_queue02.dbf' TO '/TESTDB/R12/db/apps_st/data/a_queue02.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_ref01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_ref01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_ref02.dbf' TO '/TESTDB/R12/db/apps_st/data/a_ref02.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_summ01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_summ01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data02.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data02.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data03.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data03.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data4.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data4.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data5.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data5.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_data6.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_data6.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_ind01.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_ind01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_ind02.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_ind02.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_ind03.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_ind03.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_ind04.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_ind04.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/a_txn_ind05.dbf' TO '/TESTDB/R12/db/apps_st/data/a_txn_ind05.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/ctxd01.dbf' TO '/TESTDB/R12/db/apps_st/data/ctxd01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/odm.dbf' TO '/TESTDB/R12/db/apps_st/data/odm.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/olap.dbf' TO '/TESTDB/R12/db/apps_st/data/olap.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/owad01.dbf' TO '/TESTDB/R12/db/apps_st/data/owad01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/portal01.dbf' TO '/TESTDB/R12/db/apps_st/data/portal01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/sysaux01.dbf' TO '/TESTDB/R12/db/apps_st/data/sysaux01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/apps_ts_tools01.dbf' TO '/TESTDB/R12/db/apps_st/data/apps_ts_tools01.dbf';
SET NEWNAME FOR DATAFILE '/FMSDATA/R12/db/apps_st/data/XXICAR01.dbf' TO '/TESTDB/R12/db/apps_st/data/XXICAR01.dbf';
RESTORE Database;
Switch datafile all;
}
EOF

exit;

No comments:

Post a Comment