The control file is used to record and maintain the physical structure of the database. It records all data files and redo log files that need to be located when the database is opened, and records synchronization and
The control file is used to record and maintain the physical structure of the database. It records all data files and redo log files that need to be located when the database is opened, and records synchronization and
Here we will first describe the database startup process:
1. when the instance/routine is started (nomount status), read the parameter file (PFILE in a text file or SPFILE in a server parameter file), allocate the SGA, start the background process, open the alarm file, and trace the background process file;
2. When loading a database (mount status), locate and open the control file based on the value of the initialization parameter control_file to obtain the data file and redo log information.
3. When the database (open state) is opened, all data files and redo log files are opened. At this point, the user can access the database normally;
Recommended reading:
Oracle Tutorial: User-managed backup and recovery-control file backup and recovery
The control file is used to record and maintain the physical structure of the database. It records all data files that need to be located and redo log files that need to be located when the database is opened, it also records the log serial numbers, checkpoints, and log history during Database Synchronization and recovery. If the control file is lost, it is like a human brain cannot be used, only doctors (DBAs) it can be processed, and normal users cannot access it normally, so it loses its significance as a database, unless the control file is restored or the control file is rebuilt (in either case, all control files are corrupted, the database name is changed, or the permanent parameters of the database); since it is so prominent, so we have to pay attention to it. The important embodiment is to back up the database in a diversified and regular manner or when the database configuration changes. The commands for database configuration changes include:
Add log
Alter database [add | drop] logfile
Add a log Member
Alter datebase [add | drop] logfile member
Add a log Group
Alter datebase [add | drop] logfile group
Modify database Archive
Alter datebase [noarchivelog | archivelog]
Rename database files
Alter datebase rename file
Create a tablespace
Create tablespace
Add data files to the corresponding tablespace
Alter tablespace [add | rename] datafile
Modify Table space status
Alter tablespace [read write | read only]
Delete a tablespace
Drop tablespace
Obtain the Control File Information view:
V $ controlfile
Backup control file (create control file copy ):
Copy 'e: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ control01.ctl 'E: \ oracle \ backup \ control. ctl'; (cold backup | consistent backup)
Or
Alter database backup controlfile to 'e: \ oracle \ backup \ control. ctl '[reuse] (Hot backup | non-consistent backup );
This command will store all information about the current control file to a copy of the control file. With this copy, you can execute Incomplete recovery based on the control file, you can also generate a trace file for the control file;
Backup control file (backup to tracking file ):
This solution is mainly used to create a control file to restore control files;
Alter database backup controlfile to trace;
Recovery control file:
When restoring the control file, the server process and background process need to read various backup-related information from the control file.
A ORA-00205 error occurs when the control file of the database fails to contain media;
ORA-00205: error in identifying controlfile, check alert log for more info
Cause: The system cocould not find acontrol file of the specified name and size.
Action: Check that ALL control files areonline and that they are the same files that the system created at cold starttime.
1. A media error occurred in the control file group.
Because all the control files are images of each other, you can use other control files to recover them. If a disk with a media failure is damaged, you need to modify the control_files parameter when nomount is in the status, remove problematic control files;
SQL> show parameter control_file
NAME TYPE VALUE
--------------------------------------------------------------------------------------
Control_file_record_keep_time integer 7
Control_files string E: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADA
TA \ ORCL \ CONTROL01.CTL, E: \ ORAC
LE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL
\ CONTROL02.CTL, E: \ ORACLE \ PROD
UCT \ 10.2.0 \ ORADATA \ ORCL \ CONTRO
L03.CTL
It indicates that three control files are images of each other;
SQL> shutdown immediate;
The database has been closed.
The database has been detached.
The ORACLE routine has been disabled.
Next, let's take a look at the highlights of page 2nd: