刚装的数据库,sqlplus可以登录,服务器已经启动,本机tnsping命令出错,大神们帮我看看吧,鼓捣了三天了没明白,本人刚入手鸟。。。
lsnrctl监听己启动
lsnrctl status信息
====================
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-MAR-2012 05:23:52
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 04-MAR-2012 04:13:59
Uptime 0 days 1 hr. 9 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/product/11.1.0/db_1/network/admin/listener.ora
Listener Log File /home/oracle/app/diag/tnslsnr/zjj-radhat6/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
The listener supports no services
The command completed successfully
----------------------
tnsping ORCL错误信息:
====================================
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 04-MAR-2012 05:24:54
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
/home/oracle/app/product/11.1.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = zjj-redhat6)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
TNS-12545: Connect failed because target host or object does not exist
---------------------
tnsnames.ora文件内容
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = zjj-redhat6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
LISTENER_ORCL = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
------解决方案--------------------
写成localhost则只有本机好用,远程访问全都不好用。
建议用IP地址,在服务器主机上先配置好,然后copy, listner.ora和tns.ora到各个客户端的相应目录下。