Things to Consider Before Recreating the Controlfile (Doc ID 1475632.1)
Things to Consider Before Recreating the Controlfile (Doc ID 1475632.1)In this Document
Purpose |
Troubleshooting Steps |
Before Recreating The Controlfile... |
1. Inaccessible/Offlined Datafiles |
2. Flashback database |
3. Flash Recovery Area Usage |
4. Backup metadata |
Backing Up the Current controlfile |
Recommendations |
Applies to:
Oracle Server - Enterprise Edition - Version 10.2.0.1 and laterInformation in this document applies to any platform.
Purpose
Highlight the importance of the controlfile and issues you need to consider before recreating it.
Troubleshooting Steps
Before Recreating The Controlfile...
The controlfile is very important to the database. Some information is stored only in the controlfile rather than the data dictionary. The metadata includes flashback logs, block change tracking, RMAN backups, and datafile locations. Often there are work-arounds or solutions available and the controlfile does not need to be recreated at all.
If you really must recreate the controlfile, or when instructed by Oracle, consider the following...
1. Inaccessible/Offlined Datafiles
If all of the datafiles are not on disk in the first place, you will not able able to recreate the controlfile.
If the datafiles are on disk, ensure that there are no offlined datafiles:
select distinct(status) from v$datafile
where status not in ('ONLINE','SYSTEM');
select name, ts#, online$, contents$ from ts$
where online$ =2;
Otherwise, once the controlfile is recreated with resetlogs all offlined datafiles cannot be added back to the database. You may encounter the following errors:
RMAN> sql 'alter database datafile 6 online';
sql statement: alter database datafile 6 online
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 07/29/2012 11:07:07
RMAN-11003: failure during parse/execution of SQL statement: alter database datafile 6 online
ORA-01190: control file or data file 6 is from before the last RESETLOGS
ORA-01110: data file 6: '/opt/app/oracle/oradata/ORA112/leng_ts.dbf'
2. Flashback database
When a controlfile is recreated, all flashback information - normal restore point, guaranteed restore point, and flashback database, will be turned OFF, even if using NORESETLOGS. All flashback logs on disk cannot be cataloged back into the controlfile. You will encounter this error if attempting to catalog flashback logs:
File Name: /opt/app/oracle/fra/ORA112/flashback/o1_mf_85zttw61_.flb
RMAN-07529: Reason: catalog is not supported for this file type
You will have to re-enable flashback database. All older flashbacklogs will no longer be useful and should be manually removed from disk.
3. Flash Recovery Area Usage
Once the controlfile is recreated, the view v$flash_recovery_area_usage may not reflect the actual usage on disk. So you may need to run this command to catalog everything back into the controlfile.
RMAN> catalog recovery area;
4. Backup metadata
If you are not using an RMAN recovery catalog, you will need to catalog all backuppieces into the controlfile. Further, prior to 9i, we cannot catalog backuppieces anyway.
The controlfile is important to a backup and restore process. It is true that you can catalog all backuppieces back into the controlfile, but you must have a controlfile to use in the first place. If you've lost your entire system and only have backuppieces to use, you must have at least a controlfile to catalog these backuppieces. Further, you cannot recreate the controlfile without any datafile on disk.
Backing Up the Current controlfile
You should at least take a backup of the current controlfiles before recreating it.
If in open/mounted mode:
RMAN> backup current controlfile;
SYS> alter database backup controlfile to '/tmp/control01.bk';
If the database is already shutdown, take an operating system backup first:
For example:
SYS@ORA112.SQL> show parameter control_files
NAME 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
Note that a binary backup is different from an ASCII backup!
This generates an ASCII command that will allow you to recreate the controlfile.
It is actually NOT a backup of the current controlfile.
Recommendations
1) multiplex your controlfile in different storage
You should have at least 2 copies of a controlfile, on different storage. If media is damaged, you will at least have another copy to use.
So the database parameter file (pfile or spfile) should point to at least 2 locations:
2) turn on autobackup
This will ensure that a controlfile backup is taken at the end of every backup:
Change the location if required:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1068821/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Consider Before Upgrading to 11.2.0.3/11.2.0.4 Grid Infrastructure/ASM_1363369.1IDEASTStructASM
- Restore Controlfile from SBT Tape Fails RMAN-6172 (Doc ID 1314134.1)RESTAI
- Recreating Controlfile With New Database Name Fails ORA-01503_ 109502.1DatabaseAI
- Three Reasons To Consider Being a Test DeveloperIDEDeveloper
- create controlfile for new SID
- 正式釋出Android Things 1.0Android
- Android Things 開發入門Android
- 物化檢視的CONSIDER FRESH語句(三)IDE
- 物化檢視的CONSIDER FRESH語句(二)IDE
- 物化檢視的CONSIDER FRESH語句(一)IDE
- 修改vip (Doc ID 276434.1)
- 【tomcat8】consider increasing the maximum size of the cacheTomcatIDE
- Android Things 專題 4 SDK 框架Android框架
- Android Things Developer Preview 3釋出AndroidDeveloperView
- 釋出Android Things Developer Preview 4.1AndroidDeveloperView
- Android Things Developer Preview 2 釋出AndroidDeveloperView
- Android Things系統結構及展望Android
- Android Things專題 1.前世今生Android
- HANGFG User Guide (Doc ID 362094.1)GUIIDE
- How to Prepare Storage for ASM (Doc ID 452924.1)ASM
- Android Things 專題 2 硬體介紹Android
- 快來參加Android Things Hackster競賽Android
- GDE專欄 | Android與Android Things,父子還是兄弟?Android
- idea出現Skipped breakpoint at com.yss.dayf.act.before.oper.BeforeZqjdHhblOpeIdea
- Qt QWidget Must construct a QApplication before a QWidgetQTStructAPP
- Client does not support authentication protocol requested by server; consider upgrading MySQL clientclientProtocolServerIDEMySql
- Android開發簡單教程.docAndroid
- SQLT Diagnostic Tool (Doc ID 215187.1)SQL
- Oracle Text Health Check (Doc ID 823649.1)Oracle
- The DBMS_SUPPORT Package (Doc ID 62294.1)Package
- DBMS_REPAIR example (Doc ID 68013.1)AI
- Overview of Parameter Reference Notes (Doc ID 68462.1)View
- Linux OS Service 'ntpd' (Doc ID 551704.1)Linux
- GDE專欄 | Android Things開發環境搭建Android開發環境
- Android Things 專題 3 開發環境搭建Android開發環境
- #io17# 釋出Android Things Developer Preview 4AndroidDeveloperView
- android動畫 fillBefore 和 fillAfter的用法Android動畫
- QWidget: Must construct a QApplication before a QPaintDeviceStructAPPAIdev