<?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/%e9%80%9a%e8%bf%87%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e4%bf%ae%e6%94%b9%e6%95%b0%e6%8d%ae%e5%ba%93scn/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>修改oracle scn小工具(patch scn)</title>
		<link>https://www.xifenfei.com/2022/06/win-oracle-scn-patch.html</link>
		<comments>https://www.xifenfei.com/2022/06/win-oracle-scn-patch.html#comments</comments>
		<pubDate>Tue, 14 Jun 2022 05:27:54 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[Oracle Recovery Tools]]></category>
		<category><![CDATA[oracle scn修改工具]]></category>
		<category><![CDATA[patch scn]]></category>
		<category><![CDATA[win scn修改]]></category>
		<category><![CDATA[通过控制文件修改数据库scn]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=9756</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2022/06/win-oracle-scn-patch.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/2022/06/win-oracle-scn-patch.html" target="_blank">修改oracle scn小工具(patch scn)</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>在一些情况下(特别是一些数据库非常规恢复场景中),需要修改oracle scn绕过一些错误,让数据库open成功,在以前的版本中我们可以通过event,隐含参数,oradebug等方法进行修改,在一些较新的版本中这些方法都被oracle屏蔽,无法实现oracle scn进行调整,针对这种情况,开发了一个Patch_SCN小程序,实现对oracle数据库的scn进行调整</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select dbms_flashback.get_system_change_number a from dual;

               A
----------------
    107367806959
</pre>
<p>通过工具查询scn信息,由于oracle的scn是动态的,因此和get_system_change_number 查询值有细微出入<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130358.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130358.jpg" alt="20220614130358" width="589" height="297" class="alignnone size-full wp-image-9757" /></a><br />
<hr />
<strong>win版本修改scn</strong><br />
<a href="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130543.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130543.jpg" alt="20220614130543" width="571" height="306" class="alignnone size-full wp-image-9758" /></a><br />
<hr />
通过查询确认scn修改成功<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130553.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2022/06/20220614130553.jpg" alt="20220614130553" width="545" height="100" class="alignnone size-full wp-image-9759" /></a><br />
<hr />
增加一键通过修改控制文件scn实现改变数据库scn的功能&#8212;202210增加<br />
<a href="https://www.xifenfei.com/wp-content/uploads/2022/10/20221006220814.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2022/10/20221006220814.jpg" alt="20221006220814" width="596" height="447" class="alignnone size-full wp-image-9935" /></a><br />
<hr />
<strong>linux版本修改SCN</strong><br />
查询当前数据库SCN</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; startup mount
ORACLE instance started.

Total System Global Area  551165952 bytes
Fixed Size                  2255112 bytes
Variable Size             369100536 bytes
Database Buffers          171966464 bytes
Redo Buffers                7843840 bytes
Database mounted.

SQL&gt; alter database open;

Database altered.

SQL&gt;  select dbms_flashback.get_system_change_number a from dual;

         A
----------
 248118193
</pre>
<p>关闭数据库，启动到mount，为修改SCN做准备（为了模拟真实环境，只让程序在mount情况下修改scn，open情况下可以修改但是无实际意义）</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; startup mount;
ORACLE instance started.

Total System Global Area  551165952 bytes
Fixed Size                  2255112 bytes
Variable Size             369100536 bytes
Database Buffers          171966464 bytes
Redo Buffers                7843840 bytes
Database mounted.
SQL&gt; select spid from v$process where addr = 
  2     (select paddr from v$session where sid=
  3      (select sid from v$mystat where rownum=1));

SPID
------------------------
21019
</pre>
<p>进行SCN修改</p>
<pre class="brush: bash; title: ; notranslate">
[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN 21019(会话进程号) 300000000(期望修改SCN值)
Machine Code:W0UY-SV09-71CY-IEWA

Please input Key:42FB4ADAB72BB4AD   &lt;----需要联系软件作者惜分飞获取
Confirm modification, please input [Y]...
Y
Modify the Oracle SCN value to:11E1A300:300000000
</pre>
<p>启动数据库，查询scn</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; ALTER DATABASE OPEN;

Database altered.

SQL&gt; select dbms_flashback.get_system_change_number a from dual;

         A
----------
 300000244   ---由于数据库启动之后，scn稍微增加，属于正常情况
</pre>
<p>通过上述测试，证明Patch_SCN可以完美实现linux平台Oracle 数据库的SCN调整工作<br />
<br />
<strong>该功能的通用版已经包含到oracle racovery tools工具中(注册版可用)</strong><br />
<a href="https://www.xifenfei.com/wp-content/uploads/2022/06/oracle-recovery-tools.jpg"><img src="https://www.xifenfei.com/wp-content/uploads/2022/06/oracle-recovery-tools.jpg" alt="oracle-recovery-tools" width="793" height="658" class="alignnone size-full wp-image-9761" /></a><br />
<hr />
Patch_SCN下载:<a href="https://www.xifenfei.com/wp-content/uploads/recover_check/Patch_SCN.zip">Patch_SCN下载</a><br />
Patch_SCN使用说明:<a href="https://www.xifenfei.com/wp-content/uploads/recover_check/Patch_SCN.pdf">Patch_SCN使用说明</a><br />
OraRecovery下载:<a href="https://www.xifenfei.com/wp-content/uploads/recover_check/OraRecovery.zip">OraRecovery下载</a><br />
OraRecovery使用说明:<a href="https://www.xifenfei.com/wp-content/uploads/2020/08/OracleRecoveryTools.pdf">OraRecovery使用说明</a></p>
<div id="crp_related"><ul><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/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/2022/07/ora-702_recovery-tool.html" rel="bookmark" class="crp_title">ORA-00702一键恢复工具</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/2022/07/delete-partition-oracle-recovery.html" rel="bookmark" class="crp_title">误删除分区oracle数据库恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/06/ora-01110-ora-17070-osd-04006.html" rel="bookmark" class="crp_title">ORA-01110 ORA-17070 OSD-04006 故障恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/12/crs-2674-root-sh-failed.html" rel="bookmark" class="crp_title">RAC节点时间间隔过大导致执行root.sh不成功</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/01/mallox-db-recovery.html" rel="bookmark" class="crp_title">.mallox加密数据库恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/08/oracle-recovery-tools-202008.html" rel="bookmark" class="crp_title">Oracle Recovery Tools&#8212;202008</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/02/decrypt20firemail-cc-eking.html" rel="bookmark" class="crp_title">.[decrypt20@firemail.cc].eking 数据库勒索恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/07/makop-ora-recovery.html" rel="bookmark" class="crp_title">oracle文件勒索恢复工具&#8212;.makop病毒恢复</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2022/06/win-oracle-scn-patch.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
