Unit 2: Log File Management: Control Files
Unit 2: Log File Management: Control Files
Control Files
It is a small binary file that records the physical structure of the database. It includes (can be
written for application of Control files):
• Database Name
• Names and locations of associated datafiles and redo log files
• Timestamp of database creation
• Current log sequence number
• Checkpoint information
Control file must be available for writing by the Oracle Database server whenever the
database is open. Without control file, the database cannot be mounted and recovery is
difficult.
It is created at the same time as database. By default, at least one copy of control file is
created but we should create two or more copies of control file during database creation and
also if we lose a control file or want to change particular settings in the control files.
Parameters in the CREATE DATABASE statement that created the associated database.
Increasing the values of these parameters increases the size of a control file of the associated
database.
Creating Control Files:
Use the ALTER DATABASE BACKUP CONTROLFILE statement to back up your control files. You
have two options:
• Back up the control file to a binary file (duplicate of existing control file) using the
following statement:
ALTER DATABASE BACKUP CONTROLFILE TO
'/oracle/backup/control.bkp';
• Produce SQL statements that can later be used to re-create your control file:
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Oracle Database uses only one redo log files at a time to store redo records written from the
redo log buffer. The redo log file that LGWR is actively writing to is called the current redo log
file.
Redo log files that are required for instance recovery are called active redo log files.
Redo log files that are no longer required for instance recovery are called inactive redo log
files.
If you have enabled archiving (the database is in ARCHIVELOG mode), then the database
cannot reuse or overwrite an active online log file until one of the archiver background
processes (ARCn) has archived its contents. If archiving is disabled (the database is in
NOARCHIVELOG mode), then when the last redo log file is full, LGWR continues by overwriting
the first available active file.
1 YES ACTIVE
2 NO CURRENT
3 YES INACTIVE
4 YES INACTIVE
Drop a redo log group with the SQL statement ALTER DATABASE with the DROP LOGFILE
clause.
E.g. ALTER DATABASE DROP LOGFILE GROUP 3;