<?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; 推进scn</title>
	<atom:link href="https://www.xifenfei.com/tag/%e6%8e%a8%e8%bf%9bscn/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, 07 Nov 2026 15:45:44 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>通过修改控制文件scn推进数据库scn</title>
		<link>https://www.xifenfei.com/2014/04/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6scn%e6%8e%a8%e8%bf%9b%e6%95%b0%e6%8d%ae%e5%ba%93scn.html</link>
		<comments>https://www.xifenfei.com/2014/04/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6scn%e6%8e%a8%e8%bf%9b%e6%95%b0%e6%8d%ae%e5%ba%93scn.html#comments</comments>
		<pubDate>Sun, 13 Apr 2014 06:42:34 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[非常规恢复]]></category>
		<category><![CDATA[修改控制文件]]></category>
		<category><![CDATA[推进scn]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5242</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2014/04/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6scn%e6%8e%a8%e8%bf%9b%e6%95%b0%e6%8d%ae%e5%ba%93scn.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/2014/04/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6scn%e6%8e%a8%e8%bf%9b%e6%95%b0%e6%8d%ae%e5%ba%93scn.html" target="_blank">通过修改控制文件scn推进数据库scn</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在数据库遇到ora-600[2662],scn不一致(又没有日志）的时候，我们首先想到的就是去推进数据库的scn,让数据库能够open起来,抢救其中的数据,但是由于各种乱用的情况,oracle scn的pach出来后(11.2.0.4,12.0.1.0默认就屏蔽)，屏蔽了以前大部分传统的推进scn的方法(adjust_scn, _minimum_giga_scn),现在能够推进scn的有oradebug,bbed,修改控制文件.本文就列举通过ue修改控制文件scn来推进数据库scn的方法.<br />
<strong>数据库当前scn</strong></p>
<pre class="brush: sql; title: ; notranslate">
idle&gt; select   checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
         271743118

idle&gt; shutdown abort
ORACLE 例程已经关闭。
</pre>
<p><strong>分析控制文件中scn</strong><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/04/ctl-scn.jpg" alt="ctl-scn" width="570" height="255" class="alignleft size-full wp-image-5244" /></p>
<hr />
这里我们可以看到加粗部分为数据库scn</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt;select to_number('10327a59','xxxxxxxxx') from dual;

TO_NUMBER('10327A59','XXXXXXXXX')
---------------------------------
                        271743577
</pre>
<p>这里的scn值和在数据库中查询的值有小差别,因为查询时间点和我完全关闭数据库有个时间差,而这个时间差有scn变化.细红框部分为控制文件对块的验证信息<br />
<br />
<strong>修改控制文件scn和验证信息</strong><br />
验证信息修改为全部0,scn信息你可以根据你的需求去修改,这里把数据库的scn修改为57253932971026,按照数据库的原理,启动后的scn应该稍微大于该scn值.<br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/04/ctl-scn-new.jpg" alt="ctl-scn-new" width="537" height="239" class="alignleft size-full wp-image-5243" /></p>
<hr />
<pre class="brush: sql; title: ; notranslate">
SQL&gt;select to_number('341278563412','xxxxxxxxxxxxxxxxx') from dual;

TO_NUMBER('341278563412','XXXXXXXXXXXXXXXXX')
---------------------------------------------
                               57253932971026
</pre>
<p><strong>启动数据库</strong></p>
<pre class="brush: sql; title: ; notranslate">
idle&gt; startup mount
ORACLE 例程已经启动。

Total System Global Area  400846848 bytes
Fixed Size                  2440024 bytes
Variable Size             289408168 bytes
Database Buffers          100663296 bytes
Redo Buffers                8335360 bytes
数据库装载完毕。
idle&gt; recover database;
完成介质恢复。
idle&gt; alter database open;

数据库已更改。

idle&gt; select   checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
    57253932991028
</pre>
<p>数据库启动后查询scn为57253932991028(数据库当前scn)果然微大于57253932971026(修改控制文件scn),证明我们通过修改控制文件scn,实现数据库scn推近完全OK.不实验风险较大,请勿在生产环境上测试,负载后果自负</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/oracle-12c-redo%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e6%b5%8b%e8%af%95-%e6%89%93%e4%b8%8apatch%e6%81%a2%e5%a4%8d%e5%ae%8c%e5%85%a8.html" rel="bookmark" class="crp_title">ORACLE 12C redo异常恢复测试—打上patch恢复完全</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/10/oracle-scn-patch-upgrade-202210.html" rel="bookmark" class="crp_title">一键修改Oracle SCN工具升级(patch scn)</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/08/%e4%bd%bf%e7%94%a8oradebug%e4%bf%ae%e6%94%b9%e6%95%b0%e6%8d%ae%e5%ba%93scn.html" rel="bookmark" class="crp_title">使用oradebug修改数据库scn</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/oracle-12c-redo%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e6%b5%8b%e8%af%95-%e9%83%a8%e5%88%86pdb%e6%9c%aa%e6%ad%a3%e5%b8%b8open.html" rel="bookmark" class="crp_title">ORACLE 12C redo异常恢复测试&#8212;部分pdb未正常open</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/oracle-12c-ora-07445ktuhistrecusegcrtmain1173%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORACLE 12C ORA-07445[ktuHistRecUsegCrtMain()+1173]恢复</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><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/09/modify-obj-dataobj-_next_object.html" rel="bookmark" class="crp_title">通过update _NEXT_OBJECT 实现obj$.obj#和obj$.dataobj#跳号</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/06/win-oracle-scn-patch.html" rel="bookmark" class="crp_title">修改oracle scn小工具(patch scn)</a></li><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/2024/06/patch-scn-for-linux.html" rel="bookmark" class="crp_title">Patch SCN工具for Linux</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/08/rename-sys-ora-01092-ora-00600-kokasgi1%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">重命名sys用户引起数据库启动报ORA-01092 ORA-00600 kokasgi1错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2016/07/error-recreate-controlfile.html" rel="bookmark" class="crp_title">数据库恢复的敏感性&#8212;重建控制文件使用不合适数据文件</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2014/04/%e9%80%9a%e8%bf%87%e4%bf%ae%e6%94%b9%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6scn%e6%8e%a8%e8%bf%9b%e6%95%b0%e6%8d%ae%e5%ba%93scn.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
