ORACLE 9i连接SYBASE的透明网关的配置
2010-06-10 15:12:06 来源:WEB开发网7.配置oracle server的tnsnames.ora使其能够访问sybase
connect_descriptor=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST= host_name)
(PORT= port_number)
)
(CONNECT_DATA=
(SID= gateway_sid))
(HS=OK))
connect_descriptor是连接串,任取,一般为sybs
host_name:oracle server的name
port_number:oracle监听端口
gateway_sid就是3选择的sid字符串
例子如下:
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
sybs=
(DESCRIPTION=
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST= dw-server1)(PORT= 1521))
)
(CONNECT_DATA=
(SID= tg4sybs)
)
(HS=OK)
)
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
8.建立database link
如:
CREATE DATABASE LINK sybs CONNECT TO sa
IDENTIFIED BY prient
USING "SBYS" ;
即可访问sybase 数据库。
需要注意的是,sybase数据库的表名,字段名,如果是小写的,那么在oracle里访问的时候要加上双引号""
如:
SQL〉select "a" from "b"@sybs;
更多精彩
赞助商链接