What is a control file?
An Oracle control file is a binary file necessary for the database to start and operate successfully. oracle scans the content of the control file in the mount state for the physical location of datafile and redo log files. Oracle continuously updates the control file during the functionality of the database, 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.
Loss of control file needs recovery. since control file is one of the important files, it is recommended to mirror the control file to avoid a single point of failure.At the time of mirroring place the mirrored copy in a separate file system.
we can maintain up to 8 control files but in real time we maintain 2 or 3.
An Oracle control file contains
- 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
An Oracle control File contains 2 Sections
- Nonreusable section
- Reusable section
Nonreusable section
These records contain critical information that does not change often and cannot be overwritten. Examples of information include tablespaces, data files, online redo log files, and redo threads. Oracle Database never reuses these records unless the corresponding object is dropped from the tablespace. Examples of non-circular control file sections (the ones that can only expand)
DATABASE (info)
CKPT PROGRESS (Checkpoint progress)
REDO THREAD, REDO LOG (Logfile)
DATAFILE (Database File)
FILENAME (Datafile Name)
TABLESPACE
TEMPORARY FILENAME
RMAN CONFIGURATION
Reusable section
These records contain noncritical information that is eligible to be overwritten if needed. When all available record slots are full, the database either expands the control file to make room for a new record or overwrites the oldest record. Examples include records about:
LOG HISTORY
OFFLINE RANGE
ARCHIVED LOG
BACKUP SET
BACKUP PIECE
BACKUP DATAFILE
BACKUP REDOLOG
DATAFILE COPY
BACKUP CORRUPTION
COPY CORRUPTION
DELETED OBJECT
PROXY COPY
Most of the reusable section of the control file contains RMAN backup information. The retention of the information depends on the parameter control_file_record_keep_time (Default value 7 days).
If you want to change the name of the database, we need to recreate the control file by generating a text-based control file by executing the following command.
SQL > alter database backupcontrolfile to trace;
The above command creates a text-based control file either in udump directory or trace directory.
Also read, Controlfile management activity
Words from dbapath
Thank you for giving your valuable time to read the above information. I hope the content served your purpose in reaching out the blog.
Suggestions for improvement of the blog are highly appreciable. Please contact us for any information/suggestion/feedback.
If you want to be updated with all our articles
please follow us on Facebook | Twitter
Please subscribe to our newsletter.