expdp通过db_link远程导出

环境:两台服务器都是linux,数据库版本都是11.2.0.4
node1:192.168.1.128 prod
node2 192.168.1.129 prod2
将节点1的t1用户远程导出到节点2上。
节点1:
[oracle@linux01 ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 4 14:00:45 2017


Copyright (c) 1982, 2013, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create user t1 identified by t1 default tablespace users;


User created.


SQL> grant connect,resource,dba to t1;


Grant succeeded.


SQL> conn t1/t1
Connected.
SQL> create table t1 (id number,name varchar2(60));


Table created.


SQL> insert into t1 values(1,'软件');


1 row created.


SQL> select * from t1;


        ID NAME
---------- -------------------------
         1
         1 软件
SQL> SELECT INSTANCE_NAME FROM V$INSTANCE;


INSTANCE_NAME
----------------
prod
节点2:
配置tns
[oracle@linux02 admin]$ cat tnsnames.ora 
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


PROD1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = prod)
    )
  )
查看目录
SQL> select * from dba_directories;


OWNER                          DIRECTORY_NAME                 DIRECTORY_PATH
------------------------------ ------------------------------ ------------------------------
SYS                            SD                             /u01/app/oracle/oradata/prod2/
SYS                            DD                             /u01/arch2
创建public network
SQL> create public database link dblink2 connect to system identified by oracle using 'prod1';


Database link created.


执行导出命令
[oracle@linux02 ~]$ expdp system/oracle network_link=dblink2 directory=dd dumpfile=t1.dmp logfile=t1.log schemas=t1
--expdp属于服务端工具,而exp属于客户端工具,expdp生成的文件默认是存放在服务端的,而exp生成的文件是存放在客户端的
如果使用network_link远程导出,必须远端也装有oracle数据库,只有client端没有办法利用数据泵远程导的。
数据库中不能有大文件字段,第二个就是表的分表不能导出。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29618264/viewspace-2148302/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29618264/viewspace-2148302/

你可能感兴趣的:(expdp通过db_link远程导出)