日期:2014-05-16  浏览次数:20638 次

重建控制文件后某些文件被命名为MISSINGnnnnn
转自: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为开头)。