What Is CONTROL FILE in Oracle Database

There are three important files over which the entire Oracle system is standing. These three files are

  • Control files
  • Online redo log files, and
  • Data files

What is the control file in Oracle?

Control files are small binary files that store information about the physical structure of the database. This information includes –

  • database name,
  • names and locations of data files,
  • names and locations of online redo log files,
  • current online redo log sequence number,
  • checkpoint information,
  • names and locations of RMAN backup files, and more

If you want to see what type of information is stored in your Control file then you query the V$CONTROLFILE_RECORD_SECTION dynamic performance view like this

[oracle@oracle-db-19c ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 1 15:09:40 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> 
SQL> 
SQL> show user;
USER is "SYS"
SQL> 
SQL> set pagesize 200
SQL> set linesize 200
SQL> 
SQL> select distinct type from v$controlfile_record_section;

TYPE
------------------------------------------------------------------------------------
TEMPORARY FILENAME
BACKUP CORRUPTION
BACKUP SPFILE
STANDBY DATABASE MATRIX
DATABASE BLOCK CORRUPTION
FOREIGN ARCHIVED LOG
INSTANCE SPACE RESERVATION
PDBINC RECORD
REDO THREAD
LOG HISTORY
DATAFILE COPY
PROXY COPY
MTTR
DATAFILE HISTORY
MULTI INSTANCE REDO APPLY
RMAN CONFIGURATION
BACKUP SET
BACKUP PIECE
BACKUP REDOLOG
DATABASE INCARNATION
GUARANTEED RESTORE POINT
RESTORE POINT
AUXILIARY DATAFILE COPY
CKPT PROGRESS
TABLESPACE
BACKUP DATAFILE
DELETED OBJECT
THREAD INSTANCE NAME MAPPING
REDO LOG
FILENAME
OFFLINE RANGE
RECOVERY DESTINATION
REMOVABLE RECOVERY FILES
DATABASE
DATAFILE
ARCHIVED LOG
FLASHBACK LOG
ACM OPERATION
COPY CORRUPTION
RMAN STATUS
PDB RECORD
TABLESPACE KEY HISTORY

42 rows selected.

SQL> 

A control file is created at the same time the database is created. Every database has at least one control file. Since a control file is a binary file thus it is not directly accessible to you. 

When does the control file come into action?

When the database is in NOMOUNT state, the database instance knows the location of the control file through the CONTROL_FILES initialization parameter of the spfile or init.ora file.

When you open your database in NOMOUNT mode, at this point the database instance only knows about the location of the CONTROL FILE. It doesn’t open it or access it.

oracle@oracle-db-19c ~]$ 
[oracle@oracle-db-19c ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 1 15:15:45 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  629145392 bytes
Fixed Size                  9137968 bytes
Variable Size             394264576 bytes
Database Buffers          209715200 bytes
Redo Buffers               16027648 bytes
SQL> 
SQL> alter database mount;

Database altered.

SQL> 

Now at this point when you alter your database into MOUNT mode then your control files are opened and read by the database instance. So we can say that the control files come into action when database gets mounted.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值