<?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; truncate数据恢复</title>
	<atom:link href="https://www.xifenfei.com/tag/truncate%e6%95%b0%e6%8d%ae%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, 04 Nov 2026 15:33:30 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>truncate table 无论drop storage还是reuse storage不影响数据恢复</title>
		<link>https://www.xifenfei.com/2018/06/truncate-table-recovery.html</link>
		<comments>https://www.xifenfei.com/2018/06/truncate-table-recovery.html#comments</comments>
		<pubDate>Thu, 21 Jun 2018 15:15:08 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle备份恢复]]></category>
		<category><![CDATA[dul]]></category>
		<category><![CDATA[dul truncate]]></category>
		<category><![CDATA[truncate数据恢复]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=7562</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2018/06/truncate-table-recovery.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/2018/06/truncate-table-recovery.html" target="_blank">truncate table 无论drop storage还是reuse storage不影响数据恢复</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>今天有朋友咨询,truncate table有drop storage和reuse storage方式,是否影响后续的数据恢复(在没有其他覆盖的情况下),我做了一个简单的测试证明,这些都不影响truncate table的数据库恢复<br />
<strong>创建测试环境</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; create table t_xifenfei tablespace USERNEW
  2   as select * from dba_objects;

Table created.

SQL&gt; create table t_xifenfei2  tablespace USERNEW
  2   as select * from dba_objects;

Table created.

SQL&gt;  create table t_xifenfei3  tablespace USERNEW
  2  as select * from dba_objects;

Table created.

SQL&gt; alter system checkpoint;

System altered.

SQL&gt; select count(*) from t_xifenfei;

  COUNT(*)
----------
     86348

SQL&gt;  select count(*) from t_xifenfei2;

  COUNT(*)
----------
     86349

SQL&gt;  select count(*) from t_xifenfei3;

  COUNT(*)
----------
     86350

SQL&gt; select object_id,data_object_id,object_name from dba_objects where object_name like 't_xifenfei%';

 OBJECT_ID DATA_OBJECT_ID OBJECT_NAME
---------- -------------- ------------------------------
     88205          88205 t_xifenfei
     88206          88206 t_xifenfei2
     88207          88207 t_xifenfei3

SQL&gt; truncate table t_xifenfei;

Table truncated.

SQL&gt; truncate table t_xifenfei2 drop storage;

Table truncated.

SQL&gt; truncate table t_xifenfei3 reuse storage;

Table truncated.
</pre>
<p><strong>使用dul进行恢复</strong></p>
<pre class="brush: bash; title: ; notranslate">  
DUL&gt;  bootstrap;
DUL&gt; scan database;

scanning database...
scanning database finished.

DUL&gt; unload table sys.t_xifenfei object 88205;

Unloading table: t_xifenfei,object ID: 88205
Unloading segment,storage(Obj#=88205 DataObj#=88205 TS#=6 File#=5 Block#=1410 Cluster=0)
86348 rows unloaded

DUL&gt; unload table sys.t_xifenfei2 object 88206;

Unloading table: t_xifenfei2,object ID: 88206
Unloading segment,storage(Obj#=88206 DataObj#=88206 TS#=6 File#=5 Block#=2690 Cluster=0)
86349 rows unloaded

DUL&gt; unload table sys.t_xifenfei3 object 88207;

Unloading table: t_xifenfei3,object ID: 88207
Unloading segment,storage(Obj#=88207 DataObj#=88207 TS#=6 File#=5 Block#=3970 Cluster=0)
86350 rows unloaded
</pre>
<p>这里证明truncate table不管是drop storage还是reuse storage或者默认,在没有被覆盖的情况下，数据均完全恢复出来</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/%e9%80%9a%e8%bf%87odu%e9%aa%8c%e8%af%81rman-backup%e5%af%b9%e4%ba%8etruncate%e5%af%b9%e8%b1%a1%e5%a4%87%e4%bb%bd%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">通过odu验证rman backup对于truncate对象备份处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/object_id%e5%92%8cdata_object_id%e5%8c%ba%e5%88%ab%e4%b8%8e%e8%81%94%e7%b3%bb.html" rel="bookmark" class="crp_title">object_id和data_object_id区别与联系</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/dul-10%e6%94%af%e6%8c%81oracle-11g-r2.html" rel="bookmark" class="crp_title">dul 10支持oracle 11g r2</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/02/dul-%e6%81%a2%e5%a4%8dtruncate%e8%a1%a8%e6%b5%8b%e8%af%95.html" rel="bookmark" class="crp_title">dul恢复truncate表测试</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/dul%e6%8c%96oracle-8-0%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">DUL挖ORACLE 8.0数据库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/%e4%bd%bf%e7%94%a8-dul-%e6%8c%96%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%88%9d%e8%af%95.html" rel="bookmark" class="crp_title">使用 dul 挖数据文件初试</a></li><li style="list-style-type:decimal;font-size:11px;" ><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" rel="bookmark" class="crp_title">exp dmp文件损坏(坏块/corruption)恢复&#8212;跳过dmp坏块</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/03/oracle-12c-%e6%96%b0%e7%89%b9%e6%80%a7identity-columns-%e5%ae%9e%e7%8e%b0oracle%e8%87%aa%e5%a2%9e%e9%95%bf%e5%88%97%e5%8a%9f%e8%83%bd.html" rel="bookmark" class="crp_title">ORACLE 12C 新特性Identity Columns&#8212;实现ORACLE自增长列功能</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2018/02/18c-cancel-sql.html" rel="bookmark" class="crp_title">18c新特性：alter system cancel sql</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/oracle-11g%e5%a2%9e%e5%8a%a0%e5%88%97%ef%bc%8c%e5%b9%b6%e5%b8%a6%e9%bb%98%e8%ae%a4%e5%80%bc%e7%9a%84%e6%96%b0%e7%89%b9%e6%80%a7.html" rel="bookmark" class="crp_title">Oracle 11g增加列,并带默认值的新特性</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/9i%e4%b8%ad%e6%b8%85%e9%99%a4%e7%89%b9%e5%ae%9a%e8%a1%a8%e7%9b%b8%e5%85%b3%e6%89%a7%e8%a1%8c%e8%ae%a1%e5%88%92.html" rel="bookmark" class="crp_title">9I中清除特定表相关执行计划</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/07/dul-support-arm-oracle.html" rel="bookmark" class="crp_title">dul支持arm版本Oracle数据库恢复</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2018/06/truncate-table-recovery.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
