2026-03-12 20:23:15
This commit is contained in:
36
vg/rman_clone_database.rman
Normal file
36
vg/rman_clone_database.rman
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
rman target / <<EOF
|
||||
restore controlfile from '/apps/jupi-fio/backup/JUPIFIO1/rman/fromprod/EOD_MTY_110131/cntrl_file_LIVE_bck_8175.ctrl';
|
||||
sql 'alter database mount';
|
||||
catalog start with '/apps/jupi-fio/backup/JUPIFIO1/rman/fromprod/EOD_MTY_110131/' noprompt;
|
||||
run
|
||||
{
|
||||
SET NEWNAME FOR DATAFILE 1 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_system_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 2 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_sysaux_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 3 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_undo_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 4 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_dba_audit_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 5 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_tools_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 6 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_users_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 7 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 8 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_xmldb_01.dbf';
|
||||
SET NEWNAME FOR DATAFILE 9 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_02.dbf';
|
||||
SET NEWNAME FOR DATAFILE 10 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_03.dbf';
|
||||
SET NEWNAME FOR DATAFILE 11 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_04.dbf';
|
||||
SET NEWNAME FOR DATAFILE 12 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_05.dbf';
|
||||
SET NEWNAME FOR DATAFILE 13 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_06.dbf';
|
||||
SET NEWNAME FOR DATAFILE 14 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_data_07.dbf';
|
||||
restore database;
|
||||
SWITCH datafile ALL;
|
||||
|
||||
SET NEWNAME FOR TEMPFILE 1 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_temp_01.dbf';
|
||||
SET NEWNAME FOR TEMPFILE 3 to '/apps/jupi-fio/data01/JUPIFIO1/JUPIFIO1_temp_02.dbf';
|
||||
SWITCH tempfile ALL;
|
||||
|
||||
recover database until ----;
|
||||
|
||||
sql 'alter database open resetlogs';
|
||||
}
|
||||
EOF
|
||||
|
||||
alter database backup controlfile to trace resetlogs;
|
||||
-- recreate controlfile to rename database.
|
||||
Reference in New Issue
Block a user