求助:sqlplus 远程连接 ora-12514错误

nvd11 2013-10-05 10:31:18
事情是这样的.
本人是oracle 初学者
oracle 11g装在了虚拟机(redhat 5.4)上. 实体机也是linux系统.

我在虚拟机上
用sqlplus / as sysdba 命令是正常登陆的.

实体机上用sqldeveloper 连接虚拟机的数据库, 也是正常的.




但是在实体机上执行sqlplus 远程登陆时会出现ora-12514 错误
sqlplus hr/32565624@192.168.1.105:1521/orcl

gateman@TFPC Programs $ sqlplus hr/32565624@192.168.1.105:1521/orcl

SQL*Plus: Release 12.1.0.1.0 Production on Sat Oct 5 22:14:09 2013

Copyright (c) 1982, 2013, Oracle. All rights reserved.

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor


Enter user-name: ^C
gateman@TFPC Programs $


这个语句就算在虚拟机上执行都会报同样的错误.
网上查找了很久都找不到解决方法. 有大神能帮忙看看吗? 谢谢

下面我会把 listener.ora tnsname.ora 都贴出来:

listener.ora
[oracle@TPRHEL admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/project/11.2.0/db_home1/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl_dbn)
(ORACLE_HOME = /u01/app/oracle/project/11.2.0/db_home1/oracle)
(SID_NAME = orcl)
)
)

ADR_BASE_LISTENER = /u01/app/oracle/project

[oracle@TPRHEL admin]$




tnsname.ora
[oracle@TPRHEL admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/project/11.2.0/db_home1/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.localdomain)
)
)

[oracle@TPRHEL admin]$



lsnrctl 监听状态
[oracle@TPRHEL admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 05-OCT-2013 22:15:39

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 05-OCT-2013 22:04:39
Uptime 0 days 0 hr. 11 min. 2 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/project/11.2.0/db_home1/oracle/network/admin/listener.ora
Listener Log File /u01/app/oracle/project/diag/tnslsnr/TPRHEL/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "orcl.localdomain" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.localdomain" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_dbn" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@TPRHEL admin]$ lsnrctl service

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 05-OCT-2013 22:16:07

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl.localdomain" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:2 refused:0 state:ready
LOCAL SERVER
Service "orclXDB.localdomain" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: TPRHEL, pid: 3088>
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=65294))
Service "orcl_dbn" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
[oracle@TPRHEL admin]$




十分感谢..

...全文
338 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaozheng821018 2013-10-08
  • 打赏
  • 举报
回复
我也遇到类似的问题,本机的ip是10.0.0.16,系统是64位的win7,oracle是64位11g,命令行使用sqlplus 用户名/密码@服务器 登陆没有问题,但是在测试tnsping 的时候出问题了,通过其他电脑连接也出问题ora-12541

C:\Users\Administrator>tnsping 127.0.0.1

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 08-10月-
2013 09:22:49

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

已使用的参数文件:
d:\app\zhongya\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

已使用 EZCONNECT 适配器来解析别名
尝试连接 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST
=127.0.0.1)(PORT=1521)))
OK (0 毫秒)

C:\Users\Administrator>tnsping 10.0.0.16

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 08-10月-
2013 09:23:01

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

已使用的参数文件:
d:\app\zhongya\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

已使用 EZCONNECT 适配器来解析别名
尝试连接 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST
=10.0.0.16)(PORT=1521
皮特尔 2013-10-06
  • 打赏
  • 举报
回复
我也遇到了类似的问题,不能远程登录,在服务器上用这种写法: sqlplus hr/32565624@192.168.1.105:1521/orcl 不能登录 报的错是 ORA-12541: TNS: 无监听程序 把 192.168.1.105 改成 127.0.0.1 反而可以正常登录。 是不是11g的某些功能被限制了?

17,382

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧