本文主要是介绍oracle 数据库建集群式数据库的DBLINK的语法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
根据需要修改以下红色字体的部分即可。
1、连接集群式数据库DBLINK语法
create public database link 自定义的dblink名字
connect to 连接对方数据库的用户名 identified by "密码"
using '(DESCRIPTION =
(ADDRESS_LIST =
(FAILOVER = ON)
(LOAD_BALANCE = OFF)
(ADDRESS = (PROTOCOL = TCP)(HOST =对方数据库集群服务器1)(PORT = 端口号))
(ADDRESS = (PROTOCOL = TCP)(HOST =对方数据库集群服务器2)(PORT = 端口号))
(ADDRESS = (PROTOCOL = TCP)(HOST =对方数据库集群服务器3)(PORT = 端口号))
(ADDRESS = (PROTOCOL = TCP)(HOST =对方数据库集群服务器4)(PORT = 端口号))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(FAILOVER_MODE=(TYPE=select)(METHOD=basic))
(INSTANCE_ROLE = ANY)
(SERVICE_NAME = 对方数据库的服务名)))';
2、单机数据库服务器DBLINK语法:
CREATE public database 自定义的dblink名字
connect to 连接对方数据库的用户名 identified by "密码"
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 对方数据库服务器 )(PORT = 端口号))
)
(CONNECT_DATA =
(SERVICE_NAME = 对方数据库的服务名))
)';
这篇关于oracle 数据库建集群式数据库的DBLINK的语法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!