重新认识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-