新装的测试服务器,使用plsql 远程连接时报 tns连接超时,感觉应该是问题出在服务器的监听上;
查看监听状态:
-----------------------------------------------------------------------------------------------------------------
[oracle@localhost ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-AUG-2011 11:55:20
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /install/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /install/network/admin/listener.ora
Log messages written to /install/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.5)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-AUG-2011 11:55:20
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /install/network/admin/listener.ora
Listener Log File /install/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
--------------------------------------------------------------------------------------------------------------
查看listener.ora
[oracle@localhost admin]$ cat listener.ora
# listener.ora Network Configuration File: /install//network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /install/)
# (PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.72.5 )(PORT = 1521))
)
)
为动态注册;
-------------------------------------------------------------------------------
查看tns文件:
PARAMTER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.72.5)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = parameter)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
---------------------------------------------------------------
查看监听的参数:
SQL> show parameters local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
为空
首先修改 tnsname.ora 文件为:
[oracle@localhost ~]$ cat /install/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /install/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.72.5)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = parameter)
)
)
---------------------------------------------------------------------------------------------------------------
在sqlplus中,修改参数:
SQL> alter system set local_listener=LISTENER;
System altered.
此时查看监听的状态:
[oracle@localhost ~]$ lsnrctl stat
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-AUG-2011 11:56:05
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.5)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-AUG-2011 11:55:20
Uptime 0 days 0 hr. 0 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /install/network/admin/listener.ora
Listener Log File /install/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "parameter" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
Service "parameterXDB" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
Service "parameter_XPT" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
The command completed successfully
查看监听状态:
-----------------------------------------------------------------------------------------------------------------
[oracle@localhost ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-AUG-2011 11:55:20
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /install/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /install/network/admin/listener.ora
Log messages written to /install/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.5)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-AUG-2011 11:55:20
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /install/network/admin/listener.ora
Listener Log File /install/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
--------------------------------------------------------------------------------------------------------------
查看listener.ora
[oracle@localhost admin]$ cat listener.ora
# listener.ora Network Configuration File: /install//network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /install/)
# (PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.72.5 )(PORT = 1521))
)
)
为动态注册;
-------------------------------------------------------------------------------
查看tns文件:
PARAMTER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.72.5)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = parameter)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
---------------------------------------------------------------
查看监听的参数:
SQL> show parameters local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
为空
首先修改 tnsname.ora 文件为:
[oracle@localhost ~]$ cat /install/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /install/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.72.5)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = parameter)
)
)
---------------------------------------------------------------------------------------------------------------
在sqlplus中,修改参数:
SQL> alter system set local_listener=LISTENER;
System altered.
此时查看监听的状态:
[oracle@localhost ~]$ lsnrctl stat
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-AUG-2011 11:56:05
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.72.5)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-AUG-2011 11:55:20
Uptime 0 days 0 hr. 0 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /install/network/admin/listener.ora
Listener Log File /install/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.72.5)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "parameter" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
Service "parameterXDB" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
Service "parameter_XPT" has 1 instance(s).
Instance "parameter", status READY, has 1 handler(s) for this service...
The command completed successfully
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25656398/viewspace-705341/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25656398/viewspace-705341/