WindowsServer2008R2でOracle11gを実行しています。他の場所で実行しているクライアントアプリケーション(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のprintステートメントで、それが呼び出していることがわかります
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に接続できなくなりました。