关于expdp 使用query错误

使用query报错:
[pinggu@server1 ~]$ expdp bzj/bzj directory=dmp_dir dumpfile=t_bzj.dmp QUERY=t:"where id>112" tables=t;
Export: Release 11.2.0.1.0 - Production on Thu Oct 30 11:29:36 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "BZJ"."SYS_EXPORT_TABLE_01":  bzj/******** directory=dmp_dir dumpfile=t_bzj.dmp QUERY=t:where id>112 tables=t 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-31693: Table data object "BZJ"."T" failed to load/unload and is being skipped due to error:
ORA-00936: missing expression
Master table "BZJ"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for BZJ.SYS_EXPORT_TABLE_01 is:
  /home/pinggu/dmp/t_bzj.dmp
Job "BZJ"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 11:29:45

错误原因:10g中query参数后面没有单引号,11g后面需要加单引号或者使用parfile
1、加单引号
[pinggu@server1 dmp]$ expdp bzj/bzj query='t:"where id>112"' directory=dmp_dir tables=t dumpfile=t_bzj.dmp reuse_dumpfiles=y
Export: Release 11.2.0.1.0 - Production on Thu Oct 30 12:14:33 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "BZJ"."SYS_EXPORT_TABLE_01":  bzj/******** query=t:"where id>112" directory=dmp_dir tables=t dumpfile=t_bzj.dmp reuse_dumpfiles=y 
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "BZJ"."T"                                   5.828 KB       1 rows
Master table "BZJ"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for BZJ.SYS_EXPORT_TABLE_01 is:
  /home/pinggu/dmp/t_bzj.dmp
Job "BZJ"."SYS_EXPORT_TABLE_01" successfully completed at 12:14:36
2、使用parfile

[pinggu@server1 dmp]$ vi t_query.par
query=t:"where id>112"
nologfile=y
directory=dmp_dir
dumpfile=t_bzj.dmp

[pinggu@server1 dmp]$ expdp bzj/bzj parfile=t_query.par reuse_dumpfiles=y
Export: Release 11.2.0.1.0 - Production on Thu Oct 30 12:04:24 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "BZJ"."SYS_EXPORT_SCHEMA_01":  bzj/******** parfile=t_query.par reuse_dumpfiles=y 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
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
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "BZJ"."T"                                   5.828 KB       1 rows
. . exported "BZJ"."T1"                                  5.820 KB       1 rows
. . exported "BZJ"."TEST"                                10.85 KB       7 rows
Master table "BZJ"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for BZJ.SYS_EXPORT_SCHEMA_01 is:
  /home/pinggu/dmp/t_bzj.dmp
Job "BZJ"."SYS_EXPORT_SCHEMA_01" successfully completed at 12:04:32


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29193965/viewspace-1314449/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29193965/viewspace-1314449/

你可能感兴趣的:(关于expdp 使用query错误)