Windos PL/SQL 访问 Linux Oracle11g 出现 ORA-12541

AlenCheng 2014-12-14 11:45:21
麻烦大家帮忙看下标题所述的错误是什么原因。很急!!
小弟在这先谢谢各位了。
下面是我本地的配置信息。

1、Linux使用的是桥接的方式

2、Oracle服务已经启动

[oracle@localhost bin]$ ./dbstart $ORACLE_HOME
Processing Database instance "orcl": log file /home/oracle/app/oracle/product/11.2.0/dbhome_1/startup.log

startup.log内容:
Sat Dec 13 19:38:16 PST 2014


SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 13 19:38:16 2014

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

SQL> Connected to an idle instance.
SQL> ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size 2213776 bytes
Variable Size 939526256 bytes
Database Buffers 654311424 bytes
Redo Buffers 7360512 bytes
Database mounted.
Database opened.
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

./dbstart: Database instance "orcl" warm started.


3、Listener已经启动

[oracle@localhost bin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-DEC-2014 19:40:04

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=16.156.214.130)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 13-DEC-2014 19:38:16
Uptime 0 days 0 hr. 1 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=16.156.214.130)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@localhost bin]$


3、linux中Oracle服务端listener.ora配置

[oracle@localhost admin]$ cat listener.ora
# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 16.156.214.130)(PORT = 1521))
)
)

ADR_BASE_LISTENER1 = /home/oracle/app

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 16.156.214.130)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /home/oracle/app


4、linux中Oracle服务端tnsnames.ora配置

[oracle@localhost admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ICIS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 16.156.214.130)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ICIS)
)
)
[oracle@localhost admin]$


5、tnsping成功

[oracle@localhost ~]$ tnsping ICIS

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 13-DEC-2014 19:34:43

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

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 16.156.214.130)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ICIS)))
OK (0 msec)
[oracle@localhost ~]$


6、Windows中PL/SQL配置tnsnames.ora

ICIS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 16.156.214.130)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ICIS)
)
)


7,window和linux之间可以ping通

C:\Users\chengk>ping 16.156.214.130

Pinging 16.156.214.130 with 32 bytes of data:
Reply from 16.156.214.130: bytes=32 time<1ms TTL=64
Reply from 16.156.214.130: bytes=32 time<1ms TTL=64
Reply from 16.156.214.130: bytes=32 time<1ms TTL=64
Reply from 16.156.214.130: bytes=32 time<1ms TTL=64

Ping statistics for 16.156.214.130:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
...全文
378 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
what's ur firewall configuration?
AlenCheng 2014-12-14
  • 打赏
  • 举报
回复
发现一个很奇怪的问题,我在window在tnsping ICIS。 host是个不一样的IP。 HOST = 16.157.133.72 Linux的IP应该是192.168.111.132,我本地的IP是

C:\Users\chengk>tnsping ICIS

TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 14-12ŒŽ-2014 15:02:20

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

Used parameter files:
C:\ORACLE\product\11.2.0\client_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 16.157.133.7
2)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = icis)))
TNS-12541: TNS:no listener
AlenCheng 2014-12-14
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
what's ur firewall configuration?
I added the configuration in listener.ora. still error : ORA-12541.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_NAME = orcl)
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = orcl)
  )
)

SID_LIST_LISTENER1 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_NAME = orcl)
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = orcl)
  )
)
AlenCheng 2014-12-14
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
what's ur firewall configuration?
firewall configuration:

[root@localhost ~]# cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@localhost ~]# ^C
[root@localhost ~]# service iptables status
iptables: Firewall is not running.
[root@localhost ~]#

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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