SET NEWNAME FOR
SET NEWNAME FOR後面必須帶SWITCH DATAFILE ALL或SWITCH TEMPFILE ALL
RUN {
SET NEWNAME FOR DATAFILE 1 to '/oracle/ora11g/oradata/system01.dbf';
SET NEWNAME FOR DATAFILE 2 to '/oracle/ora11g/oradata/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 to '/oracle/ora11g/oradata/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 to '/oracle/ora11g/oradata/users01.dbf';
SET NEWNAME FOR DATAFILE 5 to '/oracle/ora11g/oradata/undotbs02.dbf';
SET NEWNAME FOR DATAFILE 6 to '/oracle/ora11g/oradata/test01.dbf';
SET NEWNAME FOR TEMPFILE 1 to '/oracle/ora11g/oradata/temp01.dbf';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
}
run{
set newname for datafile '/MM/DataYY.dbf' to '/NN/DataYY.dbf';
set newname for tempfile '/MM/TempYY.dbf' to '/NN/TempYY.dbf';
restore database;
switch datafile all;
switch tempfile all;
}
MM是原路徑,NN是新路徑
只轉換DATAFILE時如下
run{
set newname for datafile '/MM/DataYY.dbf' to '/NN/DataYY.dbf';
restore database;
switch datafile all;
}
switch datafile all、switch tempfile all的作用就是在控制檔案裡面把資料檔案路徑改過了
If you need to restore a data file to a new location, then use the RMAN SET NEWNAME command within a RUN command to specify the new file name. Afterward, use a SWITCH DATAFILE ALL command, which is equivalent to using the SQL statement ALTER DATABASE RENAME FILE, to update the control file to reflect the new names for all data files for which a SET NEWNAME has been issued in the RUN command.
RUN {
SET NEWNAME FOR DATAFILE 1 to '/oracle/ora11g/oradata/system01.dbf';
SET NEWNAME FOR DATAFILE 2 to '/oracle/ora11g/oradata/sysaux01.dbf';
SET NEWNAME FOR DATAFILE 3 to '/oracle/ora11g/oradata/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 4 to '/oracle/ora11g/oradata/users01.dbf';
SET NEWNAME FOR DATAFILE 5 to '/oracle/ora11g/oradata/undotbs02.dbf';
SET NEWNAME FOR DATAFILE 6 to '/oracle/ora11g/oradata/test01.dbf';
SET NEWNAME FOR TEMPFILE 1 to '/oracle/ora11g/oradata/temp01.dbf';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
SWITCH TEMPFILE ALL;
}
run{
set newname for datafile '/MM/DataYY.dbf' to '/NN/DataYY.dbf';
set newname for tempfile '/MM/TempYY.dbf' to '/NN/TempYY.dbf';
restore database;
switch datafile all;
switch tempfile all;
}
MM是原路徑,NN是新路徑
只轉換DATAFILE時如下
run{
set newname for datafile '/MM/DataYY.dbf' to '/NN/DataYY.dbf';
restore database;
switch datafile all;
}
switch datafile all、switch tempfile all的作用就是在控制檔案裡面把資料檔案路徑改過了
If you need to restore a data file to a new location, then use the RMAN SET NEWNAME command within a RUN command to specify the new file name. Afterward, use a SWITCH DATAFILE ALL command, which is equivalent to using the SQL statement ALTER DATABASE RENAME FILE, to update the control file to reflect the new names for all data files for which a SET NEWNAME has been issued in the RUN command.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2142843/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RMAN SET NEWNAME
- rman set newname switch 用法
- RMAN : set newname for命令的一點研究
- 解決set newname 極慢的問題
- 關於rman中set newname的探討
- 【備份恢復】set newname切換日誌
- [20160720]rman set newname for datafile
- oracle rman 異機還原測試--set newnameOracle
- SET NEWNAME 切換檔案並恢復影像副本
- [20201103]set newname for datafile.txt
- oracle10g_rman_syntac testing_set newname_switch tempfile_datafile_all_tagOracle
- Set
- set /?
- lombok get/set 與 JavaBean get/setLombokJavaBean
- Jet Set
- set -e
- Vue.set與vue.$set的使用Vue
- set pause on,set pagesize N小知識點。
- [Javascript] Perform Set Operations using JavaScript Set MethodsJavaScriptORM
- alter system set event和set events的區別
- Redis 入門 - 3(集合 set、有序集合 sort set)Redis
- JavaScript Set物件JavaScript物件
- Set delete() 方法delete
- oracle set eventsOracle
- alter session setSession
- 【轉】SET SERVEROUTPUTServer
- 【轉】SET SERVEROUTPUT ONServer
- oracle set roleOracle
- set excel formatExcelORM
- Redis之setRedis
- 訓練集(train set),驗證集(validation set)和測試集(test set)AI
- cmd_sqlplus:set head off and set head onSQL
- Set size 屬性
- JavaScript Set與WeakSetJavaScript
- set_time_limitMIT
- C# Get SetC#
- Set介面_network
- Python set(集合)Python