日期:2014-05-16  浏览次数:21350 次

dg4odbc 连接 MySql
Server 1: CentOS 5 32bit,  Oracle 11gr2
Server 2: Windows 2008 x86, MySql 5.5

Oracle 已经安装了MySql odbc的驱动。
并且isql测试成功。

参考了网上很多片的文档,但还有会有报错。
SQL> select * from "table"@MySQL;
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from MYSQL

然后我开了listener的trace log级别到5,日志显示:
 nsc2addr:(ADDRESS=(PROTOCOL=beq)(PROGRAM=/u01/app/oracle/product/11.2/bin/dg4odbc)(ENVS='LD_LIBRARY_PATH=/usr/lib:/u01/app/oracle/product/11.2/lib,ORACLE_HOME=/u01/app/oracle/product/11.2,ORACLE_SID=test')(ARGV0=dg4odbctest)(ARGS='(LOCAL=NO)'))
2014-03-26 21:17:32.222585 : nsbeqaddr:connecting...
2014-03-26 21:17:32.222644 : nsopen:opening transport...
2014-03-26 21:17:32.229845 : sntpcall:detaching from parent with additional fork
2014-03-26 21:17:32.230186 : sntpcall:hdl[IR]=19, hdl[IW]=18
2014-03-26 21:17:32.230509 : nsopen:global context check-in (to slot 7) complete
2014-03-26 21:17:33.843374 : sntpcall:only 0 bytes read
2014-03-26 21:17:33.843426 : sntpcall:Can't read from pipe; err[1] = 32

$ORACLE_HOME/hs/log,却没有产生trace log。

因此我认为listener是已经解析到listener.ora中我的SID的,但不知为什么没有调用到dg4odbc。
搞了两天了,头都大了。
求高人赐教。

下面是我的几个配置文件的内容:
-----------------------------------------------------------------------------------------------------------------------
#tnsnames.ora: $ORACLE_HOME/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

test=
(DESCRIPTION=
  (ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
  ( CONNECT_DATA=
    (SERVER=DEDICATED)
    (SID=test)
  )
  (HS=OK)
)

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.localdomain)
    )
  )
-----------------------------------------------------------------------------------------------------------------------
 #listener.ora: $ORACLE_HOME/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
   (SID_DESC =
      (SID_NAME = test)
      (ORACLE_HOME =/u01/app/oracle/product/11.2)
      (PROGRAM = dg4odbc)
      (ENVS="LD_LIBRARY_PATH=/usr/lib:/u01/app/oracle/product/11.2/lib")
   )
)

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCO