实际建立DB-LINK,两个数据库之间的数据公用
创建DB-LINK
create public database link dblink_名字
connect to 账户名字 identified by 账户密码
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 数据库所在地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = 目标数据的名字)
)
)';
建立完数据库取数据:
CREATE 表名 AS SELECT * FROM 表名@dblink_名字;