ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 远程控制监听器

远程控制监听器

原创 Linux操作系统 作者:redhouser 时间:2013-09-27 19:32:42 0 删除 编辑
1,监听器状态
Linux + Oracle10.2.0.1.0
--os version
在Oracle10g/11g中,缺省监听器只能在本地管理:
[oracle@bnet95 admin]$ uname -a
Linux bnet95 2.6.18-164.el5xen #1 SMP Thu Sep 3 04:47:32 EDT 2009 i686 i686 i386 GNU/Linux

--database version
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

--监听器缺省安全设置
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-SEP-2013 17:02:26
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication  <<==只能本地管理
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

2,远程管理监听器
Windows7 + Oracle11g
--在listener.ora中增加:
LISTENER95 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 22.11.97.95)(PORT = 1521))
    )
  )

--远程控制
C:\Users\mh0575>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.1.0.6.0 - Production on 26-9月 -2013 16:09:15
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> status listener95
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-12541: TNS: 无监听程序
 TNS-12560: TNS: 协议适配器错误
  TNS-00511: 无监听程序
   32-bit Windows Error: 61: Unknown error

==〉在Linux上启动监听器后
LSNRCTL> status listener95
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-01189: 监听程序无法验证用户

3,设置监听器密码
Linux + Oracle10.2.0.1.0
--设置密码
LSNRCTL> change_password listener2  
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
Password changed for LISTENER
The command completed successfully
--保存设置
LSNRCTL> save_config listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
Saved listener2 configuration parameters.
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Old Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.bak
The command completed successfully
==〉完成此步骤后,listener.ora中增加了:
#----ADDED BY TNSLSNR 26-SEP-2013 17:04:23---
PASSWORDS_listener2 = E154352CED22C60A
#--------------------------------------------

--启动监听器
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                26-SEP-2013 17:07:34
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication 《==允许远程访问
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
4,远程管理
Linux + Oracle10.2.0.1.0
--查看状态
LSNRCTL> status listener95
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
TNS-01169: 监听程序尚未识别口令
 TNS-01189: 监听程序无法验证用户

--设置密码
LSNRCTL> set password
Password:
命令执行成功
--查询状态
LSNRCTL> status listener95
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
LISTENER 的 STATUS
------------------------
别名                      listener2
版本                      TNSLSNR for Linux: Version 10.2.0.1.0 - Production
启动日期                  26-9月 -2013 17:02:26
正常运行时间              0 天 0 小时 2 分 51 秒
跟踪级别                  off
安全性                    ON: Password or Local OS Authentication
SNMP                      OFF
监听程序参数文件          /u01/app/oracle/product/10.2.0/db_1/network/admin/list
ener.ora
监听程序日志文件          /u01/app/oracle/product/10.2.0/db_1/network/log/listen
er2.log
监听端点概要...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
服务摘要..
服务 "bnet" 包含 1 个例程。
  例程 "bnet", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
--远程停止监听器
LSNRCTL> stop listener95
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=1521)))
命令执行成功
--远程启动监听器
LSNRCTL> start listener95
启动tnslsnr: 请稍候...
TNSLSNR for 32-bit Windows: Version 11.1.0.6.0 - Production
系统参数文件为D:\app32\Administrator\product\11.1.0\db_1\network\admin\listener.
ora
写入d:\app32\administrator\diag\tnslsnr\BJ-MH0575-02\listener95\alert\log.xml的
日志信息
监听该对象时出错: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=22.11.97.95)(PORT=15
21)))
TNS-12545: 因目标主机或对象不存在, 连接失败
 TNS-12560: TNS: 协议适配器错误
  TNS-00515: 因目标主机或对象不存在, 连接失败
   32-bit Windows Error: 49: Unknown error
监听程序未能启动。请参阅上面的错误消息...
5,删除监听器密码
Linux + Oracle10.2.0.1.0
--删除listener.ora中如下行:
#----ADDED BY TNSLSNR 26-SEP-2013 17:04:23---
PASSWORDS_listener2 = E154352CED22C60A
#--------------------------------------------
--重新启动监听器
LSNRCTL> status listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                27-SEP-2013 09:26:27
Uptime                    0 days 0 hr. 0 min. 48 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> stop listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
The command completed successfully
LSNRCTL> start listener2
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bnet95)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                27-SEP-2013 09:27:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication  <<==只有OS认证
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener2.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bnet95)(PORT=1521)))
Services Summary...
Service "bnet" has 1 instance(s).
  Instance "bnet", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

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

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

注册时间:2011-05-26

  • 博文量
    211
  • 访问量
    801448