例子如下:
1。监听状态
[oracle@zltechcenter apps]$ lsnrctl
LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 15-MAY-2004 23:12:34
(c) Copyright 1998 Oracle Corporation.All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=zltechcenter)(PORT=1521)
))
STATUS of the LISTENER
------------------------
Alias
LISTENER
Version
TNSLSNR for Linux: Version 8.1.7.0.0 - Production
Start Date
15-MAY-2004 22:09:47
Uptime
0 days 1 hr. 2 min. 48 sec
Trace Level
off
Security
OFF
SNMP
OFF
Listener Parameter File /oracle/product/8.1.7/network/admin/listener.ora
Listener Log File /oracle/product/8.1.7/network/log/listener.log
Services Summary...
orcl
has 1 service handler(s)
orcl
has 2[/COLOR]service handler(s)
The command completed successfully
LSNRCTL>
2。客户端连接
ora-12545 连接因对象主机或对象不存在而失败。
3。停止监听
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=zltechcenter)(PORT=1521)
))
The command completed successfully
4。启动监听
LSNRCTL> start
Starting /oracle/product/8.1.7/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 8.1.7.0.0 - Production
System parameter file is /oracle/product/8.1.7/network/admin/listener.ora
Log messages written to /oracle/product/8.1.7/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zltechcenter)(PORT=1521)
))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=zltechcenter)(PORT=1521)
))
STATUS of the LISTENER
------------------------
Alias
LISTENER
Version
TNSLSNR for Linux: Version 8.1.7.0.0 - Production
Start Date
15-MAY-2004 23:16:23
Uptime
0 days 0 hr. 0 min. 0 sec
Trace Level
off
Security
OFF
SNMP
OFF
Listener Parameter File /oracle/product/8.1.7/network/admin/listener.ora
Listener Log File /oracle/product/8.1.7/network/log/listener.log
Services Summary...
orcl
has 1 service handler(s)
The command completed successfully
LSNRCTL>
5。这时,远程客户端可以连接了。
但等一会,又回出现开始的样子。
奇怪的是,在服务器的本机任何时候都可以连接,怀疑是否是网络的问题,但不知道如何查询。
同时,其他实例启动和连接都正常。
6。 监听器脚本如下:
# LISTENER.ORA Network Configuration File: /oracle/product/8.1.7/network/admi
istener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = zltechcenter)(PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /oracle/product/8.1.7)
(SID_NAME = orcl)
)