您的位置:首页 > 数据库 > Oracle

oracle建多个dblink

2009-12-28 22:56 295 查看
用tg4mssql链接oracle.



过程不在描述,google很多。



问题:

1、mssql express的时候,失败

将server用转义字符写出,成功。

HS_FDS_CONNECT_INFO="SERVER=SHAM0415//SQLEXPRESS;DATABASE=GMT_KJ"







2、建多个的时候,不能解析。 tnsping 命令总不通过。

找了很多,同一个帖子,转了无数次。。

唉。。中国的技术啊。。



自己研究,最后发现

MSSQL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

(CONNECT_DATA =

(SID = MSSQL))

(HS= OK)

)



MSSQL要顶格写,前面不允许有空格。

查了一下,除连接串名字(如:MSSQL)外,其他行(每一行)首应该有空格(space)。

(HS= OK) 不可缺。



3、当tg4msql挂起的时候,请先确认是不是 表名或者view名写错了。

我过几天再使用时,表名写错了,弄了好几个小时都没发现。太失败了。







转一个例子:



oracle.net.config.ServiceAliasException:10

答:

这是由于tnsnames.ora文件格式不对,

应注意除连接串名字(如:BCV)外,其他行(每一行)首应该有空格(space)。

附件:

把tnsnames.ora文件中的

BCV=

(space)[ (DESCRIPTION_LIST = # Optional depending on whether u have

(space)# one or more descriptions

(space)# If there is just one description, unnecessary ]

(space)(DESCRIPTION=

(space)[ (SDU=2048) ] # Optional, defaults to 2048

(space)# Can take values between 512 and 32K

(space)[ (ADDRESS_LIST= # Optional depending on whether u have

(space)# one or more addresses

(space)# If there is just one address, unnecessary ]

(space)(ADDRESS=

(space)[ (COMMUNITY=) ]

(space)(PROTOCOL=tcp)

(space)(HOST=)

(space)(PORT=)

(space))

(space)[ (ADDRESS=

(space)(PROTOCOL=ipc)

(space)(KEY=)

(space))

(space)]

(space)[ (ADDRESS=

(space)[ (COMMUNITY=) ]

(space)(PROTOCOL=decnet)

(space)(NODE=)

(space)(OBJECT=)

(space))

(space)]

(space)... # More addresses

(space)[ ) ] # Optional depending on whether ADDRESS_LIST is used or not

(space)[ (CONNECT_DATA=

(space)(SID=)

(space)[ (GLOBAL_NAME=) ]

(space))

(space)]

(space)[ (SOURCE_ROUTE=yes) ]

(space))

(space)(DESCRIPTION=

(space)[ (SDU=2048) ] # Optional, defaults to 2048

(space)# Can take values between 512 and 32K

(space)[ (ADDRESS_LIST= ] # Optional depending on whether u have more

(space)# than one address or not

(space)# If there is just one address, unnecessary

(space)(ADDRESS

(space)[ (COMMUNITY=) ]

(space)(PROTOCOL=tcp)

(space)(HOST=)

(space)(PORT=)

(space))

(space)[ (ADDRESS=

(space)(PROTOCOL=ipc)

(space)(KEY=)

(space))

(space)]

(space)... # More addresses

(space)[ ) ] # Optional depending on whether ADDRESS_LIST

(space)# is being used

(space)[ (CONNECT_DATA=

(space)(SID=)

(space)[ (GLOBAL_NAME=) ]

(space))

(space)]

(space)[ (SOURCE_ROUTE=yes) ]

(space))

(space)[ (CONNECT_DATA=

(space)(SID=)

(space)[ (GLOBAL_NAME=) ]

(space))

(space)]

(space)... # More descriptions

(space)[ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: