【EXPDP】使用expdp的QUERY引數限定備份資料的範圍
1.建立試驗表test_table
ora11g@RHEL53 /home/oracle$ sqlplus sec/sec
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Mar 2 18:28:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sec@ora11g> select * from cat;
no rows selected
sec@ora11g> create table test_table as select * from dba_objects where rownum<1000;
Table created.
sec@ora11g> select count(*) from test_table;
COUNT(*)
----------
999
2.使用引數檔案進行匯出
ora11g@RHEL53 /home/oracle$ cat test_tables_query.par
QUERY=test_table:"where rownum<10"
NOLOGFILE=y
DIRECTORY=DATA_PUMP_DIR
DUMPFILE=expdp_test_table.dmp
ora11g@RHEL53 /home/oracle$ expdp sec/sec parfile=test_tables_query.par reuse_dumpfiles=y
Export: Release 11.1.0.6.0 - Production on Monday, 02 March, 2009 18:35:10
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** parfile=test_tables_query.par reuse_dumpfiles=y
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/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
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/COMMENT
. . exported "SEC"."TEST_TABLE" 11.42 KB 9 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/oracle/u01/app/oracle/admin/ora11g/dpdump/expdp_test_table.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 18:35:38
3.單條語句匯出時,需要加一對單引號QUERY=test_table:'"where rownum<10"'
ora11g@RHEL53 /home/oracle$ expdp sec/sec reuse_dumpfiles=y QUERY=test_table:'"where rownum<10"' NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
或
ora11g@RHEL53 /home/oracle$ expdp sec/sec reuse_dumpfiles=y QUERY='test_table:"where rownum<10"' NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
Export: Release 11.1.0.6.0 - Production on Monday, 02 March, 2009 18:38:21
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** reuse_dumpfiles=y QUERY=test_table:"where rownum<10" NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
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/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
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/COMMENT
. . exported "SEC"."TEST_TABLE" 11.42 KB 9 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/oracle/u01/app/oracle/admin/ora11g/dpdump/expdp_test_table.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 18:38:40
secooler
09.03.02
-- The End --
ora11g@RHEL53 /home/oracle$ sqlplus sec/sec
SQL*Plus: Release 11.1.0.6.0 - Production on Mon Mar 2 18:28:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sec@ora11g> select * from cat;
no rows selected
sec@ora11g> create table test_table as select * from dba_objects where rownum<1000;
Table created.
sec@ora11g> select count(*) from test_table;
COUNT(*)
----------
999
2.使用引數檔案進行匯出
ora11g@RHEL53 /home/oracle$ cat test_tables_query.par
QUERY=test_table:"where rownum<10"
NOLOGFILE=y
DIRECTORY=DATA_PUMP_DIR
DUMPFILE=expdp_test_table.dmp
ora11g@RHEL53 /home/oracle$ expdp sec/sec parfile=test_tables_query.par reuse_dumpfiles=y
Export: Release 11.1.0.6.0 - Production on Monday, 02 March, 2009 18:35:10
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** parfile=test_tables_query.par reuse_dumpfiles=y
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/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
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/COMMENT
. . exported "SEC"."TEST_TABLE" 11.42 KB 9 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/oracle/u01/app/oracle/admin/ora11g/dpdump/expdp_test_table.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 18:35:38
3.單條語句匯出時,需要加一對單引號QUERY=test_table:'"where rownum<10"'
ora11g@RHEL53 /home/oracle$ expdp sec/sec reuse_dumpfiles=y QUERY=test_table:'"where rownum<10"' NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
或
ora11g@RHEL53 /home/oracle$ expdp sec/sec reuse_dumpfiles=y QUERY='test_table:"where rownum<10"' NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
Export: Release 11.1.0.6.0 - Production on Monday, 02 March, 2009 18:38:21
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** reuse_dumpfiles=y QUERY=test_table:"where rownum<10" NOLOGFILE=y DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdp_test_table.dmp
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/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
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/COMMENT
. . exported "SEC"."TEST_TABLE" 11.42 KB 9 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/oracle/u01/app/oracle/admin/ora11g/dpdump/expdp_test_table.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 18:38:40
secooler
09.03.02
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-558297/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- expdp query用法
- Oracle資料庫的邏輯備份工具-expdp資料泵Oracle資料庫
- expdp 邏輯備份指令碼指令碼
- [20200620]expdp impdp exclude引數.txt
- Expdp 備份到ASM之 ORA-39070ASM
- oracle資料庫的impdp,expdpOracle資料庫
- expdp/impdp 詳細引數解釋
- exp和expdp的filesize引數的使用--匯出多個檔案
- impdp和expdp用法及引數介紹
- JavaScript 限定範圍的拖拽效果JavaScript
- Oracle 效能優化-expdp備份速度優化02Oracle優化
- Oracle 效能優化-expdp備份速度優化03Oracle優化
- jQuery Validate限定輸入數字大小的範圍jQuery
- Java程式呼叫expdp資料泵實現自動邏輯備份Oracle資料庫的方案設計JavaOracle資料庫
- Oracle 10g expdp attach引數體驗Oracle 10g
- 【Data Pump】理解expdp中的ESTIMATE和ESTIMATE_ONLY引數
- 使用資料泵(expdp、impdp)遷移資料庫流程資料庫
- JavaScript 拖拽限定範圍JavaScript
- Oracle EXPDP自動備份緩慢問題解決Oracle
- 使用impdp,expdp資料泵進入海量資料遷移
- 批量按使用者expdp
- JavaScript 限定範圍拖動效果JavaScript
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- Oracle expdp資料泵遠端匯出Oracle
- 使用Exp和Expdp匯出資料的效能對比與最佳化
- 資料泵datapump(expdp/impdp)的parfile用法,避免跳脫字元字元
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- oracle按照表條件expdp匯出資料Oracle
- expdp一個例子
- Elasticsearch聚合學習之三:範圍限定Elasticsearch
- 【資料泵】EXPDP匯出表結構(真實案例)
- div拖動範圍限定在指定元素內
- 基於flashback_scn的expdp匯出
- expdp匯出慢的解決思路__增加引數metrics記錄每個步驟時間,增加引數trace記錄trace
- expdp在匯出時對資料大小進行評估
- 通過dblink,資料泵expdp遠端跨版本導庫
- 【Datapump】Oracle資料泵遷移資料命令參考(expdp/impdp說明)Oracle
- expdp+compression效能測試
- 正常終止expdp作業