微前端架构如何改变企业的开发模式与效率提升
283
2023-12-25
这篇文章主要介绍了oracle11g rac监听配置的示例分析,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
(1)概述
rac配置如下: [grid@dbrac1 admin]$ cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.2 dbrac1192.168.56.3 dbrac1-vip10.10.10.10 dbrac1-priv192.168.56.4 dbrac2192.168.56.5 dbrac2-vip10.10.10.11 dbrac2-priv192.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 sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 19 10:12:34 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> show parameter nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------cell_offloadgroup_name stringdb_file_name_convert stringdb_name string dbracdb_unique_name string dbracglobal_names boolean FALSEinstance_name string dbrac1lock_name_space stringlog_file_name_convert stringprocessor_group_name stringservice_names string dbracSQL> SQL> show parameter listenerNAME TYPE VALUE------------------------------------ ----------- ------------------------------listener_networks stringlocal_listener string (ADDRESS=(PROTOCOL=TCP)(HOST= 192.168.56.3)(PORT=1521))remote_listener string rac-scan:1521SQL> grid用户下:[grid@dbrac1 ~]$ cd $ORACLE_HOME/network/admin[grid@dbrac1 admin]$ ls -lrttotal 28-rw-r--r-- 1 grid oinstall 381 Dec 17 2012 shrept.lstdrwxr-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.oraLISTENER_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.oraLISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by AgentLISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by AgentENABLE_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]$ lssamples 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 sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 19 14:49:34 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> show parameter nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------cell_offloadgroup_name stringdb_file_name_convert stringdb_name string dbracdb_unique_name string dbracglobal_names boolean FALSEinstance_name string dbrac2lock_name_space stringlog_file_name_convert stringprocessor_group_name stringservice_names string dbracSQL> SQL> show parameter listenerNAME TYPE VALUE------------------------------------ ----------- ------------------------------listener_networks stringlocal_listener string (ADDRESS=(PROTOCOL=TCP)(HOST= 192.168.56.5)(PORT=1521))remote_listener string rac-scan:1521SQL> grid用户下:[grid@dbrac2 ~]$ cd $ORACLE_HOME/network/admin[grid@dbrac2 admin]$ ls -lrttotal 28-rw-r--r-- 1 grid oinstall 381 Oct 16 20:48 shrept.lstdrwxr-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.oraLISTENER_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.oraLISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by AgentLISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by AgentENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by AgentENABLE_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.lsnrONLINE ONLINE dbrac1 ONLINE ONLINE dbrac2 ora.OCRVOTE.dg ONLINE ONLINE dbrac1 ONLINE ONLINE dbrac2 ora.asm ONLINE ONLINE dbrac1 Started ONLINE ONLINE dbrac2 Startedora.gsd OFFLINE OFFLINE dbrac1 OFFLINE OFFLINE dbrac2 ora-1-workONLINE ONLINE dbrac1 ONLINE ONLINE dbrac2 ora.ons ONLINE ONLINE dbrac1 ONLINE ONLINE dbrac2ora.registry.acfs ONLINE ONLINE dbrac1 ONLINE ONLINE dbrac2 --------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE dbrac2ora.cvu 1 ONLINE ONLINE dbrac2 ora.dbrac.db1 ONLINE ONLINE dbrac1 Open 2 ONLINE ONLINE dbrac2 Open ora.dbrac1.vip1 ONLINE ONLINE dbrac1ora.dbrac2.vip 1 ONLINE ONLINE dbrac2 ora.oc4j1 ONLINE ONLINE dbrac2ora.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 statusLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:45:19Copyright (c) 1991, 2013, 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.4.0 - ProductionStart Date 19-OCT-2017 10:33:22Uptime 0 days 4 hr. 11 min. 56 secTrace Level offSecurity ON: Password or Local OS AuthenticationSNMP OFFListener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.oraListener Log File /oracle/app/grid/diag/tnslsnr/dbrac2/listener/alert/log.xmlListening 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_SCAN1LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:45:22Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))STATUS of the LISTENER------------------------Alias LISTENER_SCAN1Version TNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date 18-OCT-2017 22:54:51Uptime 0 days 15 hr. 50 min. 31 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.oraListener Log File /oracle/app/11.2.0/grid/log/diag/tnslsnr/dbrac2/listener_scan1/alert/log.xmlListening 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:02Copyright (c) 1991, 2013, 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.4.0 - ProductionStart Date 19-OCT-2017 02:50:38Uptime 0 days 11 hr. 52 min. 23 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.oraListener Log File /oracle/app/grid/diag/tnslsnr/dbrac1/listener/alert/log.xmlListening 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_SCAN1LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 19-OCT-2017 14:43:09Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))STATUS of the LISTENER------------------------Alias LISTENER_SCAN1Version TNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date 19-OCT-2017 09:56:13Uptime 0 days 4 hr. 46 min. 57 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /oracle/app/11.2.0/grid/network/admin/listener.oraListener Log File /oracle/app/grid/diag/tnslsnr/dbrac1/listener_scan1/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))The listener supports no servicesThe 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监听配置的示例分析”这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~