ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 关于10g RAC监听设置,tnsnames.ora设置,VIP及客户端配置问题。

关于10g RAC监听设置,tnsnames.ora设置,VIP及客户端配置问题。

原创 Linux操作系统 作者:tolywang 时间:2007-12-13 11:35:07 0 删除 编辑

[float=left][float=left]按照文档安装完成,但是lsnrctl status 没有发现节点2

gnd-rac01$lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 13-DEC-2007 11:29:16

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

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                13-DEC-2007 11:00:20
Uptime                    0 days 0 hr. 28 min. 55 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/product/oracle/network/admin/listener.ora
Listener Log File         /u01/product/oracle/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gnd-rac01)(PORT=1521)))
Services Summary...
Service "tpc" has 1 instance(s).
  Instance "tpc1", status READY, has 2 handler(s) for this service...
Service "tpcXDB" has 1 instance(s).
  Instance "tpc1", status READY, has 1 handler(s) for this service...
Service "tpc_XPT" has 1 instance(s).
  Instance "tpc1", status READY, has 2 handler(s) for this service...
The command completed successfully



----------------------------------------------------------------------------------------------------   



SQL> show parameter  listener        

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string
remote_listener                   string      LISTENERS_TPC
SQL>




---------------------------------------------------------------------------------------------------------------   


gnd-rac01$cat hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
# 127.0.0.1     gnd-rac01

127.0.0.1               localhost.localdomain    localhost

172.20.1.19     gnd-rac01
10.1.0.1           gnd-pri01
172.20.1.29     gnd-vip01

172.20.1.18     gnd-rac02
10.1.0.2           gnd-pri02
172.20.1.28     gnd-vip02


---------------------------------------------------------------------------------------------------------------   


监听默认设置:    (这里的10.155.4.95是另外一个public nic , 在安装crs的时候do not use )

gnd-rac01$cat listener.ora
# listener.ora.gnd-rac01 Network Configuration File: /u01/product/oracle/network/admin/listener.ora.gnd-rac01
# Generated by Oracle configuration tools.

LISTENER_GND-RAC01 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521)(IP = FIRST))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521)(IP = FIRST))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
    )
  )




---------------------------------------------------------------------------------------------------------------   



tnsnames.ora 设置:


gnd-rac01$cat    tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/product/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

TPC2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc2)
    )
  )

TPC1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc1)
    )
  )

TPC =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = tpc)
    )
  )

LISTENERS_TPC =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
  )




--------------------------------------------------------------------------------------------------------------------------------  




这样的默认设置需要如何更改 ?  

在DBCA的时候没有配置TAF , 客户端如何设置连接 ?   

目前用单机连接方式  (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521)(IP = FIRST)) 可以,配置如下:


GND-RAC1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.155.4.95)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = tpc)
      (INSTANCE_NAME = tpc1)
    )
  )


只有 10.155.4.95 能连接,  其他ip配置都不能连接

 

----------------- 

RAC 客户端程序设置tnsnames.ora  

TPC_RAC =
  (DESCRIPTION =
    (FAILOVER=ON)
    (LOAD_BALANCE = ON)
      (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip01)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = gnd-vip02)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = TPC)
      (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))
    )
  )


其中VIP名称更改为虚拟IP也可以 .   

 

  [/float][/float]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-127530/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13133232