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

<channel>
	<title>Oracle Masters</title>
	<atom:link href="http://www.oraclemasters.in/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.oraclemasters.in</link>
	<description>Oracle FAQ, Tips And Tricks, Resources, Certifications....Anything Oracle!</description>
	<lastBuildDate>Fri, 17 Feb 2012 03:55:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RMAN catalog</title>
		<link>http://www.oraclemasters.in/?p=1406</link>
		<comments>http://www.oraclemasters.in/?p=1406#comments</comments>
		<pubDate>Fri, 17 Feb 2012 03:55:03 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Backup/Recovery]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1406</guid>
		<description><![CDATA[Hi Ramesh, I am moving from oracle 10g RAC database with user managed backup setup to oracle11gR2 RAC database with ASM and RMAN backup setup. My question is related to RMAN catalog database setup 1) The target database would be 11GR2. 2) For backup and recovery we will use RMAN. 3) entire setup is virtualised, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Ramesh,<br />
          I am moving from oracle 10g RAC database with user managed backup setup to oracle11gR2 RAC database with ASM and RMAN backup setup. My question is related to RMAN catalog database setup</p>
<p>1) The target database would be 11GR2.<br />
2) For backup and recovery we will use RMAN.<br />
3) entire setup is virtualised, we are using VM instead of bare metal or dedicated physical boxes.</p>
<p>My question</p>
<p>1.To create RMAN backup and recovery setup in this environment do i have to use another VM to create catalog database in which the target 11GR2 database would be registered.</p>
<p>2. What version of catalog database would be compatible with 11Gr2.</p>
<p>Let me know if i am missing any piece.</p>
<p>Would be glad to hear back.</p>
<p>Thanks<br />
Amol<br />
(amoljoshi_007@yahoo.com)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1406</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RMAN</title>
		<link>http://www.oraclemasters.in/?p=1401</link>
		<comments>http://www.oraclemasters.in/?p=1401#comments</comments>
		<pubDate>Sat, 24 Dec 2011 16:04:37 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Backup/Recovery]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1401</guid>
		<description><![CDATA[Hi Ramesh, I have one query regarding RMAN restoration. I have backupieces of 3 days existing in disk,Now i want to restore 3 days old backup As by default if you do resoratin it will restore latest backup,But i want to restore 3 day old backup,suppose I have backup of 17th,18th,19th dec and now I [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Ramesh,</p>
<p>I have one query regarding RMAN restoration.</p>
<p>I have backupieces of 3 days existing in disk,Now i want to restore 3 days old backup</p>
<p>As by default if you do resoratin it will restore latest backup,But i want to restore 3 day old backup,suppose I have backup of 17th,18th,19th dec and now I want to restore backup of 17th dec.</p>
<p>Please guide me how to do that.</p>
<p>Thanks</p>
<p>Tarun</p>
<p>#&#8230;&#8230;Do not post your contact details in public</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1401</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Querry Regaring Registering Database With Catalog</title>
		<link>http://www.oraclemasters.in/?p=1397</link>
		<comments>http://www.oraclemasters.in/?p=1397#comments</comments>
		<pubDate>Sun, 18 Dec 2011 03:56:13 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1397</guid>
		<description><![CDATA[Hi, I have seen the below link:- for create Rman Catalog on 11g and registering 10G database which is on another server. Overall it is great vedio to get an breif about catalog creation. However, i have one confusion, after creating catalog on other server with 11g When we are registering the 10g Database We [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I have seen the below link:-</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/1Nrs6NyjXSU?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>for create Rman Catalog on 11g and registering 10G database which is on another server.</p>
<p>Overall it is great vedio to get an breif about catalog creation.</p>
<p>However, i have one confusion, after creating catalog on other server with 11g</p>
<p>When we are registering the 10g Database </p>
<p>We Just typed register database and we did not mention the name of catalog database.</p>
<p>My Question is how the target database knows that on which database its going to register.</p>
<p>Thanks,</p>
<p>Regards<br />
Rohit Misri<br />
Oracle DBA 10g</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1397</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Query running slow</title>
		<link>http://www.oraclemasters.in/?p=1363</link>
		<comments>http://www.oraclemasters.in/?p=1363#comments</comments>
		<pubDate>Thu, 22 Sep 2011 07:23:57 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Performance Tuning]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1363</guid>
		<description><![CDATA[Hi Ramesh, I have one question,That query is running fine yesterday and today is running slow. now my question is how we can find explain plan of that query for yesterday one. Also please explain what is verison counts. Please answers. Thank you Tarun]]></description>
			<content:encoded><![CDATA[<p>Hi Ramesh,</p>
<p>I have one question,That query is running fine yesterday and today is running slow.<br />
now my question is how we can find explain plan of that query for yesterday one.</p>
<p>Also please explain what is verison counts.</p>
<p>Please answers.<br />
Thank you<br />
Tarun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1363</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restore directly from a backup piece using dbms_backup_restore</title>
		<link>http://www.oraclemasters.in/?p=1335</link>
		<comments>http://www.oraclemasters.in/?p=1335#comments</comments>
		<pubDate>Sat, 21 May 2011 08:11:27 +0000</pubDate>
		<dc:creator>Ramesh Menon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1335</guid>
		<description><![CDATA[The article describes how you could directly read a backup piece using the dbms_backup_restore package. This restore is done from tape using the Netbackup MML. declare v_dev varchar2(50); v_done boolean; v_backup_piece varchar2(256); begin -- Allocate Device v_dev := dbms_backup_restore.deviceallocate( type=&#38;gt;'sbt_tape', params=&#38;gt;'ENV=(NB_ORA_SERV=poltfmsbkp01,NB_ORA_CLIENT=POLTFSOLDBP02)'); &#160; -- Set the backup piece information v_backup_piece := '/LTFP02_0_dly_14807_1_718596223'; &#160; -- Start the [...]]]></description>
			<content:encoded><![CDATA[<div class="article">
<p>The article describes how you could directly read a backup piece using the dbms_backup_restore package.</p>
<p>This restore is done from tape using the Netbackup MML.<br />
<span id="more-1335"></span></p>

<div class="wp_codebox"><table><tr id="p13353"><td class="code" id="p1335code3"><pre class="language" style="font-family:monospace;">declare
        v_dev   varchar2(50);
        v_done  boolean;
        v_backup_piece  varchar2(256);
begin
        -- Allocate Device
        v_dev := dbms_backup_restore.deviceallocate( type=&amp;gt;'sbt_tape', params=&amp;gt;'ENV=(NB_ORA_SERV=poltfmsbkp01,NB_ORA_CLIENT=POLTFSOLDBP02)');
&nbsp;
        -- Set the backup piece information
        v_backup_piece :=  '/LTFP02_0_dly_14807_1_718596223';
&nbsp;
        -- Start the backup conversation
        sys.dbms_backup_restore.restoreSetDatafile;
&nbsp;
        -- Specify location of datafile
        sys.dbms_backup_restore.restoreDataFileTo(dfnumber=&amp;gt;29,toname=&amp;gt;'/pool6/exportbkpU03/LTFU06/indx16k.dbf');
&nbsp;
        -- Restore the datafile
        sys.dbms_backup_restore.restoreBackupPiece(done=&amp;gt;v_done,handle=&amp;gt;v_backup_piece);
&nbsp;
        if v_done THEN
&nbsp;
                dbms_output.put_line('File restored successfully');
        else
                dbms_output.put_line('Some error');
        end if;
&nbsp;
        sys.dbms_backup_restore.deviceDeallocate;
&nbsp;
end;</pre></td></tr></table></div>

<p>
You can even catalog the backup pieces using the</p>

<div class="wp_codebox"><table><tr id="p13354"><td class="code" id="p1335code4"><pre class="language" style="font-family:monospace;">CATALOG DEVICE TYPE 'SBT_TAPE' BACKUPPIECE '/LTFP02_0_dly_14807_1_718596223';
or 
using dbms_backup_restore.inspectBackupPiece procedure</pre></td></tr></table></div>

<p>Once cataloged, you can restore it normally using restore command.
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1335</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stored Outlines</title>
		<link>http://www.oraclemasters.in/?p=1329</link>
		<comments>http://www.oraclemasters.in/?p=1329#comments</comments>
		<pubDate>Wed, 04 May 2011 11:09:40 +0000</pubDate>
		<dc:creator>Ramesh Menon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1329</guid>
		<description><![CDATA[You can use a stored outline that allows use of a standard execution plan to be maintained, irrespective of the changes in the system. This feature gives plan stability for queries. This can be useful when you cannot change the code as it is a third party application, but feel that a certain query can [...]]]></description>
			<content:encoded><![CDATA[<div class="article">
<p>
You can use a stored outline that allows use of a standard execution plan to be maintained, irrespective of the changes<br />
in the system. This feature gives plan stability for queries. This can be useful when you cannot change the code as it<br />
is a third party application, but feel that a certain query can run better with a particular execution plan.</p>
<p>The following article shows the technical aspects of setting up outlines in Oracle database.
</p>
<p><span id="more-1329"></span></p>
<ol>
<li><a href="#setup">Setup environment for stored outlines</a></li>
<li><a href="#good">Identify the &#8216;Good&#8217; execution plan for the sql</a></li>
<li><a href="#create">Create the stored outline</a></li>
<li><a href="#use">Use the stored outline and verify</a></li>
</ol>
<p><a name="setup"></a></p>
<h2>Setup environment for stored outlines</h2>

<div class="wp_codebox"><table><tr id="p132912"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p1329code12"><pre class="language" style="font-family:monospace;">SQL&gt; show parameter stored
&nbsp;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_stored_outlines               string
&nbsp;
&nbsp;
SQL&gt; alter system set create_stored_outlines=TRUE;
&nbsp;
System altered.
&nbsp;
SQL&gt; alter system set query_rewrite_enabled=TRUE;
&nbsp;
System altered.</pre></td></tr></table></div>

<p><a name="#good"></a></p>
<h2>Identify the &#8216;Good&#8217; execution plan for the sql </h2>
<p>Let us assume that we are running the following query</p>

<div class="wp_codebox"><table><tr id="p132913"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code" id="p1329code13"><pre class="language" style="font-family:monospace;">SQL&gt; variable trn_id number;
SQL&gt; exec :trn_id := 100;
&nbsp;
PL/SQL procedure successfully completed.
&nbsp;
SQL&gt; select trn_id, trn_dt, trn_smn_id, trn_loc, trn_itm_sr_no, trn_itm_code, trn_itm_qty, trn_itm_price from sales_dtls where trn_id = :trn_id
  2  ;
&nbsp;
    TRN_ID TRN_DT    TRN_SMN_ID    TRN_LOC TRN_ITM_SR_NO TRN_ITM_CODE         TRN_ITM_QTY TRN_ITM_PRICE
---------- --------- ---------- ---------- ------------- -------------------- ----------- -------------
       100 13-AUG-06         54         22             1 ABC 1                          7            19
       100 13-AUG-06         54         22             2 ABC 2                         43             5
       100 13-AUG-06         54         22             3 ABC 3                         59             8
       100 13-AUG-06         54         22             4 ABC 4                         80            18
       100 13-AUG-06         54         22             5 ABC 5                         10            15
       100 13-AUG-06         54         22             6 ABC 6                         97             9
       100 13-AUG-06         54         22             7 ABC 7                         15            15
       100 13-AUG-06         54         22             8 ABC 8                         75            10
       100 13-AUG-06         54         22             9 ABC 9                          6            18
       100 13-AUG-06         54         22            10 ABC 10                        15             6
       100 13-AUG-06         54         22            11 ABC 11                        61             7
       100 13-AUG-06         54         22            12 ABC 12                        50            18
       100 13-AUG-06         54         22            13 ABC 13                        28             3
       100 13-AUG-06         54         22            14 ABC 14                         6            15
       100 13-AUG-06         54         22            15 ABC 15                        75             8
       100 13-AUG-06         54         22            16 ABC 16                        84            19
       100 13-AUG-06         54         22            17 ABC 17                        85             4
       100 13-AUG-06         54         22            18 ABC 18                         3             4
       100 13-AUG-06         54         22            19 ABC 19                        14            17
       100 13-AUG-06         54         22            20 ABC 20                        48             6
       100 13-AUG-06         54         22            21 ABC 21                        24            16
       100 13-AUG-06         54         22            22 ABC 22                         5             2
       100 13-AUG-06         54         22            23 ABC 23                        41            17
       100 13-AUG-06         54         22            24 ABC 24                        75             7
       100 13-AUG-06         54         22            25 ABC 25                        94            14
&nbsp;
25 rows selected.
&nbsp;
SQL&gt;</pre></td></tr></table></div>

<p>Get the hash_value from V$SQL as follows. Ensure the child number is the correct one for the plan<br />
that you plan to create a stored outline for. (A sql may have multiple child cursors, for different<br />
reasons. The V$SQL_SHARED_CURSOR view will help you understand why this happened.</p>

<div class="wp_codebox"><table><tr id="p132914"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p1329code14"><pre class="language" style="font-family:monospace;">SQL&gt; col sql_text format a50
SQL&gt; select sql_id, sql_text, hash_value, child_number
from v$sql
where sql_text like '%where trn_id = :trn_id%'
  2    3    4  ;
&nbsp;
SQL_ID        SQL_TEXT                                           HASH_VALUE CHILD_NUMBER
------------- -------------------------------------------------- ---------- ------------
5m76djsz89357 select trn_id, trn_dt, trn_smn_id, trn_loc, trn_it 1048874151            0
              m_sr_no, trn_itm_code, trn_itm_qty, trn_itm_price
              from sales_dtls where trn_id = :trn_id
&nbsp;
3fj5c8r59agz4 select sql_id, sql_text, hash_value, child_number  3398778852            0
              from v$sql where sql_text like '%where trn_id = :t
              rn_id%'
&nbsp;
&nbsp;
2 rows selected.</pre></td></tr></table></div>

<p><a name="create"></a></p>
<h2>Create the stored outline</h2>

<div class="wp_codebox"><table><tr id="p132915"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1329code15"><pre class="language" style="font-family:monospace;">SQL&gt; exec dbms_outln.create_outline(1048874151,0,'TEST_OUTLINES');
&nbsp;
PL/SQL procedure successfully completed.</pre></td></tr></table></div>

<p><a name="use"></a></p>
<h2>Use the stored outline</h2>
<p>Get Outline information</p>

<div class="wp_codebox"><table><tr id="p132916"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p1329code16"><pre class="language" style="font-family:monospace;">SQL&gt; select name, category, used, enabled, sql_text from user_outlines
where category='TEST_OUTLINES'
  2    3  ;
&nbsp;
NAME                           CATEGORY                       USED   ENABLED  SQL_TEXT
------------------------------ ------------------------------ ------ -------- --------------------------------------------------
SYS_OUTLINE_11050416050420644  TEST_OUTLINES                  UNUSED ENABLED  select trn_id, trn_dt, trn_smn_id, trn_loc, trn_it
                                                                              m_sr_no, trn_itm_code, trn_itm_qty, trn_itm_price
                                                                              from sales_dtls where trn_id = :trn_id
&nbsp;
&nbsp;
1 row selected.</pre></td></tr></table></div>

<p>Set the outline for the session/system level. The outline will be used only after this value is set.</p>

<div class="wp_codebox"><table><tr id="p132917"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p1329code17"><pre class="language" style="font-family:monospace;">alter session set use_stored_outline=TEST_OUTLINES
&nbsp;
Execute the query ----
@qq02
&nbsp;
&nbsp;
SQL&gt; @qq03
&nbsp;
NAME                           USED   CATEGORY                       SQL_TEXT                                           ENABLED
------------------------------ ------ ------------------------------ -------------------------------------------------- --------
SYS_OUTLINE_11050416050420644  USED   TEST_OUTLINES                  select trn_id, trn_dt, trn_smn_id, trn_loc, trn_it ENABLED
                                                                     m_sr_no, trn_itm_code, trn_itm_qty, trn_itm_price
                                                                     from sales_dtls where trn_id = :trn_id
&nbsp;
&nbsp;
1 row selected.</pre></td></tr></table></div>

<p>You can also check using the dbms_xplan.display_cursor function as follows</p>

<div class="wp_codebox"><table><tr id="p132918"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code" id="p1329code18"><pre class="language" style="font-family:monospace;">  1* select * from table(dbms_xplan.display_cursor('5m76djsz89357',0, 'OUTLINE'))
SQL&gt; /
&nbsp;
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5m76djsz89357, child number 0
-------------------------------------
select trn_id, trn_dt, trn_smn_id, trn_loc, trn_itm_sr_no,
trn_itm_code, trn_itm_qty, trn_itm_price from sales_dtls where trn_id =
:trn_id
&nbsp;
Plan hash value: 2934699942
&nbsp;
--------------------------------------------------------------------------------
| Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |            |       |       |   658 (100)|          |
|*  1 |  TABLE ACCESS FULL| SALES_DTLS |  1958 |   189K|   658   (2)| 00:00:08 |
--------------------------------------------------------------------------------
&nbsp;
Outline Data
-------------
&nbsp;
  /*+
      BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('10.2.0.5')
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$1&quot;)
      FULL(@&quot;SEL$1&quot; &quot;SALES_DTLS&quot;@&quot;SEL$1&quot;)
      END_OUTLINE_DATA
  */
&nbsp;
Predicate Information (identified by operation id):
---------------------------------------------------
&nbsp;
   1 - filter(&quot;TRN_ID&quot;=:TRN_ID)
&nbsp;
Note
-----
   - outline &quot;SYS_OUTLINE_11050415534809234&quot; used for this statement
&nbsp;
&nbsp;
37 rows selected.</pre></td></tr></table></div>

</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1329</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explain plan</title>
		<link>http://www.oraclemasters.in/?p=1325</link>
		<comments>http://www.oraclemasters.in/?p=1325#comments</comments>
		<pubDate>Wed, 04 May 2011 05:24:58 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Performance Tuning]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1325</guid>
		<description><![CDATA[Hi Ramesh, I have good explain plan of query.How to save that plan in Oracle dataabse,so that if some for reason plan change and query behaves bad,then I can load that good plan for particular query. So question is how should I tell to optimizer to used this plan. Thanks Tarun]]></description>
			<content:encoded><![CDATA[<p>Hi Ramesh,</p>
<p>I have good explain plan of query.How to save that plan in Oracle dataabse,so that if some for reason plan change and query behaves bad,then I can load that good plan for particular query.</p>
<p>So question is how should I tell to optimizer to used this plan.</p>
<p>Thanks<br />
Tarun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1325</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Oracle 11g R2 SCAN Demo</title>
		<link>http://www.oraclemasters.in/?p=1296</link>
		<comments>http://www.oraclemasters.in/?p=1296#comments</comments>
		<pubDate>Mon, 10 Jan 2011 09:52:00 +0000</pubDate>
		<dc:creator>Ramesh Menon</dc:creator>
				<category><![CDATA[HA - RAC & Dataguard FAQs]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1296</guid>
		<description><![CDATA[With releases prior to Oracle 11GR2, addition or deletion of nodes would entail the client tnsnames.ora file being updated with the correct VIP address. This would be cumbersome if there are many clients that connect to the cluster. With Oracle 11gR2 GRID, Oracle has introduced the concept of SCAN.Clients connect to the cluster providing the [...]]]></description>
			<content:encoded><![CDATA[<div class="article">
<p>
With releases prior to Oracle 11GR2, addition or deletion of nodes would entail the client tnsnames.ora file being updated with the correct VIP address. This would be cumbersome if there are many clients that connect to the cluster.  With Oracle 11gR2 GRID, Oracle has introduced the concept of SCAN.Clients connect to the cluster providing the database service, via the scan listener (initial connection) and based on the load profile of the node, the scan listener would &#8220;hand off&#8221; the connection to the local listener, establishing the final database connection.  </p>
<p><span id="more-1296"></span>
<p>Confusing? May be because it is a new concept. However, with the following demonstration, I would help to clear a few fundamental doubts.  As any document would state, SCAN can be implemented using</p>
<ol>
<li>Domain Name Server (Method used in this demo)</li>
<li>Oracle provided Global Name Service (GNS)</li>
</ol>
<p>For the demo, I have used Vmware to host 2 nodes running Solaris 10 (x86 64bit). The vmware software is installed on a Windows server which will also serve as the DNS server.  The details of the configuration are as below</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="2" width="399" valign="top">Node 1</td>
<td colspan="2" width="399" valign="top">Node 2</td>
</tr>
<tr>
<td width="70" valign="top">Public</td>
<td width="329" valign="top">192.168.1.200  (rac11gr2-n1.vmhosts-demo.com)</td>
<td width="70" valign="top">Public</td>
<td width="329" valign="top">192.168.1.202  (rac11gr2-n2.vmhosts-demo.com)</td>
</tr>
<tr>
<td width="70" valign="top">VIP</td>
<td width="329" valign="top">192.168.1.201  (rac11gr2-n1-vip.vmhosts-demo.com)</td>
<td width="70" valign="top">VIP</td>
<td width="329" valign="top">192.168.1.203  (rac11gr2-n2-vip.vmhosts-demo.com)</td>
</tr>
<tr>
<td width="70" valign="top">Private</td>
<td width="329" valign="top">10.10.10.1  (rac11gr2-n1-pri.vmhosts-demo.com)</td>
<td width="70" valign="top">Private</td>
<td width="329" valign="top">10.10.10.2  (rac11gr2-n2-pri.vmhosts-demo.com)</td>
</tr>
</tbody>
</table>
<p>The Windows Server IP is 192.168.1.2 and dns would be running on port 53 (by default)  As mentioned earlier, we need 3 IPs (recommended by Oracle) which have not been allocated to any server. These 3 IPs must be &#8220;resolved&#8221; via a DNS request. During the cluster installation, the scan ip will be resolved, and the 3 IPs will be &#8220;plugged&#8221; in to the public interface of the cluster nodes.  I have reserved the following three IPs for SCAN  <strong>192.168.1.222, 192.168.1.223, 192.168.1.224</strong></p>
<ul>
<li><a href="#dns">Step 1 : Setup the DNS Entries</a></li>
<li><a href="#resolve">Step 2 :Setup names resolution for solaris nodes</a></li>
<li><a href="#validate">Step 3 :Validate SCAN IPs</a></li>
<li><a href="#crs">Step 4 :Install and Configure CRS and RAC database</a></li>
<li><a href="#test">Step 5 :Test SCAN using client connection</a></li>
</ul>
<div class="article"><a name="#install"></a></p>
<h2>Step 1 : Setup DNS Entries</h2>
<p>In this step, you must have the DNS role enabled for your windows server. If you are not using a Windows Server, you can download DNS software over the net and configure it. This demo shows setting up a DNS server and making SCAN IP entries.</p>
<p>Note: The demo is more inclined towards understanding the SCAN concept than the DNS setup. So, if you have other professional methods for doing the same, kindly follow those.</p>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-01.png"><img class="alignleft size-medium wp-image-1283" title="dns-01" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-01.png" alt="" width="300" height="225" /></a>
</div>
<div>
<p><div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Create a vmhosts-demo.com domain</p></div><a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-02.png"><img class="alignleft size-medium wp-image-1283" title="dns-02" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-02.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-03.png"><img class="alignleft size-medium wp-image-1283" title="dns-03" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-03.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-03.png"><img class="alignleft size-medium wp-image-1283" title="dns-03" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-03.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-04.png"><img class="alignleft size-medium wp-image-1283" title="dns-04" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-04.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-04.png"></a> <a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-05.png"><img class="alignleft size-medium wp-image-1283" title="dns-05" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-05.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-06.png"><img class="alignleft size-medium wp-image-1283" title="dns-06" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-06.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-07.png"><img class="alignleft size-medium wp-image-1283" title="dns-07" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-07.png" alt="" width="300" height="225" /></a>
</div>
<div>
<div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Now add the hosts by right click and add host on the vmhosts-demo.com zone</p></div><br />
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-08.png"><img class="alignleft size-medium wp-image-1283" title="dns-08" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-08.png" alt="" width="300" height="225" /></a>
</div>
<div>
<div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Add the first entry</p></div><br />
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-09.png"><img class="alignleft size-medium wp-image-1283" title="dns-09" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-09.png" alt="" width="300" height="225" /><br />
</a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-09.png"></a> <a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-10.png"><img class="alignleft size-medium wp-image-1283" title="dns-10" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-10.png" alt="" width="300" height="225" /></a>
</div>
<div>
<div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Repeat the entries with the same scan name and different IP Address</p></div><br />
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-11.png"><img class="alignleft size-medium wp-image-1283" title="dns-11" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-11.png" alt="" width="300" height="225" /></a>
</div>
<div>
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-12.png"><img class="alignleft size-medium wp-image-1283" title="dns-12" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-12.png" alt="" width="300" height="225" /></a>
</div>
<div>
<div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Ensure that you have round robin enabled (for load balancing , the poor man's load balancer)</p></div></p>
<p><a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-12.png"></a> <a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-13.png"><img class="alignleft size-medium wp-image-1283" title="dns-13" src="http://www.oraclemasters.in/wp-content/uploads/2011/01/dns-13.png" alt="" width="300" height="225" /></a>
</div>
<div class="article"><a name="resolve"></a></p>
<h2>Step 2 :Setup names resolution for solaris nodes</h2>
</ul>
<p>Once you have setup the DNS entries, you can use nslookup from the a Command Window and check if the name is resolvable. The round robin enabler also ensures that the IP returned is different in the <a href="javascript:void(0)" 
title="Click to read the bio for Ramesh Menon" 
onmouseover="window.status='Click to read the bio for Ramesh Menon'; return true" 
onmouseout="window.status=''; return true" 
onclick="ddub_popup('http://www.oraclemasters.in/wp-content/themes/silveray/ddub-template.php?ddub=19', 350, 400)">sub</a>sequent nslookup.s</p>

<div class="wp_codebox"><table><tr id="p129635"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code" id="p1296code35"><pre class="language" style="font-family:monospace;">C:\Users\Administrator.HOMESERVER&amp;gt;nslookup scan-ip.vmhosts-demo.com
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
        primary name server = 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.ip6.arpa
        responsible mail addr = (root)
        serial  = 0
        refresh = 28800 (8 hours)
        retry   = 7200 (2 hours)
        expire  = 604800 (7 days)
        default TTL = 86400 (1 day)
Server:  UnKnown
Address:  ::1
&nbsp;
DNS request timed out.
    timeout was 2 seconds.
DNS request timed out.
    timeout was 2 seconds.
Name:    scan-ip.vmhosts-demo.com
Addresses:  192.168.1.224
          192.168.1.222
          192.168.1.223
&nbsp;
C:\Users\Administrator.HOMESERVER&amp;gt;nslookup scan-ip.vmhosts-demo.com
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
        primary name server = 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.
0.0.0.0.0.0.0.ip6.arpa
        responsible mail addr = (root)
        serial  = 0
        refresh = 28800 (8 hours)
        retry   = 7200 (2 hours)
        expire  = 604800 (7 days)
        default TTL = 86400 (1 day)
Server:  UnKnown
Address:  ::1
&nbsp;
DNS request timed out.
    timeout was 2 seconds.
Name:    scan-ip.vmhosts-demo.com
Addresses:  192.168.1.222
          192.168.1.223
          192.168.1.224</pre></td></tr></table></div>

<p>However, in order for the solaris nodes to resolve the scan ip, you must make the following entries on both the nodes in these files</p>
<ul>
<li>/etc/nsswitch.conf</li>
</ul>
<p>Add dns as resolution method</p>

<div class="wp_codebox"><table><tr id="p129636"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1296code36"><pre class="language" style="font-family:monospace;">hosts:      files dns&lt;/blockquote&gt;</pre></td></tr></table></div>

<ul>
<li>/etc/resolv.conf</li>
</ul>

<div class="wp_codebox"><table><tr id="p129637"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1296code37"><pre class="language" style="font-family:monospace;">domain vmhosts-demo.com
nameserver 192.168.1.2  # This is the DNS Server that will resolve your scan IP</pre></td></tr></table></div>

</div>
<div class="article"><a name="validate"></a></p>
<h2>Step 3: Validate SCAN IPs</h2>
<p> Run the nslookup command from both the nodes </p>

<div class="wp_codebox"><table><tr id="p129638"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p1296code38"><pre class="language" style="font-family:monospace;"># nslookup scan-ip.vmhosts-demo.com
Server:         192.168.1.2
Address:        192.168.1.2#53
&nbsp;
Name:   scan-ip.vmhosts-demo.com
Address: 192.168.1.222
Name:   scan-ip.vmhosts-demo.com
Address: 192.168.1.224
Name:   scan-ip.vmhosts-demo.com
Address: 192.168.1.223
#</pre></td></tr></table></div>

</div>
<div class="article"><a name="crs"></a></p>
<h2>Step 4 :Install and Configure CRS and RAC database</h2>
<p>
Once you have configured your SCAN DNS entries and names resolution for the solaris nodes, you can proceed with the installation of the CRS. You just have to mention the SCAN IP in one of the screens during the installation. The scan ip will be validated and the if all is ok, configuration will be automatic.<br />
When you run root.sh on the first node, all the 3 scan IPs are plugged on to the first node&#8217;s public interface as shown below</p>

<div class="wp_codebox"><table><tr id="p129639"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p1296code39"><pre class="language" style="font-family:monospace;"># hostname
rac11gr2-n1.vmhosts-demo.com
&nbsp;
# ifconfig -a
lo0: flags=2001000849&lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL&gt; mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.200 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:37:da:14
e1000g0:1: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.201 netmask ffffff00 broadcast 192.168.1.255
e1000g0:2: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.224 netmask ffffff00 broadcast 192.168.1.255
e1000g0:3: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.223 netmask ffffff00 broadcast 192.168.1.255
e1000g0:4: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.222 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 3
        inet 10.10.10.1 netmask ff000000 broadcast 10.255.255.255
        ether 0:c:29:37:da:1e
#</pre></td></tr></table></div>

<p> Once you run root.sh on the second node, one of the scan ip is moved to the second node </p>

<div class="wp_codebox"><table><tr id="p129640"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p1296code40"><pre class="language" style="font-family:monospace;"># hostname
rac11gr2-n1.vmhosts-demo.com
# ifconfig -a
lo0: flags=2001000849&lt;UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL&gt; mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.200 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:37:da:14
e1000g0:1: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.201 netmask ffffff00 broadcast 192.168.1.255
e1000g0:3: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.223 netmask ffffff00 broadcast 192.168.1.255
e1000g0:4: flags=1040843&lt;UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4&gt; mtu 1500 index 2
        inet 192.168.1.222 netmask ffffff00 broadcast 192.168.1.255
e1000g1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 3
        inet 10.10.10.1 netmask ff000000 broadcast 10.255.255.255
        ether 0:c:29:37:da:1e</pre></td></tr></table></div>

<div>
<div class="wp-caption alignleft" style="width: 460px"><p class="wp-caption-text">Since we are using DNS, de select GNS</p></div><br />
<a href="http://www.oraclemasters.in/wp-content/uploads/2011/01/ogi04.png"><img src="http://www.oraclemasters.in/wp-content/uploads/2011/01/ogi04-300x225.png" alt="" title="ogi04" width="300" height="225" class="alignleft size-medium wp-image-1309" /></a>
</div>
</div>
<div class="article"><a name="test"></a></p>
<h2>Step 5 :Test SCAN using client connection</h2>
<p>This test uses a 11gR2 client. We will discuss pre 11gR2 clients later. You need to make an entry in the tnsnames.ora of the client</p>
<p>Let us see what are the settings on the server, with respect to services and listeners</p>
<ol>
<li>LOCAL AND REMOTE LISTENER SETTINGS</li>
<p><strong>Node 1</strong></p>

<div class="wp_codebox"><table><tr id="p129641"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p1296code41"><pre class="language" style="font-family:monospace;">SQL&gt; show parameter _listener
&nbsp;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD
                                                 DRESS=(PROTOCOL=TCP)(HOST=rac1
                                                 1gr2-n1-vip.vmhosts-demo.com)(
                                                 PORT=1521))))
remote_listener                      string      scan-ip.vmhosts-demo.com:1521</pre></td></tr></table></div>

<p><strong>Node 2</strong></p>

<div class="wp_codebox"><table><tr id="p129642"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p1296code42"><pre class="language" style="font-family:monospace;">SQL&gt; show parameter _listener
&nbsp;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD
                                                 DRESS=(PROTOCOL=TCP)(HOST=rac1
                                                 1gr2-n2-vip.vmhosts-demo.com)(
                                                 PORT=1521))))
remote_listener                      string      scan-ip.vmhosts-demo.com:1521</pre></td></tr></table></div>

<li>Status of local listeners</li>
<p><strong>Node 1</strong></p>

<div class="wp_codebox"><table><tr id="p129643"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code" id="p1296code43"><pre class="language" style="font-family:monospace;">$ lsnrctl status
&nbsp;
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 10-JAN-2011 16:15:56
&nbsp;
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
&nbsp;
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                10-JAN-2011 10:47:50
Uptime                    0 days 5 hr. 28 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/app/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /crs/oracle/product/app/diag/tnslsnr/rac11gr2-n1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.201)(PORT=1521)))
Services Summary...
Service &quot;+ASM&quot; has 1 instance(s).
  Instance &quot;+ASM1&quot;, status READY, has 1 handler(s) for this service...
Service &quot;PROD.vmhosts-demo.com&quot; has 1 instance(s).
  Instance &quot;PROD1&quot;, status READY, has 1 handler(s) for this service...
Service &quot;PRODXDB.vmhosts-demo.com&quot; has 1 instance(s).
  Instance &quot;PROD1&quot;, status READY, has 0 handler(s) for this service...
The command completed successfully
$</pre></td></tr></table></div>

<p><strong>Node 2</strong></p>

<div class="wp_codebox"><table><tr id="p129644"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code" id="p1296code44"><pre class="language" style="font-family:monospace;">$ lsnrctl status
&nbsp;
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 10-JAN-2011 16:15:19
&nbsp;
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
&nbsp;
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                10-JAN-2011 10:51:14
Uptime                    0 days 5 hr. 24 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/app/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /crs/oracle/product/app/diag/tnslsnr/rac11gr2-n2/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.202)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.203)(PORT=1521)))
Services Summary...
Service &quot;+ASM&quot; has 1 instance(s).
  Instance &quot;+ASM2&quot;, status READY, has 1 handler(s) for this service...
Service &quot;PROD.vmhosts-demo.com&quot; has 1 instance(s).
  Instance &quot;PROD2&quot;, status READY, has 1 handler(s) for this service...
Service &quot;PRODXDB.vmhosts-demo.com&quot; has 1 instance(s).
  Instance &quot;PROD2&quot;, status READY, has 0 handler(s) for this service...
The command completed successfully
$</pre></td></tr></table></div>

<li> Configuration of SCAN Listeners </li>

<div class="wp_codebox"><table><tr id="p129645"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p1296code45"><pre class="language" style="font-family:monospace;">$ srvctl config scan
SCAN name: scan-ip.vmhosts-demo.com, Network: 1/192.168.1.0/255.255.255.0/e1000g0
SCAN VIP name: scan1, IP: /192.168.1.224/192.168.1.224
SCAN VIP name: scan2, IP: /192.168.1.223/192.168.1.223
SCAN VIP name: scan3, IP: export ORACLE_HOME=/crs/oracle/product/11.2.0/grid/192.168.1.222/192.168.1.222
&nbsp;
$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac11gr2-n2
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac11gr2-n1
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac11gr2-n1</pre></td></tr></table></div>

<li> Check status of SCAN Listeners
<p> To do this set the ORACLE_HOME and GRID_HOME as follows<br />
export ORACLE_HOME=/crs/oracle/product/11.2.0/grid (Location of the grid home)<br />
export GRID_HOME=$ORACLE_HOME</p>
<p>On Node 1</p>

<div class="wp_codebox"><table><tr id="p129646"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p1296code46"><pre class="language" style="font-family:monospace;"> $ lsnrctl status LISTENER_SCAN1
&nbsp;
 LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 10-JAN-2011 16:20:20
&nbsp;
 Copyright (c) 1991, 2009, Oracle.  All rights reserved.
&nbsp;
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
 TNS-12541: TNS:no listener
  TNS-12560: TNS:protocol adapter error
   TNS-00511: No listener
    Solaris Error: 2: No such file or directory</pre></td></tr></table></div>

<p>You got the above error because the SCAN1 listener is running on Node 2 </p>
<p>Ensure that you get result for all the SCAN listeners on nodes where they are running<br />
Now on Node 1</p>

<div class="wp_codebox"><table><tr id="p129647"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code" id="p1296code47"><pre class="language" style="font-family:monospace;">$ lsnrctl status LISTENER_SCAN2
&nbsp;
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 10-JAN-2011 16:20:51
&nbsp;
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
&nbsp;
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                10-JAN-2011 10:47:51
Uptime                    0 days 5 hr. 33 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /crs/oracle/product/11.2.0/grid/network/admin/listener.ora
Listener Log File         /crs/oracle/product/11.2.0/grid/log/diag/tnslsnr/rac11gr2-n1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.223)(PORT=1521)))
Services Summary...
Service &quot;PROD.vmhosts-demo.com&quot; has 2 instance(s).
  Instance &quot;PROD1&quot;, status READY, has 1 handler(s) for this service...
  Instance &quot;PROD2&quot;, status READY, has 1 handler(s) for this service...
Service &quot;PRODXDB.vmhosts-demo.com&quot; has 2 instance(s).
  Instance &quot;PROD1&quot;, status READY, has 0 handler(s) for this service...
  Instance &quot;PROD2&quot;, status READY, has 0 handler(s) for this service...
The command completed successfully</pre></td></tr></table></div>

</ol>
<p>Now that all the entries are working fine, Let us make an entry in tnsnames.ora of the client machine. This entry is specific to 11GR2 release.</p>

<div class="wp_codebox"><table><tr id="p129648"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p1296code48"><pre class="language" style="font-family:monospace;">PROD =
  (DESCRIPTION =
    (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST=scan-ip.vmhosts-demo.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD.vmhosts-demo.com)
    )
  )</pre></td></tr></table></div>

<p>Finally, you can make a connection from the client using SCAN. However, if you hit a bug where you get ORA-12502, ORA-12564, this is because you<br />
cannot resolve the VIP address from the client. This can be resolved by either adding the ip address and hostname in the client&#8217;s /ect/hosts file or by<br />
hardcoding the LOCAL_LISTENER with the VIP IP Address in the cluster database spfile for both nodes.
</p>

<div class="wp_codebox"><table><tr id="p129649"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code" id="p1296code49"><pre class="language" style="font-family:monospace;">$  sqlplus &quot;system/oracle@prod&quot;
&nbsp;
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 10 16:07:53 2011
&nbsp;
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
&nbsp;
SQL&gt; select instance_name from v$instance;
&nbsp;
INSTANCE_NAME
----------------
PROD1
&nbsp;
SQL&gt; exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options</pre></td></tr></table></div>

<p>Connecting again&#8230;it now goes to a different instance (load balancing is working)</p>

<div class="wp_codebox"><table><tr id="p129650"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p1296code50"><pre class="language" style="font-family:monospace;">$  sqlplus &quot;system/oracle@prod&quot;
&nbsp;
&nbsp;
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 10 16:08:13 2011
&nbsp;
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
&nbsp;
&nbsp;
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
&nbsp;
SQL&gt; select instance_name from v$instance;
&nbsp;
INSTANCE_NAME
----------------
PROD2
&nbsp;
SQL&gt; exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options</pre></td></tr></table></div>

</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1296</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Repair Corrupt Oracle Installation</title>
		<link>http://www.oraclemasters.in/?p=1277</link>
		<comments>http://www.oraclemasters.in/?p=1277#comments</comments>
		<pubDate>Thu, 18 Nov 2010 16:36:28 +0000</pubDate>
		<dc:creator>tdomf_2a078</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Backup/Recovery FAQs]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1277</guid>
		<description><![CDATA[Good Day Oracle Masters, Hope u are well. I have some problem with my Oracle Installation, we had a virus called Sality and I think it might have affected some of my Oracle system files. After we installed Karspersky AntiVirus 6.0.4, I now can&#8217;t launch any of the Oracle Tools, like Enterprise Manager Console, Net [...]]]></description>
			<content:encoded><![CDATA[<p>Good Day Oracle Masters,</p>
<p>Hope u are well.</p>
<p>I have some problem with my Oracle Installation, we had a virus called Sality and I think it might have<br />
affected some of my Oracle system files. After we installed Karspersky AntiVirus 6.0.4,<br />
I now can&#8217;t launch any of the Oracle Tools, like Enterprise Manager Console, Net Service Configuration, SQLPlus etc.</p>
<p>But surprisingly when I check the Oracle Services, they are started, but I am unable to access the DB via SQLPLUS nor EM Console, nor can<br />
I reconfigure the TNS.<br />
So am wondering what to do next, could you possibly know of a way I can fix this kind of a problem?<br />
My Data files .i.e .DBF files are fortunately on a separate drive (D:), but I wonder if there<br />
is a way I can recover the affected Oracle system files and then restore the data.</p>
<p>Please guide me on how to go about this issue.</p>
<p>thanks&#038;regards,</p>
<p>NB:<br />
When you insert the Oracle 10g R2 CD, is there an option to Repair?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1277</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle 11g : Real Time Query/Active Dataguard</title>
		<link>http://www.oraclemasters.in/?p=1265</link>
		<comments>http://www.oraclemasters.in/?p=1265#comments</comments>
		<pubDate>Sat, 11 Sep 2010 14:28:32 +0000</pubDate>
		<dc:creator>Ramesh Menon</dc:creator>
				<category><![CDATA[HA - RAC, Dataguard]]></category>

		<guid isPermaLink="false">http://www.oraclemasters.in/?p=1265</guid>
		<description><![CDATA[With Oracle 11g, you can use physical standby database while your it is open in read only mode. Hence, the users can get real time data, which is almost as of production time. This feature is called Active Dataguard or Real Time Query. This feature is part of the Oracle Enterprise edition and requires separate [...]]]></description>
			<content:encoded><![CDATA[<div class="article">
<p>
With Oracle 11g, you can use physical standby database while your it is open in read only mode. Hence, the users can get real time data, which is almost as of production time. This feature is called Active Dataguard or Real Time Query. </p>
<p>This feature is part of the Oracle Enterprise edition and requires separate license for use.<br />
<span id="more-1265"></span><br />
Usage of this feature is pretty simple and straight forward. All you need to do is :
</p>
<ol>
<li> <a href="#sblogs">Create standby redo logfiles on the physical standby for real time apply </a></li>
<li> <a href="#stoprecovery">Take out the standby from recovery mode</a></li>
<li> <a href="#openstandby">Open standby database in read only mode</a></li>
<li> <a href="#dorecovery">Start real time apply recovery on the physical standby</a></li>
<li> <a href="#test">Test the setup</a></li>
</ol>
<p><a name="sblogs"></a></p>
<h2>Create standby redo logfiles for the standby database</h2>

<div class="wp_codebox"><table><tr id="p126557"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p1265code57"><pre class="language" style="font-family:monospace;">SQL&gt; alter database add standby logfile '/oradata11g/PROD11R2/data01/srl01.log' size 100M;
&nbsp;
Database altered.
&nbsp;
SQL&gt; alter database add standby logfile '/oradata11g/PROD11R2/data01/srl02.log' size 100M;
&nbsp;
Database altered.
&nbsp;
SQL&gt;</pre></td></tr></table></div>

<p><a name="stoprecovery"></a></p>
<h2>Stop recovery on the physical standby database</h2>

<div class="wp_codebox"><table><tr id="p126558"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1265code58"><pre class="language" style="font-family:monospace;">SQL&gt; recover managed standby database CANCEL;
Media recovery complete.
SQL&gt;</pre></td></tr></table></div>

<p><a name="openstandby"></a></p>
<h2>Open physical standby database in read only mode</h2>

<div class="wp_codebox"><table><tr id="p126559"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p1265code59"><pre class="language" style="font-family:monospace;">SQL&gt; alter database open;
&nbsp;
Database altered.
&nbsp;
SQL&gt; select name, open_mode, controlfile_type from v$database;
&nbsp;
NAME      OPEN_MODE            CONTROL
--------- -------------------- -------
PROD11R2  READ ONLY            STANDBY
&nbsp;
SQL&gt;</pre></td></tr></table></div>

<p><a name="dorecovery"></a></p>
<h2>Start real time apply recovery on physical standby</h2>

<div class="wp_codebox"><table><tr id="p126560"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1265code60"><pre class="language" style="font-family:monospace;">SQL&gt; recover managed standby database using current logfile disconnect;
Media recovery complete.
SQL&gt;</pre></td></tr></table></div>

<p><a name="test"></a></p>
<h2>Test the setup </h2>
<p><strong> On the PRIMARY database.</strong></p>

<div class="wp_codebox"><table><tr id="p126561"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p1265code61"><pre class="language" style="font-family:monospace;">SQL&gt; conn scott/tiger
Connected.
SQL&gt; select ename, empno, sal from emp
  2  where empno = 7934;
&nbsp;
ENAME           EMPNO        SAL
---------- ---------- ----------
MILLER           7934       1300
&nbsp;
SQL&gt; update EMP
  2  set sal = sal * 1.25
  3  where  empno = 7934;
&nbsp;
1 row updated.
&nbsp;
SQL&gt; commit;
&nbsp;
Commit complete.
&nbsp;
SQL&gt;  select ename, empno, sal from emp
 where empno = 7934;  2
&nbsp;
ENAME           EMPNO        SAL
---------- ---------- ----------
MILLER           7934       1625
&nbsp;
SQL&gt;</pre></td></tr></table></div>

<p><strong> On the STANDBY database</strong></p>

<div class="wp_codebox"><table><tr id="p126562"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p1265code62"><pre class="language" style="font-family:monospace;">SQL&gt; select * from emp
  2  where empno = 7934;
&nbsp;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7934 MILLER     CLERK           7782 23-JAN-82       1625
        10
&nbsp;
&nbsp;
SQL&gt;</pre></td></tr></table></div>

<p>
As you can see, the data has been replicated to the standby database even when it is opened in READ ONLY mode. This is very useful when you want to run queries on standby with real time data of production.
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclemasters.in/?feed=rss2&#038;p=1265</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

