远程客户端 访问 ASM 实例
来源:互联网 发布:c语言double什么意思 编辑:程序博客网 时间:2024/04/28 15:34
我们可以直接在服务器器上访问ASM 实例,只需要指定ASM 实例名,在用sqlplus连接就可以了。 如果我们想从远程的客户端访问ASM 实例,可以参考如下的配置方法。
一.官网的配置说明
This solution cannot be accomplished using Network Manager (GUI)
The solution is to
* Edit the listener.ora on ASM server
* Edit the tnsnames.ora on the client
* Setup your remote login password for your ASM instance on the ASM server
* Set your SYS password using ORAPWD for the ASM instance
* Use the properly formatted connect string to connect with your tool
1) Edit the listener.ora on ASM server
a) Logon to the ASM/Database server
b) Locate your listener.ora (typically located in the $ORACLE_HOME/network/admin)
c) Add a SID_LIST_LISTENER entry for your ASM instance (see example below)
EXAMPLE
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = +ASM)
(ORACLE_HOME = c:/oracle/app/product/11.1.0/db_1)
)
)
d) Stop the listener
lsnrctl stop
e) restart the listener
lsnrctl start
2) Edit the tnsnames.ora on the client
a) Logon to the client machine that will be used to connect to the ASM instance
NOTE: the client machine can also be the ASM/Database server (ie for DBCONTROL)
b) Locate your tnsnames.ora (typically in the $ORACLE_HOME/network/admin)
c) Add an entry (tnsalias) for your ASM instance (see example)
EXAMPLE
ASM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = kbcook-1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID_NAME = +ASM)
(UR=A)
)
)
3) Setup your remote login password for your ASM instance on the ASM server
a) Logon to the ASM/Database server
b) Locate the parameter file for your ASM instance (typically $ORACLE_HOME/dbs/init+ASM.ora [unix] or $ORACLE_HOME/dbs/init+ASM.ora [windows] )
c) Edit the parameter file and add
remote_login_passwordfile = exclusive ... for stand alone ASM setups
remote_login_passwordfile = shared ... for ASM setups that also use Real Application Cluster (RAC)
d) Save the file
NOTE: It may be required that an PFILE be created from an SPFILE in order to be able to edit the file properly ... once the line have been added ... the process can be reversed
For more details Note 249664.1 Pfile vs SPfile ... may be used
4) Set your SYS password using ORAPWD for the ASM instance
a) Logon to the ASM/Database server
b) Locate your orapw<sid> file for your ASM instance (typically $ORACLE_HOME/dbs/orapw+ASM)
c) Rename the file to orapw<sid>.old
d) Run orapwd to reset the password (see example below)
EXAMPLE
mv "orapw+ASM" "orapw+ASM.old"
orapwd file=orapw+ASM password=kbcook
5) Use the properly formatted connect string for your tool
Connnect to the ASM instance using the password (#4 above) and the tnsalias (#2 above)
EXAMPLES
C:/oracle/app/product/11.1.0/db_1/BIN/SQLPLUS.EXE "sys/kbcook@asm as sysdba"
<OR>
sqlplus "sys/kbcook@asm as sysdba"
<OR>
sqlplus "sys@asm as sysdba" ... then supply the password when prompted
二. 测试
这里我们已连接ASM 实例1为例,所以只修改这个节点上的ASM 相关配置参数。 如果要配置2个节点,就修改2个节点的LISTENER.ORA文件。 内容一样。 然后在客户端监听tnsnames.ora 文件里修改IP地址就可以了。
2.1 服务器配置
在目录$ORACLE_HOME/network/admin下,修改ASM实例的LISTENER.ORA文件,添加红色部分,然后重启监听。
SID_LIST_LISTENER_RAC1 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = +ASM) -- ASM 实例名是+ASM1和+ASM2。 但这里与ASM 实例的service_names 参数一致
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
)
)
重启监听:
[oracle@rac1 admin]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-SEP-2010 00:03:08
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
[oracle@rac1 admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-SEP-2010 00:03:18
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 23-SEP-2010 00:03:18
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@rac1 admin]$
2.2 修改客户端的$ORACLE_HOME/network/admin/tnsname.ora 文件
ASM1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = +ASM) -- 注意这里写的是ASM, 而不是ASM1
(UR=A) -- 这个必须加,不然连不上
)
)
2.3 测试一下:
C:/Users/Administrator.DavidDai>tnsping ASM
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 23-9月 -2010 11:28:48
Copyright (c) 1997, 2010, Oracle. All rights reserved.
已使用的参数文件:
D:/app/Administrator/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = +ASM) (UR=A)))
OK (0 毫秒)
2.4 客户端用sqlplus 连接
SQL> conn sys/oracle@ASM as sysdba;
已连接。
SQL> select Instance_name from v$instance;
INSTANCE_NAME
--------------------------------
+ASM1
SQL> show parameter service_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string +ASM
小结:
通过上面实验,我们发现操作和官网的步骤有出入。 所有文档都是供参考的,具体的情况要具体对待。 只有通过做实验,才能掌握这些知识。 这也是我一直说,学Oracle 就必须多做实验。 没有其他方法。 书上那些东西,也不一定完全正确。 我们学习的过程,就是用实验去证明那些理论。
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
网上资源: http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(满); DBA2 群:62697977(满)
DBA3 群:63306533; 聊天 群:40132017
--加群需要在备注说明SGA的组成部分,否则拒绝申请
- 远程客户端 访问 ASM 实例
- 远程客户端 访问 ASM 实例
- 配置客户端连接到ASM实例
- Impala客户端访问实例
- java rmi远程访问实例
- 使用图形客户端远程访问Linux服务器
- 配置客户端,访问远程Oracle服务器
- 远程客户端跨JVM访问EJB
- 使用图形客户端远程访问Linux服务器
- pgAdmin设置允许客户端远程访问
- Linux客户端远程访问windows服务器
- 西电捷通TISec远程访问技术应用实例
- (简单实例)如何从客户端访问WebService
- android客户端访问服务器登录实例
- ASM三 管理ASM实例
- 【翻译自mos文章】使用asmcmd命令在本地和远程 asm 实例之间 拷贝asm file的方法
- 第13章 远程过程访问的客户端整合
- ubuntu下openssl客户端通过代理服务器访问远程主机
- 运行时异常和非运行时异常的区别?
- 位计数(二进制中1的个数)--读Hacker's Delight
- 虚函数的实现方式
- 一种高效的基于线性四叉树编码的多级网格索引
- 感悟
- 远程客户端 访问 ASM 实例
- 租房协议样本
- 拒绝浮躁(copy来的)
- mount/umount命令详解
- MsgWaitForMultipleObjects用法
- C++ cin与cout
- 真不服气,下载东西还要我积分
- (转)无锁编程:Lock-Free Data Structures
- 配置Paoding分词时出现的错误:java.lang.AbstractMethodError: org.apache.lucene.analysis.TokenStream.incrementToken()