<?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>Ronny Egners Blog &#187; Oracle 11g Release 2</title>
	<atom:link href="http://blog.ronnyegner-consulting.de/category/oracle-11g-release-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ronnyegner-consulting.de</link>
	<description>Ronny Egners Blog about Oracle, UNIX and EMC / Legato Networker</description>
	<lastBuildDate>Sun, 04 Dec 2011 12:10:27 +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>Do you know &#8220;chopt&#8221; ?</title>
		<link>http://blog.ronnyegner-consulting.de/2010/11/06/do-you-know-chopt/</link>
		<comments>http://blog.ronnyegner-consulting.de/2010/11/06/do-you-know-chopt/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 05:00:26 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://blog.ronnyegner-consulting.de/?p=2220</guid>
		<description><![CDATA[Starting with Oracle 11g Release 2 there is a new tool called &#8220;chopt&#8221; which lets you enable or disable database features such as partitioning, olap and so on without the need to re-install the bianries. You can read about the utility here.]]></description>
			<content:encoded><![CDATA[<p>Starting with Oracle 11g Release 2 there is a new tool called &#8220;chopt&#8221; which lets you enable or disable database features such as partitioning, olap and so on without the need to re-install the bianries.</p>
<p>You can read about the utility <a href="http://download.oracle.com/docs/cd/E11882_01/install.112/e17162/post_inst_task.htm#CHDFEIJF" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2010/11/06/do-you-know-chopt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MEMORY_TARGET (SGA_TARGET) or HugePages &#8211; which to choose?</title>
		<link>http://blog.ronnyegner-consulting.de/2010/03/31/memory_target-sga_target-or-hugepages-which-to-choose/</link>
		<comments>http://blog.ronnyegner-consulting.de/2010/03/31/memory_target-sga_target-or-hugepages-which-to-choose/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 09:04:12 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=368</guid>
		<description><![CDATA[Oracle 10g introduced the SGA_TARGET and SGA_MAX_SIZE parameter which dynamically resized many SGA components on demand. With 11g Oracle developed this feature further to include the PGA as well &#8211; the feature is now called &#8220;Automatic Memory Management&#8221; (AMM) which is enabled by setting the parameter MEMORY_TARGET. Automatic Memory Management makes use of the SHMFS [...]]]></description>
			<content:encoded><![CDATA[<p>Oracle 10g introduced the SGA_TARGET and SGA_MAX_SIZE parameter which dynamically resized many SGA components on demand. With 11g Oracle developed this feature further to include the PGA as well &#8211; the feature is now called &#8220;Automatic Memory Management&#8221; (AMM) which is enabled by setting the parameter MEMORY_TARGET.</p>
<p>Automatic Memory Management makes use of the SHMFS &#8211; a pseudo file system just like /proc. Every file created in the SHMFS is created in memory.</p>
<p>Unfortunately using MEMORY_TARGET or MEMORY_MAX_SIZE together with Huge Pages is not supported. You have to choose either Automatic Memory Management or HugePages. In this post i´d like to discuss AMM and Huge Pages.</p>
<p><span id="more-368"></span></p>
<h2>Automatic Memory Management (AMM)</h2>
<h3>AMM &#8211; what it is</h3>
<p>Automatic Memory Management was introduced with Oracle 11g Release 1 and automated sizing and re-sizing of SGA <strong>and</strong> PGA. With AMM activated there are two parameters of interest:</p>
<ul>
<li>MEMORY_TARGET</li>
<li>MEMORY_MAX_TARGET</li>
</ul>
<p>MEMORY_TARGET specifies the oracle system-wide usable amount of memory while MEMORY_MAX_TARGET specifies the upper bound of which the DBA can se MEMORY_TARGET to. If MEMORY_MAX_TARGET is not specified it defaults to MEMORY_TARGET.</p>
<p>For AMM to work there is one important requirement: Your system needs to support memory mapped files (on Linux typically mounted on /dev/shm).</p>
<p>According to the <a href="http://www.filibeto.org/sun/lib/nonsun/oracle/11.1.0.6.0/B28359_01/server.111/b28310/memory005.htm#BGBCHEIC" target="_blank">documentation</a> the following platforms support AMM:</p>
<ul>
<li>Linux</li>
<li>Solaris</li>
<li>Windows</li>
<li>HP-UX</li>
<li>AIX</li>
</ul>
<p>More information on AMM can be found <a href="http://kevinclosson.wordpress.com/2009/05/08/oracle-database-11g-automatic-memory-management-part-iv-dont-use-pre_page_sga-ok/" target="_blank">here</a>, <a href="http://kevinclosson.wordpress.com/2007/08/23/oracle11g-automatic-memory-management-and-linux-hugepages-support/" target="_blank">here</a>, <a href="http://kevinclosson.wordpress.com/2007/08/24/oracle11g-automatic-memory-management-part-ii-automatically-stupid/" target="_blank">here</a> and <a href="http://kevinclosson.wordpress.com/2007/11/08/oracle11g-automatic-memory-management-part-iii-automatically-automatic/" target="_blank">here</a>.</p>
<h4>Advantages</h4>
<ul>
<li>SGA and PGA automatically adjusted</li>
<li>dynamically resizeable</li>
<li>Not swappable</li>
</ul>
<h4>Disadvantages</h4>
<ul>
<li>Only available on a limited number of plattforms</li>
</ul>
<h4>Bug for Feature?</h4>
<ul>
<li>Does not work together with HugePages &#8211; so it is either AMM or HugePages</li>
</ul>
<p>Before deciding lets see what HugePage are:</p>
<h2>HugePages</h2>
<h3>HugePages &#8211; what are they?</h3>
<p>Here is one description:</p>
<blockquote><p><span style="font-size: 85%;"><span style="font-family: Verdana;">Hugepages is a mechanism that allows the Linux kernel to utilise the multiple page size capabilities of modern hardware architectures. Linux uses pages as the basic unit of memory, where physical memory is partitioned and accessed using the basic page unit. The default page size is 4096 Bytes in the x86 [and x86_64 as well; note by Ronny Egner] architecture. </span><span style="font-family: Verdana;">Hugepages allows large amounts of memory to be utilized with a reduced overhead. Linux uses &#8220;Transaction Lookaside Buffers&#8221; (TLB) in the CPU architecture. These buffers contain mappings of virtual memory to actual physical memory addresses. So utilising a huge amount of physical memory with the default page size consumes the TLB and adds processing overhead. </span><span style="font-family: Verdana;">The Linux kernel is able to set aside a portion of physical memory to be able be addressed using a larger page size. Since the page size is higher, there will be less overhead managing the pages with the TLB.</span></span></p>
<p><span style="font-size: 85%;"><span style="font-family: Verdana;">(Source: </span></span>http://unixfoo.blogspot.com/2007/10/hugepages.html)</p></blockquote>
<h4>Advantages</h4>
<ul>
<li>Huge Pages are not swappable; thus keeping your SGA locked in memory</li>
<li>Overall memory performance is increased: Since there are less pages to scan the memory performance is increased</li>
<li>kswapd needs far less resources: kswapd regularly scans the page table for infrequent accessed pages which are a candidate for paging to disk. If the page table is large kswapd will use a lot of resources in therm of CPU. With Huge Pages enabled the page table is much smaller and Huge Pages are not subject to swap so kswapd will use less resources.</li>
<li>Improves TLB hit ratio due to less entries thus increasing memory performance further. The TLB is a small cache on cpu which stores virtual to physical memory mappings</li>
</ul>
<h4>Disadvantages</h4>
<ul>
<li>Should be allocated at startup (allocating huge pages at runtime is possible but will fail probably due to memory fragmentation; so it is advisable to allocate them at startup)</li>
<li>dynamically allocating hugepages is buggy</li>
</ul>
<h3>Linux memory management with and without Huge Pages</h3>
<p>The following two figures try to illustrate how memory access with and without huge pages work. As you can see every process in a virtual memory operating system has it´s own process page table which points to a system page table.For oracle processes running on linux it is not uncommon to use the same physical memory regions due to accessing the SGA or the block cache. This is illustrated in the figures below for the pages 2 and 3; they are access by both processes.</p>
<p>Without huge pages memory is divided in chunks (called: &#8220;pages&#8221;) of 4 KB on Intel x86 and Intel x86_64 (the actual size depends on the hardware platform). Operating system offering virtual memory (as most modern operating system do, for instance linux, solaris, hp-ux, aix and even windows) present each process a continuous addressable memory (&#8220;virtual memory&#8221;) which consists of memory pages which reside in memory or even on disk (&#8220;swap&#8221;). See <a href="http://en.wikipedia.org/wiki/Virtual_memory" target="_blank">here</a> for more information.</p>
<p>The following file taken from the wikipedia article mentioned above illustrates the concept of virtual memory:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/virtualmem01.png"><img class="alignnone size-full wp-image-865" title="VirtualMem01" src="http://ronnyegner.files.wordpress.com/2009/10/virtualmem01.png" alt="VirtualMem01" width="250" height="250" /></a></p>
<p>From the process&#8217; view it looks like it is solely running on the operating system. But it is not. In fact there are a lot of other processes running.</p>
<p>As mentioned above memory is presented to processes in chunks of 4 kb &#8211; a so called &#8220;page&#8221;. The operating system manages a list of pages &#8211; the &#8220;page table&#8221; &#8211; for each process and for the operating system as well which maps the virtual memory to physical memory.</p>
<p>The page table can be seen as &#8220;memory for managing memory&#8221;.Each page table entry (PTE) takes:</p>
<ul>
<li>4 bytes of memory per page (4 kb) per process on 32-bit intel and</li>
<li>8 byte of memory per page (4 kb) per process on 64-bit intel</li>
</ul>
<p>For more information see <a href="http://lkml.org/lkml/2009/10/6/87" target="_blank">my post</a> and the <a href="http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-10/msg02703.html" target="_blank">answer</a> on the Linux Kernel Mailing List (LKML).</p>
<p>So for a process to touch every page on a 64-bit system with 16 GB memory there are required:</p>
<ul>
<li>for the memory referenced by the process: 4.2 million PTE  (~ 16 GB) with 8 byte each = 32 MB</li>
<li>PLUS for the system page table: 4.2 million PTE (~ 16 GB) with 8 byte each = 32 MB</li>
<li><strong>equals to 64 MB for the whole page table as counted in /proc/meminfo [PageTables]<br />
</strong></li>
</ul>
<p>On systems running oracle databases with a huge buffer cache and highly active processes (= sessions) it is not uncommon for the processes to reference the whole SGA and parts of the PGA after a while. Taken the example above assuming a buffer cache of 16 GB this adds up to 32 MB per process for the page table. 100 processes will consume 3.2 GB! Thats a lot of memory which is not available and solely used to manage memory.</p>
<p>The size of the page table can be querien on linux as follows:</p>
<pre>cat /proc/meminfo | grep PageT
PageTables:      25096 kB</pre>
<p>This command show the size of the Page Table (sum of system and all process page tables). This amount of memory is unusable for all processes and solely for managing the memory. On system with a lot of memory and a huge sga/pga and many dedicated server connections the page table can be several GByte in size!</p>
<p>The solution for this memory wastage is to implement huge pages. Huge pages increase the memory chunks from 4 kb to 2 MB so a page table entry still takes 8 bytes in 64-bit intel but references 2 mb &#8211; thats more efficenty by a factor of 512!</p>
<p>So taken our example from above with a buffer cache of 16 GB (16384 MB) referenced completely by a process the page table for the process will be:</p>
<ul>
<li>16384 GB referenced / 2 MB per page = 8192 PTE with each 8 byte needed = 65536 Byte or <strong>65 KB</strong></li>
</ul>
<p>I guess the advantage is obvious: 32 MB with no huge pages vs. 65 KB with huge pages!</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/memory_wo_hugepages.png"> </a></p>
<h2>Is my system already using huge pages?</h2>
<p>You can check this by doing:</p>
<pre>cat /proc/meminfo | grep Huge</pre>
<p>There are three possibilities:</p>
<h3>No huge pages configured at all</h3>
<pre>cat /proc/meminfo | grep Huge
HugePages_Total:  0
HugePages_Free:   0
HugePages_Rsvd:   0
Hugepagesize:     2048 kB</pre>
<h3>Huge pages configured but not used</h3>
<pre>cat /proc/meminfo | grep Huge
HugePages_Total:  3000
HugePages_Free:   3000
HugePages_Rsvd:   0
Hugepagesize:     2048 kB</pre>
<h3>Huge pages configured and used</h3>
<pre>[root@rac1 ~]# cat /proc/meminfo | grep Huge
HugePages_Total:  3000
HugePages_Free:   2601
HugePages_Rsvd:   2290
Hugepagesize:     2048 kB</pre>
<h2>How to configure huge pages?</h2>
<p>1. edit /etc/sysctl.conf and add the following line:</p>
<pre>vm.nr_hugepages = &lt;number&gt;</pre>
<p>Note: This parameter specifies the <strong>number</strong> of huge pages. To get the total size you have to multiply &#8220;nr_hugepages&#8221; by &#8220;cat /proc/meminfo | grep Hugepagesize&#8221;. For 64-bit Linux on x86_64 the size of one Huge Page is 2 MB. So for a total amount of 2 GB or roughly 2000 MB you need 1000 Pages.</p>
<p>2. edit /etc/security/limits.conf and add the following lines:</p>
<pre>&lt;oracle user&gt;    soft    memlock    unlimited
&lt;oracle user&gt;    hard    memlock    unlimited</pre>
<p>3. Reboot the server and check</p>
<h2>Some real world examples</h2>
<p>The following are two database systems not using Huge Pages. Lets see how much memory is spend just for managing the memory:</p>
<h3>System A</h3>
<p>The following is an example of a Linux based database server running two database instances with approx. 8 GB SGA in total. At the time of sampling there are 444 dedicated server sessions connected.</p>
<pre>MemTotal:     16387608 kB
MemFree:        105176 kB
Buffers:         21032 kB
Cached:        9575340 kB
SwapCached:       1036 kB
Active:       11977268 kB
Inactive:      2378928 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:     16387608 kB
LowFree:        105176 kB
SwapTotal:     8393952 kB
SwapFree:      8247912 kB
Dirty:            9584 kB
Writeback:           0 kB
AnonPages:     4754720 kB
Mapped:        7130088 kB
Slab:           256088 kB
CommitLimit:  16587756 kB
Committed_AS: 22134904 kB
<strong>PageTables:    1591860 kB</strong>
VmallocTotal: 34359738367 kB
VmallocUsed:      9680 kB
VmallocChunk: 34359728499 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB
</pre>
<p>As you notice approx. 10% of all available memory is used for the Page Tables.</p>
<h3>System B</h3>
<p>System B is a Linux based system with 128 GB memory running one single database instance with 34 GB SGA and approx 400 sessions:</p>
<pre>MemTotal:     132102884 kB
MemFree:        596308 kB
Buffers:        472620 kB
Cached:       111858096 kB
SwapCached:     138652 kB
Active:       65182984 kB
Inactive:     53195396 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:     132102884 kB
LowFree:        596308 kB
SwapTotal:     8393952 kB
SwapFree:      8112828 kB
Dirty:             568 kB
Writeback:           0 kB
AnonPages:     5901940 kB
Mapped:       33971664 kB
Slab:           915092 kB
CommitLimit:  74445392 kB
Committed_AS: 48640652 kB
<strong>PageTables:   12023792 kB</strong>
VmallocTotal: 34359738367 kB
VmallocUsed:    279912 kB
VmallocChunk: 34359456747 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB</pre>
<p>In this example Page Tables allocate 12 GB of memory. Thats a lot of memory.</p>
<h2>Some laboratory examples</h2>
<h3>Test case no. 1</h3>
<p>The first test case is quite simple. I started 100 dedicated database connections with a delay of 1 second between each database connection. Each session will log on and sleep for 200 seconds and log off. In the operating system i will monitor the page table size with increasing and decreasing database sessions.</p>
<h4>foo.sql script</h4>
<pre>exec dbms_lock.sleep(200);
exit</pre>
<h4>doit.sql script</h4>
<pre>doit.sql
for i in {1..100}
do
echo $i
sqlplus system/manager@ora11p @foo.sql &amp;
sleep 1
done</pre>
<h4>Results without Huge Pages</h4>
<p>The following output were observed without huge pages:</p>
<pre>while true; do cat /proc/meminfo | grep PageTable &amp;&amp; sleep 3; done</pre>
<pre>PageTables:      58836 kB
PageTables:      60792 kB
PageTables:      62808 kB
PageTables:      64808 kB
PageTables:      66560 kB
PageTables:      68780 kB
PageTables:      70084 kB
PageTables:      72044 kB
PageTables:      72296 kB
PageTables:      74184 kB
PageTables:      76804 kB
PageTables:      79000 kB
PageTables:      80928 kB
PageTables:      82932 kB
PageTables:      84652 kB
PageTables:      86576 kB
PageTables:      88936 kB
PageTables:      90896 kB
PageTables:      94120 kB
PageTables:      96424 kB
PageTables:      98212 kB
PageTables:     100304 kB
PageTables:     101868 kB
PageTables:     103960 kB
PageTables:     105996 kB
PageTables:     108108 kB
PageTables:     109992 kB
PageTables:     111404 kB
PageTables:     113584 kB
PageTables:     114860 kB
PageTables:     116856 kB
PageTables:     118276 kB
PageTables:     120256 kB
PageTables:     120316 kB
PageTables:     120240 kB
PageTables:     120616 kB
PageTables:     120316 kB
PageTables:     121456 kB
PageTables:     121480 kB
PageTables:     121484 kB
PageTables:     121480 kB
PageTables:     121408 kB
PageTables:     121404 kB
PageTables:     121484 kB
PageTables:     121632 kB
PageTables:     121484 kB
PageTables:     121480 kB
PageTables:     120316 kB
PageTables:     120320 kB
PageTables:     120316 kB
PageTables:     120320 kB
PageTables:     121460 kB
<strong>PageTables:     121652 kB         &lt;==== PEAK AROUND HERE</strong>
PageTables:     121500 kB
PageTables:     121540 kB
PageTables:     120096 kB
PageTables:     118136 kB
PageTables:     116188 kB
PageTables:     114192 kB
PageTables:     112236 kB
PageTables:     110240 kB
PageTables:     106556 kB
PageTables:     103792 kB
PageTables:     101820 kB
PageTables:      97916 kB
PageTables:      95900 kB
PageTables:      95120 kB
PageTables:      93104 kB
PageTables:      91848 kB
PageTables:      89852 kB
PageTables:      87860 kB
PageTables:      85896 kB
PageTables:      83868 kB
PageTables:      81940 kB
PageTables:      79944 kB
[...]</pre>
<h4>Results with Huge Pages</h4>
<pre>while true; do cat /proc/meminfo | grep PageTable &amp;&amp; sleep 3; done</pre>
<pre>PageTables:      27112 kB
PageTables:      27236 kB
PageTables:      27280 kB
PageTables:      27320 kB
PageTables:      27344 kB
PageTables:      27368 kB
PageTables:      27396 kB
PageTables:      27416 kB
PageTables:      31028 kB
PageTables:      31412 kB
PageTables:      37668 kB
PageTables:      37912 kB
PageTables:      39964 kB
PageTables:      39756 kB
PageTables:      39740 kB
PageTables:      41312 kB
PageTables:      41436 kB
PageTables:      41508 kB
PageTables:      42192 kB
PageTables:      42196 kB
PageTables:      42528 kB
PageTables:      43036 kB
PageTables:      43232 kB
PageTables:      45616 kB
PageTables:      44852 kB
PageTables:      44540 kB
PageTables:      44552 kB
PageTables:      44728 kB
PageTables:      44748 kB
PageTables:      44764 kB
PageTables:      45936 kB
PageTables:      46992 kB
PageTables:      48128 kB
PageTables:      49264 kB
PageTables:      50312 kB
PageTables:      51056 kB
PageTables:      52244 kB
PageTables:      53496 kB
PageTables:      54256 kB
PageTables:      55296 kB
PageTables:      56440 kB
PageTables:      57712 kB
PageTables:      58240 kB
PageTables:      58824 kB
PageTables:      59612 kB
PageTables:      60656 kB
PageTables:      62468 kB
PageTables:      63592 kB
PageTables:      64700 kB
PageTables:      65820 kB
PageTables:      66916 kB
PageTables:      68344 kB
PageTables:      69144 kB
PageTables:      70260 kB
PageTables:      71044 kB
PageTables:      72172 kB
PageTables:      73224 kB
PageTables:      73684 kB
PageTables:      74736 kB
PageTables:      75828 kB
PageTables:      76952 kB
PageTables:      78068 kB
PageTables:      79180 kB
PageTables:      78604 kB
PageTables:      79384 kB
PageTables:      79384 kB
PageTables:      80064 kB
PageTables:      80092 kB
PageTables:      80096 kB
PageTables:      80096 kB
PageTables:      80096 kB
PageTables:      80084 kB
PageTables:      80096 kB
PageTables:      80092 kB
<strong>PageTables:      80096 kB        &lt;=== PEAK AROUND HERE</strong>
PageTables:      80096 kB
PageTables:      79408 kB
PageTables:      79400 kB
PageTables:      79400 kB
PageTables:      79396 kB
PageTables:      79392 kB
PageTables:      79392 kB
PageTables:      79392 kB
PageTables:      79392 kB
PageTables:      79392 kB
PageTables:      79396 kB
PageTables:      79396 kB
PageTables:      70260 kB
[...]</pre>
<h4>Observations</h4>
<ul>
<li>without huge pages page table size peaked at approx. 120 MB</li>
<li>with huge page page table size peaked at approx. 80 MB</li>
</ul>
<p>In this simple test case using huge pages used only 66% of memory.</p>
<p>Because of the choosen test case memory saving is not that big because we did not referenced that much memory from the SGA in our processes. Tests would be much clearer with larger parts (e.g. buffer cache) of the SGA referenced.</p>
<h2>Conclusion</h2>
<p>HugePages offers some important advantages over AMM, for instance:</p>
<ul>
<li>minimizing cpu-cycles used for scanning memory pages which are candidates for swapping thus freeing cpu-cycles for your database,</li>
<li><strong>minimizing memory spend for managing memory references</strong></li>
</ul>
<p>The latter point is the most important one. Especially systems with large memory amounts dedicated to SGA and PGA and many database sessions (&gt; 100) will benefit from using Huge Pages. The more memory dedicated to SGA and PGA and the more sessions connected with the database the larger the memory savings from using Huge Pages will be.</p>
<p>From my point of view even if AMM simplifies memory management by including both PGA and SGA the memory (and cpu) savings from using Huge Pages are more important than just simlifying memory management.</p>
<p>So if you have an SGA larger than 16 GB and more than 100 sessions using Huge Pages is definetly worth trying. On system with only a few sessions using Huge Pages will give some benefit as well but only by reduding cpu-cycles needed for scanning the memory pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2010/03/31/memory_target-sga_target-or-hugepages-which-to-choose/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Release 2 &#8211; RMAN compression comparison</title>
		<link>http://blog.ronnyegner-consulting.de/2009/11/04/oracle-11g-release-2-rman-compression-comparison/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/11/04/oracle-11g-release-2-rman-compression-comparison/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 05:00:50 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://blog.ronnyegner-consulting.de/?p=1125</guid>
		<description><![CDATA[Starting with Oracle 11g Oracle added several compression algorithms to compress data. They can be used for compressing tables, LOBs , compressed data pump exports or even RMAN backups. Unfortunately for some compression algorithms you need to purchase the &#8220;Advanced Compression Option&#8221;. The following table lists the available RMAN compression options, the most likely compression [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with Oracle 11g Oracle added several compression algorithms to compress data. They can be used for compressing tables, LOBs , compressed data pump exports or even RMAN backups. Unfortunately for some compression algorithms you need to purchase the &#8220;Advanced Compression Option&#8221;. The following table lists the available RMAN compression options, the most likely compression algorithm being used and states if an additional license is required:</p>
<p><strong>
<table id="wp-table-reloaded-id-13-no-1" class="wp-table-reloaded wp-table-reloaded-id-13">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">RMAN Compression Type</th><th class="column-2">Compression Algorithm used</th><th class="column-3">Adv. Compression License required?</th><th class="column-4">Backup set size</th><th class="column-5">CPU Load</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">BASIC</td><td class="column-2">BZIP2 (100k record size?)</td><td class="column-3">No</td><td class="column-4">small</td><td class="column-5">medium to high</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">NONE</td><td class="column-2">none</td><td class="column-3">No</td><td class="column-4">largest; approx. db size</td><td class="column-5">extremely small</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1"></td><td class="column-2"></td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">LOW</td><td class="column-2">LZO</td><td class="column-3">YES</td><td class="column-4">somewhat smaller than using NONE</td><td class="column-5">low</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">MEDIUM</td><td class="column-2">ZLIB</td><td class="column-3">YES</td><td class="column-4">medium</td><td class="column-5">medium</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">HIGH</td><td class="column-2">BZIP2 (900k record size?)</td><td class="column-3">YES</td><td class="column-4">smallest</td><td class="column-5">highest</td>
	</tr>
</tbody>
</table>
</strong></p>
<p>This article is intended to take a look at the different compression methods available in Oracle 11g and to compare them.</p>
<h2><strong><span id="more-1125"></span></strong><strong>Test environment</strong></h2>
<p>The environment being used was a freshly created 11g Release 2 database with some smaller tables in it. The total sum of all segments equals to 4.88 GB. All database data files excluding the temporary ones are 7.3 GB total. Excluding temporary and undo data files total size equates to 5.9 GB.</p>
<p>The server was running on VMWARE with one dedicated CPU core per host and 4 GB memory.</p>
<h2>Configure RMAN</h2>
<p>To configure RMAN to use compression at all you can use:</p>
<pre>CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;</pre>
<p>or</p>
<pre>CONFIGURE DEVICE TYPE TAPE BACKUP TYPE TO COMPRESSED BACKUPSET;</pre>
<p>To configure the different backup algorithms:</p>
<pre>CONFIGURE COMPRESSION ALGORITHM 'BASIC';
CONFIGURE COMPRESSION ALGORITHM 'NONE';
CONFIGURE COMPRESSION ALGORITHM 'LOW';
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
CONFIGURE COMPRESSION ALGORITHM 'HIGH';</pre>
<h2><strong>Test results</strong></h2>
<p>The following table displays the test results for the chosen test environment:</p>
<p><strong>
<table id="wp-table-reloaded-id-14-no-1" class="wp-table-reloaded wp-table-reloaded-id-14">
<thead>
	<tr class="row-1 odd">
		<th class="column-1"></th><th class="column-2">NONE (=uncompressed)</th><th class="column-3">BASIC</th><th class="column-4">LOW</th><th class="column-5">MEDIUM</th><th class="column-6">HIGH</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">Size</td><td class="column-2">4080192 KB</td><td class="column-3">356924 KB</td><td class="column-4">430200 KB</td><td class="column-5">373288 KB</td><td class="column-6">238200 KB</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">CPU Load</td><td class="column-2">< 5% per Channel</td><td class="column-3">70 to 80% per Channel</td><td class="column-4">20% per Channel</td><td class="column-5">50% per Channel</td><td class="column-6">100% per Channel</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1"></td><td class="column-2"></td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td><td class="column-6"></td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">Test 1</td><td class="column-2">281 sec</td><td class="column-3">291 sec</td><td class="column-4">213 sec</td><td class="column-5">203 sec</td><td class="column-6">2992 sec</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">Test 2</td><td class="column-2">334 sec</td><td class="column-3">267 sec</td><td class="column-4">187 sec</td><td class="column-5">189 sec</td><td class="column-6">long, very long</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">Test 3</td><td class="column-2">272 sec</td><td class="column-3">278 sec</td><td class="column-4">189 sec</td><td class="column-5">212 sec</td><td class="column-6">long, very long</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">Test 4</td><td class="column-2">324 sec</td><td class="column-3">299 sec</td><td class="column-4">157 sec</td><td class="column-5">188 sec</td><td class="column-6">long, very long</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">Test 5</td><td class="column-2">260 sec</td><td class="column-3">257 sec</td><td class="column-4">157 sec</td><td class="column-5">192 sec</td><td class="column-6">long, very long</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1"></td><td class="column-2"></td><td class="column-3"></td><td class="column-4"></td><td class="column-5"></td><td class="column-6"></td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">Minumum</td><td class="column-2">260</td><td class="column-3">257</td><td class="column-4">157</td><td class="column-5">188</td><td class="column-6">n/a</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">Maximum</td><td class="column-2">334</td><td class="column-3">299</td><td class="column-4">213</td><td class="column-5">212</td><td class="column-6">n/a</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">Avg.</td><td class="column-2">294</td><td class="column-3">278</td><td class="column-4">180</td><td class="column-5">196</td><td class="column-6">n/a</td>
	</tr>
</tbody>
</table>
</strong></p>
<p>As you can see from the table HIGH compression does an incredibly high load on the machine and take extremely long but produces the smallest backup set size. I suppose the long backup time might be explained by the fact that the environment is running under VMWARE which adds additional overhead and slows down CPU. Surprisingly BASIC compression (which is available without advanced compression license) does a good job as well and produces the second smallest backup set but takes nearly as long as doing uncompressed backups. But in other environment with faster CPUs this will change!</p>
<p>In the test environment used either LOW or MEDIUM compression seems to be the best choice. Due to the fact MEDIUM produces a approx. 15% smaller backup set but taking only a few seconds more time to complete i would rank MEDIUM on 1st and LOW on second.</p>
<h2><strong>Conclusion</strong></h2>
<p>RMAN offers backup compression since version 10. But with 11g Oracle added several new compression algorithms which lets you adjust the IO- and CPU-consumption and the resulting backup set size by choosing between five algorithms: NONE, DEFAULT, LOW, MEDIUM, HIGH. The stronger the compression the smaller the backup size but the more CPU-intensive the backup is. You basically change CPU-cycles for IOPs. If you do not have the advanced compression license BASIC compression will produce reasonable compression rates at moderate Load. If you have the licence you have a lot more options to suit your needs.</p>
<p>Regardless of the results in THIS test case <strong>YOUR results will be different</strong> due to: different data which leads to different compression ratios, different storage architecture for data files and backup destination (local disks, SAN, NAS, Tape), different CPU resources (faster/slower CPUs), rman parallelism). The test performed here are intended to give you some basic idea how backup time and backup size will change depending on the compression chosen.</p>
<p><strong>!! Because of many factors influencing backup speed and backup size you have to test backup and backup compression in your environment yourself.</strong> <strong>There is no general rule of thumb. !!<br />
</strong></p>
<p>If you want to test and optimize your rman backup you basically have three major switches to play with:</p>
<ul>
<li>compression algorithmn,</li>
<li>rman parallelism and</li>
<li>data transfer mechanism (SAN or Ethernet [this includes: iSCSI, NFS, CIFS, Backup to tape over Ethernet])</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/11/04/oracle-11g-release-2-rman-compression-comparison/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Calculate required kernel parameters for running Oracle 11g Release 2 on Linux</title>
		<link>http://blog.ronnyegner-consulting.de/2009/10/28/calculate-required-kernel-parameters-for-running-oracle-11g-release-2-on-linux/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/10/28/calculate-required-kernel-parameters-for-running-oracle-11g-release-2-on-linux/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 05:00:40 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=899</guid>
		<description><![CDATA[The following is a short guide on how to calculate the required kernel parameters for running Oracle 11g Release 2 database on Linux. In addition to that i add some parameters recommended by myself. Note that for running Oracle Grid Infrastrucure (aka &#8220;Clusterware&#8221;) some additional parameters might be required. Values required by Oracle according to [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a short guide on how to calculate the required kernel parameters for running Oracle 11g Release 2 database on Linux.</p>
<p>In addition to that i add some parameters recommended by myself.</p>
<p>Note that for running Oracle Grid Infrastrucure (aka &#8220;Clusterware&#8221;) some additional parameters might be required.</p>
<p><span id="more-899"></span></p>
<h2>Values required by Oracle according to the documentation</h2>
<p>The following tables list the required MINIMUM values according to the <a href="http://download.oracle.com/docs/cd/E11882_01/install.112/e10840/pre_install.htm#BABBBDGA" target="_blank">oracle documentation</a>.</p>
<p><strong>
<table id="wp-table-reloaded-id-3-no-1" class="wp-table-reloaded wp-table-reloaded-id-3">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Parameter name in /etc/sysctl.conf</th><th class="column-2">Description</th><th class="column-3">MINIMUM value</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">kernel.sem</td><td class="column-2">"semmsl   semmns   semopm   semmni"</td><td class="column-3"></td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">kernel.sem:semmsl</td><td class="column-2">total semaphores for each set</td><td class="column-3">250</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">kernel.sem:semmns</td><td class="column-2">total number of semaphores systemwide</td><td class="column-3">32000</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">kernel.sem:semopm</td><td class="column-2">Maximum number of operations for                                        semop call</td><td class="column-3">100</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">kernel.sem:semmni</td><td class="column-2">total semaphore sets </td><td class="column-3">128</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">kernel.shmall</td><td class="column-2">total number of shared memory pages that  can be used system wide</td><td class="column-3">2097152</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">kernel.shmmax</td><td class="column-2">the maximum size of a single shared memory segment in bytes that a linux process can allocate</td><td class="column-3">Either 4 GB - 1 byte, or half the size of physical memory (in bytes), whichever is lower.<br />
<br />
Default: 536870912</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">kernel.shmmni</td><td class="column-2">system wide number of shared memory segments</td><td class="column-3">4096</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">fs.file-max</td><td class="column-2">maximum number of open files system-wide</td><td class="column-3">6815744</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">fs.aio-max-nr</td><td class="column-2">concurrent outstanding i/o requests</td><td class="column-3">1048576</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">net.ip_local_port_range</td><td class="column-2">minimum and maximum ports for use</td><td class="column-3">	Minimum: 9000<br />
<br />
Maximum: 65500</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">net.rmem_default</td><td class="column-2">the default size in bytes of the receive buffer</td><td class="column-3">262144</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">net.rmem_max</td><td class="column-2">the maximum size in bytes of the receive buffer</td><td class="column-3">4194304</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">net.wmem_default</td><td class="column-2">the default size in bytes of the send buffer</td><td class="column-3">262144</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">net.wmem_max</td><td class="column-2">the maximum size in bytes of the send buffer</td><td class="column-3">1048576</td>
	</tr>
</tbody>
</table>
</strong>.</p>
<p><strong>
<table id="wp-table-reloaded-id-4-no-1" class="wp-table-reloaded wp-table-reloaded-id-4">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Shell Limits for Oracle User<br />
in /etc/security/limit.conf</th><th class="column-2">Description</th><th class="column-3">Hard Limit</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">nofile</td><td class="column-2">number of open files</td><td class="column-3">65536</td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">nproc</td><td class="column-2">number of processes</td><td class="column-3">16384</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">stack</td><td class="column-2">stack size in kb</td><td class="column-3">10240</td>
	</tr>
</tbody>
</table>
</strong></p>
<p><strong>
<table id="wp-table-reloaded-id-5-no-1" class="wp-table-reloaded wp-table-reloaded-id-5">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">/dev/shm file system</th><th class="column-2">largest value of MEMORY_MAX_TARGET or MEMORY_TARGET of all instances</th>
	</tr>
</thead>
<tbody>
</tbody>
</table>
</strong></p>
<h2>Calculate the required values</h2>
<p>The following table shows calculation formulas for setting the required kernel parameters for running oracle 11g release 2 on Linux.</p>
<p><strong>
<table id="wp-table-reloaded-id-7-no-1" class="wp-table-reloaded wp-table-reloaded-id-7">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Parameter name in /etc/sysctl.conf</th><th class="column-2">Description</th><th class="column-3">MINIMUM value</th><th class="column-4">Calculation</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">kernel.sem</td><td class="column-2">"semmsl   semmns   semopm   semmni"</td><td class="column-3"></td><td class="column-4"></td>
	</tr>
	<tr class="row-3 odd">
		<td class="column-1">kernel.sem:semmsl</td><td class="column-2">total semaphores for each set</td><td class="column-3">256</td><td class="column-4">set fixed to 256</td>
	</tr>
	<tr class="row-4 even">
		<td class="column-1">kernel.sem:semmns</td><td class="column-2">total number of semaphores systemwide</td><td class="column-3">32000</td><td class="column-4">2 * sum (process parameters of all database instances on the system)<br />
+ overhead for background processes<br />
+ system and other application requirements</td>
	</tr>
	<tr class="row-5 odd">
		<td class="column-1">kernel.sem:semopm</td><td class="column-2">Maximum number of operations for                                        semop call</td><td class="column-3">100</td><td class="column-4">set fixed to 100</td>
	</tr>
	<tr class="row-6 even">
		<td class="column-1">kernel.sem:semmni</td><td class="column-2">total semaphore sets </td><td class="column-3">128</td><td class="column-4">semmns divided by semmsl, rounded UP to nearest multiple to 1024</td>
	</tr>
	<tr class="row-7 odd">
		<td class="column-1">kernel.shmall</td><td class="column-2">total number of shared memory pages that  can be used system wide</td><td class="column-3">2097152</td><td class="column-4">ceil(shmmax/PAGE_SIZE).<br />
<br />
(PAGE_SIZE is usually 4096 bytes unless Big/Huge Pages used)<br />
<br />
get PAGESIZE by doing:<br />
"getconf PAGESIZE"</td>
	</tr>
	<tr class="row-8 even">
		<td class="column-1">kernel.shmmax</td><td class="column-2">the maximum size of a single shared memory segment in bytes that a linux process can allocate</td><td class="column-3">Either 4 GB - 1 byte, or half the size of physical memory (in bytes), whichever is lower.<br />
<br />
Default: 536870912</td><td class="column-4">largest value of SGA_MAX_SIZE, SGA_TARGET,MEMORY_MAX_SIZE or MEMORY_TARGET of all instances</td>
	</tr>
	<tr class="row-9 odd">
		<td class="column-1">kernel.shmmni</td><td class="column-2">system wide number of shared memory segments</td><td class="column-3">4096</td><td class="column-4">set fixed to 4096...did not find any formula</td>
	</tr>
	<tr class="row-10 even">
		<td class="column-1">fs.file-max</td><td class="column-2">maximum number of open files system-wide</td><td class="column-3">6815744</td><td class="column-4">>= 6815744 (dont know why this large....but should be enough for most databases)</td>
	</tr>
	<tr class="row-11 odd">
		<td class="column-1">fs.aio-max-nr</td><td class="column-2">concurrent outstanding i/o requests</td><td class="column-3">1048576</td><td class="column-4">no adjustment; set fix to 1048576</td>
	</tr>
	<tr class="row-12 even">
		<td class="column-1">net.ip_local_port_range</td><td class="column-2">minimum and maximum ports for use</td><td class="column-3">Minimum: 9000<br />
Maximum: 65500</td><td class="column-4">no adjustment, fixed</td>
	</tr>
	<tr class="row-13 odd">
		<td class="column-1">net.rmem_default</td><td class="column-2">the default size in bytes of the receive buffer</td><td class="column-3">262144</td><td class="column-4">>= 262144</td>
	</tr>
	<tr class="row-14 even">
		<td class="column-1">net.rmem_max</td><td class="column-2">the maximum size in bytes of the receive buffer</td><td class="column-3">4194304</td><td class="column-4">>= 4194304</td>
	</tr>
	<tr class="row-15 odd">
		<td class="column-1">net.wmem_default</td><td class="column-2">the default size in bytes of the send buffer</td><td class="column-3">262144</td><td class="column-4">>= 262144</td>
	</tr>
	<tr class="row-16 even">
		<td class="column-1">net.wmem_max</td><td class="column-2">the maximum size in bytes of the send buffer</td><td class="column-3">1048576</td><td class="column-4">>= 1048576</td>
	</tr>
</tbody>
</table>
</strong></p>
<p>The default page size needed for some calculations can be obtained by doing:</p>
<pre><code>getconf PAGESIZE
</code></pre>
<p>The output states the default (not huge page size) in bytes.</p>
<pre></pre>
<pre></pre>
<p>The shell limits shown above should be enough initially. However if you have many data files (&gt; 1000) i would increase the number of open files by doubling the value. All other parameters are sized big enough for almost every environment.</p>
<p>For using the new Automatic Memory Management Feature which automatically sized SGA and PGA Oracle uses a pseudo file system /dev/shm. If activating this feature by setting MEMORY_MAX_SIZE or MEMORY_TARGET in your init.ora you have to size /dev/shm appropriately. The following table outlines how to do it:</p>
<p><strong>
<table id="wp-table-reloaded-id-5-no-1" class="wp-table-reloaded wp-table-reloaded-id-5">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">/dev/shm file system</th><th class="column-2">largest value of MEMORY_MAX_TARGET or MEMORY_TARGET of all instances</th>
	</tr>
</thead>
<tbody>
</tbody>
</table>
</strong></p>
<p>You can make this change permanent by editing your /etc/fstab. For instance the following change will set /dev/shm to a size of 13 GB:</p>
<pre>...
shmfs /dev/shm   tmpfs   size=13g 0
...</pre>
<h2>Addition values recommended by Ronny Egner</h2>
<p>Note: The values mentioned there are values set from experience. Set them at your own risk!</p>
<p><strong>
<table id="wp-table-reloaded-id-8-no-1" class="wp-table-reloaded wp-table-reloaded-id-8">
<thead>
	<tr class="row-1 odd">
		<th class="column-1">Value</th><th class="column-2">Description</th><th class="column-3">Recommended Value</th>
	</tr>
</thead>
<tbody>
	<tr class="row-2 even">
		<td class="column-1">vm.swappiness ( in /etc/sysctl.conf)</td><td class="column-2">adjusts the swap affinity. Range from 0 to 100. Lower values mean pages remain longer in memory before swapping them out to disk. Larger values swap out infrequently used memory pages faster. The default value is “60″.</td><td class="column-3">5</td>
	</tr>
</tbody>
</table>
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/10/28/calculate-required-kernel-parameters-for-running-oracle-11g-release-2-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASM resilvering &#8211; or &#8211; how to recover your crashed cluster</title>
		<link>http://blog.ronnyegner-consulting.de/2009/10/27/asm-resilvering-or-how-to-recovery-your-asm-in-crash-scenarios/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/10/27/asm-resilvering-or-how-to-recovery-your-asm-in-crash-scenarios/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 06:00:20 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle ASM]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/2009/09/28/asm-resilvering-or-how-to-recovery-your-asm-in-crash-scenarios/</guid>
		<description><![CDATA[In this and the following posts i will perform some crash and recover scenarios and show how to recover the cluster successfully. At the moment the following tests are planned and will be published during the next days: suddenly turning off the power and restarting the node terminating private network connect between the cluster nodes [...]]]></description>
			<content:encoded><![CDATA[<p>In this and the following posts i will perform some crash and recover scenarios and show how to recover the cluster successfully.</p>
<p>At the moment the following tests are planned and will be published during the next days:</p>
<ul>
<li><a href="http://blog.ronnyegner-consulting.de/?p=438" target="_blank">suddenly turning off the power and restarting the node</a></li>
<li><a href="http://blog.ronnyegner-consulting.de/?p=461" target="_blank">terminating private network connect between the cluster nodes</a></li>
<li><span style="text-decoration: line-through;">recovering an ACFS file system which will not mount automatically</span><br />
(was not able to reproduce more than once; sorry guys)</li>
<li><a href="http://blog.ronnyegner-consulting.de/?p=566" target="_blank">overwriting the ASM disk header with the disk group being offline</a></li>
<li><a href="http://blog.ronnyegner-consulting.de/?p=590" target="_blank">corrupting an online and active ASM disk by writing chunks of random data to the disk randomly</a></li>
<li><a href="http://blog.ronnyegner-consulting.de/?p=627" target="_blank">simulating disk errors by removing the device from the operating system</a></li>
<li>corrupting  the OCR</li>
<li>corrupting the Voting Disk</li>
</ul>
<p>The environment used for the posts are explained in detail <a href="http://blog.ronnyegner-consulting.de/?p=435" target="_blank">here</a>.</p>
<p>Useful scripts can be found <a href="http://blog.ronnyegner-consulting.de/?p=695" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/10/27/asm-resilvering-or-how-to-recovery-your-asm-in-crash-scenarios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASM resilvering – or – how to recover your crashed cluster – Test no 4</title>
		<link>http://blog.ronnyegner-consulting.de/2009/10/13/asm-resilvering-%e2%80%93-or-%e2%80%93-how-to-recover-your-crashed-cluster-%e2%80%93-test-no-4/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/10/13/asm-resilvering-%e2%80%93-or-%e2%80%93-how-to-recover-your-crashed-cluster-%e2%80%93-test-no-4/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:50:35 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle ASM]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=590</guid>
		<description><![CDATA[Test #4: Corrupting the ASM disk with ASM disk group being online and active After overwriting the ASM disk header while the disk group was offline we will now put some load on the full running cluster and corrupt the asm disk slightly. Testcase Put load on the database Prior starting this test i created [...]]]></description>
			<content:encoded><![CDATA[<h1>Test #4: Corrupting the ASM disk with ASM disk group being online and active</h1>
<p>After overwriting the ASM disk header while the disk group was offline we will now put some load on the full running cluster and corrupt the asm disk slightly.</p>
<p><span id="more-590"></span></p>
<h2>Testcase</h2>
<h3>Put load on the database</h3>
<p>Prior starting this test i created a larger table with one column and approx 1.2 GB size and an empty table with the same structure. So for our simple test we will just copy one table into another table. This forces oracle to read the database blocks and do some writes as well.</p>
<pre>create table test2_empty as select * from test where rownum&lt;1;

insert into test2_empty select * from test;</pre>
<h3>Corrupting the disk</h3>
<p>According to fdisk the asm lun has a size of 21474836480 bytes:</p>
<pre>Disk /dev/sde: 21.4 GB, 21474836480 bytes
64 heads, 32 sectors/track, 20480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

 Device Boot      Start         End      Blocks     Id  System
/dev/sde1               1       20480    20971504   83  Linux</pre>
<p>And the disk is indeed the mirror partner of the disk we destroyed and re-added in the earlier part.</p>
<pre>[root@rac1 ~]# oracleasm querydisk /dev/sde1
Device "/dev/sde1" is marked an ASM disk with the label "DISK003B"</pre>
<p>We will corrupt the disk by writing 512 byte chunks of random data from /dev/urandom to 1000 different locations all over the lun. Given the lun size this makes 41943040 blocks of 512 bytes each.</p>
<p>Our command to corrupt the lun will be:</p>
<pre>dd if=/dev/random bs=512 count=1 of=/dev/sde1 seek=nnnn</pre>
<p>Where &#8220;seek=nnn&#8221; is a number from 0 to 41943040-1.</p>
<p>Note that this time we manipulate the second mirror disk of disk group DATA2 &#8211; DISK003B. In test no 3 we overwrote the asm disk header of DISK003A and re-added the disk to the data group. In this example we manipulate DISK003B. If there were undetected errors rebalancing the disks we will discover it now.</p>
<p>For this we first of all needed a small little random number generator within the limits of 0 to 41943040; here it is:</p>
<pre>#!/bin/bash

function random()
{
 od -d /dev/urandom | sed -e 's/^[0-9]* //' -e 's/ //g' |\
 while read L ; do echo -n $L ; done |\
 dd bs=1 count=${1:-10} 2&gt;/dev/null
}

A=$(random 10) #return random number with 10 numbers
B=$(expr $C % 41943040)  # keep number within range
echo $B</pre>
<p>With this random number generator we created a small shell script for corrupting the asm lun which looks like this:</p>
<pre>dd if=/dev/urandom of=/dev/sde1 bs=512 count=1 seek=986024
dd if=/dev/urandom of=/dev/sde1 bs=512 count=1 seek=1594423
dd if=/dev/urandom of=/dev/sde1 bs=512 count=1 seek=2236024
[..]</pre>
<h2>Expected test results</h2>
<p>So what are we expecting?</p>
<p>According to oracle documents (note 416046.1) there are two different scenarios:</p>
<ul>
<li>If the primary extent is detected to be corrupt (asm only reads from primary extent unless  a read preference set) ASM retries the read. If re-read data is also corrupt ASM fails over to the secondary extent. If data in secondary extent is valid data in primary extent will be overwritten with the good data from the secondary extent.</li>
<li>If data in secondary extent is corrupt it will remain undetected. If new data is written the new data will be written both to the primary and secondary disk. This will most likely overwrite the corrupted data. But if the primary extent fails oracle will read the secondary extent and will discover the corruption as well -  but this time the corruption is not fixable. You will end up with restoring/recovering the corrupt database blocks and probably much more.</li>
</ul>
<p>In addition to that i expect ASM and/or the database to automatically fix detected corruptions.</p>
<h2>Testing</h2>
<h3>Message no. 1: Database detected and fixed corruption</h3>
<p>During our Insert statement running the database alert.log showed:</p>
<pre>Fri Oct 02 10:47:21 2009
Hex dump of (file 6, block 156029) in trace file /u01/app/oracle/diag/rdbms
  /ora11p/ora11p1/trace/ora11p1_ora_30023.trc
Corrupt block relative dba: 0x0182617d (file 6, block 156029)
Bad header found during multiblock buffer read
Data in bad block:
 type: 180 format: 3 rdba: 0xb19a95b2
 last change scn: 0x6f92.6c357e5d seq: 0x1 flg: 0x5a
 spare1: 0xfd spare2: 0x80 spare3: 0x4f3c
 consistency value in tail: 0x1591148c
 check value in block header: 0x2abf
 block checksum disabled
Reading datafile '+DATA2/ora11p/users02.dbf' for corruption at rdba:
  0x0182617d (file 6, block 156029)
Read datafile mirror 'DISK003B' (file 6, block 156029) found same corrupt data
Read datafile mirror 'DISK003A' (file 6, block 156029) found valid data
Repaired corruption at (file 6, block 156029)</pre>
<h3>Message no. 2: Database detected corruption</h3>
<pre>Corrupt block relative dba: 0x01c12d35 (file 7, block 77109)
Bad check value found during validation
Data in bad block:
 type: 2 format: 2 rdba: 0x01c12d35
 last change scn: 0x0000.00253bd5 seq: 0x73 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x3bd50273
 check value in block header: 0x94cb
 computed block checksum: 0xf0eb
Trying mirror side DISK003B.
Reread of blocknum=77109, file=+DATA2/ora11p/datafile/undotbs01_02.dbf. found
 same corrupt data
Reread of blocknum=77109, file=+DATA2/ora11p/datafile/undotbs01_02.dbf. found
 valid data</pre>
<p><strong>Note: This time the database does not say anything about the corruption being fixed.</strong></p>
<h3>Message no. 3: ASM detected and fixed corruption</h3>
<pre>Mon Oct 05 09:32:15 2009
WARNNING: cache read a corrupted block group=DATA2 fn=1
 blk=893 from disk 0
NOTE: a corrupted block from group DATA2 was dumped to /u01/app/oracle/diag/asm
 /+asm/+ASM1/trace/+ASM1_ora_4739.trc
WARNNING: cache read(retry) a corrupted block group=DATA2 fn=1
 blk=893 from disk 0
NOTE: cache repaired a corrupted block group=DATA2 fn=1 blk=893
 from disk 0</pre>
<h2>Conclusion</h2>
<p>First of all: regardless of the caveats described below the insert statement most of the time completed successfully:</p>
<pre style="padding-left:60px;">SQL&gt; insert into test2 select * from sys.test;
134217728 rows created.</pre>
<p>Second: During our tests ASM performed  well and stable. We were consistently able to work on the disk groups even if the disk group missed their mirrors.</p>
<p>However i discovered some problems as well:</p>
<ul>
<li>ASM has no ability to check data on disk groups completely (i.e. compare data on all mirror partners and check for corruptions); so corruptions on secondary extents will remain undetected until primary extent fails and secondary extent is read</li>
<li>ASM nor the database does always fix corruptions found in primary extents (see message 2 above&#8230; corruption was detected but NOT corrected and remained on disk) as indicated by note 416046</li>
<li>Checking database with RMAN and &#8220;backup validate database&#8221; finds and reports errors but does not fix ANY error found. The error message no. 2 originated from a &#8220;select * from test&#8230;.&#8221; but rman produces this type of error messages in alert.log as well. From the Metalink document which describes handling of block corruptions in ASM i would have expected ASM or the database to fix these errors automatically.</li>
<li>There are scenarios where corrupted primary blocks prevent the database from starting at all. During our tests we have seen this two times with different error messages. One sample error message stack is reproduced in error message no. 3 coming from the asm instance and in the following lines below coming from the database instance:</li>
</ul>
<pre style="padding-left:60px;">Exception [type: SIGILL, Illegal operand] [ADDR:0x105DC01]
[PC:0x105DC01, kkestRCSBase()+221] [flags: 0x0, count: 1]
Errors in file /u01/app/oracle/diag/rdbms/ora11p/ora11p1/
trace/ora11p1_ora_5206.trc  (incident=48254):
ORA-07445: exception encountered: core dump [kkestRCSBase()+221]
[SIGILL] [ADDR:0x105DC01] [PC:0x105DC01] [Illegal operand] []
Incident details in: /u01/app/oracle/diag/rdbms/ora11p/ora11p1/
incident/incdir_48254/ora11p1_ora_5206_i48254.trc
Mon Oct 05 09:33:47 2009
Trace dumping is performing id=[cdmp_20091005093347]
Mon Oct 05 09:33:49 2009
Exception [type: SIGILL, Illegal operand] [ADDR:0x105DC01]
[PC:0x105DC01, kkestRCSBase()+221] [flags: 0x0, count: 1]
Errors in file /u01/app/oracle/diag/rdbms/ora11p/ora11p1/
trace/ora11p1_ora_5296.trc  (incident=48310):
ORA-07445: exception encountered: core dump [kkestRCSBase()+221]
[SIGILL] [ADDR:0x105DC01] [PC:0x105DC01] [Illegal operand] []
Incident details in: /u01/app/oracle/diag/rdbms/ora11p/ora11p1/
incident/incdir_48310/ora11p1_ora_5296_i48310.trc</pre>
<p style="padding-left:60px;">Although we met this errors we were able to fix them: In one case dropping the disk containing the corrupted blocks was enough to start the instance again. The second incident reproduced above required the corrupted disk to be dropped, re-added and ASM instance to be restarted before we were able to successfully start the database instance.</p>
<ul>
<li>Dropping a corrupted disk and re-adding the disk requires the disk group the disk belonged to be taken offline. Otherwise labeling the former member disk failed with &#8220;device or resource busy&#8221;. I will investigate this further.</li>
</ul>
<p>Summarizing my experiences until now i would go with ASM and normal or even high redundancy. This enables far more options for fixing errors without having to rebuild the disk group and restoring everything from tape/disk.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/10/13/asm-resilvering-%e2%80%93-or-%e2%80%93-how-to-recover-your-crashed-cluster-%e2%80%93-test-no-4/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Oracle Database File System (DBFS)</title>
		<link>http://blog.ronnyegner-consulting.de/2009/10/08/the-oracle-database-file-system-dbfs/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/10/08/the-oracle-database-file-system-dbfs/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 14:15:24 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>
		<category><![CDATA[Oracle in general]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=741</guid>
		<description><![CDATA[The following post is a summary of my tests with DBFS on a 11g Release 2 RAC. DBFS &#8211; An Overview Since the introduction of LOBs the database was used to store all kinds of files, for instance images, audio files, video files or even text files. Starting with Oracle 11g Release 1 introduced SecureFiles [...]]]></description>
			<content:encoded><![CDATA[<p>The following post is a summary of my tests with DBFS on a 11g Release 2 RAC.</p>
<h2>DBFS &#8211; An Overview</h2>
<p>Since the introduction of LOBs the database was used to store all kinds of files, for instance images, audio files, video files or even text files. Starting with Oracle 11g Release 1 introduced SecureFiles which introduced compression and de-duplication.</p>
<p>Oracle Database Filesystem (DBFS) creates a mountable file system which can be used to access files stored in the database as SecureFile LOBs. DBFS is a shared file system like NFS and consists of a server (the database) and a client. <strong>Just like a traditional database connection server and client can be on different systems which communicate over SQLNet. The same applies to DBFS as well. </strong></p>
<p>The following figure illustrates DBFS:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs.gif"><img class="alignnone size-full wp-image-744" title="dbfs" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs.gif" alt="dbfs" width="416" height="489" /></a></p>
<p>(Source: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10645/adlob_fs.htm)</p>
<p><span id="more-741"></span></p>
<h2>Install DBFS</h2>
<h3>Requirements</h3>
<p>The following requirements must be met to use DBFS:</p>
<ul>
<li>only available for 32-bit and 64-bit Linux</li>
<li>installed FUSE package</li>
<li>installed kernel development package</li>
<li>installed oracle client libraries</li>
</ul>
<h3>Install FUSE</h3>
<ul>
<li>Download FUSE in Version 2.7.3 from <a href="http://fuse.sourceforge.net" target="_blank">http://fuse.sourceforge.net</a><br />
(Note: I initially tested with FUSE 2.8.1 but was not able to get it working; so stick with 2.7.3 or 2.7.4)</li>
<li>Install kernel development packages matching your kernel (to query your kernel type &#8220;uname -a&#8221;)</li>
<li>Compile and install FUSE:
<ul>
<li>tar -xvfz fuse-2.7.3.tar.gz</li>
<li>cd fuse-2.7.3</li>
<li>./configure &#8211;prefix=/usr &#8211;with-kernel=/usr/src/kernels/`uname -r`-`uname -p`</li>
<li>make</li>
<li>make install</li>
<li>depmod</li>
<li>modprobe fuse</li>
<li>chmod 666 /dev/fused</li>
<li>echo &#8220;/sbin/modprobe fuse&#8221; &gt;&gt; /etc/rc.modules</li>
<li>ldconfig</li>
</ul>
</li>
</ul>
<h3>Create DBFS File System</h3>
<h4>Creating a user to store the file system in</h4>
<p>Prior creating a DBFS File system you must create a user for storing the file system in. DBFS file systems can be created for every user. The role DBFS_ROLE must be granted to users having dbfs file system, for instance:</p>
<pre>create user dbfs identified by dbfs default tablespace
users quota unlimited on users;

grant dbfs_role to dbfs;
grant create session to dbfs;
grant create procedure to dbfs;
grant create table ro dbfs;
alter user dbfs default role all;</pre>
<h4>Create a simple file system</h4>
<p>To create the DBFS file system execute the script &#8220;dbfs_create_filesystem.sql&#8221; being connected as user to store the file system in. The syntax is:</p>
<pre>sqlplus &lt;username&gt;/&lt;password&gt;@&lt;database&gt;
@$ORACLE_HOME/rdbms/admin/dbfs_create_filesystem.sql &lt;tablespace name&gt;
&lt;file system name&gt;</pre>
<p>To create a file system for user dbfs created earlier and storing the content in tablespace USERS and naming the file system TESTDBFS:</p>
<pre>sqlplus dbfs/dbfs@ora11p @$ORACLE_HOME/rdbms/admin/dbfs_create_filesystem.sql
USERS TESTDBFS</pre>
<p>dbfs_create_filesystem.sql creates a partitioned file system by creating multiple physical segments in the database and distributing files randomly in it. In cases when the files are extremely big and make a big percentage of the total file system this can cause an error &#8220;ENOSPC&#8221; to appear even if the file system is not full. In such cases the script &#8220;dbfs_create_filesystem_advances.sql&#8221; can be used to create a non-partitioned file system.</p>
<h4>Create an advanced file system</h4>
<p>Creating a standard file system does not use de-duplication or compression. To use this features you have to create the file system using the script &#8220;dbfs_create_filesystem_advanced.sql&#8221;. The calling syntax is:</p>
<pre>sqlplus &lt;username&gt;/&lt;password&gt;@&lt;database&gt;
@$ORACLE_HOME/rdbms/admin/dbfs_create_filesystem_advanced.sql
&lt;tablespace name&gt; &lt;file system name&gt;
&lt;compress-high | compress-medium | compress-low | nocompress&gt;
&lt;deduplicate | nodeduplicate&gt;
&lt;encrypt | noencrypt&gt;
&lt;partition | non-partition&gt;</pre>
<p>To create a de-duplicated, highly compressed, not encrypted and partitioned file system for user dbfs2 stored in tablespace USERS:</p>
<pre>sqlplus dbfs2/dbfs2@ora11p
@$ORACLE_HOME/rdbms/admin/dbfs_create_filesystem_advanced.sql
USERS
TESTDBFS2
compress-high
deduplicate
noencrypt
partition</pre>
<h3>Dropping a File System</h3>
<p>To drop a file system the script &#8220;dbfs_drop_filesystem.sql&#8221; must be used. Calling syntax is:</p>
<div>
<pre>sqlplus &lt;username&gt;/&lt;password&gt;@&lt;database&gt;
@$ORACLE_HOME/rdbms/admin/dbfs_drop_filesystem.sql &lt;file system name&gt;</pre>
<h3>Mounting a DBFS file system</h3>
<p>Mounting a DBFS file system used FUSE (file system in user space) so every user (even non-priviledged users) can mount dbfs file systems and to separate file systems between users. With FUSE it is possible to mount two completely different file systems to the same mountpoint onyl separated by the users looking at it. (see below for an example)</p>
<p>To mount a dbfs file system use the userspace tool &#8220;dbfs_client&#8221; which is located in $ORACLE_HOME/bin. It is important that LD_LIBRARY_PATH includes the correct path to the oracle libraries. In addition to that remember dbfs_client will NOT return until the file system is unmounted.</p>
<p>The calling syntax is:</p></div>
<p><!-- --> <!-- --></p>
<div><!-- infolevel="all" infotype="General" --></p>
<pre>Usage: dbfs_client &lt;db_user&gt;@&lt;db_server&gt; [options] &lt;mount point&gt;

    db_user: Name of Database user that owns DBFS content store filesystem(s)
    db_server:   A valid connect string Oracle database server
                 (for example, hrdb_host:1521/hrservice).
    mount point: Path to mount Database File System(s).
                 All the file systems owned by the database user will be seen
                 at the mount point.

DBFS options:
  -o direct_io   Bypasses the Linux page cache.  Gives much better performance
                 for large files.
                 Programs in the file system cannot be executed with this option.
                 This option is recommended when DBFS is used as an ETL staging
                 area.
  -o wallet      Run dbfs_client in background. Wallet must be configured to get
                 credentials.
  -o failover    DBFS Client fails over to surviving database instance with no
                 data loss.
                 Some performance cost on writes, especially for small files.
  -o allow_root  Allows root access to the filesystem.
                 This option requires setting 'user_allow_other' parameter in
                 /etc/fuse.conf
  -o allow_other    Allows other users access to the filesystem.
                    This option requires setting 'user_allow_other' parameter in
                    /etc/fuse.conf
  -o rw             Mount the filesystem read-write [Default]
  -o ro             Mount the filesystem read-only. Files cannot be modified.
  -o trace_level=N  Trace Level: 1-&gt;DEBUG, 2-&gt;INFO, 3-&gt;WARNING, 4-&gt;ERROR,
                    5-&gt;CRITICAL [Default: 4]
  -o trace_file     &lt;file&gt; | 'syslog'
  -h help
  -V version</pre>
<p>(Source: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10645/adlob_client.htm)</p></div>
<div>
<h3>Unmounting a DBFS</h3>
<p>Unmounting a dbfs can be achieved with:</p>
<pre>fusermount -u &lt;mount point&gt;</pre>
</div>
<p><!-- --></p>
<div><!-- infolevel="all" infotype="General" --></p>
<h3>Mounting DBFS Through fstab</h3>
<p>Mounting a DBFS through fstab is a little bit complicated and requires oracle wallet to be used to store the passwords. See the <a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10645/adlob_client.htm#BABCIHHD" target="_blank">DBFS documentation</a> for more information.</div>
<h3>DBFS restrictions</h3>
<p>DBFS imposes the following restrictions:</p>
<ul>
<li>no ioctl</li>
<li>no locking</li>
<li>no memory-mapped files</li>
<li>no Async IOs</li>
<li>no O_DIRECT file open flags</li>
<li>no hard links</li>
</ul>
<h3>DBFS Client Failover</h3>
<p>According to the oracle documentation failover can be achieved by modifying the service as shown below:</p>
<p>exec DBMS_SERVICE.MODIFY_SERVICE(service_name =&gt; &#8216;service_name&#8217;,<br />
aq_ha_notifications =&gt; true,<br />
failover_method =&gt; &#8216;BASIC&#8217;,<br />
failover_type =&gt; &#8216;SELECT&#8217;,<br />
failover_retries =&gt; 180,<br />
failover_delay =&gt; 1);</p>
<p>Instead of modifying the default service a new service named &#8220;DBFS&#8221; was created and configured accordingly to the example given above.</p>
<p>For POLICY MANAGED Clusters issue:</p>
<pre>srvctl add service -d ORA11P -s DBFS -g Default -y AUTOMATIC
-e SELECT -m BASIC -w 1 -z 180 -q TRUE</pre>
<p>(&#8220;-g Default&#8221; specifies the name of the cluster group)</p>
<p>For ADMIN MANAGED clusters issue:</p>
<pre>srvctl add service -d ORA11P -s DBFS -r ora11p1,ora11p2 -y AUTOMATIC
-e SELECT -m BASIC -w 1 -z 180 -q TRUE</pre>
<p>(&#8220;-r ora11p1,ora11p2&#8243; specified the instances the service runs)</p>
<p>Mounting the file system requires the parameter &#8220;-o failover&#8221; to be added:</p>
<pre>ora11p@rac1#&gt;: dbfs_client &lt;db_user&gt;@&lt;db_server&gt; -o failover /mnt/dbfs</pre>
<p><!-- --></p>
<div><!-- infolevel="all" infotype="General" --></p>
<h3>Sharing and Caching</h3>
<p>DBFS file system can be accessed by multiple clients at the same time. Sharing and caching behavior is like NFS: The client caches writes and flushes them after a timeout or a file handle was closed. Writes to files are visible to other clients after the file handle was closed. Bypassing client side write caching can be achieved by specifying switch O_SYNC opening the file.</p></div>
<p><!-- --></p>
<div><!-- infolevel="all" infotype="General" --></p>
<h3>Backup of DBFS</h3>
<ul>
<li>backing up the database also backs up the dbfs in a consistent way</li>
<li>backup up the dbfs as a normal file system enables single file restores</li>
</ul>
</div>
<div>
<h3>Small File Performance of DBFS</h3>
<p>Note that the performance of DBFS on file systems with tens of thousands of files is not fully tuned in the current revision.</p>
<h2>Some examples</h2>
<h3>File system separation between users</h3>
<p>The following three listings show the output of &#8220;df -h&#8221; from three different users: grid, ora11p and root. Note that &#8220;ora11p&#8221; mounted the dbfs file system to /test4 and is the only user which is able to use the file system:</p>
<pre>-bash-3.2$ id
uid=500(grid) gid=500(dba) groups=500(dba)
-bash-3.2$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              26G   15G  9.6G  60% /
/dev/sda1              99M   12M   83M  13% /boot
tmpfs                 3.0G  1.4G  1.7G  45% /dev/shm
/dev/asm/ora11p_home-132 10G  4.7G  5.4G  47%
                   /u01/app/oracle/product/11.2.0/ora11p</pre>
<pre>-bash-3.2$ id
uid=501(ora11p) gid=500(dba) groups=500(dba)
-bash-3.2$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              26G   15G  9.6G  60% /
/dev/sda1              99M   12M   83M  13% /boot
tmpfs                 3.0G  1.4G  1.7G  45% /dev/shm
/dev/asm/ora11p_home-132 10G  4.7G  5.4G  47%
                   /u01/app/oracle/product/11.2.0/ora11p
<strong>dbfs                   14M  3.3M   11M  25% /test4</strong></pre>
<pre>[root@rac1 ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@rac1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              26G   15G  9.6G  60% /
/dev/sda1              99M   12M   83M  13% /boot
tmpfs                 3.0G  1.4G  1.7G  45% /dev/shm
/dev/asm/ora11p_home-132 10G  4.7G  5.4G  47%
                    /u01/app/oracle/product/11.2.0/ora11p</pre>
<p>Even root is by default not allowed to see the contents of /test4. This setting can be influenced by a mount parameter (see above):</p>
<pre>[root@rac1 ~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@rac1 ~]# cd /test4
-bash: cd: /test4: Permission denied</pre>
<h3>Mounting a file system</h3>
<p>The command syntax to mount a file system is described above. In the following we wil try to mount the highly compressed and de-duplicated database file system from user &#8220;dbfs2&#8243; created above. Trying to mount this file system results in the following error message:</p>
<pre>-bash-3.2$ dbfs_client dbfs2/dbfs2@rac1:1521/ora11p /test
dbfs_client: error while loading shared libraries:
libclntsh.so.11.1: cannot open shared object file: No such file or directory</pre>
<p>Obviously an oracle library cant be found. To see a list of all dependend libraries we check with &#8220;ldd&#8221;:</p>
<pre>ora11p@rac1#&gt;: ldd $ORACLE_HOME/bin/dbfs_client
libstdc++.so.6 =&gt; /usr/lib64/libstdc++.so.6 (0x000000303f400000)
libfuse.so.2 =&gt; /usr/lib/libfuse.so.2 (0x00002b5e455cb000)
libclntsh.so.11.1 =&gt; not found
libnnz11.so =&gt; not found
libdl.so.2 =&gt; /lib64/libdl.so.2 (0x000000302ca00000)
libm.so.6 =&gt; /lib64/libm.so.6 (0x000000302c600000)
libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x000000302ce00000)
libnsl.so.1 =&gt; /lib64/libnsl.so.1 (0x0000003030200000)
libgcc_s.so.1 =&gt; /lib64/libgcc_s.so.1 (0x000000303c400000)
libc.so.6 =&gt; /lib64/libc.so.6 (0x000000302c200000)
librt.so.1 =&gt; /lib64/librt.so.1 (0x000000302d600000)
/lib64/ld-linux-x86-64.so.2 (0x000000302be00000)</pre>
<p>It turns out there are two libraries missing: libclntsh.so.11.1 and libnnz11.so. They are located in $ORACLE_HOME/lib. There are several ways to adjust the library search path:</p>
<ol>
<li>Modifying /etc/ld.so.conf to include $ORACLE_HOME/lib</li>
<li>exporting &#8220;LD_LIBRARY_PATH=$ORACLE_HOME/lib&#8221;</li>
</ol>
</div>
<div>For our tests we choose to export LD_LIBRARY_PATH which adds paths to look for libraries to the user&#8217;s environment:</div>
<div>
<pre>ora11p@host#&gt;: export LD_LIBRARY_PATH=$ORACLE_HOME/lib
ora11p@host#&gt;: ldd dbfs_client
libstdc++.so.6 =&gt; /usr/lib64/libstdc++.so.6 (0x000000303f400000)
libfuse.so.2 =&gt; /usr/lib/libfuse.so.2 (0x00002b84ba9d9000)
libclntsh.so.11.1 =&gt; /u01/app/oracle/product/11.2.0/ora11p/lib/libclntsh.so.11.1 (0x00002b84babf8000)
libnnz11.so =&gt; /u01/app/oracle/product/11.2.0/ora11p/lib/libnnz11.so (0x00002b84bd223000)
libdl.so.2 =&gt; /lib64/libdl.so.2 (0x000000302ca00000)
libm.so.6 =&gt; /lib64/libm.so.6 (0x000000302c600000)
libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x000000302ce00000)
libnsl.so.1 =&gt; /lib64/libnsl.so.1 (0x0000003030200000)
libgcc_s.so.1 =&gt; /lib64/libgcc_s.so.1 (0x000000303c400000)
libc.so.6 =&gt; /lib64/libc.so.6 (0x000000302c200000)
librt.so.1 =&gt; /lib64/librt.so.1 (0x000000302d600000)
/lib64/ld-linux-x86-64.so.2 (0x000000302be00000)
libaio.so.1 =&gt; /usr/lib64/libaio.so.1 (0x00002b84bd5ed000)</pre>
</div>
<div>In order to make this change permanent you can either modify /etc/ld.so.conf or add the export command to the user&#8217;s profile file.</div>
<div>Now we are able to mount the dbfs file system:</div>
<pre>-bash-3.2$ dbfs_client dbfs2@rac1:1521/ora11p /test
Password:
&lt;WAIT&gt;</pre>
<div>Remember: dbfs_client will not return until the file system has been unmounted. To free the terminal you put the into a file and mount:</div>
<div>
<pre>echo "dbfs2" &gt; dbfs2password</pre>
</div>
<div>
<pre>ora11p@host#&gt;: nohup dbfs_client dbfs2@rac1:1521/ora11p /test  &lt; dbfs2password &amp;
[1] 24237
ora11p@host#&gt;: nohup: appending output to `nohup.out'

ora11p@host#&gt;: df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              26G   15G  9.6G  60% /
/dev/sda1              99M   12M   83M  13% /boot
tmpfs                 3.0G  1.4G  1.7G  45% /dev/shm
/dev/asm/ora11p_home-132  10G  4.7G  5.4G  47%
                     /u01/app/oracle/product/11.2.0/ora11p
dbfs                  6.4M  192K  6.2M   3% /test</pre>
</div>
<h3>Using the file system</h3>
<p>Readers might ask: &#8220;Does the file system behave like a normal file system like ext3 do?&#8221; &#8211; the answer is: YES.</p>
<p>A few screenshots to illustrate it:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs1.png"><img class="alignnone size-full wp-image-778" title="dbfs1" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs1.png" alt="dbfs1" width="600" height="78" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs2.png"><img class="alignnone size-full wp-image-779" title="dbfs2" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs2.png" alt="dbfs2" width="415" height="64" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs3.png"><img class="alignnone size-full wp-image-780" title="dbfs3" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs3.png" alt="dbfs3" width="488" height="161" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs4.png"><img class="alignnone size-full wp-image-781" title="dbfs4" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs4.png" alt="dbfs4" width="478" height="273" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/10/dbfs5.png"><img class="alignnone size-full wp-image-782" title="dbfs5" src="http://ronnyegner.files.wordpress.com/2009/10/dbfs5.png" alt="dbfs5" width="500" height="286" /></a></p>
<h3>Testing de-duplication and compression</h3>
<p>When creating the file system we specified high compression and deduplication. Lets see the results:</p>
<h4>Compression</h4>
<p>For this test we took the file &#8220;products.xml&#8221; from the 11g Release 2 database install source. The file is approx 930 KB in size but due to xml format good compressible.</p>
<pre>ora11p@host#&gt;: df -h .
Filesystem            Size  Used Avail Use% Mounted on
dbfs                  7.4M  272K  7.1M   4% /test</pre>
<pre>ora11p@host#&gt;: cp /raw_software/database/stage/products.xml  .</pre>
<pre>ora11p@host#&gt;: ll
total 910
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:19 products.xml</pre>
<pre>ora11p@host#&gt;: df -h .
Filesystem            Size  Used Avail Use% Mounted on
dbfs                  7.4M  352K  7.0M   5% /test</pre>
<p>Although the file size is 930 KB the used space has increased from 272 KB to 352 KB &#8211; an increase by 80 KB. So the file size has been reduced from 930 KB down to 80 KB.</p>
<h4>Deduplication</h4>
<p>For testing de-duplication we copied the same file (products.xml) we copied in the previous example a dozen time and check the allocated space:</p>
<pre>ora11p@host#&gt;: ll
total 15470
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 1
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 10
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 11
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 12
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 13
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 14
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 15
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 16
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 2
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 3
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 4
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 5
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 6
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 7
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 8
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 9
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:19 products.xml
ora11p@host#&gt;: df -h .
Filesystem            Size  Used Avail Use% Mounted on
dbfs                   12M  704K   11M   7% /test</pre>
<p>Based on the directory listing above we copied the products.xml 16 times. When compressing the files only each file should add approx 80 KB to the file system. Sixteen files would add up to approx 1.3 MB. But the file systems current size is only 704 KB. So there must be sime sort of de-duplication (or en extremely intelligent compression algorithm) -  but remember: this is only a first and short test. I will investigate this further in a next post.</p>
<h3>Implementing Failover</h3>
<p>Before testing failover we need to create an extra service which will be configured according to the guidelines from oracle:</p>
<pre>srvctl add service -d ORA11P -s DBFS -r ora11p1,ora11p2
-y AUTOMATIC -e SELECT -m BASIC -w 1 -z 180 -q TRUE

srvctl start service -d ORA11P -s DBFS</pre>
<p>To use this service add a connection descriptor to TNSNAMES.ORA:</p>
<pre>DBFS =
 (DESCRIPTION =
 (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
 (CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = DBFS)
 )
 )</pre>
<p>Now mount the file system normally. In our case we mount the file system on host &#8220;rac2&#8243; while connected to host &#8220;rac1&#8243; (inst_id=1)</p>
<pre>-bash-3.2$ date
 Thu Oct  8 16:03:54 CEST 2009
 -bash-3.2$ ll
 total 2730
 -rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 1
 -rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 9
 -rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:19 products.xml</pre>
<pre>SQL&gt; select inst_id, username, to_char(logon_time,'dd.mm.yyyy hh24:mi:ss') as
 TIME from gv$session where username='DBFS2'</pre>
<pre>INST_ID USERNAME  TIME
 ---------- --------- -------------------
 1 DBFS2     08.10.2009 15:54:17</pre>
<p>We now do a &#8220;shutdown abort&#8221; on instance &#8220;ora11p1&#8243; (i.e. the instance running on host &#8220;rac1&#8243; and the instance the dbfs is connected to) and check the file system and sessions:</p>
<p>Shutdown the instance &#8220;ora11p1&#8243;:</p>
<pre>SQL@ORA11P!&gt; shutdown abort;</pre>
<p>Alert.log information from instance &#8220;ora11p2&#8243; showing instance &#8220;ora11p1&#8243; was shut down at 16:05:26:</p>
<pre>Thu Oct 08 16:05:26 2009
Reconfiguration started (old inc 28, new inc 30)
List of instances:
 2 (myinst: 2)
 Global Resource Directory frozen
 * dead instance detected - domain 0 invalid = TRUE
 Communication channels reestablished
 Master broadcasted resource hash value bitmaps
 Non-local Process blocks cleaned out
Thu Oct 08 16:05:26 2009
 LMS 0: 0 GCS shadows cancelled, 0 closed, 0 Xw survived
 Set master node info
 Submitted all remote-enqueue requests
 Dwn-cvts replayed, VALBLKs dubious
 All grantable enqueues granted
 Post SMON to start 1st pass IR
Thu Oct 08 16:05:26 2009
Instance recovery: looking for dead threads
Beginning instance recovery of 1 threads
 Submitted all GCS remote-cache requests
 Post SMON to start 1st pass IR
 Fix write in gcs resources
Reconfiguration complete
Started redo scan
Completed redo scan
 read 1725 KB redo, 701 data blocks need recovery
Started redo application at
 Thread 1: logseq 454, block 1674
Recovery of Online Redo Log: Thread 1 Group 2 Seq 454 Reading mem 0
 Mem# 0: +DATA/ora11p/onlinelog/group_2.258.698489181
 Mem# 1: +DATA2/ora11p/onlinelog/group_2.260.698489185
Completed redo application of 1.01MB
Completed instance recovery at
 Thread 1: logseq 454, block 5124, scn 5701524
 561 data blocks read, 723 data blocks written, 1725 redo k-bytes read
Thread 1 advanced to log sequence 455 (thread recovery)</pre>
<p>Session Information on instance &#8220;ora11p2&#8243;:</p>
<pre>SQL&gt; select inst_id, username, to_char(logon_time,'dd.mm.yyyy hh24:mi:ss')
from gv$session where username='DBFS2'

 INST_ID   USERNAME   TO_CHAR(LOGON_TIME,
---------- ---------- -------------------
 2         DBFS2      08.10.2009 16:05:29</pre>
<p>The session was reconnected to the surviving instance three seconds after the instance &#8220;ora11p1&#8243; was shut down.</p>
<p>Listing the file system was interrupted shortly as shown below:</p>
<pre>
<pre>-bash-3.2$ date
Thu Oct  8 16:05:28 CEST 2009
-bash-3.2$ ll

&lt;&lt; WAITED a few seconds &gt;&gt;

total 2730
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:26 1
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:27 9
-rwxr-xr-x 1 ora11p dba 931475 Oct  8 14:19 products.xml
-bash-3.2$ date
Thu Oct  8 16:05:36 CEST 2009</pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/10/08/the-oracle-database-file-system-dbfs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Release 2 &#8211; How to enable SSH equivalence</title>
		<link>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-how-to-enable-ssh-equivalence/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-how-to-enable-ssh-equivalence/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 12:00:56 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=496</guid>
		<description><![CDATA[There is a problem with shared oracle homes on ACFS documented here. However if you have not configured SSH equivalence before this short guide shows how to do set up ssh equivalence between the nodes &#8220;rac1.regner.de&#8221; and &#8220;rac2.regner.de&#8221;: 1. Unpack the database installation files 2. Execute: &#60;PATH_TO_DATABASE_INSTALLATION&#62;/sshsetup/sshUserSetup.sh -user ora11p -hosts "rac1.regner.de rac2.regner.de" -shared Arguments: -user: [...]]]></description>
			<content:encoded><![CDATA[<p>There is a problem with shared oracle homes on ACFS documented <a href="http://ronnyegner.wordpress.com/2009/09/28/ssh-equivalence-gone-after-reboot/" target="_blank">here</a>.</p>
<p>However if you have not configured SSH equivalence before this short guide shows how to do set up ssh equivalence between the nodes &#8220;rac1.regner.de&#8221; and &#8220;rac2.regner.de&#8221;:</p>
<p>1. Unpack the database installation files</p>
<p>2. Execute:</p>
<pre style="padding-left:30px;">&lt;PATH_TO_DATABASE_INSTALLATION&gt;/sshsetup/sshUserSetup.sh
  -user ora11p -hosts "rac1.regner.de rac2.regner.de" -shared</pre>
<p>Arguments:<br />
-user: the name of the user for ssh equivalence to be configured<br />
-hosts: space separated list of node names<br />
-shared: indicates a shared oracle home (on acfs or nfs)</p>
<p>3. Check it</p>
<pre style="padding-left:30px;">/usr/bin/ssh -o FallBackToRsh=no  -o PasswordAuthentication=no 
  -o StrictHostKeyChecking=yes  -o NumberOfPasswordPrompts=0 rac2 /bin/date</pre>
<pre style="padding-left:30px;">/usr/bin/ssh -o FallBackToRsh=no  -o PasswordAuthentication=no
  -o StrictHostKeyChecking=yes  -o NumberOfPasswordPrompts=0 rac1 /bin/date
</pre>
<p>The two commands above should return the current date. Thats it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-how-to-enable-ssh-equivalence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11 Release 2 Install Guide – Creating a RAC database</title>
		<link>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11-release-2-install-guide-%e2%80%93-creating-a-rac-database/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11-release-2-install-guide-%e2%80%93-creating-a-rac-database/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 11:55:34 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/?p=468</guid>
		<description><![CDATA[This is the final part of the Oracle 11g Release 2 installation guide. At this point you should have: Oracle database and grid infrastructure binaries installed at least ONE or better two disk groups configured for: database and binary files flash recovery area Our database name will be &#8220;ORA11P&#8221;. Preparations create directory for cfgtools create [...]]]></description>
			<content:encoded><![CDATA[<p>This is the final part of the Oracle 11g Release 2 installation guide. At this point you should have:</p>
<ul>
<li>Oracle database and grid infrastructure binaries installed</li>
<li>at least ONE or better two disk groups configured for:
<ul>
<li>database and binary files</li>
<li>flash recovery area</li>
</ul>
</li>
</ul>
<p>Our database name will be &#8220;ORA11P&#8221;.</p>
<h2>Preparations</h2>
<ul>
<li>create directory for cfgtools</li>
</ul>
<pre style="padding-left:60px;">create /u01/app/oracle/cfgtoollogs
mkdir -p /u01/app/oracle/cfgtoollogs
chown root:dba /u01/app/oracle/cfgtoollogs
chmod 775 /u01/app/oracle/cfgtoollogs</pre>
<ul>
<li> Check SSH equivalence once again:<br />
execute as user „ora11p“ (this is the user holding the oracle database binary installation):</li>
</ul>
<pre style="padding-left:60px;">/usr/bin/ssh -o FallBackToRsh=no  -o PasswordAuthentication=no 
  -o StrictHostKeyChecking=yes  -o NumberOfPasswordPrompts=0 rac2 /bin/date</pre>
<pre style="padding-left:60px;">/usr/bin/ssh -o FallBackToRsh=no  -o PasswordAuthentication=no 
  -o StrictHostKeyChecking=yes  -o NumberOfPasswordPrompts=0 rac1 /bin/date</pre>
<p>Both commands should return the current date. If there are errors like „connection refused“, check:</p>
<ul>
<li> network connectivity between both nodes</li>
<li>does a „normal“ SSH connection works?:
<ul>
<li>ssh root@rac1-priv</li>
<li>ssh root@rac1</li>
<li>ssh root@rac2-priv</li>
<li>ssh root@rac2</li>
</ul>
</li>
</ul>
<p>both commands should prompt for a password.</p>
<p>If SSH was working before and seems &#8220;gone&#8221; you might face a problem documented <a href="http://ronnyegner.wordpress.com/2009/09/28/ssh-equivalence-gone-after-reboot/" target="_blank">here</a>.</p>
<ul>
<li> add ACFS oracle home to cluster registry</li>
</ul>
<pre style="padding-left:60px;">$GRID_HOME/bin/srvctl add filesystem -d /dev/asm/ora11p_home-132
  -v ora11p_home -g DATA2 -m /u01/app/oracle/product/11.2.0/ora11p -u ora11p</pre>
<p style="padding-left:60px;">Arguments:<br />
-d: path of advm volume<br />
-v: name of volume<br />
-m: mount point path</p>
<p style="padding-left:60px;">„-u ora11p“ ist important and must match the owner of the database binary installation; else dbca will raise error compaining about missing permissions</p>
<h2>Create the database with dbca</h2>
<p>Start dbca</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_010.png"><img class="alignnone size-full wp-image-470" title="step6_010" src="http://ronnyegner.files.wordpress.com/2009/09/step6_010.png" alt="step6_010" width="600" height="56" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_011.png"><img class="alignnone size-full wp-image-471" title="step6_011" src="http://ronnyegner.files.wordpress.com/2009/09/step6_011.png" alt="step6_011" width="600" height="424" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_012.png"><img class="alignnone size-full wp-image-472" title="step6_012" src="http://ronnyegner.files.wordpress.com/2009/09/step6_012.png" alt="step6_012" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_013.png"><img class="alignnone size-full wp-image-473" title="step6_013" src="http://ronnyegner.files.wordpress.com/2009/09/step6_013.png" alt="step6_013" width="600" height="423" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_014.png"><img class="alignnone size-full wp-image-474" title="step6_014" src="http://ronnyegner.files.wordpress.com/2009/09/step6_014.png" alt="step6_014" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_015.png"><img class="alignnone size-full wp-image-476" title="step6_015" src="http://ronnyegner.files.wordpress.com/2009/09/step6_015.png" alt="step6_015" width="600" height="423" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_016.png"><img class="alignnone size-full wp-image-477" title="step6_016" src="http://ronnyegner.files.wordpress.com/2009/09/step6_016.png" alt="step6_016" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_017.png"><img class="alignnone size-full wp-image-478" title="step6_017" src="http://ronnyegner.files.wordpress.com/2009/09/step6_017.png" alt="step6_017" width="600" height="423" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_018.png"><img class="alignnone size-full wp-image-479" title="step6_018" src="http://ronnyegner.files.wordpress.com/2009/09/step6_018.png" alt="step6_018" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_019a.png"><img class="alignnone size-full wp-image-480" title="step6_019a" src="http://ronnyegner.files.wordpress.com/2009/09/step6_019a.png" alt="step6_019a" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_019b.png"><img class="alignnone size-full wp-image-481" title="step6_019b" src="http://ronnyegner.files.wordpress.com/2009/09/step6_019b.png" alt="step6_019b" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_020.png"><img class="alignnone size-full wp-image-482" title="step6_020" src="http://ronnyegner.files.wordpress.com/2009/09/step6_020.png" alt="step6_020" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_021.png"><img class="alignnone size-full wp-image-483" title="step6_021" src="http://ronnyegner.files.wordpress.com/2009/09/step6_021.png" alt="step6_021" width="600" height="422" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_022.png"><img class="alignnone size-full wp-image-484" title="step6_022" src="http://ronnyegner.files.wordpress.com/2009/09/step6_022.png" alt="step6_022" width="600" height="425" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_023.png"><img class="alignnone size-full wp-image-485" title="step6_023" src="http://ronnyegner.files.wordpress.com/2009/09/step6_023.png" alt="step6_023" width="600" height="423" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_024.png"><img class="alignnone size-full wp-image-486" title="step6_024" src="http://ronnyegner.files.wordpress.com/2009/09/step6_024.png" alt="step6_024" width="600" height="420" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_025.png"><img class="alignnone size-full wp-image-487" title="step6_025" src="http://ronnyegner.files.wordpress.com/2009/09/step6_025.png" alt="step6_025" width="600" height="418" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_026.png"><img class="alignnone size-full wp-image-488" title="step6_026" src="http://ronnyegner.files.wordpress.com/2009/09/step6_026.png" alt="step6_026" width="600" height="421" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_027.png"><img class="alignnone size-full wp-image-489" title="step6_027" src="http://ronnyegner.files.wordpress.com/2009/09/step6_027.png" alt="step6_027" width="600" height="423" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_028.png"><img class="alignnone size-full wp-image-490" title="step6_028" src="http://ronnyegner.files.wordpress.com/2009/09/step6_028.png" alt="step6_028" width="597" height="594" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_029.png"><img class="alignnone size-full wp-image-491" title="step6_029" src="http://ronnyegner.files.wordpress.com/2009/09/step6_029.png" alt="step6_029" width="600" height="417" /></a></p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/step6_030.png"><img class="alignnone size-full wp-image-492" title="step6_030" src="http://ronnyegner.files.wordpress.com/2009/09/step6_030.png" alt="step6_030" width="600" height="423" /></a></p>
<h2>Where to go now?</h2>
<ul>
<li> Tune Instance, for instance:
<ul>
<li>memory_target</li>
<li>db_writer_processes</li>
<li>sessions parameter</li>
<li>…</li>
</ul>
</li>
<li>Configure, perform and test your backup</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11-release-2-install-guide-%e2%80%93-creating-a-rac-database/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle 11g Release 2 &#8211; SCAN explained</title>
		<link>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-scan-explained/</link>
		<comments>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-scan-explained/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:00:53 +0000</pubDate>
		<dc:creator>Ronny Egner</dc:creator>
				<category><![CDATA[Oracle 11g Release 2]]></category>

		<guid isPermaLink="false">http://ronnyegner.wordpress.com/2009/09/28/oracle-11g-release-2-scan-explained/</guid>
		<description><![CDATA[Starting with Oracle 11g Release 2 Oracle introduced a new cluster database connection concept: SCAN &#8211; &#8220;Single Client Access Name&#8221;. SCAN on the server side When installing a 11g Release 2 grid infrastructure you are asked for the cluster name which will be part of the SCAN. The notation for the SCAN is: &#60;clustername&#62;-scan.&#60;domain&#62; For [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with Oracle 11g Release 2 Oracle introduced a new cluster database connection concept: SCAN &#8211; &#8220;Single Client Access Name&#8221;.</p>
<h2>SCAN on the server side</h2>
<p>When installing a 11g Release 2 grid infrastructure you are asked for the cluster name which will be part of the SCAN. The notation for the SCAN is:</p>
<pre>&lt;clustername&gt;-scan.&lt;domain&gt;</pre>
<p>For instance if your cluster is named &#8220;rac&#8221; and the domain &#8220;regner.de&#8221; the SCAN name will be &#8220;rac-scan.regner.de&#8221;.</p>
<p>In order to successful install grid infrastructure you need to configure your DNS (hosts file entries will not work!) prior installing grid infrastructure to resolve the name accordingly. Oracle requires <strong>at least one</strong>, better three IPs configured for the scan name. Your DNS zone file might look like this:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/scan_example1.png"><img class="alignnone size-full wp-image-453" title="scan_example" src="http://ronnyegner.files.wordpress.com/2009/09/scan_example1.png" alt="scan_example" width="356" height="45" /></a></p>
<p> </p>
<p>In the example zone file above we configured three IPs for the scan: 172.23.15.3, 172.23.15.4 and 172.23.15.5.</p>
<p>After installation you will find three listener processes running (separated on all cluster nodes) as shown in the following figure:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/scan_example.png"><img class="alignnone size-full wp-image-451" title="scan_example" src="http://ronnyegner.files.wordpress.com/2009/09/scan_example.png" alt="scan_example" width="798" height="251" /></a></p>
<p>Listener for SCAN2 and SCAN3 are running on node &#8220;rac1&#8243; and listener for SCAN1 is running on node &#8220;rac2&#8243;. For each SCAN listener there will be a dedicated network interface running with the same IP as configured in DNS:</p>
<p><a href="http://ronnyegner.files.wordpress.com/2009/09/scan_interfaces.png"><img class="alignnone size-full wp-image-452" title="scan_interfaces" src="http://ronnyegner.files.wordpress.com/2009/09/scan_interfaces.png" alt="scan_interfaces" width="592" height="673" /></a></p>
<h2>Client connections</h2>
<p>Connection to database &#8220;RAC11P&#8221; using SCAN would use this tnsnames entry:</p>
<pre>RAC11P =
 (DESCRIPTION=
 (ADDRESS=(PROTOCOL=tcp)(HOST=rac-scan.regner.de)(PORT=1521))
 (CONNECT_DATA=(SERVICE_NAME=RAC11P))
 )</pre>
<p>The &#8221;old fashioned&#8221; way still works:</p>
<pre>RAC11P_old =
 (DESCRIPTION=
 (ADDRESS_LIST=
 (ADDRESS=(PROTOCOL=tcp)(HOST=rac1-vip.regner.de)(PORT=1521))
 (ADDRESS=(PROTOCOL=tcp)(HOST=rac2-vip.regner.de)(PORT=1521))
 )
 (CONNECT_DATA=(SERVICE_NAME=RAC11P))
 )</pre>
<p>Connecting to a named instance:</p>
<pre>RAC11P =
 (DESCRIPTION=
 (ADDRESS=(PROTOCOL=tcp)(HOST=rac-scan.regner.de)(PORT=1521))
 (CONNECT_DATA=(SERVICE_NAME=RAC11P)
 (INSTANCE_NAME=RAC11P1))
 )</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.ronnyegner-consulting.de/2009/09/30/oracle-11g-release-2-scan-explained/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	<img style='margin:0;padding:0;border:0;' width='1px' height='1px' src="http://blog.ronnyegner-consulting.de/wp-content/plugins/mystat/mystat.php?act=time_load&id=668921&rnd=1030518292" /></channel>
</rss>

