Controlfile Structure

1280阅读 1评论2013-02-27 tomsyan
分类:Oracle



The first block of the controlfile is a header block that records just the controlfile block size and the number of blocks in the controlfile. The controlfile block size is the same as the database block size. When mounting a database, Oracle checks that the controlfile block size and the file size recorded in the controlfile header block match the db_block_size parameter and the file size reported by the operating system (if available). Otherwise an error is raised to indicate that the controlfile might have been corrupted or truncated.


After the header block, all controlfile blocks occur in pairs. Each logical block is represented by two physical blocks. This is necessary for the  mechanism.

It is theoretically possible that a hot backup of a controlfile could contain a split block. Therefore all controlfile blocks other than the file header have a  that can be compared when mounting a database and whenever a controlfile block is read. The block type is 0 for virgin controlfile blocks and 21 otherwise. The physical controlfile block number is used in place of an RDBA in the cache header, and a  is used in place of an SCN to record when the block was last changed. An ORA-00227 error is returned if the header and tail do not match, or if the block checksum does not match the checksum recorded in the cache header (if any).

The controlfile contains several different types of records, each in its own record section of one or more logical blocks. Records may span block boundaries within their section. The fixed view V$CONTROLFILE_RECORD_SECTION lists the types of records stored in each record section, together with the size of the record type, and the number of record slots available and in use within that section. The underlying X$KCCRS structure includes the starting logical block number (RSLBN) for each section.





红色部分说控制文件的BLOCK SIZE和数据库的BLOCK SIZE是一致的。


但在我的环境中,发现并不一致,控制文件的大小是16K,而数据库的BLOCKSIZE是8K。


SQL> show parameter db_block_size


NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
db_block_size                        integer                8192
SQL> 

[oracle@db2server huateng]$ dbfsize control01.ctl


Database file: control01.ctl
Database file type: file system
Database file size: 594 16384 byte blocks

[oracle@db2server huateng]$ dbfsize system01.dbf 


Database file: system01.dbf
Database file type: file system
Database file size: 92160 8192 byte blocks


有人知道为何吗?

上一篇:AUTOTRACE的SQL不会进行绑定变量探测
下一篇:跟踪DBCA

文章评论