【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】不使用DIRECTORY引數完成expdp資料備份
- 【EXPDP】使用EXPDP備份資料時預估大小——ESTIMATE引數
- expdp 使用QUERY 匯出部分資料。
- oracle資料泵備份(Expdp命令)Oracle
- EXPDP的parallel引數Parallel
- 【EXPDP】運用PARALLEL 和FILESIZE引數提高備份效率Parallel
- Oracle資料庫的邏輯備份工具-expdp資料泵Oracle資料庫
- expdp/impdp 使用version引數跨版本資料遷移
- 使用crontab和expdp實現資料庫定期邏輯備份資料庫
- windowns系統,oracle資料庫expdp自動備份Oracle資料庫
- 【EXPDP】使用EXPDP備份資料時ORA-39125、ORA-04031錯誤原因分析與排查
- Oracle 邏輯備份 expdp/impdpOracle
- expdp 邏輯備份指令碼指令碼
- Oracle expdp 排除表引數Oracle
- [EXPDP]使用11g的資料泵實現對邏輯備份資料進行加密加密
- 【EXPDP】使用11g的資料泵實現對邏輯備份資料進行加密加密
- 揭祕ORACLE備份之--邏輯備份(EXPDP)Oracle
- EXPDP 和 IMPDP 資料泵的使用_1
- EXPDP 和 IMPDP 資料泵的使用_2
- 資料泵 EXPDP 匯出工具的使用
- JavaScript 限定範圍的拖拽效果JavaScript
- expdp備份+FTP自動上傳FTP
- Oracle expdp/impdp匯出匯入命令及資料庫備份Oracle資料庫
- 監控資料備份恢復完成進度(EXPDP/IMPDP/RMAN)
- Oracle expdp/impdp匯入匯出備份資料庫指令碼Oracle資料庫指令碼
- EXPDP/IMPDP 中的並行度PARALLEL引數並行Parallel
- 【Toad】使用Toad呼叫expdp資料泵備份資料步驟及注意事項
- EXPDP資料泵使用方法
- 10G資料泵載入命令expdp/impdp的引數說明
- JavaScript 拖拽限定範圍JavaScript
- 【EXPDP】11g版本EXPDP 的COMPRESSION引數壓縮比堪比“gzip -9”
- 【EXPDP】使用EXPDP工具的 EXCLUDE選項過濾掉不關心的資料庫物件資料庫物件
- Oracle 邏輯備份之EXPDP精講Oracle
- oracle資料庫的impdp,expdpOracle資料庫
- jQuery Validate限定輸入數字大小的範圍jQuery
- exp和expdp的filesize引數的使用--匯出多個檔案
- Linux 平臺下 Oracle 資料泵備份(expdp) SHELL 指令碼LinuxOracle指令碼
- Oracle expdp impdp dump引數介紹Oracle