oracle的dump导入mysql,oracle导出导入(数据泵)dump文件到本地

EXPDP 通过 NETWORK_LINK 导出远程库到本地:

在客户端数据库创建 dblink 和要保存数据文件的目录:

使用plsql登录本地数据库

conn /

如用cawy_cas用户名登录本地数据库,然后用下列语句创建远程数据库桥接

create database link connect to identified by using '';

create database link ddd connect to sde identified by sde using 'azuay';

(其中sde用户是远端数据库上的一个用户;azuay是本机TNS中定义的一个连接字符串,azuay是远程服务名,其实这个链接的作用就是使用

TNS中的连接字符串、使用远端数据库上的合法用户sde来登录远端数据库)

检查远程数据库有否有效

select * from global_name@link5;

检查dir文件目录是否存在

select * from dba_directories;

conn / as sysdba

create or replace directory expdir as 'D:\oracle\expdir';

grant read, write on directory expdir to ;(此用户为远程数据库用户)

导出到本地:

expdp / directory=expdir network_link=

expdp cawy_cas/oracle DIRECTORY=dir NETWORK_LINK=ddd DUMPFILE=azuay_0627_network.dmp

(cawy_cas/oracle为本地账号密码,而ddd中包含远程服务器账号密码)

删除 dblink:

drop database link ;

a)创建到服务端的dblink

conn aa/aacc

create database link link_name connect to bb identified by password using 'connect_string';

b) 建立 directory

conn / as sysdba

create or replace directory dir as 'directory';

grant read,write on directory dir to bb;

c) 通过 network_link导出

expdp aa/aacc directory=dir network_link=link_name ...

远程直接导入:

检查db link是否存在,如果不存在需要创建

SQL> select * from dba_db_links;

Impdp cawy_cas/oracle DIRECTORY=expdir NETWORK_LINK=EEE schemas=sde