restore of database files and tempfiles

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

restore of database files and tempfiles

Roshan
Oracle Database 12.1.0.2

Hello Erman,

I am have restored a RAC database to another server.

Below is the script

connect target / ;
connect auxiliary /;
set DBID=1259716167

run {

ALLOCATE CHANNEL CH1 TYPE 'SBT_TAPE';

SEND 'NSR_ENV=(NSR_SERVER=rhis-nwdd-1202,NSR_CLIENT=10.210.127.80)';
set newname for database to '/oradata/lcms/%d%U.dbf';
restore database;
recover database;
}

On production(source), the filenames are in the format below

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/lcms/system02.dbf
+DATA/lcms/system01.dbf
+DATA/lcms/sysaux01.dbf
+DATA/lcms/undotbs101.dbf
+DATA/lcms/undotbs201.dbf
+DATA/lcms/users01.dbf
+DATA/lcms/test.dbf
+DATA/lcms/lcms_master_dat.dbf
+DATA/lcms/lcms_master_idx.dbf
+DATA/lcms/lcms_trans_dat0.dbf2.dbf
+DATA/lcms/lcms_trans_dat.dbf

FILE_NAME
--------------------------------------------------------------------------------
+DATA/lcms/lcms_trans_idx.dbf
+DATA/lcms/lcms_log_dat_06.dbf
+DATA/lcms/lcms_log_dat_05.dbf
+DATA/lcms/lcms_log_dat_04.dbf
+DATA/lcms/lcms_log_dat_03.dbf
+DATA/lcms/lcms_log_dat_02.dbf
+DATA/lcms/lcms_log_dat01.dbf
+DATA/lcms/lcms_log_dat.dbf
+DATA/lcms/lcms_log_idx.dbf
+DATA/lcms/lcms_temp_dat.dbf
+DATA/lcms/lcms_temp_idx.dbf

FILE_NAME
--------------------------------------------------------------------------------
+DATA/lcms/lcms_dwh_dat0.dbf.ora04.dbf
+DATA/lcms/lcms_dwh_dat0.dbf3.ora
+DATA/lcms/lcms_dwh_dat02.dbf
+DATA/lcms/lcms_dwh_dat.dbf
+DATA/lcms/lcms_dwh_idx.dbf
+DATA/lcms/lcms_ca_master_dat.dbf
+DATA/lcms/lcms_ca_master_idx.dbf
+DATA/lcms/lcms_ca_trans_dat.df
+DATA/lcms/lcms_ca_trans_idx.dbf
+DATA/lcms/lcms_ca_log_dat.dbf
+DATA/lcms/lcms_ca_log_idx.dbf

FILE_NAME
--------------------------------------------------------------------------------
+DATA/lcms/lcms_usrx01.dbf

How can I modify my restore script so as the restored files will have same name as production?
For example 'lcms_ca_log_idx.dbf'


connect target / ;
connect auxiliary /;
set DBID=1259716167

run {

ALLOCATE CHANNEL CH1 TYPE 'SBT_TAPE';

SEND 'NSR_ENV=(NSR_SERVER=rhis-nwdd-1202,NSR_CLIENT=10.210.127.80)';
set newname for database to '/oradata/lcms/%d%U.dbf';
restore database;
recover database;
}

Thanks,

Roshan
Reply | Threaded
Open this post in threaded view
|

Re: restore of database files and tempfiles

ErmanArslansOracleBlog
Administrator
 If you want to explicitly name your datafiles, then you must use non-OMF format as shown below :

 SET newname FOR datafile 1 TO '+DATADG/T4IPLUS/datafile/system.dbf';
 SET newname FOR datafile 2 TO '+DATADG/T4IPLUS/datafile/sysaux.dbf';
 SET newname FOR datafile 3 TO '+DATADG/T4IPLUS/datafile/undotbs1.dbf';

and so on.

Since this involves your production, be careful. Risk is yours.

Ref: Set Newname to Full OMF Name is Ignored (Doc ID 2207480.1)
Reply | Threaded
Open this post in threaded view
|

Re: restore of database files and tempfiles

Roshan
Ok noted.

Thanks