Control file
A control file is a small binary file that is part of an Oracle database. The control file is used to keep track of the database's status and physical structure.
Every Oracle Database must have at least one control file. However, it is recommended to create more than one, up to a maximum of 8. Each copy of a control file should be stored on a different disk drive. One practice is to store a control file copy on every disk drive that stores members of online redo log groups, if the online redo log is multiplexed. By storing control files in these locations, you minimize the risk that all control files will be lost in a single disk failure.
Contents
The control file contains information like:
- Database name
- Timestamp of database creation
- Names and locations of Data Files
- Names and locations of Redo Log files
- The current log sequence number
- Checkpoint information
- Recent RMAN backups taken
- Etc.
List control files in use
From SQL*Plus (connect SYS AS SYSDBA):
SHOW PARAMETERS control_files;
As a query:
SELECT * FROM v$controlfile;
Control file contents
SELECT * FROM v$controlfile_record_section;
Backup
Backup the controlfile to UDUMP in text format:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Make a binary copy of the control file:
ALTER DATABASE BACKUP CONTROLFILE TO '/tmp/control.bkp';
Generate an SQL file to create the control file:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/create_control.sql'