使Oracle能同时访问多个SQL Server
2007-05-08 12:09:07 来源:WEB开发网核心提示: 2、Oracle8i,Oracle9i的服务器端配置tnsnames.ora, 添加下面的内容:pubs =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521)))
2、Oracle8i,Oracle9i的服务器端配置tnsnames.ora, 添加下面的内容:
pubs =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
(CONNECT_DATA =
(SID = pubs)
)
(HS = pubs)
)
northwind =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
(CONNECT_DATA =
(SID = northwind)
)
(HS = northwind) )
保存tnsnames.ora后,在命令行下:
tnsping pubs
tnsping northwind
出现类似提示,即为成功:Attempting to contact (DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)
(PORT = 1521))) (CONNECT_DATA = (SID = pubs)) (HS = pubs))
OK(20毫秒)
Attempting to contact (DESCRIPTION = (ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)
(PORT = 1521)))
(CONNECT_DATA = (SID = northwind)) (HS = northwind))OK(20毫秒)
设置数据库参数global_names=false。
设置global_names=false不要求建立的数据库链接和目的数据库的全局名称一致。global_names=true则要求, 多少有些不方便。
oracle9i和oracle8i都可以在DBA用户下用SQL命令改变global_names参数:
alter system set global_names=false;
建立公有的数据库链接:
create public database link pubs
connect to testuser identified by testuser_pwd using 'pubs';
create public database link northwind
connect to testuser identified by testuser_pwd using 'northwind';
(假设SQL Server下pubs和northwind已有足够权限的用户登陆testuser,密码为testuser_pwd)
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接