Tuesday, September 25, 2018

restore_db.sql

[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;

 

No comments:

Post a Comment

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files.

[ERROR]: The value of s_patch_service_name is not set correctly in atleast one of the context files. I got the issue below wh...