expdp query用法
expdp scott/tiger directory=dp tables=t1 schemas=scott dumpfile=t1.dmp logfile=t1.log query='"where hiredate>to_date('1982-01-02','yyyy-mm-dd')"'
C:\Users\Administrator>expdp scott/tiger directory=dp tables=scott.t1 dumpfile=t1.dmp logfile=t1.log query="where hiredate>'1982-01-02'"
Export: Release 11.2.0.1.0 - Production on 星期一 3月 11 15:42:54 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. 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-39001: 引數值無效
ORA-39035: 已經指定了資料過濾器 SUBQUERY。
說明query寫的有問題
正確寫法要用\轉義引號
C:\Users\Administrator>expdp scott/tiger directory=dp tables=t1 dumpfile=t1.dmp logfile=t1.log query=t1:\"where hiredate>to_date('1982-01-02','yyyy-mm-dd')\"
Export: Release 11.2.0.1.0 - Production on 星期一 3月 11 16:33:45 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. 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/******** directory=dp tables=t1 dumpfile=t1.dmp logfile=t1.log query=t1:"where hiredate>to_date('1982-01-02','yyyy-mm-dd')"
正在使用 BLOCKS 方法進行估計...
處理物件型別 TABLE_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的總估計: 64 KB
處理物件型別 TABLE_EXPORT/TABLE/TABLE
. . 匯出了 "SCOTT"."T1" 8.304 KB 8 行
已成功載入/解除安裝了主表 "SCOTT"."SYS_EXPORT_TABLE_01"
******************************************************************************
SCOTT.SYS_EXPORT_TABLE_01 的轉儲檔案集為:
E:\ORACLE\T1.DMP
作業 "SCOTT"."SYS_EXPORT_TABLE_01" 已於 16:33:59 成功完成
impdp scott/tiger directory=dp remap_table=t1:t2 dumpfile=t1.dmp logfile=t2.log table_exists_action=replace
多個表時:
QUERY=emp:\"WHERE username in ('aaa','bb')\",taba:\"WHERE rownum<5\"