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\"