---
title: "oracle DBlink mysql sqlserver问题"
author: "lujin55"
date: "2013-01-29T13:25:33Z"
tags: []
categories: ["数据库"]
slug: "oracle-dblink-mysql-sqlserver"
draft: false
lastmod: "2013-01-29T13:25:33Z"
id: 1773298
url: "https://lujin55.iteye.com/blog/1773298"
---

oracle连接sqlserver  使用的是 unixodbc+freetds+DBlink
问题 freetds安装后没有libtdsodbc.so
原因：sql.h找不到，是因为安装unixODBC时它的三个包(lib,bin,include)会默认放入/usr/local对应的三个包中。而不需要安装的unixODBC是放在你自己的目录中，虽然你在./confiugre时，指定了--with-unixodbc，可是还是找不到。
解决：所以你必须把unixODBC下的三个包考到/usr/local对应的三个包中，这样安装时就可以找到libtdsodbc.so


问题 Adaptive Server connection failed
解决：isql -v mysqlserver test test    需要指定用户名，密码 


问题
Some character(s) could not be converted into client's character set  Unconverted bytes were changed to question marks ('?') 42000
解决：在freetds.conf中配置client charset = UTF-8

问题
ORA-00942: 表或视图不存在
Table ‘test’ doesn't exist {42S02,NativeErr = 1146}
ORA-02063: 紧接着 2 lines (起自 MYODBC3)
00942. 00000 -  "table or view does not exist"
*Cause:    
*Action:
解决：你odbc.ini中指定的数据库，与你要查的表所在数据库不一致。也有可能是表不存在。

问题： Unable to connect to data source
原因：这个是找不到odbc.ini，虽然你连接isql正确，但还是报错。
解决：init+DNSnme中是否指定odbc.ini路径。并且最好使用系统默认提供的odbc.ini.




有问题可以留言