Oracle DBA之配置静态监听(listener registered statically)

 (1)listener.ora

 本次实验将配置静态监听到listener L1上,项目SID_LIST_L1为L1的静态监听配置信息:

L1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = PC1255-20110528)(PORT = 1522))
    )
  )

SID_LIST_L1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )

    (SID_DESC =
      (GLOBAL_DBNAME = t01)
      (ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
      (SID_NAME = t01)
    )

  )


(2)listener.ora文件编辑好后,使用reload重新读取该配置文件(reload同时也会重新注册动态监听):

RELOAD

Purpose

Use the RELOAD command to reread the listener.ora file. This command enables you to add or change statically configured services without actually stopping the listener.

In addition, the database services, instances, service handlers, and listening endpoints that were dynamically registered with the listener will be unregistered and subsequently registered again.

http://download.oracle.com/docs/cd/A97630_01/network.920/a96581/lsnrctl.htm

LSNRCTL> status
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PC1255-20110528)(PORT=1522)))
LISTENER 的 STATUS
------------------------
别名                      L1
版本                      TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
启动日期                  24-7月 -2011 22:14:19
正常运行时间              0 天 1 小时 26 分 2 秒
跟踪级别                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
监听程序参数文件          D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
监听程序日志文件          D:\oracle\product\10.2.0\db_1\network\log\l1.log
监听端点概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PC1255-20110528)(PORT=1522)))
服务摘要..
服务 "t02" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
服务 "t02XDB" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
服务 "t02_XPT" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL> reload
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PC1255-20110528)(PORT=1522)))
命令执行成功
LSNRCTL> status
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PC1255-20110528)(PORT=1522)))
LISTENER 的 STATUS
------------------------
别名                      L1
版本                      TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
启动日期                  24-7月 -2011 22:14:19
正常运行时间              0 天 1 小时 26 分 8 秒
跟踪级别                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
监听程序参数文件          D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
监听程序日志文件          D:\oracle\product\10.2.0\db_1\network\log\l1.log
监听端点概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PC1255-20110528)(PORT=1522)))
服务摘要..
服务 "PLSExtProc" 包含 1 个例程。
  例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "t01" 包含 1 个例程。
  例程 "t01", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功


可以看到状态为UNKNOWN的静态监听已经起起来来了,而状态为READY的动态监听由于重新注册存在一定延时,所以还没起起来。
等上一段时间后,我们发现动态监听也起起来了。

LSNRCTL> status
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PC1255-20110528)(PORT=1522)))
LISTENER 的 STATUS
------------------------
别名                      L1
版本                      TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
启动日期                  24-7月 -2011 22:14:19
正常运行时间              0 天 1 小时 46 分 10 秒
跟踪级别                  off
安全性                    ON: Local OS Authentication
SNMP                      OFF
监听程序参数文件          D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
监听程序日志文件          D:\oracle\product\10.2.0\db_1\network\log\l1.log
监听端点概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=PC1255-20110528)(PORT=1522)))
服务摘要..
服务 "PLSExtProc" 包含 1 个例程。
  例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "t01" 包含 1 个例程。
  例程 "t01", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "t02" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
服务 "t02XDB" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
服务 "t02_XPT" 包含 1 个例程。
  例程 "t02", 状态 READY, 包含此服务的 1 个处理程序...
命令执行成功

(3)以scott用户进行测试:

测试的时候报了个ORA-12518的错:

C:\Documents and Settings\Administrator>sqlplus scott/tiger@127.1:1522/t01

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 7月 25 00:01:06 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ERROR:
ORA-12518: TNS: 监听程序无法分发客户机连接

 

以sys用户登录进去,发现是dispatchers设置有问题:

C:\Documents and Settings\Administrator>set oracle_sid=t01

C:\Documents and Settings\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 7月 25 00:05:08 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select status,instance_name from v$instance;

STATUS                   INSTANCE_NAME
------------------------ --------------------------------
OPEN                     t01

SQL> show parameter dispat

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
dispatchers                          string
(PROTOCOL=TCP) (SERVICE=t01XDB
)
max_dispatchers                      integer

重设dispatchers:

SQL> alter system set dispatchers="(PROTOCOL=TCP) (SERVICE=t01XDB)(dispatchers=3)";

系统已更改。

(4)以scott用户进行再测试,问题解决:

C:\Documents and Settings\Administrator>sqlplus scott/tiger@127.1:1522/t01

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 7月 25 00:10:21 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL>

(5)总结

配置静态监听需要先在listener.ora文件中配置一条SID_LIST_listenername的条目,然后需要用reload重新读取配置文件,碰到“监听程序无法分发客户机连接”的错误时,需要设置dispatchers参数。

Ref:

http://www.51testing.com/?uid-117986-action-viewspace-itemid-197431

http://download.oracle.com/docs/cd/A97630_01/network.920/a96581/lsnrctl.htm

http://download.oracle.com/docs/cd/B13789_01/network.101/b10775/listenercfg.htm

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值