01.23.08
MAXDATAFILES参数和DB_FILES参数
上午收到一个task,要在下周重建一个数据库的控制文件,生产系统,非常非常大的生产系统,好不容易等到一个停机的机会.
task的内容很简单,要求将控制文件中的参数maxdatafiles修改到4000,目前是1238.这个值很奇怪.一般应该没有人会设置这么个值来玩的,1024,2048这些值还有可能是创建的时候整的,1238,这个值真奇怪,难道是创建数据库的人认为这个是幸运数字?
检查该数据库,发现确实数据文件已经快到这个数目了.重建控制文件,风险太高.其实在生产系统上,改啥风险都很高的.检查了兄弟们发过来的邮件,似乎确实要调整了.
ok,说实话,以前还真没在生产系统上去重建控制文件修改这些玩意,在自己的Laptop上先测试一下.修改到是没有问题.但是还是要想想,这玩意是不是有风险.
搜索metalink,找到doc 101020.1以及119507.1,根据101020.1上的说法,在oracle8以后,maxdatafiles参数会自动扩展,一直会扩展到初始化参数db_files为止.而依据119507.1的说法,为什么要有这个玩意的限制,是因为OS平台的存储导致的,文档中也有说明限制,反正在我的平台上,每个tablespace可以到1022个,每个数据库可以到65534个,也就是说,都是2^N-2个.
不过在两个文档中都提到数据库中最大的文件数,是不可以超过初始化参数db_files的.
在101020.1中是如此描述的:
The routine that performs the expansion writes this message to the alert log.
The messages specifies the section that was expanded and the amount of
the expansion. Please note that this message cannot be turned off.The automatic expansion only occurs up to the limit of the “init.ora” parameter
“DB_FILES”.
在119507.1中是如此描述的:
3. Especially for Oracle8+ you should make sure that you do not encounter an
error against the maximum number of open database files (DB_FILES). It is
more likely that the value for DB_FILES is too low since the controlfile in
Oracle8 expands automatically as long as the number of the added datafile is
lower then the value for DB_FILES. Normally the error message should
indicate this: ORA-00059 : maximum number of DB_FILES exceeded
检查该系统的alert_.log,果然发现了如下类似的记录: Fri Aug 17 13:52:35 2007
kccrsz: expanded controlfile section 4 from 1024 to 1126 records
requested to grow by 102 record(s); added 1 block(s) of records
Mon Dec 31 11:17:18 2007
kccrsz: expanded controlfile section 4 from 1126 to 1238 records
requested to grow by 112 record(s); added 1 block(s) of records
那么,就是说,我的系统已经自动扩展过两次,才扩展到这么个奇怪的值的,也就是说没有问题了,不用重建控制文件了.生产系统,还是不整我比较能睡的着.
microsoft_fly said,
April 1, 2008 at 12:58 pm
oracle 10g以后新增特性