create public database link
链接名
connect to
远程数据库用
户名
identified by
远程数据库用户对应的密码
by using ‘
远
程数据库地址
/SID’
drop public database link dblink1
放弃
dblink1
drop public database link
连接名
select * from dba_db_links
查找所有的
dblink
select * from table1@dblink1;
使用
dblink1
查询
table1
select * from
表名
@
链接名
;
3.
结合
DB_LINK
使用数据泵
(expdp/impdp)
语法总结
----
从远程库中导出数据文件
tables
至本地
----
expdp localUSER/localPASS network_link = dblink1
dumpfile=tables .dmp tables=remoteXX .talbe1
使用
dblink1
,使用数据泵从远程库中导出
remoteXX
用户下的
table1
至
tables .dmp
中
expdp
本地库用户名
/
本地库用户密码
network_link =
链接名
dumpfile =
导出的文件名
.dmp tables=
远程库用户名
.
表名
----
将从本地库中导出的数据文件
tables
导入远程库中
----
Impdp localUSER/localPASS network_link=dblink1
dumpfile=tables tables=remoteUSER .table1
remap_schema=localUSER:remoteUSER
remap_tablespace=localSpace:remoteSpace
评论