兩個節(jié)點host,ipvip ,scan的信息
#eth0-Public IP
162.12.0.1 cqltjcpt1
162.12.0.3 cqltjcpt2
#eth2 PRIVATE IP
192.12.0.1 cqltjcpt1-prvi
192.12.0.3 cqltjcpt2-prvi
#VIP
162.12.0.5 cqltjcpt1-vip
162.12.0.7 cqltjcpt2-vip
#SCAN
162.12.0.9 cqltjcptscan
11G rac中,監(jiān)聽文件默認配置在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.ora
drwxr-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.ora
Oracle 11.2版本后,有一個新的監(jiān)聽文件endpoints_listener.ora被引進,里面的內(nèi)容是節(jié)點的IP和VIP信息
Endpoints_listener.ora 文件的作用是向后兼容11.2版本以前的數(shù)據(jù)庫,DBCA建庫時,需要通過獲取endpoints的位置信息來配置數(shù)據(jù)庫參數(shù)和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監(jiān)聽只運行在Node1上
[grid@cqltjcpt2 admin]$ ps -ef | grep tnslsnr
grid 9840 1 0 Jan07 ? 00:00:22 /u01/oracle/grid/bin/tnslsnr LISTENER -inherit
grid 22674 21922 0 11:08 pts/1 00:00:00 grep tnslsnr
[grid@cqltjcpt2 ~]$ ssh cqltjcpt1
[grid@cqltjcpt1 ~]$ ps -ef | grep tnslsnr
grid 8211 1 0 Jan07 ? 00:00:44 /u01/oracle/grid/bin/tnslsnr LISTENER -inherit
grid 8380 1 0 Jan07 ? 00:00:02 /u01/oracle/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
grid 22060 22021 0 11:08 pts/1 00:00:00 grep tnslsnr
從ps -ef輸出可以看到,無論是scan監(jiān)聽,還是本地監(jiān)聽都是運行在grid用戶的oracle_home下
NODE2本地監(jiān)聽指向的是vip地址162.12.0.7 ,因為rac是通過vip對外提供服務(wù)
[oracle@cqltjcpt2 ~]$ sqlplus / as sysdba
SQL> show parameter local_listener
NAME TYPE VALUE
--------------- ---------- --------------------------------------------------------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=162.12.0.7)(PORT=1521))))
remote_listener指向的是scan監(jiān)聽名
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]$ ls
endpoints_listener.ora listener.ora samples shrept.lst sqlnet.ora
查看監(jiān)聽文件內(nèi)容
[grid@cqltjcpt2 admin]$ more listener.ora
LISTENER_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
最下面兩行參數(shù)涉及ENABLE_GLOBAL_DYNAMIC_ENDPOINT參數(shù),ENABLE_GLOBAL_DYNAMIC_ENDPOINT參數(shù)的作用是允許監(jiān)聽程序接受針對oracle 11.2版本之前未進行動態(tài)注冊的連接
查看監(jiān)聽狀態(tài),可以看到cqltgsqz2實例已經(jīng)運行
[grid@cqltjcpt2 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): cqltjcpt1,cqltjcpt2
[grid@cqltjcpt2 ~]$ lsnrctl status listener
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 08-JAN-2013 10:58:30
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 07-JAN-2013 22:44:03
Uptime 0 days 12 hr. 14 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/grid/network/admin/listener.ora
Listener Log File /u01/oracle/app/oracle/diag/tnslsnr/cqltjcpt2/listener/alert/log.xml
Listening 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
創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),藤縣企業(yè)網(wǎng)站建設(shè),藤縣品牌網(wǎng)站建設(shè),網(wǎng)站定制,藤縣網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,
藤縣網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
標題名稱:11gR2raclinstener監(jiān)聽配置-創(chuàng)新互聯(lián)
文章URL:
http://weahome.cn/article/ceghhs.html