管理控制文件
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.

 

 

 


相关内容

热门资讯

储殷:“建设性稳定关系”涵盖了... 特朗普率高规格代表团访华,中方也是高规格接待。中美今天的互动总体呈现出什么特点?这次元首外交又将如何...
中科信息称目前没有研发具身机器... 瑞财经 严明会 5月13日,中科信息在路演活动中表示,公司目前没有研发具身机器人,现有机器人主要面向...
按下物理AI加速键!香港成全球... 近日,首届香港具身智能产业峰会暨智元APC2026(香港)召开,标志着具身智能从技术炫技正式转向生产...
内塔尼亚胡称将对《纽约时报》提... 新华社耶路撒冷5月14日电(记者庞昕熠 冯国芮)以色列总理办公室14日发表声明称,由于美国《纽约时报...
黄仁勋最后一刻从“局外人”变“... 黄仁勋在最后一刻登上飞往北京的总统专机,从原本的“局外人”瞬间变成“座上宾”。这段场景的背后到底有哪...
俄国防部称大规模打击乌军工企业 新华社莫斯科/基辅5月14日电 俄罗斯国防部14日在社交媒体上发布通报说,过去一天,俄军对乌克兰军工...
国际最强!“九章四号”研制成功... 记者 吴长锋 记者13日从中国科学技术大学获悉,该校潘建伟、陆朝阳、张强、刘乃乐等学者联合国内研究单...
在“影视泥土”里激活学生“工程... 在“影视文化名城”的金华东阳,生成式人工智能正深刻重塑影视内容生产方式。扎根于横店影视文化产业生态圈...
实拍马斯克与小儿子X出现在人民... 5月14日,凤凰卫视记者在人民大会堂采访到特斯拉创始人马斯克。
vivo手机用户注意啦!你们的... vivo手机用户注意啦!你们的系统要来一波实用更新了!这次OriginOS 6的五月升级,最给力的就...