重建控制檔案後某些檔案被命名為MISSINGnnnnn

wallimn發表於2011-08-31
轉自:http://blog.chinaunix.net/space.php?uid=21267615&do=blog&cuid=2205553

在複習OCP的過程中看到一題:
The loss of the control file forced you to re-create the control file .
After re-creating it nad opening the database , you find that some of the data files are named as MISSINGnnnnn ,
where nnnnn is a five-digit number starting with 0 . What could be the possible reason ?

A. These are the data files that are corrupted .
B. There is no SYSAUX tablespace in your database .
C. There is read-only tablespace in your database .
D. These are the data files that cannot be recovered .

Answer : C
不太明白為什麼 read-only tablespace 會有這種表現,後來一頓搜尋終於找到原因了。
Read-only files should not
be listed in the CREATE CONTROLFILE statement so that recovery can skip these files.
No recovery is required for read-only datafiles unless you restored backups of these
files from a time when the datafiles were read/write.
After you create a new control file and attempt to mount and open the database, the
database performs a data dictionary check against the files listed in the control file. For
each file that is not listed in the CREATE CONTROLFILE statement but is present in the
data dictionary, an entry is created for them in the control file. These files are named as
MISSINGnnnnn, where nnnnn is a five digit number starting with 0.
After the database is open, rename the read-only files to their correct filenames by
executing the ALTER DATABASE RENAME FILE statement for all the files whose name
is prefixed with MISSING.

All the restrictions related to read-only files in CREATE CONTROLFILE statements also
apply to offline normal tablespaces, except that you need to bring the tablespace online
after the database is open. You should leave out tempfiles from the CREATE
CONTROLFILE statement and add them after database open.
只讀檔案是不記錄在Create ControlFile 這個“救命”語句裡面的,原因是沒有必要對這些檔案進行恢復操作,但是,資料字典裡面是有這些read-only表空間的記錄的,當用一個新的 control file開啟資料庫的時候,Oracle 會檢查新 control file 中的檔案列表和資料字典裡面的檔案列表對比,結果在新 control file 中找不到,於是就會將這些檔案命名為 MISSINGnnnnn (n是數字,以0為開頭)。

相關文章