ITPub博客

首页 > 数据库 > Oracle > oracle 9i、10g、11g数据库设置listener密码的方法

oracle 9i、10g、11g数据库设置listener密码的方法

Oracle 作者:ysjxjf 时间:2014-08-12 18:01:35 0 删除 编辑

FROM : http://blog.csdn.net/gyanp/article/details/8260446

Oracle 9i、10g在缺省的情况下,允许任何一个人利用lsnrctl从远程发起对监听器的管理。

      Oracle11g在listener加密的情况下,在本服务器上执行lsnrctl status listener_name仍然可以,除非listener.ora里加如下内容:

                                  LOCAL_OS_AUTHENTICATION_LISTENER = OFF


1. 未设定密码情形下停止监听       

 

[oracle@test ~]$ lsnrctl stop listener_name   -->停止监听,可以看出不需要任何密码即可停止                                                   

2. 重新启动监听并设置密码
  1. [oracle@test ~]$ lsnrctl                                                                                                    
  2.                                                                                                                             
  3. LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011 08:24:09                                                   
  4. Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.                                                         
  5.                                                                                                                             
  6. Welcome to LSNRCTL, type "help" for information.                                                                              
  7. LSNRCTL> set current_listener listener_demo92  -->设置当前监听器                                                            
  8. Current Listener is listener_demo92                                                                                         
  9. LSNRCTL> start             -->启动过程也不需要任何密码,启动的详细信息省略                                                   
  10. LSNRCTL> change_password   -->使用change_password来设置密码                                                                 
  11. Old password:   ----之前没设置密码,直接按回车                                                                                                             
  12. New password:                                                                                                               
  13. Reenter new password:                                                                                                       
  14. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))                                                  
  15. Password changed for listener_demo92                                                                                        
  16. The command completed successfully                                                                                          
  17. LSNRCTL> save_config        -->注意此处的save_config失败                                                                    
  18. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))                                                  
  19. TNS-01169: The listener has not recognized the password                                                                     
  20. LSNRCTL> set password       -->输入新设定的密码验证                                                                         
  21. Password:                                                                                                                   
  22. The command completed successfully                                                                                          
  23. LSNRCTL> save_config       -->再次save_config成功                                                                           
  24. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))                                                  
  25. Saved listener_demo92 configuration parameters.                                                                             
  26. Listener Parameter File   /oracle/92/network/admin/listener.ora                                                             
  27. Old Parameter File   /oracle/92/network/admin/listener.bak                                                                  
  28. The command completed successfully                                                                                          
  29.                                                                                                                             
  30. -->增加密码之后可以看到listener.ora文件中有一条新增的记录,即密码选项(注:尽管使用了密码管理方式,仍然可以无需密码启动监听)  
  31. [oracle@test admin]$ more listener.ora                                                                                      
  32.     #----ADDED BY TNSLSNR 26-JUN-2011 05:12:48---                                                                             
  33.     PASSWORDS_listener_demo92 = 678679679hjfh                                                                                              
  34.     #--------------------------------------------                                                                             
3. 尝试未使用密码的情况下停止监听 
  1. [oracle@test ~]$ lsnrctl stop listener_demo92                                                 
  2. LSNRCTL for Linux: Version 9.2.0.8.0 - Production on 26-JUN-2011 06:09:51                     
  3. Copyright (c) 1991, 2006, Oracle Corporation.  All rights reserved.                           
  4.                                                                                               
  5. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=test)(PORT=1521)))                    
  6. TNS-01169: The listener has not recognized the password    -->收到错误信息,需要使用密码认证

 

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

下一篇: rlwrap安装
请登录后发表评论 登录
全部评论

注册时间:2008-04-24

  • 博文量
    381
  • 访问量
    3206372