Things to consider before rebuilding a control file
From:
Things to consider before recreating the Controlfile (document ID 1475632.1)
Suitable for:
Oracle database-enterprise edition-version 10.2.0.1 and later
Information in this document applies to any platform.
Objective:
Highlight the importance of the control file and the issues that should be considered before rebuilding the control file.
Steps to resolve the problem:
Before rebuilding the control file:
Control files are very important to the database, and some information is stored only in the control file, not in the data dictionary.
Metadata includes flashback logs, block change tracking, Rman backup, and location of data files.
There are often workarounds or solutions, and control files do not have to be rebuilt at all.
If you have to rebuild the control file, or Oracle instructs you to do so, consider the following:
1. Inaccessible/offlined datafile
If at first all datafile are not on disk, you will not be able to recreate Controlfile.
If Datafiles is on disk, make sure there is no offlined datafile
Select DISTINCT (status) from V$datafile where status isn't in (' ONLINE ', ' SYSTEM '); "SELECT Name, ts#, online$, contents$ from ts$ where online$ = 2;
Otherwise, once the control file is rebuilt in a resetlogs manner, all offlined datafile cannot be added back to the database.
You will encounter the following error:
2. Flash back to Database
When a control file is rebuilt, all flashback information--normal restore point, guaranteed restore point, and flashback database will be closed, using the noresetlogs way to build
All flash logs on disk cannot be catelog back into the control file. If you try the catalog flashback log, you will encounter the following error:
File Name:/opt/app/oracle/fra/ora112/flashback/o1_mf_85zttw61_.flb Rman-07529:reason:catalog is not supported For the This file type
You will have to re-enable flashback database. All old flashback logs will no longer be useful and need to be removed manually from disk.
3. Flash back zone (Flash Recovery area) utilization
Once the control file is rebuilt, the V$flash_recovery_area_usage view may not feed back the actual usage. Therefore, you need to run the following command to catalog everything back into the control file.
rman> Catalog recovery area;
4. Backing Up metadata
If you do not use Rman's recovery directory, you will need to catalog all the backuppiece into the control file. Further, we cannot catalog backuppiece before 9i
Control files are extremely important for backup and recovery. Catalog all the backuppiece to the control file is certainly true, but you must first have a control file.
If you lose all Syatem, and only backuppiece is available, you must have at least one controlfile to catalog backuppiece.
Further, without any datafile on disk, you cannot reconstruct controlfile
Back up current Controlfile
rman> Backup current controlfile; sys> ALTER DATABASE backup Controlfile to '/TMP/CONTROL01.BK ';
Before rebuilding the control file, you should make at least one backup of the current control file.
When in open/mounted mode:
When the database is closed, use the operating system commands to do the backup, for example:
[Email protected]> show parameter control_filesname TYPE VALUE----------------------------------------- ---------------------------------------------control_files string /opt/app/oracle/oradata/ora112 / Control1.ctl,/opt/app/oracle /oradata/ora112/control2.ctl$ cp/opt/app/oracle/oradata/ora112/control1.ctl/ opt/app/oracle/oradata/ora112/control1.ctl.old$ cp/opt/app/oracle/oradata/ora112/control2.ctl/opt/app/oracle/ Oradata/ora112/control2.ctl.old
Please note: Binary backup is different from ASCII backup!
sql> ALTER DATABASE backup Controlfile to trace;
The above command generates an ASCII command that can be rebuilt with the ASCII command controlfile. This command is not actually a backup of current controlfile.
Add Start *****************************************
Translator Note: The following is the translator himself added:
5. Database-level supplemental log information is lost after the control file is rebuilt
See MORE:
Missed Database supplemental Log information after recreate Controlfile in 10g database. (Document ID 1474952.1)
Or:
http://blog.csdn.net/msdnchina/article/details/38360055
Add End *****************************************
Recommended:
1) Reuse of control files on different storage
At a minimum, you need to have two control file copies on two different storage. If media is damaged, you have at least another copy available.
Therefore, the database parameter file has at least two control file locations:
Control_files= ' Location1/file1 ', ' location2/file2 '
2) Open the autobackup of the control file
This will ensure that at the end of each backup there will be a controlfile backup
Rman> CONFIGURE controlfile autobackup on;
If necessary, use the following command to modify the location of the autobackup:
rman> CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to '%F '; # Default
"Translated from MoS article" Things to consider before rebuilding a control file