创建db_link
create database link DB_LINK
connect to sdj
identified by sdj
using '(DESCRIPTI>
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 139.129.108.89)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)';
--如果是分区表
--在新的数据中创建一张相同结构的表(有分区创建分区表)
create table tablename(.....) ;
使用dblink导入数据
insert into tablename select * from oldtablename@DB_LINK;
--如果不是分区表
create table tablename as (select * from oldtablename@DB_LINK);