当前位置:  数据库>oracle

Oracle 默认和非默认监听

    来源: 互联网  发布时间:2017-04-25

    本文导语: 一、如果使用默认的1521端口,让实例自动注册到该监听上,那么local_listener无需设置,listener.ora文件按照正常方式配置即可。 二、如果使用非默认1521端口,让实例自动注册到该监听上,那么需要设置local_listerner参数,local_listene...

一、如果使用默认的1521端口,让实例自动注册到该监听上,那么local_listener无需设置,listener.ora文件按照正常方式配置即可。

二、如果使用非默认1521端口,让实例自动注册到该监听上,那么需要设置local_listerner参数,local_listener = 'lsnr2' (可以动态修改
 
三、编辑listener.ora文件,该监听为两个,一个为动态注册使用默认端口,一个为静态注册使用了非默认端口:
LISTENER1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oms)(PORT = 1526))
  )





SID_LIST_LISTENER1 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = guuc)
      (Oracle_HOME = /oracle/product/10201)
      (SID_NAME = cuug)
    )
  )






SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/product/10201)
      (PROGRAM = extproc)
    )
  )






LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oms)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )






三、数据库监听两个启动后的情况,此时数据库未启动,默认的的现在还没有,非默认的现在有了一个静态的:
[oracle@oms admin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:12:37

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:07:35
Uptime                    0 days 0 hr. 5 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
======================
[oracle@oms admin]$ lsnrctl status listener1



















LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:12:40

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     listener1
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:06:56
Uptime                    0 days 0 hr. 5 min. 43 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1526)))
Services Summary...
Service "guuc" has 1 instance(s).
  Instance "cuug", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
















四、启动数据库,观察监听的变化,默认的注册了一个实例,非默认的不变:
[oracle@oms admin]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:18:40

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:07:35
Uptime                    0 days 0 hr. 11 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "cuug" has 1 instance(s).
  Instance "cuug", status READY, has 1 handler(s) for this service...
Service "cuug_XPT" has 1 instance(s).
  Instance "cuug", status READY, has 1 handler(s) for this service...
The command completed successfully
==========================
[oracle@oms admin]$ lsnrctl status listener1























LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:18:42

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     listener1
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:06:56
Uptime                    0 days 0 hr. 11 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1526)))
Services Summary...
Service "guuc" has 1 instance(s).
  Instance "cuug", status UNKNOWN, has 1 handler(s) for this servi
















五、配置本地的tnsnames.ora文件
LSNR2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = oms)(PORT = 1526))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cuug)    #此名字可以自定义,一般定义为实例的名字
    )
  )










六、动态更改local_listener的值:
SQL> alter system set local_listener = lsnr2;

七、注意两个监听的变化,默认的监听没有实例注册,非默认的注册了一个实例:
[oracle@oms admin]$ lsnrctl status listener

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:25:50

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:07:35
Uptime                    0 days 0 hr. 18 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
=========================
[oracle@oms admin]$ lsnrctl status listener1



















LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-APR-2010 00:26:03

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oms)(PORT=1526)))
STATUS of the LISTENER
------------------------
Alias                     listener1
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                14-APR-2010 00:24:35
Uptime                    0 days 0 hr. 1 min. 28 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10201/network/admin/listener.ora
Listener Log File         /oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oms)(PORT=1526)))
Services Summary...
Service "cuug" has 1 instance(s).
  Instance "cuug", status READY, has 1 handler(s) for this service...
Service "cuug_XPT" has 1 instance(s).
  Instance "cuug", status READY, has 1 handler(s) for this service...
Service "guuc" has 1 instance(s).
  Instance "cuug", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully




















注意:发现实例注册到这个端口的监听上了,至此,终于明白local_listener参数的作用,默认的值是数据库的global_name,则注册到默认监听;如果设置了新值,比如lsnr2,则根据tnsnames.ora的设置,注册到指定的端口的监听,该端口与某个监听指定的端口一致。

更多Oracle相关信息见 专题页面


    
 
 

您可能感兴趣的文章:

  • 修改Oracle默认用户密码有效期时间
  • Oracle如何修改系统默认时间格式
  • 11g Oracle导出表不导出数据默认为空表的解决方法
  • Oracle的默认用户密码
  • 巧用Oracle系统账户默认口令来提升权限
  • Linux系统下Oracle的启动与Oracle监听的启动
  • Oracle 监听内存泄露问题
  • 重启linux系统,oracle监听服务起不来
  • 回收Oracle的监听器日志文件
  • oracle8的监听如何起来
  • Oracle监听口令及监听器安全详解
  • Oracle数据库监听器的问题
  • oracle 11g的警告日志和监听日志的删除方法
  • Oracle教程:浅析监听器安装/配置入门
  • Oracle监听器Server端与Client端配置实例
  • Oracle监听器服务不能启动的解决方法
  • Oracle 11g2的监听器配置教程
  • [图文]如何保护好Oracle服务器上的监听器
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • ORACLE数据库常用字段数据类型介绍
  • 网间Oracle的连接,远程连接Oracle服务器??
  • Oracle 12c的九大最新技术特性介绍
  • 请教:.profile中:if [ -d /opt/oracle/db01/app/oracle/product/9.2.0 ]是什么意思?


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,