您好,登錄后才能下訂單哦!
這篇文章主要介紹了oracle11g rac監聽配置的示例分析,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
(1)概述
rac配置如下:
[grid@dbrac1 admin]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.2 dbrac1
192.168.56.3 dbrac1-vip
10.10.10.10 dbrac1-priv
192.168.56.4 dbrac2
192.168.56.5 dbrac2-vip
10.10.10.11 dbrac2-priv
192.168.56.8 rac-scan
[grid@dbrac1 admin]$
一、查看節點1的oracle、grid用戶下的監聽及tns配置文件
oracle用戶下:
[oracle@dbrac1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DBRAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbrac)
)
)
[oracle@dbrac1 admin]$
[oracle@dbrac1 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 19 10:12:34 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name string
db_file_name_convert string
db_name string dbrac
db_unique_name string dbrac
global_names boolean FALSE
instance_name string dbrac1
lock_name_space string
log_file_name_convert string
processor_group_name string
service_names string dbrac
SQL>
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=
192.168.56.3)(PORT=1521))
remote_listener string rac-scan:1521
SQL>
grid用戶下:
[grid@dbrac1 ~]$ cd $ORACLE_HOME/network/admin
[grid@dbrac1 admin]$ ls -lrt
total 28
-rw-r--r-- 1 grid oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x 2 grid oinstall 4096 Oct 16 20:40 samples
-rw-r--r-- 1 grid oinstall 184 Oct 16 20:59 listener.ora.bak.dbrac1
-rw-r--r-- 1 grid oinstall 184 Oct 16 21:10 listener1710169PM1019.bak
-rw-r--r-- 1 grid oinstall 222 Oct 16 21:10 sqlnet.ora
-rw-r--r-- 1 grid oinstall 350 Oct 16 21:10 listener.ora
-rw-r--r-- 1 grid oinstall 185 Oct 16 21:10 endpoints_listener.ora
[grid@dbrac1 admin]$
--endpoints_listener.ora文件:
[grid@dbrac1 admin]$ cat endpoints_listener.ora
LISTENER_DBRAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.2)(PORT=1521)(IP=FIRST)))) # line added by Agent
[grid@dbrac1 admin]$
--listener.ora監聽配置文件:
[grid@dbrac1 admin]$ cat listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
[grid@dbrac1 admin]$
--sqlnet.ora文件:
[grid@dbrac1 admin]$ cat sqlnet.ora
# sqlnet.ora.dbrac1 Network Configuration File: /oracle/app/11.2.0/grid/network/admin/sqlnet.ora.dbrac1
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /oracle/app/grid
[grid@dbrac1 admin]$
[grid@dbrac1 admin]$
二、查看節點2的oracle、grid用戶下的監聽及tns配置文件
oracle用戶下:
[oracle@dbrac2 ~]$ cd $ORACLE_HOME/network/admin
[oracle@dbrac2 admin]$ ls
samples shrept.lst tnsnames.ora
[oracle@dbrac2 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DBRAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dbrac)
)
)
[oracle@dbrac2 admin]$
[oracle@dbrac2 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 19 14:49:34 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cell_offloadgroup_name string
db_file_name_convert string
db_name string dbrac
db_unique_name string dbrac
global_names boolean FALSE
instance_name string dbrac2
lock_name_space string
log_file_name_convert string
processor_group_name string
service_names string dbrac
SQL>
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
listener_networks string
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=
192.168.56.5)(PORT=1521))
remote_listener string rac-scan:1521
SQL>
grid用戶下:
[grid@dbrac2 ~]$ cd $ORACLE_HOME/network/admin
[grid@dbrac2 admin]$ ls -lrt
total 28
-rw-r--r-- 1 grid oinstall 381 Oct 16 20:48 shrept.lst
drwxr-xr-x 2 grid oinstall 4096 Oct 16 20:48 samples
-rw-r--r-- 1 grid oinstall 222 Oct 16 21:10 sqlnet.ora
-rw-r--r-- 1 grid oinstall 166 Oct 16 21:10 listener.ora.bak.dbrac2
-rw-r--r-- 1 grid oinstall 185 Oct 16 21:10 endpoints_listener.ora
-rw-r--r-- 1 grid oinstall 350 Oct 16 23:33 listener.bak
-rw-r--r-- 1 grid oinstall 481 Oct 19 10:31 listener.ora
--endpoints_listener.ora文件:
[grid@dbrac2 admin]$ cat endpoints_listener.ora
LISTENER_DBRAC2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac2-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.4)(PORT=1521)(IP=FIRST)))) # line added by Agent
[grid@dbrac2 admin]$
--listener.ora監聽配置文件:
[grid@dbrac2 admin]$ cat listener.ora
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
[grid@dbrac2 admin]$
--sqlnet.ora文件:
[grid@dbrac2 admin]$ cat sqlnet.ora
# sqlnet.ora.dbrac2 Network Configuration File: /oracle/app/11.2.0/grid/network/admin/sqlnet.ora.dbrac2
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /oracle/app/grid
[grid@dbrac2 admin]$
三、檢查集群狀態:
[grid@dbrac2 admin]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.FRA.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.LISTENER.lsnr
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.OCRVOTE.dg
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.asm
ONLINE ONLINE dbrac1 Started
ONLINE ONLINE dbrac2 Started
ora.gsd
OFFLINE OFFLINE dbrac1
OFFLINE OFFLINE dbrac2
ora.net1.network
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.ons
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
ora.registry.acfs
ONLINE ONLINE dbrac1
ONLINE ONLINE dbrac2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE dbrac2
ora.cvu
1 ONLINE ONLINE dbrac2
ora.dbrac.db
1 ONLINE ONLINE dbrac1 Open
2 ONLINE ONLINE dbrac2 Open
ora.dbrac1.vip
1 ONLINE ONLINE dbrac1
ora.dbrac2.vip
1 ONLINE ONLINE dbrac2
ora.oc4j
1 ONLINE ONLINE dbrac2
ora.scan1.vip
1 ONLINE ONLINE dbrac2
[grid@dbrac2 admin]$
發現本地監聽在ora.LISTENER.lsnr各自online,而scan監聽ora.LISTENER_SCAN1.lsnr在節點2上online;
--查看各自監聽狀態:
節點2;
[grid@dbrac2 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:45:19
Copyright (c) 1991, 2013, 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.4.0 - Production
Start Date 19-OCT-2017 10:33:22
Uptime 0 days 4 hr. 11 min. 56 sec
Trace Level off
Security ON: Password or Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/grid/diag/tnslsnr/dbrac2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.4)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.5)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "dbrac" has 1 instance(s).
Instance "dbrac2", status READY, has 1 handler(s) for this service...
Service "dbracXDB" has 1 instance(s).
Instance "dbrac2", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ lsnrctl status LISTENER_SCAN1
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:45:22
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 18-OCT-2017 22:54:51
Uptime 0 days 15 hr. 50 min. 31 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/11.2.0/grid/log/diag/tnslsnr/dbrac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.8)(PORT=1521)))
Services Summary...
Service "dbrac" has 2 instance(s).
Instance "dbrac1", status READY, has 1 handler(s) for this service...
Instance "dbrac2", status READY, has 1 handler(s) for this service...
Service "dbracXDB" has 2 instance(s).
Instance "dbrac1", status READY, has 1 handler(s) for this service...
Instance "dbrac2", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@dbrac2 admin]$
因為scan監聽駐留在節點2上。
節點1:
[grid@dbrac1 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:43:02
Copyright (c) 1991, 2013, 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.4.0 - Production
Start Date 19-OCT-2017 02:50:38
Uptime 0 days 11 hr. 52 min. 23 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/grid/diag/tnslsnr/dbrac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.3)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "dbrac" has 1 instance(s).
Instance "dbrac1", status READY, has 1 handler(s) for this service...
Service "dbracXDB" has 1 instance(s).
Instance "dbrac1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@dbrac1 admin]$
[grid@dbrac1 admin]$ lsnrctl status LISTENER_SCAN1
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:43:09
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 19-OCT-2017 09:56:13
Uptime 0 days 4 hr. 46 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/grid/diag/tnslsnr/dbrac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
The listener supports no services
The command completed successfully
[grid@dbrac1 admin]$
local_listener 默認不需要配置,默認配置指向1521端口,對于單實例改變端口需要指向tns里的連接字符串,而在rac配置中默認指向本節點的vip。
remote_listener指向的是scan監聽名,需要遠程監聽是配置。
Oracle 11.2版本后,有一個新的監聽文件endpoints_listener.ora被引進,里面的內容是節點的IP和VIP信息 。
Endpoints_listener.ora 文件的作用是向后兼容11.2版本以前的數據庫,DBCA建庫時,需要通過獲取endpoints的位置信息來配置數據庫參數和tnsnames,其中最下面兩行參數涉及ENABLE_GLOBAL_DYNAMIC_ENDPOINT參數,ENABLE_GLOBAL_DYNAMIC_ENDPOINT參數的作用是允許監聽程序接受針對oracle 11.2版本之前未進行動態注冊的連接
(2)使用srvctl 工具添加監聽并手動加入靜態注冊信息
--添加監聽:(在grid用戶下執行)
[grid@dbrac2 admin]$ srvctl config network
Network exists: 1/192.168.56.0/255.255.255.0/eth0, type static
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl add listener -h
Adds a listener configuration to the Oracle Clusterware.
Usage: srvctl add listener [-l ] [-s] [-p "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]"] [-o ] [-k ]
-l Listener name (default name is LISTENER)
-o ORACLE_HOME path (default value is CRS_HOME)
-k network number (default number is 1)
-s Skip the checking of ports
-p "[TCP:][, ...][/IPC:][/NMP:][/TCPS:] [/SDP:]" Comma separated tcp ports or listener endpoints
-h Print usage
-k 填入方才獲得的network number,-p填入端口號,-l填入監聽名,-o 填入GI HOME路徑
--執行:
[grid@dbrac2 admin]$ srvctl add listener -l LISTENER_wang -o $ORACLE_HOME -p 1522 -k 1
[grid@dbrac2 admin]$
--查詢監聽狀態:
[grid@dbrac2 admin]$ srvctl status listener -h
Displays the current state of the listener.
Usage: srvctl status listener [-l ] [-n ] [-v]
-l Listener name
-n Node name
-v Verbose output
-h Print usage
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_wang
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is not running
[grid@dbrac2 admin]$
--啟動監聽:
[grid@dbrac2 admin]$ srvctl start listener -l LISTENER_wang
[grid@dbrac2 admin]$
--查看新建的監聽狀態:
[grid@dbrac2 admin]$ lsnrctl stauts LISTENER_wang
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 15:29:34
Copyright (c) 1991, 2013, Oracle. All rights reserved.
NL-00853: undefined command "stauts". Try "help"
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ lsnrctl status LISTENER_wang
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 15:29:46
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_WANG)))
STATUS of the LISTENER
------------------------
Alias LISTENER_WANG
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 19-OCT-2017 15:29:12
Uptime 0 days 0 hr. 0 min. 35 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/11.2.0/grid/log/diag/tnslsnr/dbrac2/listener_wang/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_WANG)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.4)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.5)(PORT=1522)))
The listener supports no services
The command completed successfully
[grid@dbrac2 admin]$
--查看監聽配置文件:srvctl start listener啟動新添加的監聽后listener.ora和endpoints_listener.ora會出現新的記錄
[grid@dbrac2 admin]$ ls -lrt
total 32
-rw-r--r-- 1 grid oinstall 381 Oct 16 20:48 shrept.lst
drwxr-xr-x 2 grid oinstall 4096 Oct 16 20:48 samples
-rw-r--r-- 1 grid oinstall 222 Oct 16 21:10 sqlnet.ora
-rw-r--r-- 1 grid oinstall 185 Oct 16 21:10 endpoints_listener.ora.bak.dbrac2
-rw-r--r-- 1 grid oinstall 350 Oct 16 23:33 listener.bak
-rw-r--r-- 1 grid oinstall 481 Oct 19 10:31 listener.ora.bak.dbrac2
-rw-r--r-- 1 grid oinstall 662 Oct 19 15:29 listener.ora
-rw-r--r-- 1 grid oinstall 375 Oct 19 15:29 endpoints_listener.ora
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ cat listener.ora
LISTENER_WANG=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_WANG)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
#----ADDED BY TNSLSNR 19-OCT-2017 10:31:25---
PASSWORDS_LISTENER = 1DF5C2FD0FE9CFA2
#--------------------------------------------
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_WANG=ON # line added by Agent
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ cat endpoints_listener.ora
LISTENER_WANG_DBRAC2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac2-vip)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.4)(PORT=1522)(IP=FIRST))))# line added by Agent
LISTENER_DBRAC2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac2-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.4)(PORT=1521)(IP=FIRST)))) # line added by Agent
[grid@dbrac2 admin]$
--之后僅需要加入靜態注冊信息即可,如:
SID_LIST_LISTENER_WANG =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = dbrac)
(ORACLE_HOME = /oracle/app/11.2.0/grid)
(SID_NAME=dbrac2)
)
)
加入如上信息到listener.ora配置文件中(SID_LIST_($LISTENER_NAME),并重啟監聽即完成靜態注冊:
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_WANG
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is running on node(s): dbrac1,dbrac2
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl stop listener -l LISTENER_WANG
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_WANG
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is not running
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl start listener -l LISTENER_WANG -n dbrac2
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_WANG
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is running on node(s): dbrac2
命令srvctl start listener -l LISTENER_WANG -n dbrac2只在一個節點啟動監聽
--啟動監聽不加參數默認是在兩個節點同時啟動
[grid@dbrac2 admin]$ srvctl stop listener -l LISTENER_WANG
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_WANG
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is not running
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl start listener -l LISTENER_WANG -n dbrac1,dbrac2
PRKO-2003 : Invalid command line option value: dbrac1,dbrac2
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl start listener -l LISTENER_WANG
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$
[grid@dbrac2 admin]$ srvctl status listener -l LISTENER_WANG
Listener LISTENER_WANG is enabled
Listener LISTENER_WANG is running on node(s): dbrac1,dbrac2
--查詢監聽LISTENER_WANG狀態:
[grid@dbrac2 admin]$ lsnrctl status LISTENER_WANG
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 16:08:14
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_WANG)))
STATUS of the LISTENER
------------------------
Alias LISTENER_WANG
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 19-OCT-2017 16:05:30
Uptime 0 days 0 hr. 2 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /oracle/app/11.2.0/grid/log/diag/tnslsnr/dbrac2/listener_wang/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_WANG)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.4)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.5)(PORT=1522)))
Services Summary...
Service "dbrac" has 1 instance(s).
Instance "dbrac2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[grid@dbrac2 admin]$
附上節點一的監聽配置信息:
[grid@dbrac1 admin]$ cat listener.ora
LISTENER_WANG=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_WANG)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_WANG=ON # line added by Agent
[grid@dbrac1 admin]$
[grid@dbrac1 admin]$ cat endpoints_listener.ora
LISTENER_WANG_DBRAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac1-vip)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.2)(PORT=1522)(IP=FIRST))))# line added by Agent
LISTENER_DBRAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=dbrac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.2)(PORT=1521)(IP=FIRST)))) # line added by Agent
[grid@dbrac1 admin]$
感謝你能夠認真閱讀完這篇文章,希望小編分享的“oracle11g rac監聽配置的示例分析”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。