Oracle LSNRCTL------监听器的启动和关闭
对于DBA来说,启动和关闭oracle监听器是很基础的任务,但是Linux系统管理员或者程序员有时也需要在开发数据库中做一些基本的DBA操作,因此了解一些基本的管理操作对他们来说很重要。
本文将讨论用LSNRCTL命令启动、关闭和查看监听器的状态的方法。
怎样启动、关闭和重新启动oracle监听器
在启动、关闭或者重启oracle监听器之前确保使用lsnrctl status命令检查oracle监听器的状态。除了得到监听器的状态之外,你还可以从lsnrctl status命令的输出中得到如下的信息:
* 监听器的启动时间
* 监听器的运行时间
* 监听器参数文件listener.ora的位置,通常位于$ORACLE_HOME/network/admin目录下
* 监听器日志文件的位置
如果oracle监听器没用运行,你将得到如下的信息
view plaincopy to clipboardprint?
1. $ lsnrctl status
2.
3. LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 04-APR-2009 16:27:39
4.
5. Copyright (c) 1991, 2007, Oracle. All rights reserved.
6.
7. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1521)))
8. TNS-12541: TNS:no listener
9. TNS-12560: TNS:protocol adapter error
10. TNS-00511: No listener
11. Linux Error: 111: Connection refused
12. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
13. TNS-12541: TNS:no listener
14. TNS-12560: TNS:protocol adapter error
15. TNS-00511: No listener
16. Linux Error: 2: No such file or directory
$ lsnrctl status LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 04-APR-2009 16:27:39 Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(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
如果oracle监听器正在运行,你将得到如下信息
view plaincopy to clipboardprint?
1. $ lsnrctl status
2.
3. LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 04-APR-2009 16:27:02
4.
5. Copyright (c) 1991, 2007, Oracle. All rights reserved.
6.
7. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1521)))
8. STATUS of the LISTENER
9. ————————
10. Alias LISTENER
11. Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
12. Start Date 29-APR-2009 18:43:13
13. Uptime 6 days 21 hr. 43 min. 49 sec
14. Trace Level off
15. Security ON: Local OS Authentication
16. SNMP OFF
&n