<?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; ORA-01561</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-01561/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>Thu, 29 Oct 2026 15:31:46 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>因非常规操作导致删除表空间提示ORA-01561解决办法</title>
		<link>https://www.xifenfei.com/2012/07/%e5%9b%a0%e9%9d%9e%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e5%af%bc%e8%87%b4%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%8f%90%e7%a4%baora-01561%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html</link>
		<comments>https://www.xifenfei.com/2012/07/%e5%9b%a0%e9%9d%9e%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e5%af%bc%e8%87%b4%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%8f%90%e7%a4%baora-01561%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html#comments</comments>
		<pubDate>Sun, 29 Jul 2012 07:34:16 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[ORA-01561]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=3553</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2012/07/%e5%9b%a0%e9%9d%9e%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e5%af%bc%e8%87%b4%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%8f%90%e7%a4%baora-01561%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.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/07/%e5%9b%a0%e9%9d%9e%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e5%af%bc%e8%87%b4%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%8f%90%e7%a4%baora-01561%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html" target="_blank">因非常规操作导致删除表空间提示ORA-01561解决办法</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>今天测试手工通过bbed修改undo$中回滚段状态(从status$=5修改为1)[NEEDS RECOVERY 修改为 DELETE],然后尝试删除表空间,发现不能删除<br />
<strong>删除表空间提示ORA-01561</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; drop tablespace undotbs;
drop tablespace undotbs
*
ERROR at line 1:
ORA-01561: failed to remove all objects in the tablespace specified


SQL&gt; drop tablespace undotbs including contents; 
drop tablespace undotbs including contents
*
ERROR at line 1:
ORA-01561: failed to remove all objects in the tablespace specified
</pre>
<p><strong>查询相关信息</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select ts#,name from v$tablespace;

       TS# NAME
---------- ------------------------------
         0 SYSTEM
         1 SYSAUX
         4 USERS
         6 UNDOTBS
         3 TEMP

SQL&gt; select name,ts#,status$ from undo$;

NAME                                  TS#    STATUS$
------------------------------ ---------- ----------
SYSTEM                                  0          3
_SYSSMU1_3138885392$                    2          1
_SYSSMU2_4228238222$                    2          1
_SYSSMU3_2210742642$                    2          1
_SYSSMU4_1455318006$                    2          1
_SYSSMU5_3787622316$                    2          1
_SYSSMU6_2460248069$                    2          1
_SYSSMU7_1924883037$                    2          1
_SYSSMU8_1909280886$                    2          1
_SYSSMU9_3593450615$                    2          1
_SYSSMU10_2490256178$                   2          1

NAME                                  TS#    STATUS$
------------------------------ ---------- ----------
_SYSSMU11_253524401$                    6          1
_SYSSMU12_842775869$                    6          1
_SYSSMU13_2794767139$                   6          1
_SYSSMU14_2067649841$                   6          1
_SYSSMU15_3270221471$                   6          1
_SYSSMU16_4094338609$                   6          1
_SYSSMU17_709661646$                    6          1
_SYSSMU18_699588262$                    6          1
_SYSSMU19_718640828$                    6          1
_SYSSMU20_3516920665$                   6          1
_SYSSMU21_793796797$                    6          1

NAME                                  TS#    STATUS$
------------------------------ ---------- ----------
_SYSSMU22_3988785920$                   6          1
_SYSSMU23_1828333848$                   6          1
_SYSSMU24_1223218862$                   6          1
_SYSSMU25_2939844199$                   6          1
_SYSSMU26_1317300205$                   6          1
_SYSSMU27_1654033223$                   6          1
_SYSSMU28_3748619502$                   6          1
_SYSSMU29_1868765904$                   6          1
_SYSSMU30_3379578723$                   6          1

31 rows selected.

SQL&gt; select segment_name,status from dba_rollback_segs;

SEGMENT_NAME                   STATUS
------------------------------ ----------------
SYSTEM                         ONLINE
</pre>
<p>通过这里可以看出,通过bbed的修改,除system回滚段外,其他均已经被标志为delete状态,对于这样的情况,很本能的怀疑是extent或者segment未被清理掉导致<br />
<br />
<strong>查询EXTENT和SEGMENT</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select SEGMENT_NAME from dba_extents where TABLESPACE_NAME='UNDOTBS';

no rows selected

SQL&gt; select segment_name from dba_segments where  TABLESPACE_NAME='UNDOTBS';

no rows selected

SQL&gt; select count(*) from seg$ where ts#=6;

  COUNT(*)
----------
        10

SQL&gt; select count(*) from seg$ where ts#=2;

  COUNT(*)
----------
         0

SQL&gt; select file#,type# from  seg$ where ts#=6;

     FILE#      TYPE#
---------- ----------
         3         10
         3         10
         3         10
         3         10
         3         10
         3         10
         3         10
         3         10
         3         10
         3         10

10 rows selected.
</pre>
<p>通过查询我们发现SEG$中含有10条记录,而通过dbms_metadata.get_ddl分析DBA_SEGMENTS是的,得出type为10恰好是TYPE2 UNDO信息.<br />
<br />
<strong>解决办法</strong><br />
删除掉这些因为手工修改undo$信息导致遗留下来的后遗症对象</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; delete from seg$ where ts#=6;

10 rows deleted.

SQL&gt; commit;

Commit complete.

SQL&gt; drop tablespace undotbs ;

Tablespace dropped.
</pre>
<p>这样的直接修改基表的做法,在一般的情况下非常不建议使用,可能带来系统不稳定.但是在数据库异常处理过程中,可能将成为一个法宝</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/undo%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86%e6%ad%a5%e9%aa%a4.html" rel="bookmark" class="crp_title">undo异常处理步骤（10g）</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/oracle%e5%9c%a8%e7%ba%bf%e5%88%87%e6%8d%a2undo%e8%a1%a8%e7%a9%ba%e9%97%b4.html" rel="bookmark" class="crp_title">ORACLE在线切换undo表空间</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/04/asm%e7%ae%80%e5%8d%95%e7%ae%a1%e7%90%861.html" rel="bookmark" class="crp_title">ASM简单管理(1)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/10/%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e9%87%8d%e5%91%bd%e5%90%8d.html" rel="bookmark" class="crp_title">数据文件重命名</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/06/undo%e6%8d%9f%e5%9d%8f%e6%81%a2%e5%a4%8d-%e6%97%a0%e4%ba%8b%e5%8a%a1.html" rel="bookmark" class="crp_title">undo损坏恢复–无事务</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2010/08/oracle%e4%b9%8b%e4%b8%b4%e6%97%b6%e8%a1%a8%e5%88%9b%e5%bb%ba.html" rel="bookmark" class="crp_title">oracle之表管理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/%e5%88%a0%e9%99%a4oracle%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e4%b8%b4%e6%97%b6%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">删除Oracle数据文件/临时文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/06/undo%e6%8d%9f%e5%9d%8f%e6%81%a2%e5%a4%8d-%e6%9c%89%e4%ba%8b%e5%8a%a1.html" rel="bookmark" class="crp_title">undo损坏恢复–有事务</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/12/%e5%85%b3%e4%ba%8eaud%e5%af%b9%e8%b1%a1%e7%9b%b8%e5%85%b3%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">关于aud$对象相关处理</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/2011/08/undo%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86%e6%ad%a5%e9%aa%a4%ef%bc%889i%ef%bc%89.html" rel="bookmark" class="crp_title">undo异常处理步骤（9i）</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/dba_hist_tbspc_space_usage%e6%9f%a5%e8%af%a2undo%e8%a1%a8%e7%a9%ba%e9%97%b4%e5%bc%82%e5%b8%b8bug.html" rel="bookmark" class="crp_title">DBA_HIST_TBSPC_SPACE_USAGE查询undo表空间异常BUG</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2012/07/%e5%9b%a0%e9%9d%9e%e5%b8%b8%e8%a7%84%e6%93%8d%e4%bd%9c%e5%af%bc%e8%87%b4%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%8f%90%e7%a4%baora-01561%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
