<?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; 回滚段名字</title>
	<atom:link href="https://www.xifenfei.com/tag/%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e5%ad%97/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>找出11g undo 回滚段名称</title>
		<link>https://www.xifenfei.com/2012/02/%e6%89%be%e5%87%ba11g-undo-%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e7%a7%b0.html</link>
		<comments>https://www.xifenfei.com/2012/02/%e6%89%be%e5%87%ba11g-undo-%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e7%a7%b0.html#comments</comments>
		<pubDate>Sun, 19 Feb 2012 04:41:26 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[非常规恢复]]></category>
		<category><![CDATA[回滚段名字]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=2552</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2012/02/%e6%89%be%e5%87%ba11g-undo-%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e7%a7%b0.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/2012/02/%e6%89%be%e5%87%ba11g-undo-%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e7%a7%b0.html" target="_blank">找出11g undo 回滚段名称</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>当数据库启动的时报undo相关异常，很多情况下我们不得不使用隐含参数来处理(_offline_rollback_segments和_corrupted_rollback_segments)，而这个就需要明确异常的undo回滚段名称。在11g中，undo回滚段的名称发生了改变，在11g之前的版本中，回滚段名称是&#8221;_SYSTEMn$&#8221;之类，而到了11g回滚段的名称变为了&#8221;_SYSTEMn_时间戳$&#8221;，因为时间戳我们不知道，所以我们不能通过n的值，来确定回滚段的名称，从而也就不能很明确的使用_offline_rollback_segments和_corrupted_rollback_segments来标明异常回滚段。既然回滚段的名称我们可以通过dba_rollback_segs视图来查询，那么我们可以根据这个视图找到对应的回滚段是存储在哪张基表中，下面为dba_rollback_segs视图对应的sql语句</p>
<pre class="brush: sql; title: ; notranslate">
select un.name, decode(un.user#,1,'PUBLIC','SYS'),
       ts.name, un.us#, f.file#, un.block#,
       s.iniexts * ts.blocksize,
       decode(bitand(ts.flags, 3), 1, to_number(NULL),
                                      s.extsize * ts.blocksize),
       s.minexts, s.maxexts,
       decode(bitand(ts.flags, 3), 1, to_number(NULL),
                                      s.extpct),
       decode(un.status$, 2, 'OFFLINE', 3, 'ONLINE',
                          4, 'UNDEFINED', 5, 'NEEDS RECOVERY',
                          6, 'PARTLY AVAILABLE', 'UNDEFINED'),
       decode(un.inst#, 0, NULL, un.inst#), un.file#
from sys.undo$ un, sys.seg$ s, sys.ts$ ts, sys.file$ f
where un.status$ != 1
  and un.ts# = s.ts#
  and un.file# = s.file#
  and un.block# = s.block#
  and s.type# in (1, 10)
  and s.ts# = ts.ts#
  and un.ts# = f.ts#
  and un.file# = f.relfile#
</pre>
<p>通过观察，我们知道回滚段信息是存储在sys.undo$中(name字段表示回滚段名称，status$字段表示回滚段状态[1:DELETE,2:OFFLINE,3:ONLINE,4:UNDEFINED,5:NEEDS RECOVERY,6:PARTLY AVAILABLE,其他表示:UNDEFINED]),通过这个视图我们需要找的到status$为5所对应name。<br />
找这些值较简易的方法就是通过dul抽取sys.undo$表中数据，然后在其他库上还原，然后通过sql语句查询<br />
1.设置dul参数(config.txt)<br />
export true,其他参数根据你的实际情况设置</p>
<p>2.填写system表空间对应的数据文件(control.txt)</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@localhost dul]$ more control.txt
0 0        /u01/oradata/first/system01.dbf
</pre>
<p>3.odu导出数据</p>
<pre class="brush: bash; title: ; notranslate">
DUL&gt; unload table sys.undo$

Unloading table: UNDO$,object ID: 15
Unloading segment,storage(Obj#=15 DataObj#=15 TS#=0 File#=1 Block#=224 Cluster=0)
21 rows unloaded
</pre>
<p>4.导入至新库</p>
<pre class="brush: bash; title: ; notranslate">
imp chf/xifenfei file=C:\Users\XIFENFEI\Downloads\SYS_UNDO$.dmp FROMUSER=SYS TOUSER=CHF
</pre>
<p>5.查询需要处理的回滚段</p>
<pre class="brush: sql; title: ; notranslate">
--数据库版本10g及其以上版本
set pagesize 0 feedback off verify off heading off echo off linesize 1000
select WMSYS.WM_CONCAT(name) from UNDO$ where status$=5;

--数据库版本9i及其以下版本(自己拼接)
set pagesize 0 feedback off verify off heading off echo off
select name from UNDO$ where status$=5;
</pre>
<p>现在已经找出来了需要处理的回滚段，其他数据库恢复步骤与以前数据库相同。</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/06/%e9%80%9a%e8%bf%87%e5%9f%ba%e8%a1%a8%e8%8e%b7%e5%8f%96segment-header-block.html" rel="bookmark" class="crp_title">通过基表获取segment header block</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/07/%e5%9c%a8%e6%95%b0%e6%8d%ae%e5%ba%93open%e8%bf%87%e7%a8%8b%e4%b8%ad%e5%b8%b8%e9%81%87%e5%88%b0ora-01555%e6%b1%87%e6%80%bb.html" rel="bookmark" class="crp_title">在数据库open过程中常遇到ORA-01555汇总</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/02/exp%e8%b7%b3%e8%bf%87%e6%9f%90%e4%ba%9b%e8%a1%a8%e5%af%bc%e5%87%ba%e6%95%b0%e6%8d%ae.html" rel="bookmark" class="crp_title">exp跳过某些表导出数据</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/08/ora-600-4194-ora-600-4193-ora-600-4137.html" rel="bookmark" class="crp_title">ORA-600 4194/ORA-600 4193/ORA-600 4137故障解决</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/2012/07/bbed%e4%bf%ae%e6%94%b9undo%e5%9b%9e%e6%bb%9a%e6%ae%b5%e7%8a%b6%e6%80%81.html" rel="bookmark" class="crp_title">bbed修改undo$(回滚段)状态</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><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/08/oracle-dul-2025.html" rel="bookmark" class="crp_title">Oracle dul 最新版(12.2.0.2.10)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/dbms_scheduler%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c.html" rel="bookmark" class="crp_title">DBMS_SCHEDULER常规操作</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/03/dul-support-19c.html" rel="bookmark" class="crp_title">dul支持Oracle 19C</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/11/dul-12-2-support-oracle-19c.html" rel="bookmark" class="crp_title">dul 12.2完美支持Oracle 19c恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/08/%e4%bd%bf%e7%94%a8dml%e8%af%ad%e5%8f%a5%e5%88%a0%e9%99%a4index%e6%b5%8b%e8%af%95-%e5%8f%96%e4%bb%a3ddl.html" rel="bookmark" class="crp_title">使用dml语句删除index测试(取代ddl)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2012/02/%e6%89%be%e5%87%ba11g-undo-%e5%9b%9e%e6%bb%9a%e6%ae%b5%e5%90%8d%e7%a7%b0.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
