ITPub博客

首页 > 数据库 > Oracle > Oracle动态监听注册测试

Oracle动态监听注册测试

原创 Oracle 作者:jqs 时间:2008-04-18 13:59:17 0 删除 编辑

1.把listener.ora 删除会有什么后果?

2.ORA-12514:TNS:监听程序当前无法识别连接描述中请求的服务是怎么回事?

[@more@]
数据库版本:Oracle10.2.0.1
端口:1521
删除listener.ora
启动监听
$ lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:49:31
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/oracle/db/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Log messages written to /u01/oracle/db/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully
启动正常,但告诉你没有services
$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:49:36
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 0 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully
查看状态也是,提示没有services
此时如果通过client端连接数据库会有如下的错误提示:
ORA-12514:TNS:监听程序当前无法识别连接描述中请求的服务
大约1分钟后,查看监听状态
$ lsnrctl status
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 18-APR-2008 05:51:13
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
Start Date 18-APR-2008 05:49:31
Uptime 0 days 0 hr. 1 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Log File /u01/oracle/db/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=racnode1.midea.com.cn)(PORT=1521)))
Services Summary...
Service "MDDJ" has 1 instance(s).
Instance "MDDJ", status READY, has 1 handler(s) for this service...
Service "MDDJ_XPT" has 1 instance(s).
Instance "MDDJ", status READY, has 1 handler(s) for this service...
Service "mdzj" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...
Service "mdzjXDB" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...
Service "mdzj_XPT" has 1 instance(s).
Instance "mdzj", status READY, has 1 handler(s) for this service...

The command completed successfully
测试连接,发现连接正常。
查看数据库中的local_listener与remote_listener
SQL> show parameter listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
remote_listener string
SQL>
============================
动态监听注册
    1.不是通过listener.ora文件的,
    2.是通过PMON进程自动进行的,所以前面有一定时间的延迟,才能使用
3.如果是非默认端口,必须设置local_listener
============================

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15385/viewspace-1002715/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-02-27

  • 博文量
    18
  • 访问量
    936290