<?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; system异常恢复</title>
	<atom:link href="https://www.xifenfei.com/tag/system%e5%bc%82%e5%b8%b8%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>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>bbed打开丢失部分system数据文件库</title>
		<link>https://www.xifenfei.com/2012/11/bbed%e6%89%93%e5%bc%80%e4%b8%a2%e5%a4%b1%e9%83%a8%e5%88%86system%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%ba%93.html</link>
		<comments>https://www.xifenfei.com/2012/11/bbed%e6%89%93%e5%bc%80%e4%b8%a2%e5%a4%b1%e9%83%a8%e5%88%86system%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%ba%93.html#comments</comments>
		<pubDate>Fri, 09 Nov 2012 15:04:08 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[非常规恢复]]></category>
		<category><![CDATA[ORA-01147]]></category>
		<category><![CDATA[system丢失恢复]]></category>
		<category><![CDATA[system异常恢复]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=3955</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2012/11/bbed%e6%89%93%e5%bc%80%e4%b8%a2%e5%a4%b1%e9%83%a8%e5%88%86system%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%ba%93.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/11/bbed%e6%89%93%e5%bc%80%e4%b8%a2%e5%a4%b1%e9%83%a8%e5%88%86system%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%ba%93.html" target="_blank">bbed打开丢失部分system数据文件库</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在某种情况下，数据库system表空间可能有多个数据文件，而意外的丢失了其中某个(不能为第一个),然后通过bbed来模拟一个数据文件来open库<br />
<strong>system增加数据文件</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; alter tablespace system add datafile '/u01/oracle/oradata/ora11g/system02.dbf' size 10m;

Tablespace altered.

--创建表，为了使得数据库发生类此生产环境的部分操作，使得system表空间可能发生改变
SQL&gt; create table t_xifenfei tablespace system 
  2  as 
  3  select * from dba_tables;

Table created.
</pre>
<p><strong>删除system中某个文件(system02.dbf)</strong></p>
<pre class="brush: sql; title: ; notranslate">
[oracle@xifenfei ora11g]$ mv system02.dbf system02.dbf_bak
</pre>
<p><strong>尝试启动数据库</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; shutdown abort  
ORACLE instance shut down.
SQL&gt; startup 
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                  1344652 bytes
Variable Size             251661172 bytes
Database Buffers           54525952 bytes
Redo Buffers                6328320 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01110: data file 8: '/u01/oracle/oradata/ora11g/system02.dbf'
</pre>
<p><strong>错误思路offline system数据文件</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; alter database datafile 8 offline;

Database altered.

SQL&gt; alter database open;
alter database open
*
ERROR at line 1:
ORA-01147: SYSTEM tablespace file 8 is offline
ORA-01110: data file 8: '/u01/oracle/oradata/ora11g/system02.dbf'

SQL&gt; alter database datafile 8 online;
alter database datafile 8 online
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 8 - see DBWR trace file
ORA-01110: data file 8: '/u01/oracle/oradata/ora11g/system02.dbf'
</pre>
<p><strong>使用system表空间其他数据文件来模拟丢失数据文件</strong></p>
<pre class="brush: bash; title: ; notranslate">
[oracle@xifenfei ora11g]$ cp system01.dbf system02.dbf
</pre>
<p><strong>通过dul获取file$相关信息</strong></p>
<pre class="brush: bash; title: ; notranslate">
FILE#
RELFILE#
CRSCNWRP
CRSCNBAS
</pre>
<p><strong>bbed修改下面参数值</strong></p>
<pre class="brush: bash; title: ; notranslate">
--rdba
 ub4 rdba_kcbh                         @4        0x02000001
--绝对文件号
 ub2 kccfhfno                          @52       0x0008
--scn
 ub4 kscnbas                           @100      0xc01a3581
 ub2 kscnwrp                           @104      0x0b2c
--相对文件号
 ub4 kcvfhrfn                             @368      0x00000008
--文件大小(不修改,为了重建欺骗数据库重建控制文件)
kccfhfsz
--文件创建时间(重建控制文件来实现控制文件和数据文件头一致)
kcvfhcrt
</pre>
<p><strong>重建控制文件</strong><br />
1.因为复制来自同一个表空间下面的数据文件，数据文件大小和原数据文件一样, 所以不要修改kccfhfsz大小，不然会出现</p>
<pre class="brush: sql; title: ; notranslate">
CREATE CONTROLFILE REUSE DATABASE &quot;ORA11G&quot; NORESETLOGS       ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01200: actual file size of 90880 is smaller than correct size of 10485760 blocks
ORA-01110: data file 8: '/u01/oracle/oradata/ora11g/system02.dbf'
</pre>
<p>2. 数据文件创建时间是通过kcvfhcrt参数值来控制的，而这个值是通过1988年01月01日00时00分00秒开始计时，按照每月31天计算的累计值，按照这个规则可以推断出来kcvfhcrt.因为数据库在启动的时候会验证控制文件中这个值和数据文件头的该值是否一致，所以如果你不修改kcvfhcrt,可以选择重建控制文件来完成.<br />
<br />
<strong>再次open数据库</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/oracle/oradata/ora11g/system01.dbf'


SQL&gt; recover database;
Media recovery complete.
SQL&gt; alter database open;

Database altered.
</pre>
<p>操作到这里,库已经可以正常的被open,如果通过这种方面屏蔽掉的异常的system数据文件中数据字典的部分表信息时,可能数据库依然不能被正常逻辑导出(例如dba_segments,dba_extents的基表等),需要进一步特殊处理，如果不能自行解决相关问题,需要恢复支持,请联系我们<br />
<strong><font color="red" size=4>Phone:17813235971  &nbsp;&nbsp;   Q Q:107644445<a target="_blank" href="https://wpa.qq.com/msgrd?v=3&amp;uin=107644445&amp;site=qq&amp;menu=yes"><img id="xffqqimg" src="//www.xifenfei.com/wp-content/themes/img/site_qq.jpg" alt="QQ咨询惜分飞" title="QQ咨询惜分飞"></a>  &nbsp;&nbsp;  E-Mail:dba@xifenfei.com</font></strong></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/02/oracle%e5%90%84%e7%a7%8d%e6%96%87%e4%bb%b6%e4%b8%a2%e5%a4%b1%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORACLE丢失各种文件导致数据库不能OPEN恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/%e6%81%a2%e5%a4%8d%e8%a2%abrm%e6%84%8f%e5%a4%96%e5%88%a0%e9%99%a4%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6.html" rel="bookmark" class="crp_title">恢复被rm意外删除数据文件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/03/%e9%9d%9e%e5%bd%92%e6%a1%a3%e5%bc%82%e5%b8%b8%e6%95%b0%e6%8d%ae%e5%ba%93rman%e5%a4%87%e4%bb%bd.html" rel="bookmark" class="crp_title">非归档异常数据库rman备份</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.html" rel="bookmark" class="crp_title">_allow_resetlogs_corruption和adjust_scn解决ORA-01190</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/08/%e4%bf%ae%e6%94%b9props-nls_characterset%e5%af%bc%e8%87%b4ora-00900%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">修改props$.NLS_CHARACTERSET导致ORA-00900异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/07/%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e7%9a%84%e4%b8%89%e4%b8%aa%e5%88%9b%e5%bb%ba%e4%b8%80%e7%82%b9%e7%82%b9%e6%8e%a2%e8%ae%a8.html" rel="bookmark" class="crp_title">数据文件的三个创建SCN一点点探讨</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/08/%e9%87%8d%e5%bb%ba%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e4%b8%a2%e5%a4%b1undo%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d-ora-01173%e6%a8%a1%e6%8b%9f%e4%b8%8e%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">重建控制文件丢失undo异常恢复&#8212;ORA-01173模拟与恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2019/04/linux-limit-wrong-ora-01157.html" rel="bookmark" class="crp_title">linux资源限制导致数据库异常</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2017/12/file-read-only-db-open-ora-01114.html" rel="bookmark" class="crp_title">文件read only导致数据库无法open</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/07/%e4%bd%bf%e7%94%a8bbed%e8%a7%a3%e5%86%b3ora-01178-file-n-created-before-last-create-controlfile-cannot-recreate.html" rel="bookmark" class="crp_title">使用bbed解决ORA-01178 file N created before last CREATE CONTROLFILE, cannot recreate</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/11/19c-pdb-undo-lost-recovery.html" rel="bookmark" class="crp_title">模拟19c数据库pdb undo异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/oracle-12c-%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORACLE 12C 控制文件异常恢复</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2012/11/bbed%e6%89%93%e5%bc%80%e4%b8%a2%e5%a4%b1%e9%83%a8%e5%88%86system%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e5%ba%93.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
