我在我的mac上在Centos VM上安装了11g.我已经完成所有工作并在服务器上运行.我已经包含了以下命令,我在cenos上运行.
$lsnrctl状态
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-JUN-2014 14:49:41
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hayer)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 23-JUN-2014 14:03:58
Uptime 0 days 0 hr. 45 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/hayer/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hayer)(PORT=1522)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
我的tnsnames.ora文件如下:
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = hayer)(PORT = 1522))
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hayer)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(SID = orcl)
)
)
~
~
~
~
在Centos服务器上我也可以使用sqlplus登录.我将Windows上的tnsnames.ora更改为与server相同.我在Windows主机文件中添加了oracle主机信息,我可以在端口1522上ping oracle主机和telnet主机.
我已禁用服务iptables,因此centos上不存在任何类型的防火墙.
但我仍然在Windows客户端上出现以下错误:
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 23 14:51:31 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Enter user-name: system as sysdba
Enter password:
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name: system as sysdba
Enter password:
ERROR:
ORA-12560: TNS:protocol adapter error