使用场景:当你需要从ORACLE数据库上访问另一台SqlServer数据库的数据时,Oracle提供了一个工具:gateways。通过这个工具,你可以创建dblink来连接sqlserver或其他不同公司的数据库----取决于你安装时的选项
安装GATEWAYS后,使用下列2种方式可创建DBLINK
方式A:
create database link bslink
connect to "username" identified by "password"
using '( DESCRIPTION =
( ADDRESS = ( PROTOCOL = TCP )( HOST = remoteIP )( PORT = 1433 ))
( CONNECT_DATA = (
SID = SQLSERVER数据库名 ) ) ( HS=OK ) ) '
这种方式是不需要配置initdg4msql.ora和tnsnames.
方式B:
1. 在$ORACLE_HOME/dg4msql/admin/initdg4msql ----这步可省略 使用方式A替代
配置initdg4msql.ora,以我的例子,如下:
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database