1. 在A库中创建dblink连接到B库
create database link dblink_name
connect to user identified by pwd
using service_name ; --B库的用户名和密码,连接字符串
2. insert into test_a select * from test_a@dblink_name where ...
本文介绍如何在A数据库中创建到B数据库的dblink连接,并通过该连接实现两个数据库间的数据同步操作。具体步骤包括定义dblink连接、使用特定语法进行跨库查询及数据插入等。
1. 在A库中创建dblink连接到B库
create database link dblink_name
connect to user identified by pwd
using service_name ; --B库的用户名和密码,连接字符串
2. insert into test_a select * from test_a@dblink_name where ...

被折叠的 条评论
为什么被折叠?