Oracle 监听器密码设置方法(LISTENER)
监听器也有安全?Sure!在缺省的情况下,任意用户不需要使用任何密码即通过lsnrctl 工具对Oracle Listener进行操作或关闭,从而造成任意新的会话都将无法建立连接。在Oracle 9i 中Oracle监听器允许任何一个人利用lsnrctl从远程发起对监听器的管理。也容易导致数据库受到损坏。
1. 未设定密码情形下停止监听
[oracle@test ~]$ lsnrctl s listener_demo92 -->停止监听,可以看出不需要任何密码即可停止 LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011 08:22:26 Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) The mand pleted suessfully
2. 重新启动监听并设置密码
[oracle@test ~]$ lsnrctl LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011 08:24:09 Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved. Wele to LSNRCTL, type "help" for information. LSNRCTL> set current_listener listener_demo92 -->设置当前监听器 Current Listener is listener_demo92 LSNRCTL> start -->启动过程也不需要任何密码,启动的详细信息省略 LSNRCTL> change_password -->使用change_password来设置密码 Old password: New password: Reenter new password: Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) Password changed for listener_demo92 The mand pleted suessfully LSNRCTL> save_config -->注意此处的save_config失败 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) TNS-01169: The listener has not recognized the password LSNRCTL> set password -->输入新设定的密码验证 Password: The mand pleted suessfully LSNRCTL> save_config -->save_config成功 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) Saved listener_demo92 configuration parameters. Listener Parameter File /oracle/92/work/admin/listener.ora Old Parameter File /oracle/92/work/admin/listener.bak The mand pleted suessfully -->增加密码之后可以看到listener.ora文件中有一条新增的记录,即密码选项(注尽管使用了密码管理方式,仍然可以无需密码启动监听) [oracle@test admin]$ more listener.ora #----ADDED BY TNSLSNR 26-JUN-2011 05:12:48--- PASSWORDS_listener_demo92 = #--------------------------------------------
3. 尝试未使用密码的情况下停止监听
[oracle@test ~]$ lsnrctl s listener_demo92 LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011 06:09:51 Copyright (c) 1991, 2006, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) TNS-01169: The listener has not recognized the password -->收到错误信息,需要使用密码认证
4. 使用密码来停止监听
[oracle@test ~]$ lsnrctl LSNRCTL> set current_listener listener_demo92 Current Listener is listener_demo92 LSNRCTL> s Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) TNS-01169: The listener has not recognized the password LSNRCTL> set password Password: The mand pleted suessfully LSNRCTL> s Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) The mand pleted suessfully LSNRCTL> status Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refused Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 2: No such file or directory
5. save_config失败的问题
-->在 Oracle 9i中,使用save_config命令将会失败 LSNRCTL> save_config Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<port>))) TNS-01169: The listener has not recognized the password -->应该先使用set password之后再save_config,则保存配置成功。 LSNRCTL> set password Password: <the password you chose> The mand pleted suessfully /在Oracle 10g 中不会出现类似的问题,因为在10g中可以使用基于操作系统验证方式。listener将检测到如果用户属于dba组的成员, 将会被授予改变密码,保存配置以及停止监听等权限。 /
6. 配置listener.ora中ADMIN_RESTRICTIONS参数
参数作用
当在listener.ora文件中设置了ADMIN_RESTRICTIONS参数后,在监听器运行时,不允许执行任何管理命令,set命令将不可用
,不论是在服务器本地还是从远程执行都不行。此时对于监听的设置仅仅通过手工修改listener.ora文件,要使修改生效,只能
使用lsnrctl reload命令或lsnrctl s/start命令重新载入一次监听器配置信息。
修改方法
在listener.ora文件中手动加入狼蚁网站SEO优化这样一行
ADMIN_RESTRICTIONS_<监听器名> = ON
狼蚁网站SEO优化是其它网友的补充
LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ecp-uc-db1)(PORT=1521)))
Password changed for LISTENER
The mand pleted suessfully
LSNRCTL> set password
Password:
The mand pleted suessfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ecp-uc-db1)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File /opt/oracle/product/10.2.0/db_1/work/admin/listener.ora
Old Parameter File /opt/oracle/product/10.2.0/db_1/work/admin/listener.bak
The mand pleted suessfully
[oracle@ecp-uc-db1 admin]$ cat listener.ora
#—-ADDED BY TNSLSNR 10-JUN-2011 18:13:24—
PASSWORDS_LISTENER = 6D7AA003392C436A
#——————————————–
note10g数据库上需要上添加(重启监听)
LOCAL_OS_AUTHENTICATION_LISTENER = OFF
1、添加LOCAL_OS_AUTHENTICATION_LISTENER = OFF之前
Security ON: Password or Local OS Authentication
2、添加LOCAL_OS_AUTHENTICATION_LISTENER = OFF之后
Security ON: Password
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ecp-uc-db1)(PORT=1521)))
TNS-01169: The listener has not recognized the password
LSNRCTL> s
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ecp-uc-db1)(PORT=1521)))
TNS-01169: The listener has not recognized the password
LSNRCTL> set password 123456
The mand pleted suessfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ecp-uc-db1)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0 – Production
Start Date 10-JUN-2011 18:15:49
Uptime 0 days 0 hr. 1 min. 16 sec
Trace Level off
Security ON: Password
SNMP OFF
Listener Parameter File /opt/oracle/product/10.2.0/db_1/work/admin/listener.ora
Listener Log File /opt/oracle/product/10.2.0/db_1/work/log/listener.log
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ECP-UC-DB1)(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 “ecp” has 1 instance(s).
Instance “ecp”, status READY, has 1 handler(s) for this service…
Service “ecpXDB” has 1 instance(s).
Instance “ecp”, status READY, has 1 handler(s) for this service…
Service “ecp_XPT” has 1 instance(s).
Instance “ecp”, status READY, has 1 handler(s) for this service…
The mand pleted suessfully
编程语言
- 甘肃哪有关键词排名优化购买方式有哪些
- 甘肃SEO如何做网站优化
- 河南seo关键词优化怎么做电话营销
- 北京SEO优化如何做QQ群营销
- 来宾百度关键词排名:提升您网站曝光率的关键
- 卢龙关键词优化:提升您网站排名的策略与技巧
- 山东网站优化的注意事项有哪些
- 四川整站优化怎样提升在搜索引擎中的排名
- 疏附整站优化:提升网站性能与用户体验的全新
- 海南seo主要做什么工作售后服务要做到哪些
- 荣昌百度网站优化:提升您网站的搜索引擎排名
- 河北seo网站排名关键词优化如何做SEO
- 江西优化关键词排名推广售后保障一般有哪些
- 古浪SEO优化:提升你的网站可见性
- 西藏网站排名优化怎么把网站排名在百度首页
- 如何提升阳东百度快照排名:详尽指南