📄 asm_10g2.mht
字号:
From: <Saved by Microsoft Internet Explorer 5>
Subject: ORACLE - DBA Tips Corner
Date: Mon, 30 Mar 2009 14:27:13 +0530
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_0000_01C9B143.9E67D5A0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
This is a multi-part message in MIME format.
------=_NextPart_000_0000_01C9B143.9E67D5A0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Storage_Management/ASM_45.shtml
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--=0A=
iDevelopment_DOCUMENT_TITLE=3DConnecting to ASM through the TNS Listener =
from a Client Desktop=0A=
--><HTML><HEAD><TITLE>ORACLE - DBA Tips Corner</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<STYLE>A.noLink {
TEXT-DECORATION: none
}
A.noLinkYellow {
COLOR: yellow; TEXT-DECORATION: none
}
A.noLinkBlue {
COLOR: blue; TEXT-DECORATION: none
}
A.noLinkOrange {
COLOR: orange; TEXT-DECORATION: none
}
A.noLinkCyan {
COLOR: cyan; TEXT-DECORATION: none
}
A.noLinkGreen {
TEXT-DECORATION: none
}
A.noLinkRed {
COLOR: red; TEXT-DECORATION: none
}
</STYLE>
<META content=3D"MSHTML 6.00.2900.5726" name=3DGENERATOR></HEAD>
<BODY vLink=3D#0000ff aLink=3D#0000ff link=3D#0000ff =
bgColor=3D#ffffff><!--=0A=
| **********************************************************=0A=
| HEADER CODE - (BEGIN)=0A=
| **********************************************************=0A=
+-->
<TABLE width=3D"100%" border=3D0>
<TBODY>
<TR>
<TD><IMG =
src=3D"http://www.idevelopment.info/gifs/header_oracle.gif">=20
<P><U><B>Oracle DBA Tips Corner</B></U>=20
<P><A class=3DnoLinkBlue=20
onmouseover=3D"window.parent.status=3D'Return to Home Page'; =
return true;"=20
href=3D"http://www.idevelopment.info/" target=3D_top><IMG=20
src=3D"http://www.idevelopment.info/gifs/home_button.gif" =
border=3Dno></A>=20
<A class=3DnoLinkBlue=20
onmouseover=3D"window.parent.status=3D'Return to Oracle DBA Tips =
Corner'; return true;"=20
href=3D"javascript:window.history.back()"><IMG=20
src=3D"http://www.idevelopment.info/gifs/back_button.gif" =
border=3Dno></A>=20
Return to the Oracle DBA Tips Corner. </P></TD>
<TD align=3Dright>
<SCRIPT type=3Dtext/javascript><!--=0A=
google_ad_client =3D "pub-7890769181671129";=0A=
google_ad_width =3D 125;=0A=
google_ad_height =3D 125;=0A=
google_ad_format =3D "125x125_as";=0A=
google_ad_type =3D "text";=0A=
google_ad_channel =3D"4978044779";=0A=
google_page_url =3D document.location;=0A=
google_color_border =3D "336699";=0A=
google_color_bg =3D "FFFFFF";=0A=
google_color_link =3D "0000FF";=0A=
google_color_url =3D "008000";=0A=
google_color_text =3D "000000";=0A=
//--></SCRIPT>
<SCRIPT =
src=3D"http://pagead2.googlesyndication.com/pagead/show_ads.js"=20
type=3Dtext/javascript>=0A=
</SCRIPT>
</TD></TR></TBODY></TABLE><!--=0A=
| **********************************************************=0A=
| HEADER CODE - (END)=0A=
| **********************************************************=0A=
+-->
<P>
<HR noShade SIZE=3D3>
<P><FONT color=3D#000080 size=3D5>Connecting to ASM through the TNS =
Listener from a=20
Client Desktop</FONT>=20
<P><I>by Jeff Hunter, Sr. Database Administrator</I>=20
<P>
<HR align=3Dleft width=3D280>
<!--=0A=
| *****************************************=0A=
| CONTENTS=0A=
| *****************************************=0A=
+-->
<P><FONT color=3D#000099><B><U>Contents</U></B></FONT>=20
<P>
<OL><B>
<LI><A class=3DnoLinkBlue=20
=
href=3D"http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Stora=
ge_Management/ASM_45.shtml#Overview">Overview</A></B>=20
<B>
<LI><A class=3DnoLinkBlue=20
=
href=3D"http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Stora=
ge_Management/ASM_45.shtml#Modify the listener.ora for the ASM =
Instances">Modify=20
the listener.ora for the ASM Instances</A></B> <B>
<LI><A class=3DnoLinkBlue=20
=
href=3D"http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Stora=
ge_Management/ASM_45.shtml#Add ASM Entries to the tnsnames.ora File on =
the Client Machine">Add=20
ASM Entries to the tnsnames.ora File on the Client Machine</A></B> <B>
<LI><A class=3DnoLinkBlue=20
=
href=3D"http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Stora=
ge_Management/ASM_45.shtml#Bounce the TNS Listener">Bounce=20
the TNS Listener</A></B> <B>
<LI><A class=3DnoLinkBlue=20
=
href=3D"http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Stora=
ge_Management/ASM_45.shtml#Test Access to ASM from the Client =
Machine">Test=20
Access to ASM from the Client Machine</A></B> </LI></OL>
<P><BR>
<HR>
<P><!--=0A=
| **********************************************************=0A=
| OVERVIEW=0A=
| **********************************************************=0A=
+--><A=20
name=3DOverview><U><B><FONT color=3D#000099>Overview</FONT></B></U>=20
<BLOCKQUOTE>By default, the Oracle Database Configuration Assistant =
(DBCA)=20
does not configure the TNS listener to accept client requests to an =
ASM=20
instance running from a different node. Access will be denied for =
clients like=20
SQL*Plus, Perl DBI:DBD, and JDBC when attempting to connect to an ASM =
instance=20
from a node other than the node running the ASM instance. When the =
service is=20
created for an ASM instance, its status is BLOCKED: =
<PRE>[oracle@linux1 ~]$ <B>lsnrctl status LISTENER_LINUX1 | grep ASM</B>
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status <B><FONT color=3D#ff0000>BLOCKED</FONT></B>, =
has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
Instance "+ASM1", status <B><FONT color=3D#ff0000>BLOCKED</FONT></B>, =
has 1 handler(s) for this service...</PRE>This=20
limitation puts restrictions on scripts and other client tools that =
want to=20
monitor and manage an ASM instance from a different node. Getting =
around this=20
restriction however is an easy task that involves manually creating a =
service=20
name for the ASM instance.=20
<P>This article presents the steps required to access an ASM instance =
through=20
the TNS listener from a client desktop. The database used in this =
article is a=20
two-node Oracle RAC 10<I>g</I> clustered database where in fact there =
will two=20
ASM instances (one ASM instance for each Oracle instance in the =
cluster). The=20
database version is Oracle 10<I>g</I> Release 2 (10.2.0.3.0) running =
on CentOS=20
4.5 (or RHEL 4.5):=20
<P>
<TABLE cellSpacing=3D1 cellPadding=3D2 width=3D550 border=3D1>
<TBODY>
<TR>
<TD align=3Dmiddle bgColor=3D#1d5387 colSpan=3D2><FONT =
face=3Darial=20
color=3D#ffffff>Node 1</FONT> </TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>Machine=20
Name:</SMALL></B></TD>
<TD noWrap =
width=3D"75%"><SMALL>linux1.idevelopment.info</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>Oracle=20
SID:</SMALL></B></TD>
<TD noWrap width=3D"75%"><SMALL>orcl1</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>ASM =
SID:</SMALL></B></TD>
<TD noWrap width=3D"75%"><SMALL>+ASM1</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>ASM Global DB =
Name=20
(service name):</SMALL></B></TD>
<TD noWrap width=3D"75%"><SMALL>+ASM</SMALL></TD></TR>
<TR>
<TD align=3Dmiddle bgColor=3D#1d5387 colSpan=3D2><FONT =
face=3Darial=20
color=3D#ffffff>Node 2</FONT> </TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>Machine=20
Name:</SMALL></B></TD>
<TD noWrap =
width=3D"75%"><SMALL>linux2.idevelopment.info</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>Oracle=20
SID:</SMALL></B></TD>
<TD noWrap width=3D"75%"><SMALL>orcl2</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>ASM =
SID:</SMALL></B></TD>
<TD noWrap width=3D"75%"><SMALL>+ASM2</SMALL></TD></TR>
<TR>
<TD noWrap width=3D"25%" bgColor=3D#e0e0e0><B><SMALL>ASM Global DB =
Name=20
(service name):</SMALL></B></TD>
<TD noWrap=20
width=3D"75%"><SMALL>+ASM</SMALL></TD></TR></TBODY></TABLE></P></BLOCKQUO=
TE>
<P><BR>
<HR>
<P><!--=0A=
| **********************************************************=0A=
| MODIFY THE LISTENER.ORA FOR THE ASM INSTANCES=0A=
| **********************************************************=0A=
+--><A=20
name=3D"Modify the listener.ora for the ASM Instances"><U><B><FONT=20
color=3D#000099>Modify the listener.ora for the ASM =
Instances</FONT></B></U>=20
<BLOCKQUOTE>The first step is to modify the <TT>listener.ora</TT> file =
for the=20
ORACLE_HOME running ASM on all nodes in the RAC cluster by adding a =
new=20
service:=20
<P>
<TABLE cellSpacing=3D1 cellPadding=3D2 width=3D550 border=3D1>
<TBODY>
<TR>
<TD align=3Dmiddle bgColor=3D#1d5387><FONT face=3Darial =
color=3D#ffffff>Node 1 -=20
(listener.ora)</FONT> </TD></TR>
<TR>
<TD noWrap bgColor=3D#e0e0e0><PRE>LISTENER_LINUX1 =3D
(DESCRIPTION_LIST =3D
(DESCRIPTION =3D
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D linux1-vip)(PORT =3D =
1521)(IP =3D FIRST))
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D 192.168.1.100)(PORT =3D =
1521)(IP =3D FIRST))
)
)
SID_LIST_LISTENER_LINUX1 =3D
(SID_LIST =3D
(SID_DESC =3D
(SID_NAME =3D PLSExtProc)
(ORACLE_HOME =3D /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM =3D extproc)
)
<B><FONT color=3D#0000ff>(SID_DESC =3D
(GLOBAL_DBNAME =3D +ASM)
(SID_NAME =3D +ASM1)
(ORACLE_HOME =3D /u01/app/oracle/product/10.2.0/db_1)
)</FONT></B>
)</PRE></TD></TR>
<TR>
<TD align=3Dmiddle bgColor=3D#1d5387 colSpan=3D2><FONT =
face=3Darial=20
color=3D#ffffff>Node 2 - (listener.ora) </FONT></TD></TR>
<TR>
<TD noWrap bgColor=3D#e0e0e0><PRE>LISTENER_LINUX2 =3D
(DESCRIPTION_LIST =3D
(DESCRIPTION =3D
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D linux2-vip)(PORT =3D =
1521)(IP =3D FIRST))
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D 192.168.1.101)(PORT =3D =
1521)(IP =3D FIRST))
)
)
SID_LIST_LISTENER_LINUX2 =3D
(SID_LIST =3D
(SID_DESC =3D
(SID_NAME =3D PLSExtProc)
(ORACLE_HOME =3D /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM =3D extproc)
)
<B><FONT color=3D#0000ff>(SID_DESC =3D
(GLOBAL_DBNAME =3D +ASM)
(SID_NAME =3D +ASM2)
(ORACLE_HOME =3D /u01/app/oracle/product/10.2.0/db_1)
)</FONT></B>
)</PRE></TD></TR></TBODY></TABLE></P></BLOCKQUOTE>
<P><BR>
<HR>
<P><!--=0A=
| **********************************************************=0A=
| ADD ASM ENTRIES TO THE TNSNAMES.ORA FILE ON THE CLIENT MACHINE=0A=
| **********************************************************=0A=
+--><A=20
name=3D"Add ASM Entries to the tnsnames.ora File on the Client =
Machine"><U><B><FONT=20
color=3D#000099>Add ASM Entries to the tnsnames.ora File on the Client=20
Machine</FONT></B></U>=20
<BLOCKQUOTE>The next step is to add ASM entries to the =
<TT>tnsnames.ora</TT>=20
file on the client machine that will be connecting to the ASM =
instance(s). The=20
client machine in this example is named=20
<TT><B>alex.idevelopment.info</B></TT>. A separate tnsnames entry will =
be=20
created for each ASM instance in the two-node RAC. The two tnsnames =
entries=20
for this example are named <TT><B><FONT=20
color=3D#0000ff>ORCL1_ASM1</FONT></B></TT> and <TT><B><FONT=20
color=3D#0000ff>ORCL2_ASM2</FONT></B></TT>:=20
<P>
<TABLE cellSpacing=3D1 cellPadding=3D2 width=3D550 border=3D1>
<TBODY>
<TR>
<TD align=3Dmiddle bgColor=3D#1d5387><FONT face=3Darial =
color=3D#ffffff>Client=20
Node - (tnsnames.ora)</FONT> </TD></TR>
<TR>
<TD noWrap bgColor=3D#e0e0e0><PRE>ORCL =3D
(DESCRIPTION =3D
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D linux1-vip)(PORT =3D 1521))
(ADDRESS =3D (PROTOCOL =3D TCP)(HOST =3D linux2-vip)(PORT =3D 1521))
(LOAD_BALANCE =3D yes)
(CONNECT_DATA =3D
(SERVER =3D DEDICATED)
(SERVICE_NAME =3D orcl.idevelopment.info)
)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -