一、实现目标:
要实现从源表:AAA到目标表:BBB的数据同步。
二、在目标机上建立Oracle DB Link:
1、 在network/admin/tnsname.ora文件中加入源库的连接信息,如:
AAA=
(DESCRIPTION =
(ADDRESS =(PROTOCOL=TCP)(HOST=10.5.1.3)(PORT=1521 ))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME= AAA)
)
)
(DESCRIPTION =
(ADDRESS =(PROTOCOL=TCP)(HOST=10.5.1.3)(PORT=1521 ))
(CONNECT_DATA=
(SERVER = DEDICATED)
(SERVICE_NAME= AAA)
)
)
2、在目标机上用sqlplus user/pwd登录。
3、用如下命令建立DB Link:
createpublicdatabaselinkAAA_LINKconnecttouseridentifiedbypwdusing'AAA'
;