控制文件中MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS等参数的说明

CONTENTS
--------
1. What are the maximun number of datafiles ? MAXDATAFILES
2. What are the maximun number of redolog groups ? MAXLOGFILES
3. What are the maximun number of members for a redolog group ? MAXLOGMEMBERS
4. What are the maximun number of instances that can access a database concurrently? MAXINSTANCES
5. What are the maximun number of redo log files that can be recorded in the log history of the control file? MAXLOGHISTORY

1. MAXDATAFILE
Maxdatafiles can be defined when the database is created or when the controlfile is recreated. The default valueis 32, the maximun value is 4096 per tablespace 

In 8.0 and 8i, the limit on datafiles per database is around 40,000. This limit is imposed by the limit on control file size (20,000 blocks) with a 4K block size.

In 9i and 10g, larger block sizes are supported, thus with DB_BLOCK_SIZE=8192 there can be up to 65,534 datafiles (same limit as other platforms).

However, there is an issue with the maximum number of files the server can have open simultaneously. In both the OSDI and MPM implementations the server is limited to approximately 3000 distinct simultaneously open files across all sessions. This limit is removed
in Oracle9i 9.2.

说到这个MAXDATAFIEL我们不得不说另一个参数db_files,那么这个maxdatafile和这个db_files之间有什么数量上的关系呢?

db_files:


Property


Description


Parameter type


Integer


Default value


200


Modifiable


No


Range of values


Minimum: the largest among the absolute file numbers of the datafiles in the database

Maximum: operating system-dependent


Basic


No


Real Application Clusters


Multiple instances must have the same value.

  DB_FILES specifies the maximum number of database files that can be opened for this database. The maximum valid value is the maximum number of files, subject to operating system constraint(受制于操作系统的约束), that will ever be specified
for the database, including files to be added by ADD DATAFILE statements.

       If you increase the value of DB_FILES, then you must shut down and restart all instances accessing the database before the new value can take effect. If you have a primary and standby database, then they should have
the same value for this parameter.

maxdatafiles:

这个参数是保存在控制文件里的,在DBCA创建实例的时候可以指定该值的大小。 官网对这个参数的说明如下:

 
MAXDATAFILES
       The MAXDATAFILES option of CREATE DATABASE determines the number of data files a database can have. With Oracle Real Application Clusters, databases tend to have more data files and log files than an exclusive mounted database.
 
       一般db_files <= maxdatafiles值。 当select count(*) from dba_data_files; 的值达到db_files时,就需要修改db_files,把这个值调大。
 
       对这个参数的默认值,从我dump 出的trace 文件看,是30. 这个值明显过小。 稍大一点的系统也不止30个datafile。 不过dbca来看,该值是100.
 
SQL>alter database backup controlfile to trace
 
 
CREATE CONTROLFILE REUSE DATABASE "DAVE" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXDATAFILES 30
MAXINSTANCES 1
MAXLOGHISTORY 292
 
 
在DBCA创建Instance的时候,我们可以指定该参数。 如下图:

 

 

 

       如果说是已经建好了,就只能重建控制文件来修改该参数值。先将控制文件dump 出来,然后修改该值,在重建控制文件。 在重建之前,记得备份控制文件和DB。 具体操作步骤参考:

       Oracle 控制文件

       http://blog.csdn.net/tianlesoftware/archive/2009/12/09/4974440.aspx

Oracle db_files and maxdatafiles parameters

The db_files parameter is a "soft limit " parameter that controls the maximum number of physical OS files that can map to an Oracle instance. Historically (before Oracle8i) you need to be careful not to set db_files too high, else you would have DBWR (database writer) issues.

The maxdatafiles parameter is a different "hard limit" parameter.  When you issue a"create database" command, the value you specify for maxdatafiles is stored in your Oracle control files.  The default value of 32 is usually sufficient, but after Oracle8i there is no downside to using a larger value.

In practice, many Oracle DBA with large databases will segregate important tables and indexes into isolated tablespaces and datafiles to give them more control and detailed statistrics.

Fixing a maxdatafiles limit problem

In practice, the ORA-1118 occurs when your database has hit the MAXDATAFILES limit, usually during database maintenance.  Here are instructions from "Rhubarb" Stewart McGlaughlin, one of the best Oracle DBA's in North Carolina:

1. Shutdown database; Backup database
2. Start up database
3. From sqlplus as sysdba, type: alter database backup controlfile to trace;
4. Type: shutdown immediate:
5. Go to the operating system and go to the USER_DUMP_DEST directory
6. Find the newest trace file
7. Edit the trace file and change MAXDATAFILES to the new value. You will also need to delete all of the lines prior to the line that begins: STARTUP NOMOUNT. See sample text below (the example is for a database using ARCHIVELOG):

STARTUP NOMOUNTCREATE CONTROLFILE REUSE DATABASE "ORACLE" RESETLOGS ARCHIVELOG

MAXLOGFILES 32 MAXLOGMEMBERS 2 
MAXDATAFILES
 32 
MAXINSTANCES 16 
MAXLOGHISTORY 1600 
LOGFILE 
   GROUP 1 'D:\ORAWIN95\DATABASE\LOG2ORCL.ORA' SIZE 200K, 
   GROUP 2 'D:\ORAWIN95\DATABASE\LOG1ORCL.ORA' SIZE 200K DATAFILE 'D:\ORAWIN95\DATABASE\SYS1ORCL.ORA', 'D:\ORAWIN95\DATABASE\USR1ORCL.ORA', 'D:\ORAWIN95\DATABASE\RBS1ORCL.ORA', 'D:\ORAWIN95\DATABASE\TMP1ORCL.ORA' ;
# Database can now be opened normally. ALTER DATABASE OPEN RESETLOGS;

8. From sqlplus as sysdba, run the edited trace file from step 7.
9. Shutdown database and backup database

关于maxdatafiles、db_files和数据库最大datafiles数的关系:

DB_FILES 参数指定数据库能打开的最大的datafiles 的数量,这个最大值也会受操作系统的限制。

--如果我们增加DB_FILES 的值,那么必须重启instance,才能让修改生效。 如果是DG 环境,也需要保证主备库参数一致。

在Oracle 11gR2 中,这个参数的默认值是200,比控制文件的默认值大。

--从Oracle 8 开始,控制文件是自动扩展的,当新添加的datafile时,datafile的个数超过了控制空maxdatafiles 参数的限制时,maxdatafiles参数值会自动的增加。

--这个验证可以通过dump 控制文件来查看

 

This alsohappens if new records are added to the "log_history" section of thecontrol files and there are no entries that could be replaced. 

--控制文件的自动扩展也发生在的section 不够时。

 

The routine thatperforms the expansion writes this message to the alert log. The messagesspecifies the section that was expanded and the amount of the expansion. Pleasenote that this message cannot be turned off.

--执行扩展操作时会往alert log 里写一些log 信息,就是上面部分的内容,这部分内容列出了扩展的section和扩展的数量,这个显示信息不能被关闭。

 

The automatic expansion only occurs up to the limit of the "init.ora" parameter "DB_FILES".

       --注意,控制文件中的自控扩展的datafile 的最大值就是我们DB_FILES 参数的值。 所以这也是我们之前看的,DB_FILES 参数值比控制文件中默认值大的原因。

 

 

 

总结一下:

       数据库中真正的最大的datafiles 的个数由DB_FILES 参数决定,虽然控制文件中也有限制,但是这个控制文件中的限制参数会自动的增加,直到到达DB_FILES的值。

 

2. MAXLOGFILES

MaxLogFiles can be defined when the database is created or when the controlfile is recreated. 
The default value, if not especified, is 32, and the maximun value is 256.

3. MAXLOGMEMBERS

MaxLogMembers can be defined when the database is created or when the controlfile is recreated. 
The default value, if not especified, is 2, and the maximun value is 5.

In Oracle10g, now you can also specify the following parameters:

4. MAXINSTANCES 

The MAXINSTANCES option of CREATE DATABASE limits the number of instances that can access a database concurrently. 
The default value for this option under z/OS is 15. Set MAXINSTANCES to a value greater than the
maximum number of instances you expect to run concurrently.

5. MAXLOGHISTORY 

The MAXLOGHISTORY option of CREATE DATABASE specifies the maximum number of redo log files that can be recorded in the log
history of the control file. The log history is used for automatic media recovery of
Oracle Real Application Clusters.
For Oracle Real Application Clusters, set MAXLOGHISTORY to a large value, such
as 100. The control file can then store information about this number of redo log
files. When the log history exceeds this limit, the Oracle server overwrites the oldest
entries in the log history. 
Setting the MAXLOGHISTORY to 0 (zero), disables log history.

时间: 2024-09-20 05:45:39

控制文件中MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS等参数的说明的相关文章

mysql启动的时参数文件中的[mysql]下的参数没有生效

问题描述 mysql启动的时参数文件中的[mysql]下的参数没有生效 my.cnf下的参数如下 [mysqld] 此处省略..... [mysql] #no-auto-rehash prompt='u@h:pd mysql>' #max_allowed_packet = 1024M ##影响mysql导人的速度 #default_character_set = gbk 启动方式 mysqld --defaults-file=/etc/my.cnf & 启动后prompt没有生效 [root

如何删除控制文件中过去rman备份到磁带的归档备份集

pub 上的一个帖子,分享一下: 环境介绍:数据库版本为9201.原操作系统是solaris8,原备份方式是rman通过tsm备份到磁带.由于原服务器不能满足生产需要更新了服务器,将数据库迁移至新的数据库服务器,操作系统是solaris10,rman备份到磁盘.迁移的方式是tar过去的.原服务器rman实际是是有一个catalog库的,新服务器rman使用的是控制文件. 问题:由于整个数据库都是tar过来的,控制文件保存着过去的备份信息(不知为啥控制文件怎么会保持了一次rman的备份信息,因为备

RMAN 中使用控制文件代替恢复目录需要注意的参数

      (原创) 在RMAN中如果不使用恢复目录的情况下,是使用控制文件来保存RMAN的信息.所以控制文件必定会不断增大,并且控制文件会循环的使用这个区域.所以我叫这个区域叫做控制文件的可变区域,它有别于控制文件中的一些固定信息如日志文件位置,数据文件位置等,所以RMAN信息是不会通过控制文件重建来恢复的.         如果控制文件中的RMAN信息被覆盖了话,而我们需要恢复的时间点在被覆盖的信息中,那样我们只有使用特殊恢复了....(做过,数据会丢失一部分)       所以在ORACL

ORACLE控制文件的重建

oracle|控制 数据库系统运行一段时间后有很多参数需要调整,有些参数可在$ORACLE_HOME/dbs/initXXX.ora文件中调整,而有些参数必须要在ORACLE的控制文件中调整.如ORACLE的缺省数据文件个数为30个,在系统需要扩表空间而数据文件个数不够时就需要进行调整. 一种方法是将所有数据全倒出来,重建库,再将数据倒进出.这种方法较麻烦. 二种方法是只重建控制文件,因为数据文件个数的限制参数存放在控制文件中. 以下是一种较好的重建控制文件的方法: 1. 备份数据库中的数据,以

当oracle丢失所有控制文件后可以重新创建控制文件来恢复数据库

当oracle丢失所有控制文件后可以重新创建控制文件来使数据库正常打开 重新创建控制文件的方法如下: 第一步是查询出该数据的所有日志文件,数据文件和控制文件 SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------- D:\ORACLE\PRODUCT\10.1.0\ORADATA\OCP\REDO03.LOG

重建控制文件时resetlogs与noresetlogs的使用情况

重建控制文件时resetlogs与noresetlogs的使用情况 控制文件中记录着数据库的数据文件,日志文件,备份数据等信息,更为重要的,控制文件中还记录了数据库的检查点 和scn信息,这些信息在数据恢复的过程中将起到关键性作用. 一个正常运行的数据库,通常控制文件都存在多份镜像,这些镜像的内容是完全相同的,oracle缺省就创建多份控制 文件更说明了控制文件的重要: SQL> select name from v$controlfile; NAME ---------------------

Oracle 控制文件(CONTROLFILE)

--============================= -- Oracle 控制文件(CONTROLFILE) --=============================   一.Oracle 控制文件         为二进制文件,初始化大小由CREATE DATABASE指定,可以使用RMAN备份         记录了当前数据库的结构信息,同时也包含数据文件及日志文件的信息以及相关的状态,归档信息等等         在参数文件中描述其位置,个数等等.通常采用分散放开,多路复用

oracle重建控制文件丢失数据文件导致悲剧

数据库最初故障 Thu Sep 25 09:27:26 2014 MMON started with pid=15, OS id=1968 starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'... starting up 1 shared server(s) ... ORACLE_BASE from environment = F:\oracle Thu Sep 25 09

备份控制文件

控制文件用于记录和维护数据库,当恢复数据库时,服务器进程和后台进程需要从控制文件中读取各种与备份相关的信息.如果控制文件损坏,则会导致这些信息丢失.尽管多元化的控制文件可以防止控制文件损坏,但因控制文件的重要性,所以应当定期的备份控制文件.当数据库配置发生变化时,一定要备份控制文件. 涉及到改变数据库配置的命令一般以 alter database .ceate tablespace,alter tablespace ,drop tablespace 等命令. 第一 建立控制文件的副本. SQL>