<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bitbach's Blog</title>
	<atom:link href="http://bitbach.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitbach.wordpress.com</link>
	<description>Just another Oracle weblog @ WordPress</description>
	<lastBuildDate>Mon, 09 Jan 2012 16:35:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bitbach.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bitbach's Blog</title>
		<link>http://bitbach.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bitbach.wordpress.com/osd.xml" title="Bitbach&#039;s Blog" />
	<atom:link rel='hub' href='http://bitbach.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Moving a vmware player driven virtual machine between local discs</title>
		<link>http://bitbach.wordpress.com/2012/01/09/moving-a-vmware-player-driven-virtual-machine-between-local-discs/</link>
		<comments>http://bitbach.wordpress.com/2012/01/09/moving-a-vmware-player-driven-virtual-machine-between-local-discs/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 16:35:19 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[vmware player]]></category>
		<category><![CDATA[network failure]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[working directory]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=778</guid>
		<description><![CDATA[Sometimes, simple things seem to become complicated by the multitude of options being available on how to actually execute them. This was the case for me lately when i tried to just move a vm from some location on my local discs to another. This vm runs in a vmware player 4.0.1 and remembering the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=778&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes, simple things seem to become complicated by the multitude of options being available on how to actually execute them. This was the case for me lately when i tried to just move a vm from some location on my local discs to another. This vm runs in a vmware player 4.0.1 and remembering the steps i executed during installation, that is, copy the source files (some appliance of redmine on suse, great stuff, really, see <a href="http://bitnami.org/stack/redmine">http://bitnami.org/stack/redmine</a>) to some location and then opening them in the player, i decided to evenly do another copy as well as another open.</p>
<p>However, although the copy vm booted nicely, it somehow lost its network settings such that eth0 failed to come up. At a first glance, i supposed that having two vm&#8217;s of the same environment (excluding the disk location) might puzzle vmware player such that i shutdown the copy vm, renamed the original vm disk location and removed the original vm from the vmware player library entry by offer. On retry, i found the same result, eth0 not coming up.</p>
<p>There are other approaches, in fact, but without boring anyone out there to immediate sleep the following steps did work for me eventually:</p>
<ol>
<li>Shutdown this running vm (environment) cleanly</li>
<li>Close vmware player (iff not self-closed)</li>
<li>Copy, don&#8217;t move for backup reasons, this vm top directory (usually the vm name) to the new location</li>
<li>Start vmware player again</li>
<li>Open the settings of this vm, go to the <code>options</code> tab and change the <code>general</code> setting called <code>working directory</code> to point to the new location</li>
<li>Close the settings of this vm by save</li>
<li>Launch this vm as usual</li>
</ol>
<p>have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/778/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=778&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2012/01/09/moving-a-vmware-player-driven-virtual-machine-between-local-discs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Reformatting empty but corruptly marked oracle blocks</title>
		<link>http://bitbach.wordpress.com/2012/01/03/reformatting-empty-but-corruptly-marked-oracle-blocks/</link>
		<comments>http://bitbach.wordpress.com/2012/01/03/reformatting-empty-but-corruptly-marked-oracle-blocks/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 14:09:33 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[blockrecover]]></category>
		<category><![CDATA[corruption]]></category>
		<category><![CDATA[dbv]]></category>
		<category><![CDATA[logical]]></category>
		<category><![CDATA[ORA-19566]]></category>
		<category><![CDATA[RMAN-03009]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=768</guid>
		<description><![CDATA[What actually appeared as a top most error on the monitoring stack was: Executing dbv against it proved the assumption of rman. However, trying a block recovery by rman eventually delivered no results (after running for hours unpacking any available backup set) because the blocks in question were empty! Knowing that oracle always reformats empty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=768&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What actually appeared as a top most error on the monitoring stack was:</p>
<p><pre class="brush: plain;">
channel ORA_DISK_2: backup set complete, elapsed time: 02:57:02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 01/01/2012 05:17:04

RMAN-03009: failure of backup command on ORA_DISK_2 channel at 01/01/2012 02:20:02
ORA-19566: exceeded limit of 0 corrupt blocks for file H:\ORACLE\SAN_3\ORADATA\WAZ\TEXT\TEXT_DATIDX_05.DBF
</pre></p>
<p><span id="more-768"></span></p>
<p>Executing <em>dbv</em> against it proved the assumption of <em>rman</em>.</p>
<p><pre class="brush: plain;">
DBVERIFY: Release 10.2.0.4.0 - Production on Tue Jan 3 11:43:56 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.

DBVERIFY - Verification starting : FILE = H:\ORACLE\SAN_3\ORADATA\WAZ\TEXT\TEXT_DATIDX_05.DBF
Page 261345 is marked corrupt
Corrupt block relative dba: 0x1a83fce1 (file 106, block 261345)
Bad header found during dbv:
Data in bad block:
 type: 40 format: 2 rdba: 0x16c3fce1
 last change scn: 0x000a.2b57e527 seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xe5272802
 check value in block header: 0x16f2
 computed block checksum: 0x0

Page 261408 is marked corrupt
Corrupt block relative dba: 0x1a83fd20 (file 106, block 261408)
Bad header found during dbv:
Data in bad block:
 type: 40 format: 2 rdba: 0x16c3fd20
 last change scn: 0x000a.2b58ef29 seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xef292802
 check value in block header: 0xa93d
 computed block checksum: 0x0

Page 261420 is marked corrupt
Corrupt block relative dba: 0x1a83fd2c (file 106, block 261420)
Bad header found during dbv:
Data in bad block:
 type: 40 format: 2 rdba: 0x16c3fd2c
 last change scn: 0x000a.2b58ef29 seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xef292802
 check value in block header: 0xb930
 computed block checksum: 0x0

DBVERIFY - Verification complete

Total Pages Examined         : 262144
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 257948
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 2254
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 1939
Total Pages Marked Corrupt   : 3
Total Pages Influx           : 0
Highest block SCN            : 1084849528 (10.1084849528)
</pre></p>
<p>However, trying a block recovery by <em>rman</em> eventually delivered no results (after running for hours unpacking any available backup set) because the blocks in question were empty!<br />
Knowing that <em>oracle</em> always reformats empty (here previously deleted) blocks before writing to it, a dummy table was created to (re)write any available block of the tablespace until a tablespace extension error occurs (do review the dedicated tablespace settings in advance):</p>
<p><pre class="brush: plain;">
create table reformat_me tablespace TEXT_DATIDX as select * from all_objects;
</pre></p>
<p>Repeat until the tablespace extension error:</p>
<p><pre class="brush: plain;">
insert into reformat_me select * from reformat_me;
commit;

...

ORA-1653: unable to extend table reformat_me by 128 in tablespace TEXT_DATIDX 
</pre></p>
<p>Execute another <em>dbv</em> based check:</p>
<p><pre class="brush: plain;">
DBVERIFY: Release 10.2.0.4.0 - Production on Tue Jan 3 14:40:39 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
DBVERIFY - Verification starting : FILE = H:\ORACLE\SAN_3\ORADATA\WAZ\TEXT\TEXT_DATIDX_05.DBF

DBVERIFY - Verification complete

Total Pages Examined         : 262144
Total Pages Processed (Data) : 116700
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 143913
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 1531
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 0
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 1088144588 (10.1088144588)
</pre></p>
<p>Execute another <em>rman</em> baseline (level 0) backup immediately!!!</p>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/768/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=768&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2012/01/03/reformatting-empty-but-corruptly-marked-oracle-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Recovering disk failures that comprise undo segements</title>
		<link>http://bitbach.wordpress.com/2011/12/21/recovering-disk-failures-that-comprise-undo-segements/</link>
		<comments>http://bitbach.wordpress.com/2011/12/21/recovering-disk-failures-that-comprise-undo-segements/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 14:13:51 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[backup / recovery]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[offline]]></category>
		<category><![CDATA[ORA-00376]]></category>
		<category><![CDATA[ORA-01110]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[undo]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=757</guid>
		<description><![CDATA[This is just a snapshot of some sitation that happened quite a while ago on a 10g oracle database. I&#8217;m not going to dive into the details that much, just providing some selects to decipher the scenario and show up one of the probable ways of resolving the problem. Jep, due to a disk failure, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=757&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just a snapshot of some sitation that happened quite a while ago on a 10g oracle database. I&#8217;m not going to dive into the details that much, just providing some selects to decipher the scenario and show up one of the probable ways of resolving the problem.</p>
<p>Jep, due to a disk failure, as i noticed during the analysis, some statements and things complained about datafiles being offline. An attempt to re-online some datafile resulted in an <code>ORA-00376</code> error as follows:</p>
<p><pre class="brush: plain;">
SQL&gt; ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF' ONLINE;
ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF' ONLINE
*
FEHLER in Zeile 1:
ORA-00376: Datei 6 kann zur Zeit nicht gelesen werden
ORA-01110: Datendatei 6: 'H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS03.DBF'
</pre></p>
<p>Looking up <code>dba_data_files</code> produced this output:</p>
<p><span id="more-757"></span></p>
<p><pre class="brush: plain;">
SQL&gt; column file_name format a50
SQL&gt; select file_id, status, online_status, file_name from dba_data_files
  where online_status != 'ONLINE' order by file_name;

FILE_ID  STATUS     ONLINE_  FILE_NAME
-------  ---------  -------  ---------------------------------------------------------
      1  AVAILABLE  SYSTEM   H:\app_ORACLE\SAN_3\ORADATA\appxyz\SYSTEM01.DBF
      5  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS02.DBF
      6  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS03.DBF
     58  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS04.DBF
     65  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS05.DBF
     10  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_01.DBF
     47  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_02.DBF
     50  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_03.DBF
     60  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_05.DBF
     55  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_04.DBF
     86  AVAILABLE  RECOVER  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF
</pre></p>
<p>Further on, there is another file status according to <code>v$datafile</code>:</p>
<p><pre class="brush: plain;">
SQL&gt; column name format a50
SQL&gt; select FILE#, status, name from v$datafile
  where status in ('OFFLINE','RECOVER') order by name;

    FILE#  STATUS   NAME
---------  -------  ---------------------------------------------------------
        5  OFFLINE  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS02.DBF
        6  OFFLINE  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS03.DBF
       58  OFFLINE  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS04.DBF
       65  OFFLINE  H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS05.DBF
       10  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_01.DBF
       47  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_02.DBF
       50  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_03.DBF
       55  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_04.DBF
       60  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_05.DBF
       86  OFFLINE  H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF
</pre></p>
<p>Finally then, on the segments layer, one may inspect what segments do actually need recovery bei selecting from <code>dba_rollback_segs</code>:</p>
<p><pre class="brush: plain;">
SQL&gt; select tablespace_name, segment_name, status from dba_rollback_segs
  where status = 'NEEDS RECOVERY';

TABLESPACE_NAME     SEGMENT_NAME      STATUS
------------------- ----------------- ----------------
UNDOTBS1            _SYSSMU13$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU16$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU17$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU22$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU23$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU24$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU25$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU26$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU27$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU28$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU29$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU30$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU31$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU32$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU33$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU36$        NEEDS RECOVERY
UNDOTBS1            _SYSSMU37$        NEEDS RECOVERY
</pre></p>
<p>So far, one notices that just the undo suffered from a disk failre but oracle also offlined other regular datafiles that reference the undo segments in question (see the four stati selected with several statements above).</p>
<p>Ok, this is a situation, that needs a closed database for recovery but using the standard way of closing the database will not work:</p>
<p><pre class="brush: plain;">
SQL&gt; alter database close;
alter database close
*
FEHLER in Zeile 1:
ORA-00376: Datei 58 kann zur Zeit nicht gelesen werden
ORA-01110: Datendatei 58: 'H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS04.DBF'
</pre></p>
<p>However, for the curious of us, doing static selects is still possible:</p>
<p><pre class="brush: plain;">
SQL&gt; select sysdate from dual;
--------
01.05.10
</pre></p>
<p>So i at least attempted to execute a shutdown that stopped the job queue and the dispatchers and stuff (as monitored in the alert log):</p>
<p><pre class="brush: plain;">
SQL&gt; shutdown immediate;
ORA-00376: Datei 5 kann zur Zeit nicht gelesen werden
ORA-01110: Datendatei 5: 'H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS02.DBF'
</pre></p>
<p>What follows is a step-by-step protocol of the actions to resove the problem. These steps preassume an oracle on windows, to understand the services and registry steps, and a ready-to-go rman backup, to just do an automatic database recovery.</p>
<ol>
<li>Stop the windows services for the database and the listener.</li>
<li>Set the autostart entry for the database to false (see <code>HKLM/SOFTWARE/ORACLE/KEY_OraDb10g_home1/ORA_appxyz_AUTOSTART</code>).</li>
<li>Start the windows service for the database.</li>
<li>Connect to the database as sysdba (<code>sqlplus "/ as sysdba"</code>).</li>
<li>Just mount the database (<code>SQL&gt; startup mount;</code>).</li>
<li>Execute a database wide recovery (<code>SQL&gt; recover database;</code>), devine rman will care for any action by itself.</li>
<li>Open the database (<code>SQL&gt; alter database open;</code>).</li>
<li>Online the undo files in question:<br />
<pre class="brush: plain;">
	SQL&gt; ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_3\ORADATA\appxyz\UNDOTBS03.DBF' ONLINE;
	</pre></li>
<li>Online the data files in question:<br />
<pre class="brush: plain;">
	SQL&gt; ALTER DATABASE DATAFILE 'H:\app_ORACLE\SAN_4\ORADATA\appxyz\stuff\app_UTL_06.DBF' ONLINE;
	</pre></li>
<li>Reset the autostart entry for the database to the original value.</li>
<li>Start the windows service for the listener.</li>
</ol>
<p>That&#8217;s it. Have fun.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/757/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/757/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/757/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=757&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/12/21/recovering-disk-failures-that-comprise-undo-segements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Non-range queries on numeric fields with lucene gt 2.9</title>
		<link>http://bitbach.wordpress.com/2011/09/21/non-range-queries-on-numeric-fields-with-lucene-gt-2-9/</link>
		<comments>http://bitbach.wordpress.com/2011/09/21/non-range-queries-on-numeric-fields-with-lucene-gt-2-9/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 13:19:50 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
		
		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=751</guid>
		<description><![CDATA[As you might know from following the ongoing development of the Lucene search engine, true indexing of numeric values is possible since version 2.9. The actual trick that implemements numeric values in a string based engine, as opposite to a regular relational database for example, is widely discussed elsewhere, e.g. (SearchNumericalFields). However, to get it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=751&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As you might know from following the ongoing development of the <a href="http://lucene.apache.org" target="_blank">Lucene</a> search engine, true indexing of numeric values is possible since version <code>2.9</code>. The actual trick that implemements numeric values in a string based engine, as opposite to a regular relational database for example, is widely discussed elsewhere, e.g. (<a href="http://wiki.apache.org/lucene-java/SearchNumericalFields" target="_blank">SearchNumericalFields</a>). However, to get it in short, those guys just encode any signed numeric along a line of string encoded buckets of a certain precicion that finally allows for greater-than, greater-than-equal etc. queries. As a result you have new &#8220;numeric&#8221; classes at your disposal, namely <code>NumericRangeQuery</code> and <code>NumericRangeFilter</code> for querying and filtering, respectively. Also note that the class <code>SortField</code> since then allows for field types being encoded numerics.</p>
<p>So far, this is a huge step forward in providing professional means for semi-structured searching and sorting. However, what fairly seldom gets attention is the question how to realize equality or in-list searches (or filtering) on numeric values because launching a classic <code>TermQuery</code> or <code>Filter</code> on a numeric field will simply not work. Something quite commonly seen is to just employ a range query/filter with the same inclusive upper and lower bound to achive an equality logic like so:</p>
<p><pre class="brush: plain;">
Filter filter = NumericRangefilter.newIntRange(&quot;someField&quot;, 2, 2, true, true);
</pre></p>
<p>I do not know whether this will perform well under all circumstances but at least know that Lucene comprises some clever rewrite code to care for something chubby like this.</p>
<p>Jep uhh, replacing equality logic with the line above does not imply a comparable approach for in-list searches (or filtering), probably known from <code>TermsFilter</code>. The only way to reproduce in-list logic is to encode the numeric search tokens to the internal format by yourself. This is when the class <code>NumericUtils</code> comes in. It provides for several member methods that produce encoded strings from the family of common numeric datatypes like so:</p>
<p><pre class="brush: plain;">
long[] mdtIds = {168, 167, 151};
Filter orListFilter = new TermsFilter();
for (long mdtId : mdtIds)
((TermsFilter) orListFilter).addTerm(
  new Term(IndexField.IMP_MANDANT.name(), NumericUtils.longToPrefixCoded(mdtId)));
</pre></p>
<p>Someone may argue that using <code>NumericUtils</code> ist not a recommended employment of the Lucene library. He/she may be right &#8230; or not <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Let&#8217;s see.</p>
<p>ps. I&#8217;m using query and filter more or less as synonyms throughout the article. In fact, a Lucene filter may just be seen as a query without scoring. This also becomes obvious iff one takes a look at classes like <code>ConstantScoreQuery</code> or <code>QueryWrapperFilter</code>.</p>
<p>have fun</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/751/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/751/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/751/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=751&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/09/21/non-range-queries-on-numeric-fields-with-lucene-gt-2-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Resolving connections errors on oci8 in jdeveloper 11gR2</title>
		<link>http://bitbach.wordpress.com/2011/08/09/resolving-connections-errors-on-oci8-in-jdeveloper-11gr2/</link>
		<comments>http://bitbach.wordpress.com/2011/08/09/resolving-connections-errors-on-oci8-in-jdeveloper-11gr2/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 07:10:15 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[jedeveloper]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=744</guid>
		<description><![CDATA[Got a fresh jdev 11gR2 (11.1.2.0.0, studio) on an existing oracle client home 11.1.0.6.0 and tried to create a connection to an oracle database based on the oci8 option (thick instead of thin driver) in the Create Database Connection dialogue. The result on some test (test connection button) was a: Test failed: oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I The resolution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=744&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Got a fresh jdev 11gR2 (11.1.2.0.0, studio) on an existing oracle client home 11.1.0.6.0 and tried to create a connection to an oracle database based on the oci8 option (thick instead of thin driver) in the <em>Create Database Connection</em> dialogue. The result on some test (test connection button) was a:</p>
<blockquote><p>Test failed: oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I</p></blockquote>
<p>The resolution trick seems to comprise of a copy of the <code>ojdbc6.jar</code> of the oracle client installation, here in <code>d:\Programme\Oracle\product\11.1.0\client_1\jdbc\lib\</code>, to the jdeveloper app server lib path, here in <code>d:\Programme\Oracle\Middleware\wlserver_10.3\server\lib\</code>.</p>
<p>My reference to the problem solution was: <a href="http://kr.forums.oracle.com/forums/thread.jspa?threadID=2204363&amp;tstart=118" target="_blank">this thread entry</a> on the oracle forums.</p>
<p>have fun</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/744/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/744/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/744/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=744&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/08/09/resolving-connections-errors-on-oci8-in-jdeveloper-11gr2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding page help to a 3.x apex application</title>
		<link>http://bitbach.wordpress.com/2011/05/23/adding-page-help-to-a-3-x-apex-application/</link>
		<comments>http://bitbach.wordpress.com/2011/05/23/adding-page-help-to-a-3-x-apex-application/#comments</comments>
		<pubDate>Mon, 23 May 2011 10:41:48 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[apex]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[help content]]></category>
		<category><![CDATA[hide'n'show]]></category>
		<category><![CDATA[input field]]></category>
		<category><![CDATA[page help]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=727</guid>
		<description><![CDATA[I was lately adding some help content to the create/edit form pages of an internal (dev team) change manager application. This is how i did it, discussing some aspects of the design approach as well as the actual execution with apex 3.x (I&#8217;m still with apex 3.2, since this version is quite sufficient for an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=727&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was lately adding some help content to the create/edit form pages of an internal (dev team) change manager application. This is how i did it, discussing some aspects of the design approach as well as the actual execution with apex 3.x (I&#8217;m still with apex 3.2, since this version is quite sufficient for an internal app).</p>
<p>Providing on page help for form pages is usually a game like this: some input field may be called &#8220;Creation date&#8221; and the help text goes as &#8220;This is the creation date&#8221;. Wow, this is what the world needs to know! I more or less get angry or better ignorant seeing this information garbage but that&#8217;s another story. I prefer on page help content that provides page context information, just pointing out dedicated input fields only when necessary.</p>
<p>In fact, apex puts both approaches at your disposal. The key element with apex is the <em>help text region</em> that you may add with the create region dialogue on a page.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0485.jpg"><img class="aligncenter size-medium wp-image-731" title="SNAG-0485" src="http://bitbach.files.wordpress.com/2011/05/snag-0485.jpg?w=300&#038;h=227" alt="" width="300" height="227" /></a><span id="more-727"></span></p>
<p>Configuring the wizard for the region, I choosed to have a <em>hide and show region</em> for the template and the <em>page template body #1</em> for the display point.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0486.jpg"><img class="aligncenter size-medium wp-image-732" title="SNAG-0486" src="http://bitbach.files.wordpress.com/2011/05/snag-0486.jpg?w=300&#038;h=117" alt="" width="300" height="117" /></a></p>
<p>This will put an initially hidden content area just on top of the form.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0487.jpg"><img class="aligncenter size-medium wp-image-733" title="SNAG-0487" src="http://bitbach.files.wordpress.com/2011/05/snag-0487.jpg?w=300&#038;h=89" alt="" width="300" height="89" /></a></p>
<p>You may go now and enter help text content both for the page and for the several input fields of the form as shown below.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0488.jpg"><img class="aligncenter size-medium wp-image-734" title="SNAG-0488" src="http://bitbach.files.wordpress.com/2011/05/snag-0488.jpg?w=300&#038;h=209" alt="" width="300" height="209" /></a></p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0489.jpg"><img class="aligncenter size-medium wp-image-735" title="SNAG-0489" src="http://bitbach.files.wordpress.com/2011/05/snag-0489.jpg?w=300&#038;h=94" alt="" width="300" height="94" /></a></p>
<p>This results in having both the page and the input fields help being unfolded.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0490.jpg"><img class="aligncenter size-medium wp-image-736" title="SNAG-0490" src="http://bitbach.files.wordpress.com/2011/05/snag-0490.jpg?w=300&#038;h=136" alt="" width="300" height="136" /></a></p>
<p>However, I did&#8217;nt enter any text for the input fields as explained above such that the final (unfolded) view looks as follows.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0491.jpg"><img class="aligncenter size-medium wp-image-737" title="SNAG-0491" src="http://bitbach.files.wordpress.com/2011/05/snag-0491.jpg?w=300&#038;h=99" alt="" width="300" height="99" /></a></p>
<p>have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/727/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/727/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/727/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=727&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/05/23/adding-page-help-to-a-3-x-apex-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0485.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0485</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0486.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0486</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0487.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0487</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0488.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0488</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0489.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0489</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0490.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0490</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0491.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0491</media:title>
		</media:content>
	</item>
		<item>
		<title>Repositioning the wordpress start and posts pages</title>
		<link>http://bitbach.wordpress.com/2011/05/06/repositioning-the-wordpress-start-and-posts-pages/</link>
		<comments>http://bitbach.wordpress.com/2011/05/06/repositioning-the-wordpress-start-and-posts-pages/#comments</comments>
		<pubDate>Fri, 06 May 2011 09:30:06 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[page template]]></category>
		<category><![CDATA[post page]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[start page]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=718</guid>
		<description><![CDATA[I was recently asked to provide a general, description-oriented start page on another wordpress blog (ludoix.wordpress.com). An initial direction was given by Gary Barrett with this article on the wordpress support portal. The trick is to set up another page on the Pages view and configure it to have the lowest order index. Afterwards you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=718&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to provide a general, description-oriented start page on another wordpress blog (<a href="http://ludoix.wordpress.com" target="_blank">ludoix.wordpress.com</a>). An initial direction was given by Gary Barrett with this <a href="http://wordpress.org/support/topic/change-home-page-2" target="_blank">article</a> on the wordpress support portal. The trick is to set up another page on the <em>Pages</em> view and configure it to have the lowest order index. Afterwards you proceed to the <em>Settings / Reading</em> view and change the selection below <em>Front page displays / Front page</em> to the just created item. That&#8217;s great so far, on reloading the blog you&#8217;ll now find your new start page on intial display.</p>
<p><a href="http://bitbach.files.wordpress.com/2011/05/snag-0476.jpg"><img src="http://bitbach.files.wordpress.com/2011/05/snag-0476.jpg?w=300&#038;h=147" alt="" title="SNAG-0476" width="300" height="147" class="aligncenter size-medium wp-image-722" /></a></p>
<p>However, changing the settings with <em>Settings / Reading / Front page displays</em> I already wondered what to enter with the <em>Front page displays / Posts page</em> select list. I actually expected to find an entry such as posts or default-posts or whatever but to no avail. In fact, leaving out this selection removes the the posts page from the blog completely. Stuck! Just driven by some enlightment of intuition (ha ha) I tried the following: I created another (empty) page on the <em>Pages</em> view, not forgetting to set the order index accordingly. Thereafter, i proceeded to the <em>Settings / Reading</em> view again and configured <em>Front page displays / Posts page</em> to this new (empty) item. And, it worked! That is, wordpress obviously only needs another (empty) container page to put the posts page into.</p>
<p>Another functionality i employed with the new start page was page templates that you&#8217;ll find along with the order index on the <em>Pages</em> view. It removes all the sidebar widget stuff from the start page which i find is much more comfortable. Please note however, that the availability and the layout of page templates depend on the theme of the blog.</p>
<p>have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/718/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/718/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/718/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=718&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/05/06/repositioning-the-wordpress-start-and-posts-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>

		<media:content url="http://bitbach.files.wordpress.com/2011/05/snag-0476.jpg?w=300" medium="image">
			<media:title type="html">SNAG-0476</media:title>
		</media:content>
	</item>
		<item>
		<title>Client-failover for dataguard switchover and failover</title>
		<link>http://bitbach.wordpress.com/2011/04/15/client-failover-for-dataguard-switchover-and-failover/</link>
		<comments>http://bitbach.wordpress.com/2011/04/15/client-failover-for-dataguard-switchover-and-failover/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 15:01:53 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[data guard]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[10g]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[cold fusion]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[sql*net]]></category>
		<category><![CDATA[switchover]]></category>
		<category><![CDATA[taf]]></category>
		<category><![CDATA[tnsnames]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=681</guid>
		<description><![CDATA[Introduction The following is nothing more than some extension of the oracle metalink document: [ID 740029.1] Step By Step Guide On How To Configure And Test Client-Failover For Dataguard Switchover And Failover That is, the article does not only present the cookbook how-to of its anchestor but also examines what happens in the database and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=681&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>The following is nothing more than some extension of the oracle metalink document:</p>
<blockquote><p>[ID 740029.1] Step By Step Guide On How To Configure And Test Client-Failover For Dataguard Switchover And Failover</p></blockquote>
<p>That is, the article does not only present the cookbook how-to of its anchestor but also examines what happens in the database and what the clients experience will be concerning a so called transparent application failover (TAF). The scenario has been tested on an oracle 10.2.0.3 on windows, please note that the metalink document points to a some more applicable technique available with oracle 11gR2 (<a href="http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf">Client Failover Best Practices for Highly Available Oracle Databases: Oracle Database 11g Release 2</a>).</p>
<p>Client-failover for dataguard, away from other failover scenarios, essentially aims at using a general <em>tnsnames</em> entry against some server-side database endpoint, no matter what server-side database instance is currently running in a dataguard <em>primary role</em>. This is actually the transparency in a <em>transparent application failover</em> where the application, client here, does not have to care to switch its network configuration in any way (some simple implementation would be, not uncommonly, to provide some <code>tnsnames.ora</code>, <code>tnsnames.ora.prm</code> and <code>tnsnames.ora.stb</code> and rename the files) during a failover or switchover.</p>
<p><span id="more-681"></span></p>
<p>The key to the solution is to have an equally named <em>service</em> being prepared to run on any database instance within the dataguard network. However, the service is defined to actually run on only one of these  database instances. This is achieved by firing a <em>database trigger</em> after <em>startup </em>that checks for the database role being primary along in <code>v$database</code> and then starts the service (see below). Do note, that services may also serve other requirements, such as workload management and analysis as well as load balancing. Such a way there is no overhead in having a couple of services being active on a database (you already know or use the xdb service that comes with a standard installation).</p>
<p><strong>Set-up and test</strong></p>
<p>The set-up consists of two database instances <code>plt</code> and <code>plts</code> where the first one is the usual primary. As <code>sys</code>, you at first create a service on <code>plt</code> being the current primary as follows:</p>
<p><pre class="brush: sql;">
--exec dbms_service.stop_service('pltp');
--exec dbms_service.delete_service('pltp');
exec dbms_service.create_service('pltp', 'pltp');
</pre></p>
<p>This will just register the service but not yet launch any code or whatsoever. The next step creates the database startup trigger to actually start the service for a primary instance:</p>
<p><pre class="brush: sql;">
--drop trigger manage_dg_service;
create or replace trigger manage_dg_service after startup on database
declare
  v_role varchar(30);
begin
  select database_role into v_role from v$database;
  if (v_role = 'PRIMARY') then
    dbms_service.start_service('pltp');
  end if;
end;
/
</pre></p>
<p>With the next planned switchover (or an explicit <code>dbms_service.start_service(...);</code>, depending on whatever 24X7 requirements you have), the service will be started. I verified this at two locations. On one hand I inspected the <code>alert.log</code> for any logging entries and in fact, the regarded service will, in terms of the trigger, be started after <em>database startup</em> but not before <em>alter database open</em> with an <code>ALTER SYSTEM SET</code> in memory only:</p>
<p><pre class="brush: plain;">
...
Wed Apr 13 17:17:16 2011
ALTER SYSTEM SET service_names='pltp' SCOPE=MEMORY SID='plts';
Wed Apr 13 17:17:19 2011
Completed: alter database open
...
</pre></p>
<p>The other spot i inspected was <code>v$services</code> with a subselect to include information from <code>v$active_services</code> as well. Its interesting to see, that service on a standby do not even have the <code>service_id</code> column populated:</p>
<p><pre class="brush: sql;">
-- current primary
SQL&gt; column service_name format a20
SQL&gt; column network_name format a20
SQL&gt; set colsep ' | '
SQL&gt; select service_id, name as service_name, network_name,
  2    (select count(*) from v$active_services where name = A.name) as active
  3  from v$services A order by name;

SERVICE_ID | SERVICE_NAME     | NETWORK_NAME     |     ACTIVE
---------- | ---------------- | ---------------- | ----------
         4 | plt              | plt              |          1
         5 | pltp             | pltp             |          1
         3 | pltXDB           | pltXDB           |          1
         1 | SYS$BACKGROUND   |                  |          1
         2 | SYS$USERS        |                  |          1

-- current standby
SQL&gt; column service_name format a20
SQL&gt; column network_name format a20
SQL&gt; set colsep ' | '
SQL&gt; select service_id, name as service_name, network_name,
  2    (select count(*) from v$active_services where name = A.name) as active
  3  from v$services A order by name;

SERVICE_ID | SERVICE_NAME     | NETWORK_NAME     |     ACTIVE
---------- | ---------------- | ---------------- | ----------
         0 | plts             | plts             |          0
         0 | SYS$BACKGROUND   |                  |          1
         0 | SYS$USERS        |                  |          1
         0 |                  | pltsXDB          |          0
</pre></p>
<p>Ok, having the regarded service being up and running successfully, we go and configure an according <em>tnsname</em> entry with the <code>tnsnames.ora</code> on the clients. It may look as follows whereby the two database instance host ip&#8217;s serve as the failover network endpoints in the <code>ADDRESS_LIST</code> / <code>ADDRESS</code> blocks of the configuration:</p>
<p><pre class="brush: sql;">
dg_plt_prod =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.29.48)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.29.49)(PORT = 1521)))
    (CONNECT_DATA =
      (SERVICE_NAME = pltp)))
</pre></p>
<p>Let&#8217;s now test what happens on a switchover as seen from some client side. I prepared a <em>database link</em> and a simple <em>procedure</em> on a third database instance (client) to select from <code>v$database</code> of the current primary and print some relevant information, most importantly <code>v$database.db_unique_name</code> to sqlplus:</p>
<p><pre class="brush: sql;">
create database link dg_plt_prod connect to xxx identified by xxx using 'dg_plt_prod';

create or replace procedure sfo_test as
begin
  for cur in (
    select '[' || to_char(sysdate, 'hh24:mi:ss') ||
      '] name: ' || name || ', db_unique_name: ' || db_unique_name || ', database_role: ' || database_role
      as status
    from v$database@dg_plt_prod
  ) loop
    dbms_output.put_line(cur.status);
  end loop;
end;
/
</pre></p>
<p>The output of the third database instance (client) sqlplus session reads as follows (the exception messages are in german but you can examine the error codes for inspection):</p>
<p><pre class="brush: sql;">
SQL&gt; set serveroutput on

-- dg environment is running smoothly
SQL&gt; exec sfo_test
[10:50:43] name: PLT, db_unique_name: plt, database_role: PRIMARY
PL/SQL-Prozedur wurde erfolgreich abgeschlossen.

-- last primary is going down, the connection being cancelled
SQL&gt; exec sfo_test
BEGIN sfo_test; END;
*
FEHLER in Zeile 1:
ORA-02068: aufgrund eines schwerwiegenden Fehlers von DG_PLT_PROD
ORA-03113: Unerwartetes _bertragungsende in Kommunikation
ORA-06512: in &quot;XXX.SFO_TEST&quot;, Zeile 3
ORA-06512: in Zeile 1

-- last primary is down, last standby not yet up,
--   the regarded service name unknown with sql*net
SQL&gt; exec sfo_test
BEGIN sfo_test; END;
*
FEHLER in Zeile 1:
ORA-12514: TNS: Listener kennt den Service aktuell nicht, der in dem
Connect-Deskriptor angefordert wird
ORA-06512: in &quot;XXX.SFO_TEST&quot;, Zeile 3
ORA-06512: in Zeile 1

-- last primary is the new standby, last standby is the new primary,
--   the dg environment is running smoothly again
SQL&gt; exec sfo_test
[10:53:15] name: PLT, db_unique_name: plts, database_role: PRIMARY
PL/SQL-Prozedur wurde erfolgreich abgeschlossen.
</pre></p>
<p>So far, anything works as expected. The big shot is that there is no need to reconnect with the third database instance (client) due to the fixed user database link. The client session on the third database instance will care for this automatically (like with a short network outage).</p>
<p>Although this was all the functionality I actually needed for my business case, I mused about the coming out of a directly connected session. Will it failover that transparently as well? Let&#8217;s see:</p>
<p><pre class="brush: sql;">
-- still everything ok
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

STATUS
--------------------------------------------------------------------
[14:03:27] name: PLT, db_unique_name: plts, database_role: PRIMARY

-- switchover in progress
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

*
FEHLER in Zeile 1:
ORA-03113: Unerwartetes _bertragungsende in Kommunikation
Prozess-ID: 0
Session-ID: 128 Seriennummer: 216
ERROR: ORA-03114: Nicht mit ORACLE verbunden

-- switchover being done
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

ERROR: ORA-03114: Nicht mit ORACLE verbunden
ERROR: ORA-03114: Nicht mit ORACLE verbunden

-- another explicit reconnect on sqlplus
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

STATUS
-----------------------------------------------------------------------------
[14:24:07] name: PLT, db_unique_name: plt, database_role: PRIMARY
</pre></p>
<p>Nope, obviously, it won&#8217;t. Only the explicit reconnect serves us with the required response again.</p>
<p>But, why not dig deeper into the TAF-functionality of services by setting the <code>failover_</code>*-parameters of <code>dbms_service.create_service(...);</code> or <code>dbms_service.modify_service(...);</code>, respectively. Likewise we may continously have a look into the TAF-columns of <code>v$session</code>, namely <code>failover_type</code>, <code>failover_method</code> and <code>failed_over</code>. </p>
<p>At a first spot the TAF-columns of our directly connected session read like this so far:</p>
<p><pre class="brush: sql;">
select sid, serial#, logon_time, status, failover_type, failover_method, failed_over
  from v$session where program = 'sqlplus.exe';

       SID|   SERIAL#|STATUS  |FAILOVER_TYPE|FAILOVER_M|FAI
----------|----------|--------|-------------|----------|---
       125|        96|ACTIVE  |NONE         |NONE      |NO
</pre></p>
<p>A modify against our regarded service (within another session on the server) sets all the above mentioned parameters according to the possibilities of 10gR2 (for a detailed documentation see <a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_serv.htm">http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_serv.htm</a> and <a href="http://vnull.pcnet.com.pl/dl/oracle/MAA_WP_10gR2_ClientFailoverBestPractices.pdf">http://vnull.pcnet.com.pl/dl/oracle/MAA_WP_10gR2_ClientFailoverBestPractices.pdf</a>). This includes <em>not</em> applying <code>aq_ha_notifications</code> because although fast application notification (FAN) for avoiding long tcp timeouts is available since 10gR2 it is not be integrated into data guard, specifically the broker, before 11gR2 (!):</p>
<blockquote><p>
FAILOVER_METHOD_BASIC: Server side TAF method is BASIC. BASIC is the only value currently supported. This means that a new connection is established at failure time. It is not possible to pre-establish a backup connection. (which is to say, PRECONNECT is not supported).</p>
<p>FAILOVER_TYPE_SESSION: Server side TAF failover type is SESSION. At failure time, if the failover type is SESSION, TAF will re-connect to a surviving node and re-establish a vanilla database session. Customizations (for example, ALTER SESSION) must be re-executed in a failover callback.
</p></blockquote>
<p>That results in a session-level TAF at a sum of 5 minutes by 60 attempts at 5 secs.</p>
<p><pre class="brush: sql;">
begin
  dbms_service.modify_service(
    service_name =&gt; 'pltp',
    failover_method =&gt; dbms_service.FAILOVER_METHOD_BASIC,
    failover_type =&gt; dbms_service.FAILOVER_TYPE_SESSION,
    failover_retries =&gt; 60,
    failover_delay =&gt; 5);
end;
/
</pre></p>
<p>Let&#8217;s reconnect the directly connected session and remark the changed failover_type and failover_method values being listed immediately.</p>
<p><pre class="brush: sql;">
select sid, serial#, status, failover_type, failover_method, failed_over
  from v$session where program = 'sqlplus.exe';

       SID|   SERIAL#|STATUS  |FAILOVER_TYPE|FAILOVER_M|FAI
----------|----------|--------|-------------|----------|---
       125|        98|ACTIVE  |SESSION      |BASIC     |NO
</pre></p>
<p>ok, now execute another manual switchover in the background and check again what happens:</p>
<p><pre class="brush: sql;">
-- launch the test set-up standard select for the direct session
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

STATUS
-----------------------------------------------------------------------------
[15:07:03] name: PLT, db_unique_name: plt, database_role: PRIMARY

-- switchover being underway the following select ***waits*** for completion
--   and does not thow exceptions about network errors like before
--   (however, after the switchover it complains about an impossible
--   replay)
select sid, serial#, status, failover_type, failover_method, failed_over
  from v$session where program = 'sqlplus.exe';
*
FEHLER in Zeile 1:
ORA-25408: Aufruf kann nicht sicher wiederholt werden

-- just try again and see it works (!) and features a failed_over = 'YES'
select sid, serial#, status, failover_type, failover_method, failed_over
  from v$session where program = 'sqlplus.exe';

       SID|   SERIAL#|STATUS  |FAILOVER_TYPE|FAILOVER_M|FAI
----------|----------|--------|-------------|----------|---
       111|         1|ACTIVE  |SESSION      |BASIC     |YES

-- well, try the test select again, works also
select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' ||
  db_unique_name || ', database_role: ' || database_role as status
from v$database;

STATUS
------------------------------------------------------------------------------
[15:09:59] name: PLT, db_unique_name: plts, database_role: PRIMARY
</pre></p>
<p>Great stuff really. But what about that <code>ORA-25408</code> error? This is <em>expected behaviour</em> as according to metalink note <em>473145.1: SQLPLUS does not failover service receiving FAN events</em>. Sqlplus can&#8217;t just handle this scenario before 10.2.0.4 and unless being started with the <code>-F</code> option. Martin Bach writes in an article (<a href="http://martincarstenbach.wordpress.com/2011/02/16/rac-one-node-and-database-protection">RAC One Node and Database Protection</a>) that it is more or less the responsibility of the calling environment to handle just this exception (when the database is unable to replay the transactional operations that occur past the last committed transaction). I would go with that, especially concerning the logic to perform a sufficient <code>rollback;</code> before proceeding with transactions in the failed over session. <code>OCI-JDBC</code>, beware of the recent change from TAF to fast connection failover (FCF), in fact provides a couple of methods to get along with (<a href="http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/ocitaf.htm">http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/ocitaf.htm</a> or metalink note 276225.1 <em>JDBC Sample on How to Implement OCI TAF callbacks with DML and PL/SQL</em>).</p>
<p><strong>conclusion</strong></p>
<p>So, what&#8217;s next? Thinking about having a much smarter solution for the actual business case with a database link client session now? I got to disappoint you, sorry. TAF being based on service and an accordingly set failover_method as well as failover_type will <em>not</em> work over database links as described in metalink note <em>399453.1: Database Link Usage with Connect Time Failover or Transparent Application Failover</em>:</p>
<blockquote><p>
Database Link Usage with Connect Time Failover or Transparent Application Failover [ID 399453.1]<br />
Modified 06-AUG-2010     Type HOWTO     Status PUBLISHED<br />
Applies to:<br />
Oracle Net Services &#8211; Version: 9.2.0.1.0 and later   [Release: 9.2 and later ]<br />
Information in this document applies to any platform.<br />
Goal<br />
Database link usage with Connect Time Failover (CTF) or Transparent Application Failover (TAF)<br />
Solution<br />
Database links do not currently support either Connection Time Failover or Transparent Application Failover.<br />
This is confirmed by Oracle Development in the Bug 2393357 ORA-25402 USING TAF WITH DB-LINKS. This is closed with code &#8220;Status 92,Closed, Not a Bug&#8221;<br />
The following enhancement request is outstanding for this issue. Bug 3389688 ORA-25402 WHEN USING TAF WITH DATABASE LINKS
</p></blockquote>
<p>One has to catch all this disconnect and unknown service exceptions. There is no way out. It&#8217;s a shame.</p>
<p>There is another valuable collection of metalink notes for TAF on 10g from Julian Dyke at <a href="http://www.juliandyke.com/References/TAF.html">TAF References</a> (where Julian Dyke = &#8216;Pro Oracle Database 10g RAC on Linux&#8217; and Martin Bach = &#8216;Pro Oracle Database 11g RAC on Linux&#8217;, ok?).</p>
<p><strong>update concerning cold fusion</strong></p>
<p>The last few days I also tested the service-based TAF, as described above, against(adobe) cold fusion. In fact, cold fusion does support TAF but only in the enterprise (or developer) edition and by employing the macromedia driver. I tested cold fusion version 9.x with a 11g jdbc driver and used the following datasource settings (note that you&#8217;ll need to select the other type driver class when creating the datasource):</p>
<p><pre class="brush: plain;">
--&gt; JDBC URL
jdbc:macromedia:oracle://192.168.29.48:1521;ServiceName=hugopltp;AlternateServers=(192.168.29.49:1521);ConnectionRetryCount=60;ConnectionRetryDelay=5
--&gt; Driver Class
macromedia.jdbc.MacromediaDriver
</pre></p>
<p>To keep it short, it does work with just one poor flaw. Upon a planned switchover the web site in action notices the role change somehow and correctly waits for completion. However, when the following finishes for the former primary:</p>
<p><pre class="brush: sql;">
alter database commit to switchover to physical standby with session shutdown;
</pre></p>
<p>and the database was dismounted, the web site throws an exception with this text:</p>
<p><pre class="brush: plain;">
Error Executing Database Query.
[Macromedia][Oracle JDBC Driver][Oracle]ORA-00604: error occurred at recursive SQL level 1 ORA-01219: database not open: queries allowed on fixed tables/views only
 
The error occurred in D:/wwwroot/_test/plt/plt_db_test.cfm: line 25

23 : 	name=&quot;qry_selectTest&quot; result=&quot;res&quot;&gt;
24 : 	
25 : 	#preserveSingleQuotes(form.sqlStatement)#
26 : 	
27 : &lt;/cfquery&gt;

VENDORERRORCODE 	  604
SQLSTATE 	  HY008
SQL 	   select '[' || to_char(sysdate, 'hh24:mi:ss') || '] name: ' || name || ', db_unique_name: ' || db_unique_name || ', database_role: ' || database_role as status from v$database
DATASOURCE 	  PLT_DG_TEST
</pre></p>
<p>Iff you do a reload on that, the web site waits again until the switchover has been done and redisplays the data in order. So what? Is this cold fusion&#8217;s way to tell us about <code>ORA-25408</code> from above or is it in fact different. Me, i don&#8217;t know. An recommended article from from datadirect (<a href="http://www.datadirect.com/resources/jdbc/oracle-rac/failover.html">http://www.datadirect.com/resources/jdbc/oracle-rac/failover.html</a>), where datadirect seems to be the actual producer of <code>macromedia.jdbc.MacromediaDriver</code>, does not really encourage someone to examine this question further (whereupon the article itself is ok but not the bottom line). That&#8217;s it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/681/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=681&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/04/15/client-failover-for-dataguard-switchover-and-failover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>Materialized views ddl and dml stati (and the infamous NEEDS_COMPILE)</title>
		<link>http://bitbach.wordpress.com/2011/04/08/materialized-views-ddl-and-dml-stati-and-the-infamous-needs_compile/</link>
		<comments>http://bitbach.wordpress.com/2011/04/08/materialized-views-ddl-and-dml-stati-and-the-infamous-needs_compile/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 18:54:32 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[schema design]]></category>
		<category><![CDATA[dba_mviews]]></category>
		<category><![CDATA[dba_objects]]></category>
		<category><![CDATA[dba_snapshots]]></category>
		<category><![CDATA[ddl]]></category>
		<category><![CDATA[dml]]></category>
		<category><![CDATA[invalid]]></category>
		<category><![CDATA[materialized view]]></category>
		<category><![CDATA[needs_compile]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[valid]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=653</guid>
		<description><![CDATA[introduction Employing materialized views (or snapshot or mview for short) for producing simple sum-up reports is really cool stuff. You just launch some statement like the following: and will be served with a well performing collection of data that is more or less current (that is why i call that simple). Oracle will care for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=653&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>introduction</strong></p>
<p>Employing materialized views (or snapshot or mview for short) for producing <em>simple</em> sum-up reports is really cool stuff. You just launch some statement like the following:</p>
<p><pre class="brush: plain;">
create materialized view some_mv
  build immediate
  refresh force next (sysdate + 1/24/12)
as
select X.ts, Y.name from (
  select to_char(max(A.ts), 'dd.mm.yyyy hh24:mi') as ts, B.blubb
    from tab1 A, tab1_1 B where A.id = B.id
    group by B.blubb
) X, tab2 Y
  where X.blubb = Y.id;
</pre></p>
<p>and will be served with a well performing collection of data that is more or less current (that is why i call that simple). Oracle will care for the refresh of the mview by self-registering a job on calling <code>dbms_refresh.refresh('some_mv');</code>, that starts immediately and takes the interval from the statement. Handing in the <code>force</code> keyword just chooses a <code>fast</code> refresh method iff possible and a <code>complete</code> refresh method otherwise. There are more defaults applied by leaving other keywords unset, the refresh mode for example, but this is not the point of the article. It is:</p>
<blockquote><p>Why does that &#8230; mview always show a state of <code>NEEDS_COMPILE</code> although no ddl action has happend along the objects dependency chain lately?</p></blockquote>
<p><span id="more-653"></span></p>
<p>Uuh, the answer is not easy to give and much less easy to explain (by means of the oracle dictionary). Generally spoken, a <code>NEEDS_COMPILE</code> in fact implies another compile to be executed on the mview but, however, not to re-evaluate code integrity of the mview but data integrity instead. in other words, a recompile will find out whether some mview is <em>stale</em> concerning the underlying data (you know that from statistics and stuff). But let&#8217;s find out about that. A good starting point is the following article from metalink:</p>
<blockquote><p>(454552.1) How To: What Causes So Many Invalid Materialized Views</p></blockquote>
<p><strong>testbed and tests</strong></p>
<p>However, it will only show you <em>expected behaviour</em>, in a sense that oracle assumes what is to be expected behaviour and what is not. As a dba you may turn the medal up and down, you&#8217;ll not manage to bypass detailed testing in order to know what you get. My <em>eye into the system</em> is the following statement that i have been setting up from <code>dba_mviews</code>, <code>dba_mview_refresh_times</code> and <code>dba_objects</code>. <code>dba_snapshots</code> is no longer regarded, since it has not been documented from oracle since 10gR1 onwards (iff i remember it correctly), but is still available though. Some typical columns of <code>dba_snapshots</code>, as <code>master_owner</code>, <code>master</code> and <code>master_link</code> can now be sourced from <code>dba_mview_refresh_times.master_owner</code>,<br />
<code>dba_mview_refresh_times.master</code> and <code>dba_mviews.master_link</code>, respectively. Please note also, that <code>dba_objects</code> contains two entities for the mview, one of <code>object_type = 'MATERIALIZED VIEW'</code> and one of <code>object_type = 'TABLE'</code>. This is important later on, when checking the status of the mview as seen from <code>dba_objects</code>. Another point to puzzle around with was the timestamps given with the three different views. Along my tests any data of <code>dba_mviews.last_refresh_date</code>, <code>dba_mview_refresh_times.last_refresh</code> and <code>dba_objects.last_ddl_time where object_type = 'MATERIALIZED VIEW'</code> was identical. Ok, here we go for the <em>eye into the system</em> statement (the commented columns will not be shown below but you may probably need them for another exercise):</p>
<p><pre class="brush: plain;">
select
  A.owner as owner, A.mview_name as name,
  (select A.compile_state || '/' || invalid from dba_mview_analysis
    where owner = A.owner and mview_name = A.mview_name) as c_stat_inval,
  (select master_owner || '.' || master ||
      decode(A.master_link, null, null, '@' || master_link) from dba_mview_refresh_times
    where owner = A.owner and name = A.mview_name) as master,
  (select status from dba_objects
    where owner = A.owner and object_name = A.mview_name
      and object_type = 'MATERIALIZED VIEW') as mvw_status,
  (select status from dba_objects
    where owner = A.owner and object_name = A.mview_name
      and object_type = 'TABLE') as tab_status,
  (select A.staleness || '/' || known_stale from dba_mview_analysis
    where owner = A.owner and mview_name = A.mview_name) as stale_known,
  /*A.stale_since, A.refresh_mode as refresh_mode, A.refresh_method as refresh_method,*/
  /*A.last_refresh_type,*/ A.last_refresh_date as last_refr_ts
from dba_mviews A
where A.mview_name in ('SOME_MV')
order by 1, 2, 3;
</pre></p>
<p>and this is a couple of tables and constraints to define a mview upon:</p>
<p><pre class="brush: plain;">
create table tab1 ( id number not null, ts date not null, flag varchar2(1) default not null,
  constraint tab1_pk primary key(ts, id) using index );
alter table tab1 add ( constraint tab1_uq unique (id) not deferrable using index );
create table tab1_1 ( id number not null, blubb number not null,
  constraint tab1_1_pk primary key(id) using index );
alter table tab1_1 add ( constraint tab1_1_tab1_fk foreign key( id)
  references tab1( id) not deferrable enable );
create table tab2 ( id number not null, name varchar2(128) not null,
  constraint tab2_pk primary key(id) using index );
alter table tab1_1 add ( constraint tab1_1_tab2_fk foreign key( blubb)
  references tab2( id) not deferrable enable );
</pre></p>
<p>What follows now is essentially a <em>do something</em> and look <em>what happens</em>, mostly by executing the <em>eye into the system</em> statement (only the last two trials use pl/sql). The tests were executed on a 11.2.0.1 / windows 64.</p>
<p>Firstly, the mview gets created (actually the mview statement from above) and we look for the results:</p>
<p><pre class="brush: plain;">
create materialized view some_mv
  build immediate
  refresh force next (sysdate + 1/24/12)
as
select X.ts, Y.name from (
  select to_char(max(A.ts), 'dd.mm.yyyy hh24:mi') as ts, B.blubb
    from tab1 A, tab1_1 B where A.id = B.id
    group by B.blubb
) X, tab2 Y
  where X.blubb = Y.id;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | VALID/N         | TAB2   | VALID      | VALID      | FRESH/N         | 08.04.2011 18:37:44
.
</pre>
<p>Jep, for <em>C_STAT_INVAL</em> the source column <code>dba_mviews.compile_status</code> looks fine and <code>dba_mview_refresh_times.invalid</code> is not true. For <em>MVW_STATUS</em>and <em>TAB_STATUS</em>, which represent the above mentioned status of the mview as seen from <code>dba_objects</code>, we get what we expect. Also <code>dba_mviews.staleness</code> is in order and <code>dba_mview_refresh_times.known_stale</code> does not &#8220;know&#8221; about any staleness. The next step is to insert some data and look again:</p>
<p><pre class="brush: plain;">
insert into tab2 (id, name) values (1, 'name 1');
insert into tab2 (id, name) values (2, 'name 2');
insert into tab1 (id, ts, flag) values (1, sysdate, 'T');
insert into tab1 (id, ts, flag) values (2, sysdate-1/12, 'T');
insert into tab1_1 (id, blubb) values (1, 1);
insert into tab1_1 (id, blubb) values (2, 2);
commit;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | NEEDS_COMPILE/Y | TAB2   | INVALID    | VALID |    | NEEDS_COMPILE/N | 08.04.2011 18:42:44
.
</pre>
<p>Hhm, the stati change, except for &#8220;knowing&#8221; about staleness and the mview status from <code>dba_objects</code> has flipped too. Ok, why not. Since the given data convinced me to <em>compile</em> the mview, i go for that:</p>
<p><pre class="brush: plain;">
alter materialized view some_mv compile;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | VALID/N         | TAB2   | VALID      | VALID      | STALE/Y         | 08.04.2011 18:54:40
.
</pre>
<p>Aah, everything ok gain, but the mview has now been explicitely marked stale (the underlying data is inconsistent with the mview) and oracle does &#8220;know&#8221; about that. Fine. However, since the mview has now lost consistency with the underlying data, we should do an on-demand refresh (will actually be triggered from the job being created from oracle automatically iff you follow the straight path):</p>
<p><pre class="brush: plain;">
exec dbms_refresh.refresh('SOME_MV');
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | VALID/N         | TAB2   | VALID      | VALID      | FRESH/N         | 08.04.2011 18:57:02
.
</pre>
<p>Yes, everything shiny again. Now, the following will execute an update on the given <em>master table</em> of the mview:</p>
<p><pre class="brush: plain;">
update tab2 set name = 'name 22222222' where id = 2;
commit;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | NEEDS_COMPILE/Y | TAB2   | INVALID    | VALID      | NEEDS_COMPILE/N | 08.04.2011 19:03:17
.
</pre>
<p>Obviously the same as with the initial inserts &#8230; expected behaviour. Just to be shure, we take a look at the real data:</p>
<p><pre class="brush: plain;">
select 'MV' as srcc, ts, name from some_mv
union all
select 'STMT' as srcc, X.ts, Y.name from (
  select to_char(max(A.ts), 'dd.mm.yyyy hh24:mi') as ts, B.blubb
    from tab1 A, tab1_1 B where A.id = B.id
    group by B.blubb
) X, tab2 Y
  where X.blubb = Y.id;
</pre></p>
<pre>
SRCC | TS               | NAME
---------------------------------------
MV   | 08.04.2011 18:42 | name 1
MV   | 08.04.2011 16:47 | name 2
STMT | 08.04.2011 18:42 | name 1
STMT | 08.04.2011 16:47 | name 22222222
.
</pre>
<p>Jep, as expected again. Not missing to reset up the testbed, i.e. the mview stati, for the next case using <code>dbms_refresh.refresh();</code>, see above, i ask what happens when i update a column of a non master table that even does not appear with the mview setup statement:</p>
<p><pre class="brush: plain;">
update tab1 set flag = 'F' where id = 2;
commit;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | NEEDS_COMPILE/Y | TAB2   | INVALID    | VALID      | NEEDS_COMPILE/N | 08.04.2011 19:07:12
.
</pre>
<p>Uuh, everything invalid again. This was not expected, at least by me (got to rtfm). I do another manual refresh to clean up the testbed and now switch from dml to ddl test mode. I wonder what will be the result of the following:</p>
<p><pre class="brush: plain;">
alter table tab1 add(blabla number null );
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | NEEDS_COMPILE/Y | TAB2   | INVALID    | VALID      | NEEDS_COMPILE/N | 08.04.2011 19:34:40
.
</pre>
<p>Nothing essentially new it seems and, most important, nothing different from the dml cases? Clean up the testbed one more time and try harder now, be really nasty:</p>
<p><pre class="brush: plain;">
drop table tab1_1;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | NEEDS_COMPILE/Y | TAB2   | INVALID    | VALID      | NEEDS_COMPILE/N | 08.04.2011 19:37:23
.
</pre>
<p>Aha, needs some compile. We saw that before, did&#8217;nt we. I supposed to do something really out of style but oracle still seems to keep calm. Again, i might need a recompile. I&#8217;ll just have a try:</p>
<p><pre class="brush: plain;">
alter materialized view some_mv compile;
</pre></p>
<pre>
NAME    | C_STAT_INVAL    | MASTER | MVW_STATUS | TAB_STATUS | STALE_KNOWN     | LAST_REFR_TS
----------------------------------------------------------------------------------------------------
SOME_MV | COMPILATION_ERROR/N | TAB2 | INVALID  | VALID      | COMPILATION_ERROR/N | 08.04.2011 19:37:23
.
</pre>
<p>Bingo, only now the code inconsistency gets reflected with the dictionary. But, out of the habits of a dba, let&#8217;s try a <code>show errors</code> after the compile with a pl/sql shell:</p>
<p><pre class="brush: plain;">
show errors
</pre></p>
<pre>
Keine Fehler.
</pre>
<p>Puuuuh, no errors. This can&#8217;t be true! And what will <code>dbms_refresh.refresh(...);</code> tell us?</p>
<p><pre class="brush: plain;">
exec dbms_refresh.refresh('SOME_MV');
</pre></p>
<pre>
FEHLER in Zeile 1:
ORA-12018: Folgender Fehler bei Codegenerierung f³r SOME_MV aufgetreten
ORA-00942: Tabelle oder View nicht vorhanden
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2558
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2771
ORA-06512: in "SYS.DBMS_IREFRESH", Zeile 685
ORA-06512: in "SYS.DBMS_REFRESH", Zeile 195
ORA-06512: in Zeile 1
</pre>
<p>Finally, we get a thorough exception, although, however, the exception contains <code>ora-00942</code> which is another running infamous error message, for not telling us what table or view is actually missing &#8230; I was also trying a view access based on the dropped table scenario and the information from the dictionary did not change compared to the data above. Last but not least I re-created the table along with the foreign key and found that one has to do an <code>alter materialized view ... compile;</code> before any other <code>exec dbms_refresh.refresh(...);</code> to fix the situation, looks logical.</p>
<p><strong>conclusions</strong></p>
<p>Throughout the article and in regard to a mview, I was talking a lot about consistency, namely concerning the underlying data and the code dependency. After testing the behaviour of a mview under different scenarions, I may tend to have learned that the implementation of the mview sql or pl/sql interface with oracle is <em>not</em> consistent with other interfaces, i.e. for regular views or for tables. The most astonishing point is however, that you can&#8217;t tell at any given point in time, whether some mview is invalid due to some dml or ddl changes of the underlying layers. In general, i believe that the seen mview interface comprises a design flaw in integrating the conceptually different aspects of code and data into a usually code-dedicated compile statement. I would, iff someone out there would ask me, ha ha, propose to include a pseudo-column with every mview that tells you about the staleness of the underlying data with just this executed select (using every day oracle read consistency).</p>
<p>Have fun, nevertheless.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/653/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/653/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/653/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=653&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/04/08/materialized-views-ddl-and-dml-stati-and-the-infamous-needs_compile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
		<item>
		<title>RFS: No standby redo logfiles &#8230;</title>
		<link>http://bitbach.wordpress.com/2011/04/05/rfs-no-standby-redo-logfiles/</link>
		<comments>http://bitbach.wordpress.com/2011/04/05/rfs-no-standby-redo-logfiles/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 13:01:00 +0000</pubDate>
		<dc:creator>bitbach</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[data guard]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[ARCH]]></category>
		<category><![CDATA[LGWR]]></category>
		<category><![CDATA[rfs]]></category>
		<category><![CDATA[standby]]></category>
		<category><![CDATA[standby redo]]></category>

		<guid isPermaLink="false">http://bitbach.wordpress.com/?p=638</guid>
		<description><![CDATA[Some day, you may trap the following error message with your standby database alert log (seen on a 10.2.0.3): The reason for this message is most probably that you have cloned your standby database with rman and configured your dataguard environment to directly write into redo log at standby (using LGWR), instead of just transfering [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=638&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some day, you may trap the following error message with your standby database alert log (seen on a 10.2.0.3):</p>
<p><pre class="brush: plain;">
RFS: No standby redo logfiles available
</pre></p>
<p>The reason for this message is most probably that you have cloned your standby database with <code>rman</code> and configured your dataguard environment to directly write into redo log at standby (using <code>LGWR</code>), instead of just transfering the archive log items from primary (using <code>ARCH</code>), but have missed to provide the necessary standby redo log files. <code>RFS</code> may also log <code>RFS[1]: Unable to open standby log 9: 313</code> or something similar (the primary will also complain about connection problems to the standby destination target, which is the standby redo log, actually).</p>
<p><pre class="brush: plain;">
RFS: No standby redo logfiles available of size 104857600 bytes
</pre></p>
<p><span id="more-638"></span></p>
<p>This is another message you may hit for a comparable reason, however, this one implies that standby redo log files do exist, but of  a wrong size. Standby redo log files indeed have to match the size of the online log files as well as the archive log files, respectively. As for this example, oracle expects standby redo log files of size 100 mb.</p>
<p>It is interesting though to see, that dataguard does an intelligent fallback in just leaving the transactional log shipping aside (or in error) and proceeding in the traditional log switch triggered shipping mode (using <code>ARCH</code>). That is, dataguard continues to work, although some misconfiguration is pending. Really cool!</p>
<p>Do regard, by the way, that the things have changed with the introduction of 10.2.0.4. From this release on, a standby database resulting from an <code>rman</code> clone is smart enough to create the necessary standby redo log on the run. In detail and supposed that you already created the standby redo log on the initial primary, the standby database finds from the standby control file that there <em>should</em> exist standby redo log files (which is true for the online log also). However, only with the first log switch from primary, the standby database will step into some standby redo log regeneration by means of log file clearing (see elsewhere what that means). I collected some <code>alert log</code> output to trace what actually happens and it reads as follows:</p>
<ul>
<li>Recovery of rman duplicate has finished, rfs starts and finds the srl&#8217;s missing.
<p><pre class="brush: plain;">
Incomplete Recovery applied until change 599746
Completed: alter database recover logfile 'J:\ORADATA\DGP\ARCH\ARC00008_0733948503.001'
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[1]: Assigned to RFS process 3172
RFS[1]: Identified database type as 'physical standby'
Mon Nov 01 19:59:50 2010
RFS LogMiner: Client disabled from further notification
Mon Nov 01 20:00:53 2010
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 6048
RFS[2]: Identified database type as 'physical standby'
Primary database is in MAXIMUM PERFORMANCE mode
Primary database is in MAXIMUM PERFORMANCE mode
Mon Nov 01 20:00:53 2010
Errors in file e:\oracle\product\10.2.0\admin\dgs\udump\dgs_rfs_6048.trc:
ORA-00313: open failed for members of log group 4 of thread 0
ORA-00312: online log 4 thread 0: 'E:\ORADATA\DGS\STBREDO\STBREDO04B.LOG'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
ORA-00312: online log 4 thread 0: 'E:\ORADATA\DGS\STBREDO\STBREDO04A.LOG'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
</pre>
</li>
<li>However oracle seems to notice that the srl&#8217;s have already been registered with the controlfile (from the initial primary) but not yet created on standby.<br />
<pre class="brush: plain;">
SRL log 4 needs clearing because log has not been created
</pre>
</li>
<li>Well, after cycling through all the srl&#8217;s and repeating the above entries, rfs finally prints that no srl&#8217;s are seen (of a certain size, ha ha).<br />
<pre class="brush: plain;">
RFS[2]: No standby redo logfiles of size 102400 blocks exist
</pre>
</li>
<li>But, now oracle automatically creates (cleares) the srl&#8217;s.<br />
<pre class="brush: plain;">
Clearing online log 7 of thread 0 sequence number 0
...
Clearing online log 4 of thread 0 sequence number 0
</pre>
</li>
<li>And &#8230; some way further down the alert, the first srl has been successfully opened.<br />
<pre class="brush: plain;">
Mon Nov 01 20:00:54 2010
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[3]: Assigned to RFS process 4116
RFS[3]: Identified database type as 'physical standby'
RFS[3]: Successfully opened standby log 4: 'E:\ORADATA\DGS\STBREDO\STBREDO04A.LOG'
</pre>
</li>
<li>By the way, the same procedure will be applied for the orl&#8217;s, but only after media recovery has been started.<br />
<pre class="brush: plain;">
ALTER DATABASE recover managed standby DATABASE disconnect
MRP0 started with pid=21, OS id=596
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 15 processes
Mon Nov 01 20:09:57 2010
Waiting for all non-current ORLs to be archived...
...
Mon Nov 01 20:10:00 2010
Errors in file e:\oracle\product\10.2.0\admin\dgs\bdump\dgs_mrp0_596.trc:
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: 'E:\ORADATA\DGS\REDO\REDO02B.LOG'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
ORA-00312: online log 2 thread 1: 'E:\ORADATA\DGS\REDO\REDO02.LOG'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.
...
Clearing online redo logfile 2 E:\ORADATA\DGS\REDO\REDO02.LOG
Clearing online log 2 of thread 1 sequence number 14
...
Clearing online redo logfile 2 complete
</pre></p>
</li>
</ul>
<p>Have fun!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bitbach.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bitbach.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bitbach.wordpress.com/638/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bitbach.wordpress.com&amp;blog=5472326&amp;post=638&amp;subd=bitbach&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bitbach.wordpress.com/2011/04/05/rfs-no-standby-redo-logfiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>51.050991 13.733633</georss:point>
		<geo:lat>51.050991</geo:lat>
		<geo:long>13.733633</geo:long>
		<media:content url="http://0.gravatar.com/avatar/28091fa9ab634e43a30eb6fbfd29d45c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bitbach</media:title>
		</media:content>
	</item>
	</channel>
</rss>
