0

我在 Windows Server 2008R2 上运行 Oracle 11g。我有一个在其他地方运行的客户端应用程序(Zabbix)试图连接到它。

客户端机器具有:

  • oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm
  • oracle-instantclient11.2-devel-11.2.0.3.0-1.i386.rpm

因此,它没有 sqlnet.ora 或 tnsnames.ora 文件。它正在尝试使用直接寻址建立连接。使用 php 中的打印语句,我看到它正在调用

ociplogon(user,password,$connect);

将 connect 设置为//dbhostmachine:1521/zabbix。所以那里的一切看起来都很好。

C:\Users\mdobrini> lsnrctl services

LSNRCTL for 64-bit Windows: Version 11.1.0.7.0 - Production on 02-NOV-2012 13:00:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhostmachine.dddd.cccc.com)(POR
Services Summary...
Service "zabbix" has 1 instance(s).
  Instance "zabbix", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:578 refused:0 state:ready
         LOCAL SERVER
Service "zabbixXDB" has 1 instance(s).
  Instance "zabbix", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: dbhostmachine, pid: 6384>
         (ADDRESS=(PROTOCOL=tcp)(HOST=dbhostmachine.dddd.cccc.com)(PORT=61396))
Service "zabbix_XPT" has 1 instance(s).
  Instance "zabbix", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:578 refused:0 state:ready
         LOCAL SERVER
The command completed successfully

尝试在本地连接工作正常:

SQL*Plus: Release 11.1.0.7.0 - Production on Fri Nov 2 13:06:31 2012

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

Enter user-name: SYSTEM
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

SQL> connect uuu/ppp@localhost/zabbix
Connected.
SQL>  

但是,远程我得到了流行的错误:

ociplogon(): ORA-12154: TNS:could not resolve the connect identifier specified 

奇怪的是,它之前一直在间歇性地工作。我的应用程序中每 10 秒就会出现一个错误:

30923:20121101:142237.595 [Z3001] connection to database '//dbhostmachine:1521/zabbix'     failed: [-1] ORA-12516: TNS:listener could not find available handler with matching   protocol stack
30923:20121101:142237.596 watchdog: database is down

但是肯定有数据通过网络发送,并保存在数据库中。重新启动应用程序和服务器后,我根本无法获得连接,我一直在关注 ORA-12154

4

1 回答 1

0

ORA-12154 是由 DNS 问题引起的。切换到IP地址后就消失了。

ORA-12516 是由数据库上达到的最大会话/进程引起的。在调整它以及一些 PHP OCI8 参数之后,它也消失了。

于 2012-11-12T16:20:48.647 回答