问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

动态监听和静态监听可以同时存在吗

发布网友 发布时间:2022-04-11 23:51

我来回答

2个回答

懂视网 时间:2022-04-12 04:12

步骤大致是:1.配置一个非默认的动态监听,运行在1525端口 2.默认动态监听同时要运行 3.配置一个静态监听,运行在1526端口 4.打开这些监听,并使用sqlplus登陆测试 数据库内一些参数: SYS@ bys3show parameter service NAME TYPE VALUE --------------------

步骤大致是:1.配置一个非默认的动态监听,运行在1525端口
2.默认动态监听同时要运行
3.配置一个静态监听,运行在1526端口
4.打开这些监听,并使用sqlplus登陆测试


数据库内一些参数:
SYS@ bys3>show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string bys3
SYS@ bys3>show parameter db_na
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string bys3
SYS@ bys3>show parameter db_unique
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string bys3
SYS@ bys3>show parameter db_domain
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_domain string
SYS@ bys3>show parameter instance_na

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string bys3
关于这几个参数的设置及替换,详见:ORACLE监听之动态监听与静态监听特点

配置默认及非默认动态监听

1.配置listener.ora,增加非默认动态监听的地址、端口条目

[oracle@bys3 admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1525))
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /u01

2.在数据库中配置 local_listener参数,语句如下:--就是把listener.ora中的几行复制过来,注意换行的括号不要少了。

alter system set local_listener='(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1525))
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1521)))';
SYS@ bys3>alter system register; --手动注册,或者等上一分钟,让PMON自动进行动态监听注册。

3.查看监听状态,动态监听已经注册成功:

[oracle@bys3 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:20:16
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bys3.bys.com)(PORT=1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 14-JAN-2014 22:02:22
Uptime 0 days 0 hr. 17 min. 54 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/diag/tnslsnr/bys3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bys3.bys.com)(PORT=1525)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bys3.bys.com)(PORT=1521)))
Services Summary...
Service "bys3" has 1 instance(s).
Instance "bys3", status READY, has 1 handler(s) for this service...
The command completed successfully

4.使用SQLPLUS进行登陆测试:

[oracle@bys3 admin]$ cat tnsnames.ora
bys3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bys3)
)
)
test =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1525))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bys3)
)
)
[oracle@bys3 admin]$ tnsping test
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:30:42
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1525)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys3)))
OK (0 msec)
[oracle@bys3 admin]$ tnsping bys3
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:30:46
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys3)))
OK (10 msec)
[oracle@bys3 admin]$ sqlplus bys/bys@bys3
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 14 22:32:02 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
BYS@ bys3>exit

[oracle@bys3 admin]$ sqlplus bys/bys@test
BYS@ test>exit
###############################################################

配置静态监听:

1.配置listener.ora,增加相应条目

[oracle@bys3 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1525))
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1521))
)
)

l3 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT = 1526))
)
)
SID_LIST_l3=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=bys9)
(SID_NAME=bys3)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)))
ADR_BASE_LISTENER = /u01

2.启动监听,查看状态:

[oracle@bys3 ~]$ lsnrctl status l3
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:19:49
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bys3.bys.com)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias l3
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 14-JAN-2014 22:15:15
Uptime 0 days 0 hr. 4 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/diag/tnslsnr/bys3/l3/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bys3.bys.com)(PORT=1526)))
Services Summary...
Service "bys9" has 1 instance(s).
Instance "bys3", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
#################

3.使用SQLPLUS进行登陆测试

[oracle@bys3 admin]$ cat tnsnames.ora
test9 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1526))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bys9)
)
)
[oracle@bys3 ~]$ tnsping test9
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 14-JAN-2014 22:37:56
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bys3.bys.com)(PORT =1526))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bys9)))
OK (10 msec)
[oracle@bys3 ~]$ sqlplus bys/bys@test9
SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 14 22:38:05 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
BYS@ test9>

热心网友 时间:2022-04-12 01:20

当然是可以的,但是感觉意义不大。
因为发挥作用只会是其中一个,何必静态和动态 都启用呢?
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
巴西龟最长活多久,家养!!! 养胃的药最好的是什么啊 婴儿积食发烧不愿吃药怎么办 板门穴位在哪个部位 手机设置放偷看的方法? 凝结水回收器生产厂家? 个人账户养老金预测公式:现有5万元,缴费20年,能领多少钱? 临沂比较有名的男装品牌 呼伦贝尔市悦动网络科技有限公司怎么样? 呼伦贝尔中汇实业有限公司怎么样? 端口检查--网络监听端口的快速检查检查结果 oracle监听静态注册和动态注册的区别 数据库默认监听接口 Excel做相关分析的步骤 如何在excel2010 xy散点图上分析数据? 如何对散点图进行描述分析? jdbc connection是不是可以创建多个statement java jdbc 里connection可以创建哪几种Statement 本人小白,刚接触linux和mysql,请问初始化之后报这个错是啥意思?怎么解决? Mysql启动不了服务器,我查看了错误日志求大神解决 在windows2003上第一次安装mysql,最后一步报错,the service could not be started win8平板提示安装net.framework 3.5却安装不了? win8.1无法安装.net 3.5 win8.1安装.net framework 3.5方法汇总 为什么win8装不了net,framework3.5 Win8系统老是出现提示安装net framework 3.5,可是又总是安装失败。 win8安装Microsoft .NET Framework 3.5 安装失败,然后再双击Microsoft .NET Framework 3.5 安装包无反应 win8.1 下net framework3.5怎么安装失败 怎么win8安装不了net framework 3.5 win8 net framework怎么安装失败 BT默认的监听端口是多少? 怎么修改sqlserver的默认监听端口 海康录像机做远程监控,海康默认端口号80 8000 554,是不是在路由器上做端口映射是端口号也是这个, linux 启动服务 默认监听ipv6端口 如何用DOC命令显示所有的监听端口? oracle监听和tns最大的区别 如何使用命令查看当前活动的TCP连接、计算机侦听的端口、以太网统计信息、IP路由表等信息? 怎样关闭已经打开,或是监听状态的端口 闽南话老子很不爽怎么说 animal是什么意思,我不知道 男生和女生用韩语叫“姐姐”“哥哥”有何不同?怎么发音,怎么写? 求问德语中表示频率副词(“总是”、“经常”、“从不”这种。。)都有什么?还有staüdig是什么意思?! 韩文“哦不赛哟”是什么意思?“不是这样的”用韩语怎么念? sa bo nim 韩语发音这是撒意思 nim nim包是什么品牌?有名吗?价格大约多少?不是miu miu。 我80kg 一般只跑半小时3公里 脚中间,磨损差不多,膝盖稍微不舒服 买asics…k还是nim Babo sa bu nim 这是个发音,估计不是韩语就是日语的,谁知道是什么意思? 梦三国测试区帐号公开.本人不玩了,帐号26693784 密码wo操nimabide 好的的泰剧吻戏不借位 ey huda nim kun bu biz ga ha什么意思?