千家信息网

11g R2 rac linstener 监听配置

发表于:2024-11-18 作者:千家信息网编辑
千家信息网最后更新 2024年11月18日,两个节点host,ipvip ,scan的信息#eth0-Public IP162.12.0.1 cqltjcpt1162.12.0.3 cqltjcpt2#eth2 PRIVATE IP
千家信息网最后更新 2024年11月18日11g R2 rac linstener 监听配置
两个节点host,ipvip ,scan的信息#eth0-Public IP162.12.0.1    cqltjcpt1162.12.0.3    cqltjcpt2#eth2 PRIVATE IP192.12.0.1   cqltjcpt1-prvi192.12.0.3   cqltjcpt2-prvi#VIP162.12.0.5   cqltjcpt1-vip162.12.0.7   cqltjcpt2-vip#SCAN162.12.0.9   cqltjcptscan11G rac中,监听文件默认配置在grid用户下[root@cqltjcpt2 ~]# su - grid[grid@cqltjcpt2 ~]$ cd $ORACLE_HOME[grid@cqltjcpt2 grid]$ cd network/admin/[grid@cqltjcpt2 admin]$ ll-rw-r--r-- 1 grid oinstall  189 Jan  7 21:21 endpoints_listener.ora-rw-r--r-- 1 grid oinstall  350 Jan  7 21:21 listener.oradrwxr-xr-x 2 grid oinstall 4096 Jan  7 21:04 samples-rw-r--r-- 1 grid oinstall  205 May 11  2011 shrept.lst-rw-r--r-- 1 grid oinstall  227 Jan  7 21:21 sqlnet.oraOracle 11.2版本后,有一个新的监听文件endpoints_listener.ora被引进,里面的内容是节点的IP和VIP信息Endpoints_listener.ora 文件的作用是向后兼容11.2版本以前的数据库,DBCA建库时,需要通过获取endpoints的位置信息来配置数据库参数和tnsnames[grid@cqltjcpt2 admin]$ more endpoints_listener.ora LISTENER_CQLTJCPT2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cqltjcpt2-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=162.12.0.3)(PORT=1521)(IP=FIRST))))               由于用hosts解析配置本例中没有配置DNS,只有一个scan listener 此时scan监听只运行在Node1上[grid@cqltjcpt2 admin]$ ps -ef | grep tnslsnrgrid      9840     1  0 Jan07 ?        00:00:22 /u01/oracle/grid/bin/tnslsnr LISTENER -inheritgrid     22674 21922  0 11:08 pts/1    00:00:00 grep tnslsnr[grid@cqltjcpt2 ~]$ ssh cqltjcpt1[grid@cqltjcpt1 ~]$ ps -ef | grep  tnslsnrgrid      8211     1  0 Jan07 ?        00:00:44 /u01/oracle/grid/bin/tnslsnr LISTENER -inheritgrid      8380     1  0 Jan07 ?        00:00:02 /u01/oracle/grid/bin/tnslsnr LISTENER_SCAN1 -inheritgrid     22060 22021  0 11:08 pts/1    00:00:00 grep tnslsnr从ps -ef输出可以看到,无论是scan监听,还是本地监听都是运行在grid用户的oracle_home下NODE2本地监听指向的是vip地址162.12.0.7 ,因为rac是通过vip对外提供服务[oracle@cqltjcpt2 ~]$ sqlplus  / as sysdbaSQL> show parameter local_listenerNAME            TYPE        VALUE--------------- ---------- --------------------------------------------------------------------------------local_listener  string      (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=162.12.0.7)(PORT=1521))))remote_listener指向的是scan监听名SQL> show parameter remote_listener             NAME               TYPE         VALUE-----------------  -----------  ------------------------------remote_listener    string       cqltjcptscan:1521切换至grid用户[root@cqltjcpt2 ~]# su - grid[grid@cqltjcpt2 ~]$ cd $ORACLE_HOME/network/admin[grid@cqltjcpt2 admin]$ lsendpoints_listener.ora  listener.ora    samples  shrept.lst  sqlnet.ora查看监听文件内容[grid@cqltjcpt2 admin]$ more listener.oraLISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                 LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))             ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON               ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                最下面两行参数涉及ENABLE_GLOBAL_DYNAMIC_ENDPOINT参数,ENABLE_GLOBAL_DYNAMIC_ENDPOINT参数的作用是允许监听程序接受针对oracle 11.2版本之前未进行动态注册的连接查看监听状态,可以看到cqltgsqz2实例已经运行[grid@cqltjcpt2 ~]$ srvctl  status listenerListener LISTENER is enabledListener LISTENER is running on node(s): cqltjcpt1,cqltjcpt2[grid@cqltjcpt2 ~]$ lsnrctl status listenerLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 08-JAN-2013 10:58:30Copyright (c) 1991, 2011, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))STATUS of the LISTENER------------------------Alias                     LISTENERVersion                   TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionStart Date                07-JAN-2013 22:44:03Uptime                    0 days 12 hr. 14 min. 26 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /u01/oracle/grid/network/admin/listener.oraListener Log File         /u01/oracle/app/oracle/diag/tnslsnr/cqltjcpt2/listener/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=162.12.0.3)(PORT=1521)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=162.12.0.7)(PORT=1521)))Services Summary...Service "+ASM" has 1 instance(s).  Instance "+ASM2", status READY, has 1 handler(s) for this service...Service "cqlthxqf" has 1 instance(s).  Instance "cqlthxqf2", status READY, has 1 handler(s) for this service...Service "cqlthxqfXDB" has 1 instance(s).  Instance "cqlthxqf2", status READY, has 1 handler(s) for this service...Service "cqlthxqz" has 1 instance(s).  Instance "cqlthxqz2", status READY, has 1 handler(s) for this service...Service "cqlthxqzXDB" has 1 instance(s).  Instance "cqlthxqz2", status READY, has 1 handler(s) for this service...Service "cqltjcpt" has 1 instance(s).  Instance "cqltjcpt2", status READY, has 1 handler(s) for this service...Service "cqltjcptXDB" has 1 instance(s).  Instance "cqltjcpt2", status READY, has 1 handler(s) for this service...The command completed successfully


0