expdp 简单用法

来源:互联网 发布:sql 查询重复人员 编辑:程序博客网 时间:2024/06/05 07:42
impdp expdp
exp dbu/dbudbu@dfdz_datasrv file=123.dmp buffer=4096000 tables=t0401_data:t0401_data_20150801,t0401_data:t0401_data_20150802
导出
$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 23 14:05:09 2015
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 directory dpdata as '/rdbm/orasrv/dpdata';
Directory created.
SQL> grant write,read on directory dpdata to dbu;
Grant succeeded.
SQL> exit

expdp dbu/dbudbu@dfdz_datasrv dumpfile=dbu.dmp directory=dpdata schemas=dbu

导入
[orasrv@z2rdb1 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 23 14:05:09 2015
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 directory dpdata as '/rdbm/orasrv/dpdata';
Directory created.
SQL> grant write,read on directory dpdata to dbu;
Grant succeeded.
SQL> exit
impdp dbu/dbudbu@dfdz_datasrv file=dbu.dmp schemas=dbu directory=dpdata TABLE_EXISTS_ACTION=REPLACE


3、不通过expdp的步骤生成dmp文件而直接导入的方法:
--从源数据库中向目标数据库导入表p_street_area
impdp gwm/gwm directory=dir_dp NETWORK_LINK=igisdb tables=p_street_area logfile=p_street_area.log  job_name=my_job
igisdb是目的数据库与源数据的链接名,dir_dp是目的数据库上的目录


[orasrv@z3rdb1 ~]$ sqlplus dbu/dbudbu@dfdz_datasrv
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 23 16:09:57 2015
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 database link towebdb connect to dbu identified by dbudbu using 'dfdz_datasrv_bak';

Database link created.
impdp dbu/dbudbu@dfdz_datasrv directory=dpdata NETWORK_LINK= towebdb schemas=DBU TABLE_EXISTS_ACTION=REPLACE

--impdp dbu/dbudbu@dfdz_datasrv directory=dpdata NETWORK_LINK=tozd schemas=DBU TABLE_EXISTS_ACTION=REPLACE PARALLEL=10
0 0
原创粉丝点击