数据泵导出报错ORA-31693 ORA-02354 ORA-01466

Posted gw666

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了数据泵导出报错ORA-31693 ORA-02354 ORA-01466相关的知识,希望对你有一定的参考价值。

1.Oracle数据泵导出schema时有报错:

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** flashback_scn=3072010 tables=t dumpfile=t.dmp logfile=t.log directory=expdp
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 9 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-31693: Table data object "SCOTT"."T" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01466: unable to read data - table definition has changed
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
  /home/oracle/expdp/t.dmp
Job "SCOTT"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 00:20:06

2.经过分析报错:

ORA-31693: Table data object "SCOTT"."T" failed to load/unload and is being skipped due to error:

说明是T表导出报错

 

ORA-01466: unable to read data - table definition has changed

可以分析是该表现在的表结构和导出时该表的结构发生了变化

 

 

3.重现该报错(测试环境还原场景)

SYS@PROD4 >conn scott/tiger;
Connected.
SCOTT@PROD4 >select current_scn from v$database;

CURRENT_SCN
-----------
    3072010

SCOTT@PROD4 >desc t;
 Name                               Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 OWNER                                VARCHAR2(30)
 OBJECT_NAME                            VARCHAR2(128)
 SUBOBJECT_NAME                         VARCHAR2(30)
 OBJECT_ID                            NUMBER
 DATA_OBJECT_ID                         NUMBER
 OBJECT_TYPE                            VARCHAR2(19)
 CREATED                            DATE
 LAST_DDL_TIME                            DATE
 TIMESTAMP                            VARCHAR2(19)
 STATUS                             VARCHAR2(7)
 TEMPORARY                            VARCHAR2(1)
 GENERATED                            VARCHAR2(1)
 SECONDARY                            VARCHAR2(1)
 NAMESPACE                            NUMBER
 EDITION_NAME                            VARCHAR2(30)

 

SCOTT@PROD4 >alter table t add country varchar2(20);

Table altered.

SCOTT@PROD4 >desc t;
 Name                               Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 OWNER                                VARCHAR2(30)
 OBJECT_NAME                            VARCHAR2(128)
 SUBOBJECT_NAME                         VARCHAR2(30)
 OBJECT_ID                            NUMBER
 DATA_OBJECT_ID                         NUMBER
 OBJECT_TYPE                            VARCHAR2(19)
 CREATED                            DATE
 LAST_DDL_TIME                            DATE
 TIMESTAMP                            VARCHAR2(19)
 STATUS                             VARCHAR2(7)
 TEMPORARY                            VARCHAR2(1)
 GENERATED                            VARCHAR2(1)
 SECONDARY                            VARCHAR2(1)
 NAMESPACE                            NUMBER
 EDITION_NAME                            VARCHAR2(30)
 COUNTRY                            VARCHAR2(20)

SCOTT@PROD4 >create directory expdp as ‘/home/oracle/expdp‘;

Directory created.

SCOTT@PROD4 >grant all on directory expdp to public;

Grant succeeded.

[oracle@edbjr2p2 ~]$ mkdir -p /home/oracle/expdp
[oracle@edbjr2p2 ~]$ chmod 777 -R /home/oracle/expdp/

[oracle@edbjr2p2 trace]$ expdp scott/tiger flashback_scn=3072010 tables=t dumpfile=t.dmp logfile=t.log directory=expdp

Export: Release 11.2.0.3.0 - Production on Sun Feb 16 00:19:54 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SCOTT"."SYS_EXPORT_TABLE_01":  scott/******** flashback_scn=3072010 tables=t dumpfile=t.dmp logfile=t.log directory=expdp
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 9 MB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-31693: Table data object "SCOTT"."T" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01466: unable to read data - table definition has changed
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
  /home/oracle/expdp/t.dmp
Job "SCOTT"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 00:20:06

 

以上是关于数据泵导出报错ORA-31693 ORA-02354 ORA-01466的主要内容,如果未能解决你的问题,请参考以下文章

诊断:expdp导出时遇到错误ORA-31693和ORA-00922

rac下 expdp 报错:ORA-31693 ORA-31617 ORA-19505 ORA-27037

impdp报错:ORA-31693, ORA-02354, ORA-00600

expdp时报ORA-31693 ORA-31617 ORA-195错误

Oracle之数据泵导入/导出数据

ORA-31693, ORA-02354 and ORA-01555 with Export Datapump