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