<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>惜分飞 &#187; exp dmp恢复</title>
	<atom:link href="https://www.xifenfei.com/tag/exp-dmp%e6%81%a2%e5%a4%8d/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Wed, 28 Oct 2026 00:37:06 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>exp dmp文件损坏(坏块/corruption)恢复&#8212;跳过dmp坏块</title>
		<link>https://www.xifenfei.com/2015/08/exp-dmp%e6%96%87%e4%bb%b6%e6%8d%9f%e5%9d%8f%e5%9d%8f%e5%9d%97corruption%e6%81%a2%e5%a4%8d.html</link>
		<comments>https://www.xifenfei.com/2015/08/exp-dmp%e6%96%87%e4%bb%b6%e6%8d%9f%e5%9d%8f%e5%9d%8f%e5%9d%97corruption%e6%81%a2%e5%a4%8d.html#comments</comments>
		<pubDate>Tue, 18 Aug 2015 15:37:21 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[dmp corruption]]></category>
		<category><![CDATA[dmp recovery]]></category>
		<category><![CDATA[dmp坏块]]></category>
		<category><![CDATA[dmp恢复]]></category>
		<category><![CDATA[dmp损坏]]></category>
		<category><![CDATA[exp dmp恢复]]></category>
		<category><![CDATA[IMP-00008]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=6035</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2015/08/exp-dmp%e6%96%87%e4%bb%b6%e6%8d%9f%e5%9d%8f%e5%9d%8f%e5%9d%97corruption%e6%81%a2%e5%a4%8d.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div id="xifenfeicopyright">
<p>联系：<a href="https://www.xifenfei.com/about_xifenfei" target="_blank">手机/微信(+86 17813235971)   QQ(107644445)</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&#038;uin=107644445&#038;site=qq&#038;menu=yes"><img src="https://www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"/></a></p>
<p>标题：<a href="https://www.xifenfei.com/2015/08/exp-dmp%e6%96%87%e4%bb%b6%e6%8d%9f%e5%9d%8f%e5%9d%8f%e5%9d%97corruption%e6%81%a2%e5%a4%8d.html" target="_blank">exp dmp文件损坏(坏块/corruption)恢复&#8212;跳过dmp坏块</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在有些情况下，大家都知道通过dul可以恢复损坏的dmp文件的表的数据,但是该方法有很多问题，特别是对很多数据类型的支持不够完美,比如lob,long raw类型等,而且还有可能恢复出来数据大量丢失,本人通过对dmp结构的分析,使用使用一些特殊的技巧方法,可以实现对于损坏的dmp文件,通过跳过异常坏块所在表,继续恢复后续表,从而最大程度减少损坏<br />
<strong>创建测试表</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; conn xifenfei/&quot;www.xifenfei.com&quot;
Connected.
SQL&gt; create table t_xifenfei1 as select * from dba_objects;

Table created.

SQL&gt; create table t_xifenfei2 as select * from v$sql;

Table created.

SQL&gt; create table t_xifenfei3 as select * from dba_tables;

Table created.

SQL&gt; select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
T_XIFENFEI1                    TABLE
T_XIFENFEI2                    TABLE
T_XIFENFEI3                    TABLE

SQL&gt; select count(*) from t_xifenfei1;

  COUNT(*)
----------
     86275

SQL&gt;  select count(*) from t_xifenfei2;

  COUNT(*)
----------
      3387

SQL&gt;  select count(*) from t_xifenfei3;

  COUNT(*)
----------
      2800
</pre>
<p><strong>导出来dmp文件</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@web103 ~]$ exp &quot;'/ as sysdba'&quot; owner=xifenfei file=/data/temp/t_xifenfei.dmp log=/data/temp/exp_t_xifenfei.log

Export: Release 11.2.0.4.0 - Production on Tue Aug 18 22:08:30 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user XIFENFEI 
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user XIFENFEI 
About to export XIFENFEI's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export XIFENFEI's tables via Conventional Path ...
. . exporting table                    T_XIFENFEI1      86275 rows exported
. . exporting table                    T_XIFENFEI2       3387 rows exported
. . exporting table                    T_XIFENFEI3       2800 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
</pre>
<p><strong>获取dmp file中的T_XIFENFEI2所在位置</strong><br />
计划在该表上通过dd进行破坏,因此需要事先知道该表所在的dmp文件位置范围</p>
<pre class="brush: bash; title: ; notranslate">
CPFL&gt; SEARCH TABLE T_XIFENFEI2 FROM EXPFILE  /tmp/t_xifenfei.dmp
9980561: TABLE &quot;T_XIFENFEI2&quot;
9980581: CREATE TABLE &quot;T_XIFENFEI2&quot; (表定义忽略)
9985356: BIND information for 87 columns
 col[  1] type 1 max length 1000 cset 852 (ZHS16GBK) form 1
 col[  2] type 112 max length 86 cset 852 (ZHS16GBK) form 1
 col[  3] type 1 max length 13 cset 852 (ZHS16GBK) form 1
 col[  4] type 2 max length 22
 col[  5] type 2 max length 22
 col[  6] type 2 max length 22
 col[  7] type 2 max length 22
 col[  8] type 2 max length 22
 col[  9] type 2 max length 22
 col[ 10] type 2 max length 22
 col[ 11] type 2 max length 22
 col[ 12] type 2 max length 22
 col[ 13] type 2 max length 22
 col[ 14] type 2 max length 22
 col[ 15] type 2 max length 22
 col[ 16] type 2 max length 22
 col[ 17] type 1 max length 38 cset 852 (ZHS16GBK) form 1
 col[ 18] type 2 max length 22
 col[ 19] type 2 max length 22
 col[ 20] type 2 max length 22
 col[ 21] type 2 max length 22
 col[ 22] type 2 max length 22
 col[ 23] type 2 max length 22
 col[ 24] type 2 max length 22
 col[ 25] type 2 max length 22
 col[ 26] type 2 max length 22
 col[ 27] type 2 max length 22
 col[ 28] type 2 max length 22
 col[ 29] type 2 max length 22
 col[ 30] type 2 max length 22
 col[ 31] type 1 max length 10 cset 852 (ZHS16GBK) form 1
 col[ 32] type 2 max length 22
 col[ 33] type 23 max length 2000
 col[ 34] type 2 max length 22
 col[ 35] type 2 max length 22
 col[ 36] type 2 max length 22
 col[ 37] type 1 max length 30 cset 852 (ZHS16GBK) form 1
 col[ 38] type 2 max length 22
 col[ 39] type 23 max length 8
 col[ 40] type 23 max length 8
 col[ 41] type 2 max length 22
 col[ 42] type 2 max length 22
 col[ 43] type 2 max length 22
 col[ 44] type 2 max length 22
 col[ 45] type 1 max length 64 cset 852 (ZHS16GBK) form 1
 col[ 46] type 2 max length 22
 col[ 47] type 1 max length 64 cset 852 (ZHS16GBK) form 1
 col[ 48] type 2 max length 22
 col[ 49] type 1 max length 64 cset 852 (ZHS16GBK) form 1
 col[ 50] type 2 max length 22
 col[ 51] type 2 max length 22
 col[ 52] type 1 max length 64 cset 852 (ZHS16GBK) form 1
 col[ 53] type 2 max length 22
 col[ 54] type 2 max length 22
 col[ 55] type 2 max length 22
 col[ 56] type 23 max length 8
 col[ 57] type 2 max length 22
 col[ 58] type 1 max length 1 cset 852 (ZHS16GBK) form 1
 col[ 59] type 1 max length 19 cset 852 (ZHS16GBK) form 1
 col[ 60] type 2 max length 22
 col[ 61] type 1 max length 38 cset 852 (ZHS16GBK) form 1
 col[ 62] type 1 max length 1 cset 852 (ZHS16GBK) form 1
 col[ 63] type 1 max length 1 cset 852 (ZHS16GBK) form 1
 col[ 64] type 1 max length 1 cset 852 (ZHS16GBK) form 1
 col[ 65] type 1 max length 1 cset 852 (ZHS16GBK) form 1
 col[ 66] type 2 max length 22
 col[ 67] type 1 max length 64 cset 852 (ZHS16GBK) form 1
 col[ 68] type 1 max length 30 cset 852 (ZHS16GBK) form 1
 col[ 69] type 1 max length 30 cset 852 (ZHS16GBK) form 1
 col[ 70] type 2 max length 22
 col[ 71] type 2 max length 22
 col[ 72] type 2 max length 22
 col[ 73] type 2 max length 22
 col[ 74] type 12 max length 7
 col[ 75] type 23 max length 2000
 col[ 76] type 2 max length 22
 col[ 77] type 2 max length 22
 col[ 78] type 2 max length 22
 col[ 79] type 2 max length 22
 col[ 80] type 2 max length 22
 col[ 81] type 2 max length 22
 col[ 82] type 2 max length 22
 col[ 83] type 2 max length 22
 col[ 84] type 2 max length 22
 col[ 85] type 2 max length 22
 col[ 86] type 2 max length 22
 col[ 87] type 2 max length 22
Conventional export
9986063: start of table data
19675141: TABLE &quot;T_XIFENFEI3&quot;
</pre>
<p><strong>使用dd命令破坏T_XIFENFEI2所在位置的dmp文件</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@web103 ~]$ dd if=/dev/zero of=/data/temp/t_xifenfei.dmp bs=1024 count=2 conv=notrunc seek=9747
2+0 records in
2+0 records out
2048 bytes (2.0 kB) copied, 1.6e-05 seconds, 128 MB/s
</pre>
<p><strong>尝试imp导入被破坏的dmp文件数据</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@web103 ~]$ imp &quot;'/ as sysdba'&quot; fromuser=xifenfei touser=xifenfeinew 
&gt;file=/data/temp/t_xifenfei.dmp log=/data/temp/imp_t_xifenfei.log

Import: Release 11.2.0.4.0 - Production on Tue Aug 18 22:35:09 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing XIFENFEI's objects into XIFENFEINEW
. . importing table                  &quot;T_XIFENFEI1&quot;      86275 rows imported
IMP-00017: following statement failed with ORACLE error 1740:
 &quot;CREATE TABLE &quot;T_XIFENFEI2&quot; (&quot;SQL_TEXT&quot; VARCHAR2(1000), &quot;SQL_FULLTEXT&quot; CLOB,&quot;
 &quot; &quot;SQL_ID&quot; VARCHAR2(13), &quot;SHARABLE_MEM&quot; NUMBER, &quot;PERSISTENT_MEM&quot; NUMBER, &quot;RU&quot;
 &quot;NTIME_MEM&quot; NUMBER, &quot;SORTS&quot; NUMBER, &quot;LOADED_VERSIONS&quot; NUMBER, &quot;OPEN_VERSIONS&quot;
 &quot;&quot; NUMBER, &quot;USERS_OPENING&quot; NUMBER, &quot;FETCHES&quot; NUMBER, &quot;EXECUTIONS&quot; NUMBER, &quot;P&quot;
 &quot;X_SERVERS_EXECUTIONS&quot; NUMBER, &quot;END_OF_FETCH_COU&quot;
IMP-00003: ORACLE error 1740 encountered
ORA-01740: missing double quote in identifier
IMP-00008: unrecognized statement in the export file: 
  
IMP-00008: unrecognized statement in the export file: 
</pre>
<p>导入报IMP-00003 ORA-01740 IMP-00008,由于dmp文件被dd破坏(而且破坏位置是T_XIFENFEI2所在之处),因此imp导入到T_XIFENFEI2之时,抛出大量异常,imp终止<br />
<br />
<strong>检查导入表情况</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; conn xifenfeinew/&quot;www.xifenfei.com&quot;
Connected.
SQL&gt; select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
T_XIFENFEI1                    TABLE

SQL&gt; select count(*) from t_xifenfei1;

  COUNT(*)
----------
     86275
</pre>
<p>和预期相符,表t_xifenfei1导入进去,但是t_xifenfei2由于坏块原因未导入,由于t_xifenfei3在t_xifenfei2之后,因此也未导入<br />
<br />
<strong>使用CPFL程序抽取正常dmp文件</strong></p>
<pre class="brush: bash; title: ; notranslate">
CPFL&gt;getdmp '/data/temp/t_xifenfei.dmp' skip table 'T_XIFENFEI2'
&gt;/data/temp/t_xifenfeinew.dmp
</pre>
<p>重新导入dmp文件</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@web103 ~]$ imp &quot;'/ as sysdba'&quot; fromuser=xifenfei touser=xifenfeinew 
&gt;file=/data/temp/t_xifenfeinew.dmp log=/data/temp/imp_t_xifenfeinew.log

Import: Release 11.2.0.4.0 - Production on Tue Aug 18 22:41:04 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing XIFENFEI's objects into XIFENFEINEW
. . importing table                  &quot;T_XIFENFEI1&quot;      86275 rows imported 
. . importing table                  &quot;T_XIFENFEI3&quot;       2800 rows imported
Import terminated successfully no warnings.
</pre>
<p>导入了t_xifenfei1，t_xifenfei3，果然t_xifenfei2被跳过<br />
<br />
<strong>验证导入数据</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@web103 ~]$ sqlplus xifenfeinew/&quot;www.xifenfei.com&quot;

SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 18 22:41:32 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
T_XIFENFEI1                    TABLE
T_XIFENFEI3                    TABLE

SQL&gt; select count(*) from t_xifenfei1;

  COUNT(*)
----------
     86275

SQL&gt; select count(*) from t_xifenfei3;

  COUNT(*)
----------
      2800

SQL&gt; 
</pre>
<p>通过验证数据证明，通过CPFL完美跳过了坏块所在表,实现后续数据完美恢复</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/11/imp-00098-internal-error-impgst2.html" rel="bookmark" class="crp_title">IMP-00098: INTERNAL ERROR: impgst2</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/dul%e5%ae%9e%e7%8e%b0exp-dump%e6%96%87%e4%bb%b6%e8%bd%ac%e6%8d%a2sqlldr%e6%a0%bc%e5%bc%8f.html" rel="bookmark" class="crp_title">密码保护：dul实现exp dump文件转换sqlldr格式</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/%e8%a7%a3%e5%86%b3imp%e5%af%bc%e5%85%a5%e6%95%b0%e6%8d%ae%e6%8a%a5imp-00028%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">解决imp导入数据报IMP-00098错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/pls-00302-component-set_no_outlines-must-be-declared.html" rel="bookmark" class="crp_title">PLS-00302: component &#8216;SET_NO_OUTLINES&#8217; must be declared</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/%e9%aa%8c%e8%af%81imp-show%e5%8f%82%e6%95%b0.html" rel="bookmark" class="crp_title">验证imp show参数</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/exp%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae%e6%8a%a5exp-00056ora-01403%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">exp导出数据报EXP-00056/ORA-01403错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/05/shell%e8%84%9a%e6%9c%ac%e8%8e%b7%e5%be%97extents%e5%88%86%e5%b8%83.html" rel="bookmark" class="crp_title">shell脚本获得extents分布</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/10/exp-00104-datatype-binary_double-%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">EXP-00104: datatype (BINARY_DOUBLE) 错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/10/tts%e5%ae%9e%e7%8e%b0%e8%b7%a8%e7%89%88%e6%9c%ac%e8%bf%81%e7%a7%bb%e6%95%b0%e6%8d%ae.html" rel="bookmark" class="crp_title">TTS实现跨版本迁移数据</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/08/exp-direct-y-imp-ora-01400.html" rel="bookmark" class="crp_title">增加默认值列exp DIRECT=Y导出，导入遭遇ORA-01400</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/dul-10-export_modetrue%e5%8a%9f%e8%83%bd%e5%a2%9e%e5%bc%ba.html" rel="bookmark" class="crp_title">dul 10 export_mode=true功能增强</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/09/dul%e5%ae%9e%e7%8e%b0expdp-dump%e6%96%87%e4%bb%b6%e8%bd%ac%e6%8d%a2sqlldr%e6%a0%bc%e5%bc%8f.html" rel="bookmark" class="crp_title">密码保护：dul实现expdp dump文件转换sqlldr格式</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2015/08/exp-dmp%e6%96%87%e4%bb%b6%e6%8d%9f%e5%9d%8f%e5%9d%8f%e5%9d%97corruption%e6%81%a2%e5%a4%8d.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
