共計 1482 個字符,預計需要花費 4 分鐘才能閱讀完成。
丸趣 TV 小編給大家分享一下 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 .
如果要將某些數據文件還原到新位置,請在 RUN 命令中按順序執行 RESTORE DATABASE 和 RECOVER DATABASE。使用 SET NEWNAME 重命名數據文件,如 將數據文件還原到非默認位置 中所述。
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(將數據文件還原到非默認位置)
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.
如果無法將數據文件恢復到其默認位置,則必須更新控制文件以反映數據文件的新位置。在 RUN 命令中使用 RMAN SET NEWNAME 命令來指定新的文件名。之后,使用一個 SWITCH 命令(相當于使用 SQL 語句 ALTER DATABASE RENAME FILE)來更新控制文件中數據文件的名稱。 SWITCH DATAFILE ALL 將更新控制文件,以反映在 RUN 命令中為 SET NEWNAME 發出的所有數據文件的新名稱。
以上是“RMAN 中如何使用 set 命令”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注丸趣 TV 行業資訊頻道!