Database Link 创建注意的两点

Database Link 创建注意的两点:

一般创建(Database Link Name 和 Service Name 一致)

A: 先在 Server 端的tnsname.ora 中增加要访问的 database的连接字符串格式如下:

BPCS = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = Ip Address)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = bpcs) ) )

B: 再用SQL /或OEM 创建 为某用户的DBlink  

CREATE DATABASE LINK "bpcs" CONNECT TO "BQY" IDENTIFIED BY "********" USING 'bpcs'     

特殊创建(Database Link Name 和Service Name 不一致)

A: 首先要在Server 端的 tnsname.ora 中增加要访问的 database的连接字符串格式如下

BACHS = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = IpAddress)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = bpcs) ) )  

B: 要将 Global_name=false

(如果Global_name =true 则在使用创建好的 Databaselink 时会出现如下错误提示)

/* ORA-02085 database link strin conects to strings Cause: The database link attempted to connect to a database with a different name.The name of the database link must be the same as the name of the database. Acton: Create a database link with the same name as the database to which it connects. */

C: 再用SQL /或OEM 创建 为某用户的DBlink

CREATE DATABASE LINK "BACHS" CONNECT TO "BQY" IDENTIFIED BY "********" USING 'BACHS'

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/34596/viewspace-804184/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/34596/viewspace-804184/

你可能感兴趣的:(Database Link 创建注意的两点)