-2

如何在三个实例之间创建数据库链接?例如,我有名为 orcl、orcl1、orcl2 的数据库如何链接它们?谢谢

4

1 回答 1

1

这些是下面可能对您有帮助的 SQL :)

在数据库 ORCL:

CREATE DATABASE LINK db_link_orcl1
CONNECT TO orcl1_user_name IDENTIFIED BY orcl1_user_password 
USING 'localhost:1521/orcl1';

CREATE DATABASE LINK db_link_orcl2
CONNECT TO orcl2_user_name IDENTIFIED BY orcl2_user_password 
USING 'localhost:1521/orcl2';

在数据库 ORCL1:

CREATE DATABASE LINK db_link_orcl
CONNECT TO orcl_user_name IDENTIFIED BY orcl_user_password 
USING 'localhost:1521/orcl';

CREATE DATABASE LINK db_link_orc2
CONNECT TO orcl2_user_name IDENTIFIED BY orcl2_user_password 
USING 'localhost:1521/orcl2';

在数据库 ORCL2:

CREATE DATABASE LINK db_link_orcl
CONNECT TO orcl_user_name IDENTIFIED BY orcl_user_password 
USING 'localhost:1521/orcl';

CREATE DATABASE LINK db_link_orcl1
CONNECT TO orcl1_user_name IDENTIFIED BY orcl1_user_password 
USING 'localhost:1521/orcl1';
于 2018-05-10T15:22:44.103 回答