[oascpprd@TJTGB006 rman]$ cat restore_db.sql
set echo off pages 0 feed off sqlp #
set linesize 300
set head off
spool restore-db_ASCPPROD.rman
select 'catalog start with ''/ASCPPROD_Arch/ASCPPRD_BKP_090115'' NOPROMPT;' from dual;
select 'RUN { ' from dual;
select 'set newname for datafile '||file#||' to '||'''/ASCPPROD_DB/oracle/product/ASCPPROD/db/apps_st/data/'||REGEXP_REPLACE(''||name||'','.*/')||''';' from v$datafile;
select 'set newname for tempfile '||file#||' to '||'''/ASCPPROD_DB/oracle/product/ASCPPROD/db/apps_st/data/'||REGEXP_REPLACE(''||name||'','.*/')||''';' from v$tempfile;
select 'restore database;' from dual;
select 'switch datafile all;' from dual;
select 'switch tempfile all;' from dual;
select 'recover database;' from dual;
select '} ' from dual;
select 'exit' from dual;
spool off
exit;
set echo off pages 0 feed off sqlp #
set linesize 300
set head off
spool restore-db_ASCPPROD.rman
select 'catalog start with ''/ASCPPROD_Arch/ASCPPRD_BKP_090115'' NOPROMPT;' from dual;
select 'RUN { ' from dual;
select 'set newname for datafile '||file#||' to '||'''/ASCPPROD_DB/oracle/product/ASCPPROD/db/apps_st/data/'||REGEXP_REPLACE(''||name||'','.*/')||''';' from v$datafile;
select 'set newname for tempfile '||file#||' to '||'''/ASCPPROD_DB/oracle/product/ASCPPROD/db/apps_st/data/'||REGEXP_REPLACE(''||name||'','.*/')||''';' from v$tempfile;
select 'restore database;' from dual;
select 'switch datafile all;' from dual;
select 'switch tempfile all;' from dual;
select 'recover database;' from dual;
select '} ' from dual;
select 'exit' from dual;
spool off
exit;
No comments:
Post a Comment