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

<channel>
	<title>DBA survival BLOG &#187; cluster</title>
	<atom:link href="http://www.ludovicocaldara.net/dba/tag/cluster/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ludovicocaldara.net/dba</link>
	<description>Keep DBA job simple. Thanks.</description>
	<lastBuildDate>Sat, 01 Oct 2011 20:06:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Dataguard check script for Real Application Clusters (MAA)</title>
		<link>http://www.ludovicocaldara.net/dba/dataguard-check-script-for-real-application-clusters-maa/</link>
		<comments>http://www.ludovicocaldara.net/dba/dataguard-check-script-for-real-application-clusters-maa/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 13:46:30 +0000</pubDate>
		<dc:creator>Ludovico</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[maximum availability architecture]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Oracle Dataguard]]></category>
		<category><![CDATA[Oracle MAA]]></category>
		<category><![CDATA[Perl script]]></category>
		<category><![CDATA[RAC]]></category>
		<category><![CDATA[real-time apply]]></category>
		<category><![CDATA[Standby]]></category>

		<guid isPermaLink="false">http://www.ludovicocaldara.net/dba/?p=86</guid>
		<description><![CDATA[Two years after my posts: Quick Oracle Dataguard check script and More about Dataguard and how to check it I faced a whole new Dataguard between two Oracle Real Application Clusters, aka Oracle Maximum Availability Architecture (MAA). This enviromnent is relying on Windows OS. Don&#8217;t know how this could be called &#8220;availability&#8221; but here we [...]]]></description>
			<content:encoded><![CDATA[<p>Two years after my posts:<br />
<a href="http://www.ludovicocaldara.net/dba/quick-oracle-dataguard-check-script/">Quick Oracle Dataguard check script</a> and <a href="http://www.ludovicocaldara.net/dba/more-about-dataguard-and-how-to-check-it">More about Dataguard and how to check it</a> I faced a whole new <strong>Dataguard </strong> between two <strong>Oracle Real Application Clusters</strong>, aka <em>Oracle Maximum Availability Architecture (MAA)</em>.</p>
<p>This enviromnent is relying on Windows OS. Don&#8217;t know how this could be called &#8220;<em>availability</em>&#8221; but here we are. I revisited my scripts in a quick and very dirty way. Please consider that I did copy and paste to check the alignment once per thread, but it should be improved with some kind of iteration to check each thread in a more structured fashion.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!D:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe -w</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> DBD<span style="color: #339933;">::</span><span style="color: #006600;">Oracle</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span>ora_session_modes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># DB connection #</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$prod</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;prod&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$stby</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;stby&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$prodh</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$prodh</span> <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>connect<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:Oracle:'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$prod</span><span style="color: #339933;">,</span> 
    <span style="color: #ff0000;">'sys'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'strongpwd'</span><span style="color: #339933;">,</span> 
    <span style="color: #009900;">&#123;</span>PrintError<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> AutoCommit <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
    ora_session_mode <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> ORA_SYSDBA<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Error connecting to DB: $DBI::errstr<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #0000ff;">$prodh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#123;</span>RaiseError<span style="color: #009900;">&#125;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$stbyh</span> <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>connect<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'dbi:Oracle:'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$stby</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">'sys'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'strongpwd'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#123;</span>PrintError<span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> AutoCommit <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
    ora_session_mode <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> ORA_SYSDBA<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Error connecting to DB: $DBI::errstr<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$prodh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>disconnect<span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span><span style="color: #009900;">&#123;</span>RaiseError<span style="color: #009900;">&#125;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">### query stdby MRP0</span>
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> thread<span style="color: #666666; font-style: italic;">#, SEQUENCE#, BLOCK#</span>
    from gv<span style="color: #0000ff;">\$managed_standby</span> 
    where process<span style="color: #339933;">=</span><span style="color: #ff0000;">'MRP0'</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mrpthread</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpsequence</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpblock</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### query stdby RFS</span>
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> thread<span style="color: #666666; font-style: italic;">#, SEQUENCE#, BLOCK#</span>
    from gv<span style="color: #0000ff;">\$managed_standby</span> 
    where process<span style="color: #339933;">=</span><span style="color: #ff0000;">'RFS'</span> <span style="color: #b1b100;">and</span> client_process<span style="color: #339933;">=</span><span style="color: #ff0000;">'LGWR'</span> order by thread<span style="color: #666666; font-style: italic;">#</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rfsthread1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfssequence1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfsblock1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rfsthread2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfssequence2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfsblock2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### query prod</span>
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$prodh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> thread<span style="color: #666666; font-style: italic;">#, SEQUENCE#, BLOCK#</span>
    from gv<span style="color: #0000ff;">\$managed_standby</span>
    where process<span style="color: #339933;">=</span><span style="color: #ff0000;">'LNS'</span> order by thread<span style="color: #666666; font-style: italic;">#</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pthread1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$psequence1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$pblock1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$pthread2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$psequence2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$pblock2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ENVIRONM  Thread Sequence   Block<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;--------- ------ ---------- ----------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;PROD     LNS1  1 %10d %10d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$psequence1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$pblock1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;STANDBY  RFS1  1 %10d %10d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfssequence1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfsblock1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;PROD     LSN2  2 %10d %10d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$psequence2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$pblock2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;STANDBY  RFS2  2 %10d %10d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfssequence2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfsblock2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;STANDBY  MRP0  %d %10d %10d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpthread</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpsequence</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpblock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$psequence</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$pblock</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$mrpthread</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$psequence</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$psequence1</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$pblock</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$pblock1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$psequence</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$psequence2</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$pblock</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$pblock2</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> nvl<span style="color: #009900;">&#40;</span>sum<span style="color: #009900;">&#40;</span>blocks<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">+</span> <span style="color: #0000ff;">$pblock</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$mrpblock</span> as BLOCK_GAP
from gv<span style="color: #0000ff;">\$archived_log</span>
where thread<span style="color: #666666; font-style: italic;">#=$mrpthread and sequence#</span>
between <span style="color: #0000ff;">$mrpsequence</span> <span style="color: #b1b100;">and</span> <span style="color: #0000ff;">$psequence</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mrpblockgap</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> nvl<span style="color: #009900;">&#40;</span>sum<span style="color: #009900;">&#40;</span>blocks<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">+</span> <span style="color: #0000ff;">$pblock1</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$rfsblock1</span> as BLOCK_GAP
from gv<span style="color: #0000ff;">\$archived_log</span>
where thread<span style="color: #666666; font-style: italic;">#=1 and sequence#</span>
between <span style="color: #0000ff;">$rfssequence1</span> <span style="color: #b1b100;">and</span> <span style="color: #0000ff;">$psequence1</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rfsblockgap1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>prepare<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span>EOSQL <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">select</span> nvl<span style="color: #009900;">&#40;</span>sum<span style="color: #009900;">&#40;</span>blocks<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #339933;">+</span> <span style="color: #0000ff;">$pblock2</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$rfsblock2</span> as BLOCK_GAP
from gv<span style="color: #0000ff;">\$archived_log</span>
where thread<span style="color: #666666; font-style: italic;">#=2 and sequence#</span>
between <span style="color: #0000ff;">$rfssequence2</span> <span style="color: #b1b100;">and</span> <span style="color: #0000ff;">$psequence2</span>
EOSQL
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>execute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$rfsblockgap2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>fetchrow_array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>finish<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>%-10d blocks gap in TRANSMISSION<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$rfsblockgap1</span><span style="color: #339933;">+</span><span style="color: #0000ff;">$rfsblockgap2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%-10d blocks gap in APPLY (MRP0)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$mrpblockgap</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$stbyh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>disconnect<span style="color: #339933;">;</span>
<span style="color: #0000ff;">$prodh</span><span style="color: #339933;">-</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span>disconnect<span style="color: #339933;">;</span></pre></div></div>

<p>Please foreward me every improvement you implement over my code: it would be nice to post it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludovicocaldara.net/dba/dataguard-check-script-for-real-application-clusters-maa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle RAC Standard Edition to achieve low cost and high performance</title>
		<link>http://www.ludovicocaldara.net/dba/oracle-rac-standard-edition-to-achieve-low-cost-and-high-performance/</link>
		<comments>http://www.ludovicocaldara.net/dba/oracle-rac-standard-edition-to-achieve-low-cost-and-high-performance/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 23:43:04 +0000</pubDate>
		<dc:creator>Ludovico</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[RAC]]></category>
		<category><![CDATA[Standard Edition]]></category>

		<guid isPermaLink="false">http://www.ludovicocaldara.net/dba/?p=29</guid>
		<description><![CDATA[I finished today to create a new production environment based on 2 Linux serverX86_64 and running Oracle RAC 10gR2. (I know, there is 11g right now, but I&#8217;m a conservative!) Wheeew, I just spent a couple of hours applying all the recommended patches! We choosed 2 nodes with a maximum of 2 multi-core processors each [...]]]></description>
			<content:encoded><![CDATA[<p>I finished today to create a new production environment based on 2 Linux serverX86_64 and running Oracle RAC 10gR2. (I know, there is 11g right now, but I&#8217;m a conservative!)<br />
Wheeew, I just spent a couple of hours applying all the recommended patches!<br />
We choosed 2 nodes with a maximum of 2 multi-core processors each one so we can license Standard Edition instead of Enterprise Edition. 64bits addressing allow us to allocate many gigabytes of SGA. I&#8217;m starting with 5Gb but I think we&#8217;ll need more. And a set of 6x300Gb 15krpms disks (it can be expanded with more disks and more shelves).<br />
This configuration keeps low the total cost of ownership but achieves best performance.<br />
Due to disks layout, costs and needed usable storage, we had to configure one huge RAID5 on the SAN with multi-path. I decided anyway to create 2 ASM disk groups (ASM is mandatory for Standard Edition RAC), one for the DB, the second one for the recovery area. With spare disks we should have enough availability and even if it&#8217;s a RAID5 I saw good write performances (&gt;150M/s).</p>
<p>Welcome new RAC, I hope we&#8217;ll feel good together!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludovicocaldara.net/dba/oracle-rac-standard-edition-to-achieve-low-cost-and-high-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBOSS Cluster isolation and multicasting</title>
		<link>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/</link>
		<comments>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 15:02:47 +0000</pubDate>
		<dc:creator>Ludovico</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[mod_jk]]></category>
		<category><![CDATA[multicast]]></category>

		<guid isPermaLink="false">http://www.ludovicocaldara.net/dba/?p=26</guid>
		<description><![CDATA[JBoss uses UDP multicasting to replicate informations across cluster nodes: even if I isolate TCP traffic, JBoss will "ear" messages sent from other clusters.]]></description>
			<content:encoded><![CDATA[<p>I configured two <strong>JBoss</strong> clusters in the same LAN: a production and a test environment.<br />
I decided to configure every single cluster with a dedicate private LANs using a restricted netmask to isolate production and test connectivity, so I assigned<br />
<strong>192.168.100.0/255.255.255.0</strong> to test and<br />
<strong>192.168.200.0/255.255.255.0</strong> to production.<br />
I configured <strong>Apache</strong> and <strong>mod_jk </strong>to loadbalance activities between cluster instances.</p>
<p>The page <a title="UsingMod_jk1.2WithJBoss" href="http://www.jboss.org/com munity/docs/DOC-12525" target="_blank">UsingMod_jk1.2WithJBoss</a> (http://www.jboss.org/community/docs/DOC-12525) is a good tutorial to achieve this.</p>
<p><span style="text-decoration: underline;">What problems should I expect?</span><br />
<strong>JBoss</strong> uses <strong>UDP multicasting</strong> to replicate informations across cluster nodes: even if I isolate TCP traffic, JBoss will &#8220;ear&#8221; messages sent from other clusters and will log a lot of warnings like the following:</p>
<p>&#8230; WARN [NAKACK] [...] discarded message from non-member &#8230;.</p>
<p>I had to change <strong>BOTH</strong> multicast ip address and port (attributes <em>mcast_addr</em> and <em>mcast_port</em>) in the following configuration files:</p>
<ul>
<li>./deploy/jboss-web-cluster.sar/META-INF/jboss-service.xml</li>
</ul>
<ul>
<li>./deploy/jmx-console.war/WEB-INF/web.xml</li>
</ul>
<ul>
<li>./deploy/cluster-service.xml</li>
</ul>
<ul>
<li>./deploy/ejb3-clustered-sfsbcache-service.xml</li>
</ul>
<ul>
<li>./deploy/ejb3-entity-cache-service.xml</li>
</ul>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ludovicocaldara.net/dba/jboss-cluster-isolation-and-multicasting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

