<?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-00393</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-00393/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>Sat, 24 Oct 2026 14:05:24 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORA-16038 ORA-00354故障处理</title>
		<link>https://www.xifenfei.com/2023/05/ora-16038-ora-00354.html</link>
		<comments>https://www.xifenfei.com/2023/05/ora-16038-ora-00354.html#comments</comments>
		<pubDate>Wed, 24 May 2023 13:56:15 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle备份恢复]]></category>
		<category><![CDATA[ORA-00393]]></category>
		<category><![CDATA[ORA-00393 ORA-00312]]></category>
		<category><![CDATA[ORA-16038]]></category>
		<category><![CDATA[ORA-16038 ORA-00354]]></category>
		<category><![CDATA[unrecoverable datafile]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=10320</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2023/05/ora-16038-ora-00354.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/2023/05/ora-16038-ora-00354.html" target="_blank">ORA-16038 ORA-00354故障处理</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>遇到一个案例,数据库open报ORA-16038,ORA-00354等错误<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2023/05/ORA-16038-ORA-00354.png"><img src="https://www.xifenfei.com/wp-content/uploads/2023/05/ORA-16038-ORA-00354.png" alt="ORA-16038-ORA-00354" width="1173" height="495" class="alignnone size-full wp-image-10321" /></a><br />
<hr />
查询该redo状态(使用<a href="https://www.xifenfei.com/oracle_recovery_check" title="Oracle数据库异常恢复检查脚本(Oracle Database Recovery Check)" rel="noopener" target="_blank">Oracle数据库异常恢复检查脚本(Oracle Database Recovery Check)</a>脚本收集),确认为inactive<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2023/05/20230524213907.png"><img src="https://www.xifenfei.com/wp-content/uploads/2023/05/20230524213907.png" alt="20230524213907" width="1591" height="183" class="alignnone size-full wp-image-10322" /></a><br />
<hr />
由于inactive 状态的redo损坏,无法被arch进程归档导致数据库无法正常open,尝试强制clear联机日志<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2023/05/ORA-00393-ORA-00312.png"><img src="https://www.xifenfei.com/wp-content/uploads/2023/05/ORA-00393-ORA-00312.png" alt="ORA-00393-ORA-00312" width="1311" height="669" class="alignnone size-full wp-image-10323" /></a><br />
<hr />
由于25号文件属于offline状态,导致联机日志无法正常被clear,报ORA-00393 ORA-00312等错误.通过试验重现该问题.</p>
<pre class="brush: bash; title: ; notranslate">
SQL&gt; alter database datafile 5 offline;

Database altered.

--使用一些技巧让数据库无法归档

SQL&gt; select group#,status,archived from v$log;

    GROUP# STATUS           ARC
---------- ---------------- ---
         1 INACTIVE         NO
         2 ACTIVE           NO
         3 CURRENT          NO

SQL&gt; shutdown abort;
ORACLE instance shut down.
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  626327552 bytes
Fixed Size                  2255832 bytes
Variable Size             234882088 bytes
Database Buffers          385875968 bytes
Redo Buffers                3313664 bytes
Database mounted.
SQL&gt; alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-00393: log 1 of thread 1 is needed for recovery of offline datafiles
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
ORA-01110: data file 5: '/u01/app/oracle/oradata/orcl/t_xifenfei01.dbf'

SQL&gt; !oerr ora 393
00393, 00000, &quot;log %s of thread %s is needed for recovery of offline datafiles&quot;
// *Cause:  Log cannot be cleared because the redo in it is needed to recover
//          offline datafiles. It has not been archived so there is no
//          other copy available. If the log is cleared the tablespaces
//          containing the files will have to be dropped.
// *Action: Archive the log then repeat the clear command. If archiving is not
//          possible, and dropping the tablespaces is acceptible, then add the
//          clause UNRECOVERABLE DATAFILE at the end of the clear command.


SQL&gt;  alter database clear unarchived logfile group 1 unrecoverable datafile;

Database altered.

SQL&gt; select group#,status,archived from v$log;

    GROUP# STATUS           ARC
---------- ---------------- ---
         1 UNUSED           YES
         3 CURRENT          NO
         2 ACTIVE           NO
</pre>
<p>客户的问题也是通过unrecoverable datafile 方式强制clear联机日志成功,数据库open成功</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/03/buffer-io-error-on-dev-recovery.html" rel="bookmark" class="crp_title">Buffer I/O error on dev故障数据库恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/%e5%bd%93%e5%89%8d%e8%81%94%e6%9c%ba%e6%97%a5%e5%bf%97%e6%8d%9f%e5%9d%8f%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">当前联机日志损坏恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/09/oracle-recovery-tool-ora-00279-ora-00289-ora-00280.html" rel="bookmark" class="crp_title">Oracle Recovery Tools解决ORA-00279 ORA-00289 ORA-00280故障</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/ora-00313%e5%92%8cora-00313%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">数据库open状态下日志异常处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/09/ora-01113-ora-01110.html" rel="bookmark" class="crp_title">一键恢复ORA-01113 ORA-01110&#8212;Oracle Recovery Tools</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/11/ora-600-kccpb_sanity_check_2.html" rel="bookmark" class="crp_title">ora-600 kccpb_sanity_check_2故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/08/redo-corrupt-recovery.html" rel="bookmark" class="crp_title">不太常见的10.2.0.1的oracle redo损坏恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2021/01/oracle-recovery-tools-ora-01190-ora-01248.html" rel="bookmark" class="crp_title">Oracle Recovery Tools 解决ORA-01190 ORA-01248等故障</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2026/09/ora-00354.html" rel="bookmark" class="crp_title">记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/05/ora-600-ksvworkmsgalloc-bad-reaper.html" rel="bookmark" class="crp_title">ORA-600 ksvworkmsgalloc: bad reaper</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/02/asm-disk-add-vg-extend-lv.html" rel="bookmark" class="crp_title">再一例asm disk被误加入vg并且扩容lv恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/08/ora-01245_ora-01110%e6%95%85%e9%9a%9c%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">system01.dbf文件被offline,导致数据库报ORA-01245 ORA-01110故障恢复</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2023/05/ora-16038-ora-00354.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
