<?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; adjust_scn</title>
	<atom:link href="https://www.xifenfei.com/tag/adjust_scn/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>Sun, 22 Nov 2026 15:21:14 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>_allow_resetlogs_corruption和adjust_scn解决ORA-01190</title>
		<link>https://www.xifenfei.com/2012/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.html</link>
		<comments>https://www.xifenfei.com/2012/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.html#comments</comments>
		<pubDate>Thu, 15 Mar 2012 14:24:30 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle备份恢复]]></category>
		<category><![CDATA[adjust_scn]]></category>
		<category><![CDATA[ORA-01190]]></category>
		<category><![CDATA[_ALLOW_RESETLOGS_CORRUPTION]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=2669</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2012/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.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/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.html" target="_blank">_allow_resetlogs_corruption和adjust_scn解决ORA-01190</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p><strong>一、模拟offline文件然后resetlogs操作</strong></p>
<pre class="brush: bash; title: ; notranslate">
1.设置datafile 5数据文件offline
2.rman备份数据库
3.关闭原数据库，删除数据文件/当前日志和部分归档日志
4.执行不完全恢复，resetlogs打开数据库(如下面操作)
[oracle@xifenfei ora11g]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Mar 15 07:36:59 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL&gt; recover database until cancel;
ORA-00279: change 868870 generated at 03/15/2012 03:32:11 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_29_777766629.dbf
ORA-00280: change 868870 for thread 1 is in sequence #29


Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL&gt; alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL&gt; alter database open resetlogs;

Database altered.

SQL&gt; select file#,online_status,to_char(change#,'999999999999') from v$recover_file;

     FILE# ONLINE_STATUS  TO_CHAR(CHANGE#,'999999999
---------- -------------- --------------------------
         5 OFFLINE               868810

SQL&gt; alter database datafile 5 online;
alter database datafile 5 online
*
ERROR at line 1:
ORA-01190: control file or data file 5 is from before the last RESETLOGS
ORA-01110: data file 5: '/u01/oracle/oradata/ora11g/xifenfei01.dbf'


SQL&gt; select file#,to_char(checkpoint_change#,'999999999999'),
  2  to_char(last_change#,'999999999999') from v$datafile;

     FILE# TO_CHAR(CHECKPOINT_CHANGE# TO_CHAR(LAST_CHANGE#,'9999
---------- -------------------------- --------------------------
         1        868874
         2        868874
         3        868874
         4        868874
         5        868810                     868874

--可以看到offline的数据文件，没有因为resetlogs操作而改变
--CHECKPOINT_CHANGE#和RESETLOGS_CHANGE#信息
SQL&gt; select file#,to_char(checkpoint_change#,'999999999999'),
  2  to_char(RESETLOGS_CHANGE#,'999999999999')
  3  from v$datafile_header;

     FILE# TO_CHAR(CHECKPOINT_CHANGE# TO_CHAR(RESETLOGS_CHANGE#,
---------- -------------------------- --------------------------
         1        868874                     868871
         2        868874                     868871
         3        868874                     868871
         4        868874                     868871
         5        868810                     787897
</pre>
<p><strong>二、隐含参数设置</strong></p>
<pre class="brush: bash; title: ; notranslate">
SQL&gt; create pfile='/tmp/pfile' from spfile;

File created.

SQL&gt; shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

在pfile中增加
_allow_resetlogs_corruption=true
_allow_error_simulation=TRUE(10g及其以上版本需要)
</pre>
<p><strong>三、打开数据库,online离线文件</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; startup pfile='/tmp/pfile' mount;
ORACLE instance started.

Total System Global Area  368263168 bytes
Fixed Size                  1345016 bytes
Variable Size             293603848 bytes
Database Buffers           67108864 bytes
Redo Buffers                6205440 bytes
Database mounted.
--在mount状态下执行
SQL&gt; alter session set events '10015 trace name adjust_scn level 2';

Session altered.


--[一定要]在mount状态下执行online操作
SQL&gt; alter database datafile 5 online;

Database altered.
SQL&gt; recover database until cancel;
ORA-00279: change 868810 generated at 03/13/2012 22:19:37 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_27_777766629.dbf
ORA-00280: change 868810 for thread 1 is in sequence #27


Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01190: control file or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: '/u01/oracle/oradata/ora11g/system01.dbf'


ORA-01112: media recovery not started


SQL&gt; alter database open resetlogs;

Database altered.

SQL&gt; select file#,online_status,to_char(change#,'999999999999') from v$recover_file;

no rows selected
</pre>
<p>姊妹篇:<a href="//www.xifenfei.com/2666.html" title="bbed解决ORA-01190" target="_blank">bbed解决ORA-01190</a></p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/bbed%e8%a7%a3%e5%86%b3ora-01190.html" rel="bookmark" class="crp_title">bbed解决ORA-01190</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e4%bd%bf%e7%94%a8_allow_resetlogs_corruption%e5%8f%82%e6%95%b0%e6%89%93%e5%bc%80%e6%97%a0%e5%bd%92%e6%a1%a3%e6%97%a5%e5%bf%97rman%e5%a4%87%e4%bb%bd%e5%ba%93.html" rel="bookmark" class="crp_title">使用_allow_resetlogs_corruption打开无归档日志rman备份库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/%e6%81%a2%e5%a4%8d%e5%a4%87%e4%bb%bd%e6%8e%a7%e5%88%b6%e6%96%87%e4%bb%b6%e9%81%bf%e5%85%8dresetlogs%e6%96%b9%e5%bc%8f%e6%89%93%e5%bc%80%e6%95%b0%e6%8d%ae%e5%ba%93.html" rel="bookmark" class="crp_title">恢复备份控制文件避免resetlogs方式打开数据库</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/06/%e5%bf%98%e8%ae%b0%e6%89%a7%e8%a1%8cend-backup%e5%91%bd%e4%bb%a4%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">忘记执行end backup命令数据库恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/%e8%ae%b0%e5%bd%958-0-5%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d%e8%bf%87%e7%a8%8b.html" rel="bookmark" class="crp_title">记录8.0.5数据库恢复过程</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/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/2014/11/redo%e5%bc%82%e5%b8%b8-ora-600-kclchkblk_4-%e6%95%85%e9%9a%9c%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">redo异常 ORA-600 kclchkblk_4 故障恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/08/ora-00205%e9%97%ae%e9%a2%98%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">ORA-00205问题处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/09/ora-65088-database-open-should-be-retried.html" rel="bookmark" class="crp_title">ORA-65088: database open should be retried</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2020/11/19c-redo-lost-recovery.html" rel="bookmark" class="crp_title">模拟19c数据库redo异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/11/%e4%bd%bf%e7%94%a8flashback-database%e6%89%be%e5%9b%9e%e8%a2%ab%e8%af%af%e5%88%a0%e9%99%a4%e8%a1%a8%e7%a9%ba%e9%97%b4.html" rel="bookmark" class="crp_title">使用flashback database找回被误删除表空间</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2012/03/_allow_resetlogs_corruption%e5%92%8cadjust_scn%e8%a7%a3%e5%86%b3ora-01190.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
