exp與expdp的區別


數據泵導出導入與傳統導出導入的區別

 

在10g之前,傳統的導出和導入分別使用EXP工具和IMP工具,從10g開始,不僅保留了原有的EXP和IMP工具,還提供了數據泵導出導入工具EXPDP和IMPDP.使用EXPDP和IMPDP時應該注意的事項:

1)EXP和IMP是客戶端工具程序,它們既可以在可以客戶端使用,也可以在服務端使用。

2)EXPDP和IMPDP是服務端的工具程序,他們只能在ORACLE服務端使用, 不能在客戶端使用。

3) IMP 只適用於EXP 導出文件, 不適用於EXPDP 導出文件;IMPDP 只適用於EXPDP 導出文件, 而不適用於EXP 導出文件。

 

其中:

數據泵取只能在服務器端運行,客戶端只能用來連接服務器啟動導入導出操作

即:從192.168.10.201 執行248 導出命令后,導出的數據存儲在248 上。也就是201 只是調用了248 的expdp 命令而已;

 

 

Exp 遠程導出

如果高版本數據庫導出低版本數據庫數據會產生

EXP-00008: ORACLE 錯誤 904 出現

ORA-00904: 無效列名

EXP-00000: 導出終止失敗

 

201 導出248 中scott 用戶下的dept 

 

配置網絡

192.168.1.201

[oracle@localhost admin]$ vim $ORACLE_HOME/network/admin/tnsnames.ora

248 =

     (DESCRIPTION =

         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.248)(PORT = 1521))

              (CONNECT_DATA =

                  (SERVER = DEDICATED)

                     (SERVICE_NAME = orcl)

             )

       )

[oracle@localhost admin]$ tnsping 248

 

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 23-4月 -2015 09:29:05

 

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

 

已使用的參數文件:

/opt/oracle/product/10.2.0/network/admin/sqlnet.ora

 

已使用 TNSNAMES 適配器來解析別名

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.248)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))

OK (0 毫秒)

 

 

2 遠程導出

[oracle@localhost exp]$ exp scott/tiger@248 file=dept.dmp tables=dept

 

Export: Release 10.2.0.1.0 - Production on 星期四 4月 23 09:24:10 2015

 

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

 

 

連接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

已導出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集

 

即將導出指定的表通過常規路徑...

. . 正在導出表                            DEPT導出了           4 行

成功終止導出, 沒有出現警告。

 

[oracle@localhost exp]$ strings dept.dmp >dept.txt

[oracle@localhost exp]$ cat dept.txt

 

 

expdp 遠程導出

 

[oracle@localhost chen]$ expdp scott/tiger@248 directory=chen_dir tables=dept du

mpfile=deptaaa.dmp

 

Export: Release 10.2.0.1.0 - Production on 星期四, 23 4月, 2015 11:15:01

 

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

 

連接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

ORA-39002: 操作無效

ORA-39070: 無法打開日志文件。

ORA-39087: 目錄名 CHEN_DIR 無效      

 

因為客戶端201 配置了目錄及權限,但是服務端沒有配置目錄及權限,客戶端只是調用服務端expdp 命令而已

 

192.168.10.248

 

SQL> conn /as sysdba

Connected.

 

SQL> create directory chen_dir as '/home/oracle11/exp';

 

Directory created.

 

SQL> grant read,write on directory chen_dir to scott;

 

Grant succeeded.       

 

192.168.10.201

[oracle@localhost chen]$ expdp scott/tiger@248 directory=chen_dir tables=dept dumpfile=dept201-248.dmp

 

Export: Release 10.2.0.1.0 - Production on 星期四, 23 4月, 2015 12:26:25

 

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

 

連接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

啟動 "SCOTT"."SYS_EXPORT_TABLE_01":  scott/********@248 directory=chen_dir tables=dept dumpfile=dept201-248.dmp

正在使用 BLOCKS 方法進行估計...

處理對象類型 TABLE_EXPORT/TABLE/TABLE_DATA

使用 BLOCKS 方法的總估計: 64 KB

處理對象類型 TABLE_EXPORT/TABLE/TABLE

處理對象類型 TABLE_EXPORT/TABLE/INDEX/INDEX

處理對象類型 TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

處理對象類型 TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

處理對象類型 TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

. . 導出了 "SCOTT"."DEPT"                              5.937 KB       4 行

已成功加載/卸載了主表 "SCOTT"."SYS_EXPORT_TABLE_01"

******************************************************************************

SCOTT.SYS_EXPORT_TABLE_01 的轉儲文件集為:

  /home/oracle11/exp/dept201-248.dmp

作業 "SCOTT"."SYS_EXPORT_TABLE_01" 已於 12:51:39 成功完成

 

 

192.168.10.248

[oracle11@localhost exp]$ ls

dept201-248.dmp  export.log  

轉自:http://blog.itpub.net/29785807/viewspace-1593229/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM