管理控制文件
admin
2023-05-11 21:02:09
0

 

ControlFile

·A small binary file

·Defines current state of physical database

·Maintains integrity of database

·Required:

  -At MOUNT state during database start up

  -To operate the database

·Linked to asingle database

·Loss may require recovery

·Sized initially by CREATE DATABASE

 

 

The Size of Control File

The main determinants of the size of a control file are the values set for the MAXDATAFILES, MAXLOGFILES, MAXLOGMEMBERS, MAXLOGHISTORY, and MAXINSTANCE parameters in the CREATE DATABASE statement that created the associated database. Increasing the values of these parameters increases the size of acontrol file of the associated database.

 

 

Control File Contents

A control file contains the following entries:

·Database nameand identifier

·Time stamp ofdatabase creation

·Tablespace names

·Names and locations of data files and online redo log files

·Current online redo log file sequence number

·Checkpoint information

·Begin and endof undo segments

·Redo log archive information

·Backup information

The control file is a fairly small file(it can grow up to 64MB or so in extreme cases) that contains a directory of the other files Oracle needs. The parameter file tells the instance where control files are, and the control files tell the instance where the database and online redo log files are.

The control files also tell Oracle other things, such as information about checkpoints that have taken place, the name of the database(which should match the DB_NAME parameter), the timestamp of the database as it was created, an archive redo log history(this can make a control file large in some cases), RMAN information, and so on.

Control files should be multiplexed either by hardware(RAID) or by Oracle when RAID or mirroring is not available. More than one copy of them should exist, and they should be stored on separate disk, to avoid losing them in the event you have a disk failure. It is not fatal to lose your control files—it just makes recovery that much harder.

Control files are something a developer will probably never have to actually deal with. To a DBA they are an important part of the database, but to a software developer they are not extremely relevant.

 

 

Multiplexing the Control File

Every Oracle Database should have at least two control files, each stored on a different physical disk. If a control file is damaged due to a disk failure, the associated instance must be shut down. Once the disk drive is repaired, the damaged control file can be restored using the intact copy of the control file from the other disk and the instance can be restarted. In this case, no media recovery is required.

The be havior of multiplexed control files is this:

·The database writes to all filenames listed for the initialization parameter CONTROL FILES in the database initialization parameter file.

·The database reads only the first file listed in the CONTROL_FILES parameter during database operation.

·If any of the control files become unavailable during database operation, the instance becomes inoperable and should be aborted.

Note: Oracle strongly recommends that your database has a minimum of two control files and that they are located on separate physical disks.

 

 

SHOW CONTROL FILES:

$cd $ORACLE_HOME/dbs

$ strings spfileSID.ora | grep control_files

SQL> show parameter control_files;

SQL> select name from v$controlfile;

 

 

When using Spfile

1.Alter the SPFILE:

SQL> alter system set control_files=

     '/u01/app/oradata/example/control01.ctl',

     '/u01/app/oradata/example/control02.ctl',

     '/u01/app/oradata/example/control03.ctl' scope=spfile;

 

2.Shut down the database:

SQL> shutdown immediate;

 

3.Create additionalcontrol files:

$ cd /u01/app/oradata/example/

$ cp control01.ctlcontrol02.ctl

$ cp cintrol01.ctl control03.ctl

 

4.Start the database:

SQL> startup;

 

 

Get Control File Information

Information about control file status and locations can retrieved by querying the following views.

·v$controlfile: Lists the name and status of all control files associated with the instance.

  ·v$parameter: Lists status and location of all parameters.

·v$controlfile_record_section: Provides information about the control file record sections.

·show parameter control_files: Lists thename, status, and location of the control files.

 

 

 


相关内容

热门资讯

以军士兵集体丢掉武器抗命,大喊... 据凤凰卫视报道,以色列国防军一军事基地7月30日发生士兵抗命事件,约120名士兵抗议指挥官做法,将武...
蒋成华任商务部副部长 国务院任免国家工作人员。任命蒋成华为商务部副部长。免去蒋成华的商务部国际贸易谈判副代表职务。
伊朗驻华大使:在军事威胁下,不... 新华社北京7月31日电(记者刁慧琳) 伊朗驻华大使法兹里7月28日表示,伊美回到谈判桌的前提是美国必...
伊朗革命卫队在霍尔木兹海峡击中... 当地时间31日,伊朗伊斯兰革命卫队发布声明称,革命卫队海军当天在霍尔木兹海峡击中并扣留了两艘违反禁令...
美媒:特朗普,遇到了一个更强硬... 据《纽约时报》7月29日报道,就在特朗普总统看似放弃战事升级计划几天后,美国再次与伊朗交火。上周末,...
女子做气管镜时不幸身亡,丈夫称... 7月29日,西安刘先生反映妻子在当地医院做支气管镜检查时死亡,看监控时发现医生疑有违规操作。刘先生表...
全网“帮卖西瓜”,然后呢? 近日,河南部分地区西瓜滞销的消息在网上热度很高。很多地方也伸出援手:有景区收购千斤西瓜、免费赠予游客...
美媒:乌克兰袭击伊朗船只,险引... 据《纽约时报》7月28日报道,据伊朗和西方官员称,伊朗曾考虑攻击乌克兰的一个港口,以报复乌克兰对一艘...
20年里,他只画美女,用东方风... 迈进KIM在上海的工作室,迎面是一整墙的美女们。她们像是刚从一场时髦的沙龙里退场,或倚或立,眉宇间是...
Google在港推出AI代理G... 观点网讯:7月29日,Google在香港推出AI代理Gemini Spark,该代理可全天候在后台运...