expdp中使用include或者exclude匯出資料
expdp中使用include或者exclude匯出資料就是多了一個篩選關鍵詞。
---匯出Scott模式中所有的物件,除了emp表與dept表不匯出來(exclude):
--匯出策略:
expdp scott/tiger directory=homedir dumpfile=scott_all_tab.dmp
schemas=scott exclude=table:\" in\(\'EMP\',\'DEPT\'\)\"
[oracle@enmo homedir]$ expdp scott/tiger directory=homedir dumpfile=scott_all_tab.dmp schemas=scott exclude=table:\" in\(\'EMP\',\'DEPT\'\)\"
Export: Release 11.2.0.4.0 - Production on Wed Nov 2 22:05:56 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=homedir dumpfile=scott_all_tab.dmp schemas=scott exclude=table:" in('EMP','DEPT')"
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 256 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."HISLOADER" 5.921 KB 3 rows
. . exported "SCOTT"."MYLOADER" 6.023 KB 7 rows
. . exported "SCOTT"."SALGRADE" 5.859 KB 5 rows
. . exported "SCOTT"."T1" 19.77 KB 100 rows
. . exported "SCOTT"."BONUS" 0 KB 0 rows
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/homedir/scott_all_tab.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Nov 2 22:06:20 2016 elapsed 0 00:00:23
[oracle@enmo homedir]$
#匯出完成。
--檢視匯出檔案:
[oracle@enmo homedir]$ ll
total 344
-rw-r--r-- 1 oracle oinstall 16384 Nov 2 20:10 emp.dmp
-rw-r--r-- 1 oracle oinstall 1791 Nov 2 22:06 export.log
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 21:36 myspace.dmp
-rw-r----- 1 oracle oinstall 253952 Nov 2 22:06 scott_all_tab.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:13 scott.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:16 scotts.dmp
[oracle@enmo homedir]$
---匯出Scott模式中的物件,只把emp表與dept表匯出來(include):
--匯出策略:
expdp scott/tiger directory=homedir dumpfile=scott_some_tab.dmp
schemas=scott include=table:\" in\(\'EMP\',\'DEPT\'\)\"
[oracle@enmo homedir]$ expdp scott/tiger directory=homedir dumpfile=scott_some_tab.dmp schemas=scott include=table:\" in\(\'EMP\',\'DEPT\'\)\"
Export: Release 11.2.0.4.0 - Production on Wed Nov 2 22:10:28 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=homedir dumpfile=scott_some_tab.dmp schemas=scott include=table:" in('EMP','DEPT')"
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/homedir/scott_some_tab.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Nov 2 22:10:36 2016 elapsed 0 00:00:08
[oracle@enmo homedir]$
#匯出完成。
--檢視匯出檔案:
[oracle@enmo homedir]$ ls
emp.dmp export.log myspace.dmp scott_all_tab.dmp scott.dmp scotts.dmp scott_some_tab.dmp
[oracle@enmo homedir]$ ll
total 572
-rw-r--r-- 1 oracle oinstall 16384 Nov 2 20:10 emp.dmp
-rw-r--r-- 1 oracle oinstall 1511 Nov 2 22:10 export.log
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 21:36 myspace.dmp
-rw-r----- 1 oracle oinstall 253952 Nov 2 22:06 scott_all_tab.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:13 scott.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:16 scotts.dmp
-rw-r----- 1 oracle oinstall 229376 Nov 2 22:10 scott_some_tab.dmp
[oracle@enmo homedir]$
兩個關鍵詞當中,exclude就是排除選項中的物件,include就是選擇只包括選項中的物件。
---匯出Scott模式中所有的物件,除了emp表與dept表不匯出來(exclude):
--匯出策略:
expdp scott/tiger directory=homedir dumpfile=scott_all_tab.dmp
schemas=scott exclude=table:\" in\(\'EMP\',\'DEPT\'\)\"
[oracle@enmo homedir]$ expdp scott/tiger directory=homedir dumpfile=scott_all_tab.dmp schemas=scott exclude=table:\" in\(\'EMP\',\'DEPT\'\)\"
Export: Release 11.2.0.4.0 - Production on Wed Nov 2 22:05:56 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=homedir dumpfile=scott_all_tab.dmp schemas=scott exclude=table:" in('EMP','DEPT')"
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 256 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."HISLOADER" 5.921 KB 3 rows
. . exported "SCOTT"."MYLOADER" 6.023 KB 7 rows
. . exported "SCOTT"."SALGRADE" 5.859 KB 5 rows
. . exported "SCOTT"."T1" 19.77 KB 100 rows
. . exported "SCOTT"."BONUS" 0 KB 0 rows
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/homedir/scott_all_tab.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Nov 2 22:06:20 2016 elapsed 0 00:00:23
[oracle@enmo homedir]$
#匯出完成。
--檢視匯出檔案:
[oracle@enmo homedir]$ ll
total 344
-rw-r--r-- 1 oracle oinstall 16384 Nov 2 20:10 emp.dmp
-rw-r--r-- 1 oracle oinstall 1791 Nov 2 22:06 export.log
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 21:36 myspace.dmp
-rw-r----- 1 oracle oinstall 253952 Nov 2 22:06 scott_all_tab.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:13 scott.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:16 scotts.dmp
[oracle@enmo homedir]$
---匯出Scott模式中的物件,只把emp表與dept表匯出來(include):
--匯出策略:
expdp scott/tiger directory=homedir dumpfile=scott_some_tab.dmp
schemas=scott include=table:\" in\(\'EMP\',\'DEPT\'\)\"
[oracle@enmo homedir]$ expdp scott/tiger directory=homedir dumpfile=scott_some_tab.dmp schemas=scott include=table:\" in\(\'EMP\',\'DEPT\'\)\"
Export: Release 11.2.0.4.0 - Production on Wed Nov 2 22:10:28 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. 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
Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/******** directory=homedir dumpfile=scott_some_tab.dmp schemas=scott include=table:" in('EMP','DEPT')"
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/homedir/scott_some_tab.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Nov 2 22:10:36 2016 elapsed 0 00:00:08
[oracle@enmo homedir]$
#匯出完成。
--檢視匯出檔案:
[oracle@enmo homedir]$ ls
emp.dmp export.log myspace.dmp scott_all_tab.dmp scott.dmp scotts.dmp scott_some_tab.dmp
[oracle@enmo homedir]$ ll
total 572
-rw-r--r-- 1 oracle oinstall 16384 Nov 2 20:10 emp.dmp
-rw-r--r-- 1 oracle oinstall 1511 Nov 2 22:10 export.log
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 21:36 myspace.dmp
-rw-r----- 1 oracle oinstall 253952 Nov 2 22:06 scott_all_tab.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:13 scott.dmp
-rw-r--r-- 1 oracle oinstall 24576 Nov 2 20:16 scotts.dmp
-rw-r----- 1 oracle oinstall 229376 Nov 2 22:10 scott_some_tab.dmp
[oracle@enmo homedir]$
兩個關鍵詞當中,exclude就是排除選項中的物件,include就是選擇只包括選項中的物件。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2127556/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- expdp exclude/include 命令出錯
- expdp 使用QUERY 匯出部分資料。
- 使用資料泵工具expdp工具匯出資料
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- expdp遠端匯出資料
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- 使用expdp匯出分割槽表中的部分分割槽資料
- expdp匯出表的部分資料
- Oracle expdp匯出多表或表中的部分資料Oracle
- 使用EXPDP/IMPDP匯入匯出表中資料/後設資料測試
- 資料庫泵(expdp/impdp)匯入匯出流程資料庫
- 【EXPDP/IMPDP】使用 EXPDP/IMPDP工具“模糊”匯出和匯入
- Oracle expdp資料泵遠端匯出Oracle
- 【EXPDP】使用EXPDP工具的 EXCLUDE選項過濾掉不關心的資料庫物件資料庫物件
- expdp impdp 資料庫匯入匯出命令詳解資料庫
- oracle按照表條件expdp匯出資料Oracle
- 在鎖表情況下expdp匯出資料
- 資料泵 EXPDP 匯出工具的使用
- Oracle10g 資料泵匯出命令 expdp 使用總結Oracle
- 頁面資料匯出為word或者excelExcel
- Oracle expdp/impdp匯出匯入命令及資料庫備份Oracle資料庫
- 通過EXPDP/IMPDP匯出匯入遠端資料倒本地
- Oracle expdp/impdp匯入匯出備份資料庫指令碼Oracle資料庫指令碼
- 使用Exp和Expdp匯出資料的效能對比與優化優化
- 使用EXPDP工具的 EXCLUDE選項過濾掉不關心的資料庫物件資料庫物件
- 使用Exp和Expdp匯出資料的效能對比與最佳化
- 【資料泵】EXPDP匯出表結構(真實案例)
- expdp 匯出指令碼指令碼
- ORACLE expdp匯出遠端庫指定使用者資料到本地資料庫Oracle資料庫
- shell,ant指令碼實現自動資料泵(exp.expdp)匯出匯入資料指令碼
- expdp在匯出時對資料大小進行評估
- oracle匯入匯出之expdp/impdpOracle
- expdp impdp只匯出匯入viewView
- expdp exclude大量表可以使用子查詢實現
- expdp 匯出特定物件物件
- 使用expdp匯出資料,報ORA-01691表空間不足錯誤
- [20130727]ORACLE 12C使用expdp匯出view資料.txtOracleView
- expdp/impdp中匯出/匯入任務的管理和監控