问题:
使用impdp 导入数据是,出现ORA-14460错误,无法正确导入数据。
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39083: Object type TABLE:"SCOTT"."EMP" failed to create with error:
ORA-14460: only one COMPRESS or NOCOMPRESS clause may be specified
Failing sql is:
CREATE TABLE…………
解决方法:
在导入语句中加入:TRANSFORM=segment_attributes:n
加入此参数的意义在于,可与忽略expdp导出时附带的相关表空间和存储子句约束。
注释:
-bash-3.00$ oerr ora 14460
14460, 00000, "only one COMPRESS or NOCOMPRESS clause may be specified"
// *Cause: COMPRESS was specified more than once, NOCOMPRESS was specified more
// than once, or both COMPRESS and NOCOMPRESS were specified.
// *Action: specify each desired COMPRESS or NOCOMPRESS clause option only once.
-bash-3.00$
新增参数解释:TRANSFORM=segment_attributes:n
-
SEGMENT_ATTRIBUTES:[Y | N]
If the value is specified as
Y
, then segment attributes (physical attributes, storage attributes, tablespaces, and logging) are included, with appropriate DDL. The default isY
.也即在导入表时,原表的相关属性不进行导入。
自己的例子:
impdp gs/gspassword@nbb DIRECTORY=dumpdir DUMPFILE=gs_20171024.dmp logfile=impdp_gs_20171024.log SCHEMAS='gs'
报如下错误:
ORA-39083: Object type TABLE:"GS"."YW_OUT_ORDER" failed to create with error:ORA-14460: only one COMPRESS or NOCOMPRESS clause may be specifiedFailing sql is:CREATE TABLE "GS"."YW_OUT_ORDER" ("ORDER_NUMBER" VARCHAR2(50 BYTE) NOT NULL ENABLE, "MERCHANT_NO" VARCHAR2(20 BYTE), "BB_BANK_ORDER_CODE" VARCHAR2(50 BYTE), "BANK_ORDER_CODE" VARCHAR2(50 BYTE), "MERCHANT_ORDER_CODE" VARCHAR2(50 BYTE), "ID_USER" NUMBER(20,0), "OLD_ORDER_CODE" VARCHAR2(50 BYTE), "MERCHANT_REMARK" VARCHAR2(1000 BYTE), "ORDER_TYPE" CH
数据库导后就没有yw_out_order这张表,通过上面的原因得知,补充导入yw_out_order这张表。
只导入指定的表,命令如下:impdp gs/gspassword@nbb DIRECTORY=dumpdir DUMPFILE=gs_20171024.dmp logfile=impdp_gs_20171024_1.log tables=yw_out_order TRANSFORM=segment_attributes:n