溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

RMAN中如何使用set命令

發(fā)布時間:2021-11-11 14:50:08 來源:億速云 閱讀:223 作者:小新 欄目:關系型數(shù)據(jù)庫

小編給大家分享一下RMAN中如何使用set命令,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

一、set newname命令:
If you are restoring some data files to new locations, then execute RESTORE DATABASE and RECOVER DATABASE sequentially in a RUN command. Use the SET NEWNAME to rename data files, as described in "Restoring Datafiles to a Nondefault Location".
如果要將某些數(shù)據(jù)文件還原到新位置,請在RUN命令中按順序執(zhí)行RESTORE DATABASE和RECOVER DATABASE。 使用SET NEWNAME重命名數(shù)據(jù)文件,如"將數(shù)據(jù)文件還原到非默認位置"中所述。

The following example restores the database, specifying new names for three of the data files, and then recovers the database:
RUN
{  
  SET NEWNAME FOR DATAFILE 2 TO '/disk2/df2.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '/disk2/df3.dbf';
  SET NEWNAME FOR DATAFILE 4 TO '/disk2/df4.dbf';
  RESTORE DATABASE;
  SWITCH DATAFILE ALL;
  RECOVER DATABASE;
}

二、Restoring Datafiles to a Nondefault Location(將數(shù)據(jù)文件還原到非默認位置)
If you cannot restore data files to their default locations, then you must update the control file to reflect the new locations of the data files. Use the RMAN SET NEWNAME command within a RUN command to specify the new file name. Afterward, use a SWITCH command, which is equivalent to using the SQL statement ALTER DATABASE RENAME FILE, to update the names of the data files in the control file. SWITCH DATAFILE ALL updates the control file to reflect the new names for all data files for which a SET NEWNAME has been issued in a RUN command.
如果無法將數(shù)據(jù)文件恢復到其默認位置,則必須更新控制文件以反映數(shù)據(jù)文件的新位置。 在RUN命令中使用RMAN SET NEWNAME命令來指定新的文件名。 之后,使用一個SWITCH命令(相當于使用SQL語句ALTER DATABASE RENAME FILE)來更新控制文件中數(shù)據(jù)文件的名稱。  SWITCH DATAFILE ALL將更新控制文件,以反映在RUN命令中為SET NEWNAME發(fā)出的所有數(shù)據(jù)文件的新名稱。

以上是“RMAN中如何使用set命令”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI