【故障處理】imp-00051,imp-00008

imp導入報錯:
IMP-00051: Direct path exported dump file contains illegal column length
IMP-00008: unrecognized statement in the export file
IMP-00009: abnormal end of export file
[oracle@lhrdb ~]$ oerr imp 51
00051, 00000, "Direct path exported dump file contains illegal column length"
// *Cause: An invalid column length was encountered while processing column
// pieces."
// *Action: Check to make sure the export file is not corrupted, or else
// report this to Oracle Worldwide Support as an Import/Export
// internal bug and submit the
// export file.
由于使用了direct=y的方式導出,是以導入的時候報錯。MOS上是針對分區表的某一個空的分區導入的時候會報該錯,但是客戶這邊的表不是分區表,dmp檔案太大,不能做具體原因分析。給出的解決方案為:針對報錯的表單獨導出,并采用parfile參數。
[ZFZHLHRDB1:oracle]:/oracle>more /tmp/scottfile.par
tables=scott.emp,scott.dept
exp \'/ AS SYSDBA\' file=/tmp/test_query_lhr_scott_01.dmp parfile=/tmp/scottfile.par log=/tmp/test_query_lhr_scott_01.log
參考的MOS文檔:
Traditional Import (IMP) Raises Error IMP-51 Direct Path Exported Dump File Contains Illegal Column Length (文檔 ID 1403865.1)
ALERT Direct Path Export (EXP) Corrupts The Dump If An Empty Table Partition Exists (文檔 ID 1604983.1)
The traditional export utility is de-supported beginning with the version 11g and is no more maintained.
exp和imp從11g開始不再維護。
In this Document
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#DESCRIPTION" target="_blank">Description</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#OCCURRENCE" target="_blank">Occurrence</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#SYMPTOMS" target="_blank">Symptoms</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#WORKAROUND" target="_blank">Workaround</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#HISTORY" target="_blank">History</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373984242427256&id=1604983.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_304#REF" target="_blank">References</a>
Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 31-Oct-2016***
You performed a direct path export (table, schema or full) using the traditional export utility (EXP). If the exported objects include an empty table partition, then the export dump is corrupt and cannot be imported.
Only exp versions >= 11.2.0.1 are affected. The traditional export utility is de-supported beginning with the version 11g and is no more maintained.
During import you may see one of the following issues:
Or:
Import silently skips a part of the dump, tables are missing and later constraints cannot be created.
This is below demonstrated with a simple test:
connect test
create table part001
(
col001 number,
col002 varchar2(100)
)
partition by range (col001)
partition p001 values less than (10),
partition p002 values less than (100),
partition p003 values less than (1000)
);
insert into part001 values (5, 'Text 5');
insert into part001 values (500, 'Text 500');
commit;
#> exp test/password file=part001.dmp tables=part001 direct=y
This will show:
About to export specified tables via Direct Path ...
. . exporting table PART001
. . exporting partition P001 1 rows exported
. . exporting partition P002 0 rows exported
. . exporting partition P003 1 rows exported
Export terminated successfully without warnings.
but the import breaks with error:
. importing TEST's objects into TEST
. . importing partition "PART001":"P001" 1 rows imported
. . importing partition "PART001":"P002"
Import terminated successfully with warnings.
If you perform direct path exports using a version greater or equal 11.2.0.1 and you see the messages:
...
. . exporting partition <partition_name> 0 rows exported
in the export output (or log file), then you obtain a corrupt dump. You can verify the dump with the commands:
#> imp user/passw full=y
or:
#> imp user/passw full=y show=y
which will show you one of the behaviors listed above.
To workaround this please use:
- conventional path export (exp direct=n)
- materialize the empty partitions before running direct path exports:
connect / as sysdba
exec dbms_space_admin.materialize_deferred_segments (schema_name => 'TEST', table_name => 'PART001', partition_name => 'P002');
- DataPump export (expdp)
[03-DEC-2013] - Document created
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373987861713582&id=1403865.1&displayIndex=2&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_345#SYMPTOM" target="_blank">Symptoms</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373987861713582&id=1403865.1&displayIndex=2&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_345#CAUSE" target="_blank">Cause</a>
<a href="https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=373987861713582&id=1403865.1&displayIndex=2&_afrWindowMode=0&_adf.ctrl-state=mbfqmempp_345#FIX" target="_blank">Solution</a>
Oracle Server - Enterprise Edition - Version 11.2.0.2 and later
An original import of an export dump file created from an 11.2.0.2 database with DIRECT=Y fails with:
The exact cause is undetermined in this case.
Instead of using the traditional export/import, use the DataPump export/import as a workaround.
本文轉自lhrbest 51CTO部落格,原文連結:http://blog.51cto.com/lhrbest/1890137,如需轉載請自行聯系原作者