<?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>Andrew Fraser DBA &#187; rman</title>
	<atom:link href="http://andrewfraserdba.com/category/rman/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewfraserdba.com</link>
	<description>Oracle DBA (plus SQL Server)</description>
	<lastBuildDate>Fri, 16 Jul 2010 13:26:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Data block corruption cleared with alter system flush buffer_cache</title>
		<link>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/</link>
		<comments>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/#comments</comments>
		<pubDate>Thu, 19 Apr 2007 14:45:46 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[old]]></category>
		<category><![CDATA[rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/</guid>
		<description><![CDATA[So I had:
ORA-08103: object no longer exists
being reported on SQL affecting one application table. But that table existed ok in dba_tables, could be described ok, and selects restricted to its indexed columns returned data ok.
Suspicion was some sort of data block corruption. Rman backup logs had not reported any corrpution, but dbverify did find some [...]]]></description>
			<content:encoded><![CDATA[<p>So I had:<br />
<code>ORA-08103: object no longer exists</code><br />
being reported on SQL affecting one application table. But that table existed ok in dba_tables, could be described ok, and selects restricted to its indexed columns returned data ok.</p>
<p>Suspicion was some sort of data block corruption. Rman backup logs had not reported any corrpution, but dbverify did find some corrupt blocks. Those blocks were not associated with any record in dba_extents though.</p>
<p>All that is curious enough, but it is the fix which was the real surprise. Running:<br />
<code>SQL&gt; alter system flush buffer_cache ;</code><br />
Fixed the problem. Implication of that is that there is intermittent data block corruption, and that  table was corrupt at the time it was first read into cache, and clean again (on disk) by the time I came along to look at it.</p>
<p>Dbverify later on also switched over to giving the datafiles a clean bill of health.</p>
<p>What&#8217;s the root cause? Don&#8217;t know (yet), but intermittent disk or memory hardware failure seems  the most likely. Nothing reported in server logs though.</p>
<p>This on Oracle 10.1.0.4.0 Enterprise Edition on Microsoft Windows Server 2003 Standard Edition Service Pack 1 on Intel Xeon 3.2GHz.</p>
<p>The dbverify syntax I used was like:<br />
<code>dbv file=D:\ORACLE\ORADATA\SYSTEM01.DBF logfile=4.log</code><br />
I didn&#8217;t have to specify block size because database was at the default block size for that version of dbv (seen with <code>dbv help=y</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Data Guard today</title>
		<link>http://andrewfraserdba.com/2007/03/07/data-guard-today/</link>
		<comments>http://andrewfraserdba.com/2007/03/07/data-guard-today/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 15:29:27 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[old]]></category>
		<category><![CDATA[rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/03/07/data-guard-today/</guid>
		<description><![CDATA[Today had noticed that redo logs were not being applied to standby. Checking live database alert log showed errors like:
PING[ARC1]: Heartbeat failed to connect to standby '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=drserver)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbase_DR)(INSTANCE_NAME=dbase)(SERVER=dedicated)))'. Error is 12514.
Wed Mar 07 10:51:10 2007
Error 12514 received logging on to the standby
Wed Mar 07 10:51:10 2007
Errors in file d:\oracle\admin\dbase\bdump\dbase_arc1_2540.trc:
ORA-12514: Message 12514 not found; No message file [...]]]></description>
			<content:encoded><![CDATA[<p>Today had noticed that redo logs were not being applied to standby. Checking live database alert log showed errors like:<br />
<span id="more-33"></span><code>PING[ARC1]: Heartbeat failed to connect to standby '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=drserver)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbase_DR)(INSTANCE_NAME=dbase)(SERVER=dedicated)))'. Error is 12514.<br />
Wed Mar 07 10:51:10 2007<br />
Error 12514 received logging on to the standby<br />
Wed Mar 07 10:51:10 2007<br />
Errors in file d:\oracle\admin\dbase\bdump\dbase_arc1_2540.trc:<br />
ORA-12514: Message 12514 not found; No message file for product=RDBMS, facility=ORA</code></p>
<p>But they are somewhat misleading &#8211; ora-12514 implies listener issues, and the listener was actually working ok on the standby server.</p>
<p>Drc<em>dbname</em>.log had the right information:</p>
<p><code>DG 2007-03-07-07:12:42        0 2 0 RSM detected log transport problem: log transport for database 'dbase_DR' has the following error.<br />
DG 2007-03-07-07:12:42        0 2 0   ORA-12514: Message 12514 not found; No message file for product=RDBMS, facility=ORA<br />
DG 2007-03-07-07:12:42        0 2 0 RSM0: HEALTH CHECK ERROR: ORA-16737: the redo transport service for standby database "dbase_DR" has an error<br />
DG 2007-03-07-07:12:42        0 2 0 NSV1: Failed to connect to remote database dbase_DR. Error is ORA-01034<br />
DG 2007-03-07-07:12:42        0 2 0 NSV1: Message is dropped.<br />
DG 2007-03-07-07:12:42        0 2 606440720 DMON: Database dbase_DR returned ORA-01034<br />
DG 2007-03-07-07:12:42        0 2 606440720       for opcode = CTL_GET_STATUS, phase = BEGIN, req_id = 1.1.606440720<br />
DG 2007-03-07-07:12:42        0 2 606440720 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778<br />
DG 2007-03-07-07:12:42        0 2 606440720 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778</code></p>
<p>Checking Data Guard Manager on live server showed the same ORA-1034 error, with description added in:</p>
<p><code>C:\&gt;dgmgrl<br />
DGMGRL for 32-bit Windows: Version 10.2.0.1.0 - Production</code></p>
<p>Copyright (c) 2000, 2005, Oracle. All rights reserved.</p>
<p>Welcome to DGMGRL, type &#8220;help&#8221; for information.<br />
DGMGRL&gt; connect sys/password<br />
Connected.<br />
DGMGRL&gt; show configuration;</p>
<p>Configuration<br />
Name:                db_DOCUMENTUM<br />
Enabled:             YES<br />
Protection Mode:     MaxPerformance<br />
Fast-Start Failover: DISABLED<br />
Databases:<br />
dbase    &#8211; Primary database<br />
dbase_DR &#8211; Physical standby database</p>
<p>Current status for &#8220;db_DOCUMENTUM&#8221;:<br />
Warning: ORA-16607: one or more databases have failed</p>
<p>DGMGRL&gt; show database &#8216;dbase&#8217;;</p>
<p>Database<br />
Name:            dbase<br />
Role:            PRIMARY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase&#8221;:<br />
Error: ORA-16778: redo transport error for one or more databases</p>
<p>DGMGRL&gt; show database &#8216;dbase_DR&#8217;;</p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
Error: ORA-01034: ORACLE not available</p>
<p>So the standby database had stopped running (although its windows service was still up and running ok). To fix, first startup nomount the standby database:</p>
<p><code>sqlplus sys/password as sysdba<br />
SQL&gt;<br />
</code></p>
<h2>startup nomount</h2>
<p>At this point dgmgrl on live server reported:</p>
<p><code>DGMGRL&gt; show database 'dbase_DR';</code></p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
Error: ORA-16525: the Data Guard broker is not yet available</p>
<p>And secondly, again on the standby database:</p>
<p><code>SQL&gt;<br />
</code></p>
<h2>alter database mount standby database ;</h2>
<p>Dgmgrl on live server now reported everything ok:</p>
<p><code>DGMGRL&gt; show database 'dbase_DR';</code></p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
SUCCESS</p>
<p>DGMGRL&gt; show configuration;</p>
<p>Configuration<br />
Name:                db_DOCUMENTUM<br />
Enabled:             YES<br />
Protection Mode:     MaxPerformance<br />
Fast-Start Failover: DISABLED<br />
Databases:<br />
dbase    &#8211; Primary database<br />
dbase_DR &#8211; Physical standby database</p>
<p>Current status for &#8220;db_DOCUMENTUM&#8221;:<br />
SUCCESS</p>
<p>DGMGRL&gt;</p>
<p>Which alert logs for live and standby confirmed.</p>
<p>The standby alert log shows this command also:<br />
<code>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  NODELAY</code><br />
But that was issued behind the scenes by the Data Guard Broker, not issued manually by the DBA.</p>
<p>As an aside, 10g logical standby databases (that replay SQL rather than redo change vectors) are availalable with the same protection modes and fast start failover options as physical standby databases (the traditional type that replay redo). That is according to documentation, I haven&#8217;t had a chance to use those myself yet, but hope to be soon. The big advantage of logical standby databases is that they are available for reporting use without halting the replication. In the absence of other drawbacks (not unknown in new oracle features), that would make logical standby the preferred option.</p>
<p><strong>EDIT</strong> &#8211; for older databases or otherwise where data guard is not running, commands to use would instead be like:</p>
<p>recover managed standby database cancel;<br />
recover standby database;<br />
[auto]<br />
recover managed standby database disconnect;</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/03/07/data-guard-today/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Clone a database</title>
		<link>http://andrewfraserdba.com/2007/02/09/clone-a-database/</link>
		<comments>http://andrewfraserdba.com/2007/02/09/clone-a-database/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 13:13:47 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[old]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/02/09/clone-a-database/</guid>
		<description><![CDATA[The below SQL generates a SQL script that can be used to clone a database, putting tablespaces into hot backup mode one at a time. Run it on the source database, and edit the output to specify new target file and directory names, and change cp to rcp or scp if cloning to another server.
Database [...]]]></description>
			<content:encoded><![CDATA[<p>The below SQL generates a SQL script that can be used to clone a database, putting tablespaces into hot backup mode one at a time. Run it on the source database, and edit the output to specify new target file and directory names, and change cp to rcp or scp if cloning to another server.</p>
<p>Database clones can also be done with rman, which has the advantage of avoiding the performance draining hot backup mode.</p>
<pre class="brush:sql">set pages 9999 lines 132 serverout on size 99999
BEGIN
  FOR t IN ( select distinct tablespace_name from dba_data_files )
  LOOP
    dbms_output.put_line('alter tablespace '||t.tablespace_name||' begin backup ;') ;
    FOR f IN ( select file_name from dba_data_files where tablespace_name = t.tablespace_name )
    LOOP
      dbms_output.put_line('host cp '||f.file_name||' '||f.file_name ) ;
    END LOOP ;
    dbms_output.put_line('alter tablespace '||t.tablespace_name||' end backup ;') ;
  END LOOP ;
END ;
/
set lines 80
select 'alter tablespace '||tablespace_name||' add tempfile '||file_name||' size '||bytes/1024/1024||' m ;'
from dba_temp_files
/
prompt alter system switch logfile ;;
prompt alter system backup controlfile to trace ;;</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/02/09/clone-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NID to fix RMAN-20035: invalid high recid</title>
		<link>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/</link>
		<comments>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 13:20:43 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[old]]></category>
		<category><![CDATA[rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/</guid>
		<description><![CDATA[For errors like:
RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high recid
You can switch the catalog over to a previous incarnation (before an open resetlogs):
RMAN&#62; list incarnation of database &#60;database name&#62;;
RMAN&#62; reset database to incarnation &#60;incarnation number&#62;;
But that is only valid where you want to go back in [...]]]></description>
			<content:encoded><![CDATA[<p>For errors like:</p>
<pre class="brush:sql">RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high recid</pre>
<p>You can switch the catalog over to a previous incarnation (before an open resetlogs):</p>
<pre class="brush:sql">RMAN&gt; list incarnation of database &lt;database name&gt;;
RMAN&gt; reset database to incarnation &lt;incarnation number&gt;;</pre>
<p>But that is only valid where you want to go back in time to have the catalog work with an old incarnation. If you have mutiple copies of the same database, and want them all registered in the same rman catalog, you have to give the copies different DBIDs, usng the Nid utility:</p>
<pre class="brush:sql">SQL&gt; shutdown immediate
SQL&gt; startup mount
$ nid target=sys/password@testdb</pre>
<p> (you don&#8217;t need to use a connect string here, but if you do, a remote login passwordfile is required)</p>
<pre class="brush:sql">SQL&gt; shutdown immediate</pre>
<p> (at least for 9i, is handled automatically with 10g according to documentation)</p>
<pre class="brush:sql">SQL&gt; startup mount
SQL&gt; alter database open resetlogs;
$ rman target / catalog=rman/password@catdb
RMAN&gt; register database;</pre>
<p>Nid comes with release 9iR2 and above, but can be run against older databases (at least with 8174 64 bit on Solaris), provided you use the connect string syntax with a remote login password file. It is
<pre class="brush:sql">$ORACLE_HOME/bin/nid</pre>
<p>. You have to set your full environment to the new (9iR2 or later) ORACLE_HOME before running nid that way &#8211; can use . oraenv naming a dummy (non existant) database and then typing in the new ORACLE_HOME when prompted.</p>
<p>Reference: Metalink Note:224266.1 or <a href="http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dbnewid.htm#i1005317">Utilities doc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rman crosscheck archivelog all</title>
		<link>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/</link>
		<comments>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 20:55:30 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[old]]></category>
		<category><![CDATA[rman]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/01/12/rman-crosscheck-archivelog-all/</guid>
		<description><![CDATA[If archived redo logs are (wrongly) deleted/moved/compressed from disk without being backed up, the rman catalog will not know this has happened, and will keep attempting to backup the missing archived redo logs. That will cause rman archived redo log backups to fail altogether with an error like:
RMAN-06059: expected archived log not found, lost of [...]]]></description>
			<content:encoded><![CDATA[<p>If archived redo logs are (wrongly) deleted/moved/compressed from disk without being backed up, the rman catalog will not know this has happened, and will keep attempting to backup the missing archived redo logs. That will cause rman archived redo log backups to fail altogether with an error like:</p>
<pre class="brush:sql">RMAN-06059: expected archived log not found, lost of archived log compromises recoverability</pre>
<p>If you can, you should bring back the missing archved redo logs to their original location and name, and let rman back them up. But if that is impossible, the workaround is to &#8220;crosscheck archivelog all&#8221;, like:</p>
<pre class="brush:sql">rman &lt;&lt;e1
connect target /
connect catalog username/password@catalog
run {
allocate channel c1 type disk ;
crosscheck archivelog all ;
release channel c1 ;
}
e1</pre>
<p>You&#8217;ll get output like this:</p>
<pre class="brush:sql">validation succeeded for archived log
archive log filename=D:REDOARCHARCH_1038.DBF recid=1017 stamp=611103638</pre>
<p>for every archived log as they are all checked on disk. That should  be the catalog fixed, run an archivelog backup to make sure.</p>
<p>[Ref: <a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:4990080915650096676::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,291415.1,1,1,1,helvetica">Metalink</a> ]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
