﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Bert Scalzo's Blog</title>
    <description>&lt;table&gt;
        &lt;tr&gt;
            &lt;td valign="top"&gt;&lt;img height="183" alt="" width="139" src="/Portals/0/Blog/blog-bert-scalzo.png" /&gt;&lt;/td&gt;
            &lt;td valign="top"&gt;Bert Scalzo is a product architect for Quest Software,&amp;#160;a member of the Toad team and an &lt;a href="http://www.oracle.com/technology/community/oracle_ace/index.html"&gt;Oracle ACE&lt;/a&gt;. He has worked with Oracle databases for over two decades; his key areas of interest are data modeling, database benchmarking, tuning and optimization, "Star Schema" data warehouses and Linux. Bert is the author of several books and has written articles for many online outlets and publications,&amp;#160;and has presented at numerous Oracle conferences and user groups.
            &lt;p&gt;Bert's blog provides useful Toad “how to” and “tips and tricks” covering topics on database admin and benchmarking.&lt;/p&gt;
            &lt;p&gt;&lt;font color="#003366" size="3"&gt;&lt;strong&gt;Recent postings:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
&lt;/table&gt;</description>
    <link>http://www.toadworld.com/BLOGS/tabid/67/BlogId/14/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>Bert Scalzo</managingEditor>
    <webMaster>webmaster@toadworld.com</webMaster>
    <pubDate>Fri, 19 Mar 2010 16:23:16 GMT</pubDate>
    <lastBuildDate>Fri, 19 Mar 2010 16:23:16 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.15477</generator>
    <item>
      <title>RAC the Casba</title>
      <description>&lt;div&gt;
&lt;p&gt;On many occasions, people will email or call me to get help with perceived RAC connectivity issues for various client applications – Toad and other Quest products included. Now some times they may have setups that we’ve not pre-tested, so they have a potential bug – or at least another regression testing scenario for us. But many times, it’s simply a SQL*Net configuration issue. While it’s easy to draw a simple diagram of what RAC is, it’s almost an art form to write RAC “tnsnames.ora” files that work as intended. So I figured a quick refresher on RAC and SQL*Net configuration files might be useful.&lt;br /&gt;
  &lt;br /&gt;
Let’s start by drawing a picture of the basic concept of an Oracle &lt;strong&gt;R&lt;/strong&gt;eal &lt;strong&gt;A&lt;/strong&gt;pplication &lt;strong&gt;C&lt;/strong&gt;luster (a.k.a. RAC). RAC is essentially a group of database servers and Oracle instances running as a collective group so as to appear as a single server and database to the outside world. Thus to all the end users, web servers and application servers out there – there is really just the RAC server and database. The fact that it’s a group performing as a cluster is really transparent and unimportant – except the correct tnsnsmes.ora files &lt;span&gt;&lt;font face="Wingdings"&gt;J&lt;br /&gt;
 &lt;br /&gt;
&lt;img height="561" alt="" width="700" src="http://www.toadworld.com/Portals/0/blogimages/Bert Scalzo/BertBlog09172008-1.gif" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;So what should the tnsnames.ora file look like? Let’s show an example where the RAC database has just two servers and instances: RAC1 and RAC2.&lt;/div&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;pre&gt;RAC =&lt;br /&gt; (DESCRIPTION =&lt;br /&gt;&lt;span&gt;    (ADDRESS = (PROTOCOL=TCP)(HOST=linux_rac1-vip)(PORT=1521))&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    (ADDRESS = (PROTOCOL=TCP)(HOST=linux_rac2-vip)(PORT=1521))&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    (LOAD_BALANCE = YES)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    (CONNECT_DATA =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;      (SERVER = DEDICATED)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;      (SERVICE_NAME = RAC)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;      (FAILOVER_MODE =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (TYPE = SELECT)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (METHOD = BASIC)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (RETRIES = 180)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (DELAY = 5)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;      )&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    )&lt;br /&gt;&lt;/span&gt; )&lt;/pre&gt;
&lt;pre&gt;RAC1 =&lt;br /&gt;&lt;span&gt;    (DESCRIPTION =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (ADDRESS_LIST =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (ADDRESS = (PROTOCOL=TCP)(HOST=linux_rac1)(PORT = 1521))&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        )&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (CONNECT_DATA =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (SERVICE_NAME = RAC)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (INSTANCE_NAME = RAC1)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        )&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    )&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;RAC2 =&lt;br /&gt;&lt;span&gt;    (DESCRIPTION =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        (ADDRESS_LIST =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (ADDRESS = (PROTOCOL=TCP)(HOST=linux_rac2)(PORT=1521))&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        )&lt;br /&gt;&lt;/span&gt; &lt;span&gt;       (CONNECT_DATA =&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (SERVICE_NAME = RAC)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;            (INSTANCE_NAME = RAC2)&lt;br /&gt;&lt;/span&gt;&lt;span&gt;        )&lt;br /&gt;&lt;/span&gt;&lt;span&gt;    )&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div&gt;So let’s use Toad as an example – how should we connect to the database? Generally speaking, probably 98% of the time we should simply specify the &lt;strong&gt;RAC&lt;/strong&gt; instance/service name and let Oracle load balance us to whichever node has capacity. Only when we need to debug PL/SQL should Toad users (because of an Oracle limitation/requirement) specify connecting to a specific node – such as &lt;strong&gt;RAC1&lt;/strong&gt;. That’s because the Oracle debugger API needs to create two sessions on the same node so one can watch the other. If we tried to debug using &lt;strong&gt;RAC&lt;/strong&gt;, it might load balance the two sessions onto different nodes – and then we’d get a debugger scoping error. But for all other times we should simply use &lt;strong&gt;RAC&lt;/strong&gt; to connect – period.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;Finally, look at the RAC entries for the TCP host addresses. Why do they say &lt;strong&gt;node-vip&lt;/strong&gt; instead of just node as with the RAC1 and RAC2 corresponding entries? What is the VIP portion? Let’s look at my PC’s Windows &lt;strong&gt;&lt;em&gt;hosts&lt;/em&gt;&lt;/strong&gt; file:&lt;br /&gt;
 &lt;/div&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;pre&gt;192.168.100.104&lt;span&gt;   linux_rac1&lt;br /&gt;&lt;/span&gt;192.168.100.105&lt;span&gt;   linux_rac1-vip&lt;br /&gt;&lt;/span&gt;192.168.200.104&lt;span&gt;   linux_rac1-priv&lt;br /&gt;&lt;/span&gt;192.168.100.106&lt;span&gt;   linux_rac2&lt;br /&gt;&lt;/span&gt;192.168.100.107&lt;span&gt;   linux_rac2-vip&lt;br /&gt;&lt;/span&gt;192.168.200.106&lt;span&gt;   linux_rac2-priv&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div&gt;Why are there three IP addresses per database server? Look back to our RAC architecture diagram above. The RAC instances require two distinct TCP/IP addresses, one for the public network (e.g. &lt;strong&gt;linux_rac1&lt;/strong&gt;) and one for the private network (&lt;strong&gt;linux-rac1-priv&lt;/strong&gt;). So what exactly are the seemingly extra entries for &lt;strong&gt;linux_rac1-vip&lt;/strong&gt; and &lt;strong&gt;linux_rac2-vip&lt;/strong&gt;, and why do we use them as our addresses for the &lt;strong&gt;RAC&lt;/strong&gt; entry in our tnsnames.ora file?&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;When the DBA sets up the cluster nodes, one of the steps involved creating virtual IP addresses. That’s what these entries point to. A virtual IP address is the path by which users should access the node, and whenever a node crashes – Oracle can dynamically reassign the virtual IP address to point to one of the other nodes in the cluster. That way we have transparent application failover (TAF) – because all the network access is virtualized and dynamic. Hence nodes can come and go, or be physically relocated – and to the database nothing has changed. Only the Oracle listeners on the database servers need be aware of this dynamic addressing scheme.&lt;br /&gt;
 &lt;/div&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/277/Default.aspx</link>
      <author>Bert Scalzo</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/277/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=277</guid>
      <pubDate>Wed, 17 Sep 2008 13:44:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=277</trackback:ping>
    </item>
  </channel>
</rss>