ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【ORACLE CONCEPT】控制文件

【ORACLE CONCEPT】控制文件

原创 Linux操作系统 作者:renjixinchina 时间:2013-03-19 17:34:35 0 删除 编辑

控制文件(control file)中包含了其所属数据库的信息,实例(instance)在启动,及正常工作期间都需要存取这些信息。控制文件的内容只能由Oracle修改,数据库管理员或用户都不应编辑控制文件。

控制文件(control file)中主要包含以下内容:
  • 数据库名(database name)
  • 数据库创建时的时间戳(timestamp)
  • 属于此数据库的数据文件(datafile)及重做日志文件(redo log file)的名称与存储位置
  • 表空间(tablespace)信息
  • 脱机(offline)的数据文件
  • 日志历史信息
  • 归档日志(archived log)信息
  • 备份集(backup set)与备份块(backup piece)信息
  • 数据文件与重做日志的备份信息
  • 数据文件复制信息
  • 当前的日志序列号(log sequence number)
  • 检查点(checkpoint)信息

数据库名(database name)和数据库创建时间戳(timestamp)都来源于数据库创建过程。数据库名既可以来自 DB_NAME 初始化参数中的设定值,也可以来自 CREATE DATABASE 语句中的指定值。

每当添加,重命名,或移除数据库中的数据文件(datafile)及重做日志文件(redo log file)时,控制文件(control file)就会被更新以反映这些数据库物理结构变化。进行这些记录的目的是:
  • Oracle可以籍此在数据库启动(startup)时识别打开的数据文件和重做日志文件
  • Oracle可以籍此在恢复数据库时识别当前可用及需要恢复的文件

因此,用户每次更改数据库的物理结构后(使用 ALTER DATABASE 语句),一定要及时备份控制文件(control file)。

控制文件(control file)还被用于保存检查点(checkpoint)信息。每隔三秒钟,检查点进程(checkpoint process,CKPT)将会在控制文件中记录重做日志(redo log)检查点位置(checkpoint position)信息。当数据库恢复时,重做日志中此点之前的重做条目(redo entry)都无需恢复,因为这些数据已经被写入数据文件(datafile)中了。


Overview of Control Files

The database control file is a small binary file necessary for the database to start and operate successfully. A control file is updated continuously by Oracle during database use, so it must be available for writing whenever the database is open. If for some reason the control file is not accessible, then the database cannot function properly.

Each control file is associated with only one Oracle database.

Control File Contents

A control file contains information about the associated database that is required for access by an instance, both at startup and during normal operation. Control file information can be modified only by Oracle; no database administrator or user can edit a control file.

Among other things, a control file contains information such as:

  • The database name

  • The timestamp of database creation

  • The names and locations of associated datafiles and redo log files

  • Tablespace information

  • Datafile offline ranges

  • The log history

  • Archived log information

  • Backup set and backup piece information

  • Backup datafile and redo log information

  • Datafile copy information

  • The current log sequence number

  • Checkpoint information

The database name and timestamp originate at database creation. The database name is taken from either the name specified by the DB_NAME initialization parameter or the name used in the CREATE DATABASE statement.

Each time that a datafile or a redo log file is added to, renamed in, or dropped from the database, the control file is updated to reflect this physical structure change. These changes are recorded so that:

  • Oracle can identify the datafiles and redo log files to open during database startup

  • Oracle can identify files that are required or available in case database recovery is necessary

Therefore, if you make a change to the physical structure of your database (using ALTER DATABASE statements), then you should immediately make a backup of your control file.

Control files also record information about checkpoints. Every three seconds, the checkpoint process (CKPT) records information in the control file about the checkpoint position in the redo log. This information is used during database recovery to tell Oracle that all redo entries recorded before this point in the redo log group are not necessary for database recovery; they were already written to the datafiles.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15747463/viewspace-756553/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: ORACLE DSI
请登录后发表评论 登录
全部评论

注册时间:2011-01-30

  • 博文量
    373
  • 访问量
    2161127