重新認識CREATE DATAFILE命令

kewin發表於2010-03-02
重新認識CREATE DATAFILE命令
2010-2-25
由於工作的原因,需要找CREATE DATAFILE命令,之前對這個命令是出於一知半解的狀態,通過專案重新瞭解用途。
命令的語法: ALTER DATABASE CREATE DATABASE FILE_NAME。
我們知道一般來說,用到ALTER DATABASE 都是影響比較大的操作如RECOVER ,RENAME FILENAME等等,所以我們在執行這個操作前需要謹慎。
檢視幫助手冊,發現這個命令是重新建立一個新的空的檔案來代替舊的檔案,一般是用在檔案丟失需要做恢復的時候。
原文:
Use the CREATE DATAFILE clause to create a new empty datafile 
in place of an old one. You can use this clause to re-create a datafile that was lost
with no backup. The filename or filenumber must identify a file
that is or was once part of the database. If you identify the file by number, then filenumber
is an integer representing the number found in the FILE# column of the V$DATAFILE
dynamic performance
view or in the FILE_ID column of the DBA_DATA_FILES data dictionary view.
During recovery, all archived redo logs written to since the original datafile was created must be
applied to the new, empty version of the lost datafile. Oracle Database creates the new file
in the same state as the old file when it was created. You must perform. media recovery on
the new file to return it to the state of the old file at the time it was lost.

還是那句話,對於不瞭解的命令或者是不熟悉的命令,不要去操作。
-THE END-

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/40239/viewspace-628423/,如需轉載,請註明出處,否則將追究法律責任。

相關文章