<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>《使用_allow_resetlogs_corruption打开无归档日志rman备份库》的评论</title>
	<atom:link 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/feed" rel="self" type="application/rss+xml" />
	<link>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</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 11 Dec 2025 02:46:14 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>作者：惜分飞</title>
		<link>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/comment-page-1#comment-722</link>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 04:27:50 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=2619#comment-722</guid>
		<description><![CDATA[补充一次无归档日志，scn不一致，有offline文件的恢复
[sql]
SQL&gt; select file#,online_status,to_char(change#,&#039;999999999999&#039;) from v$recover_file;

     FILE# ONLINE_STATUS  TO_CHAR(CHANGE#,&#039;999999999
---------- -------------- --------------------------
         1 ONLINE                869697
         2 ONLINE                869732
         3 ONLINE                869768
         4 ONLINE                869768
         5 OFFLINE               868415

SQL&gt; select file#,to_char(checkpoint_change#,&#039;999999999999&#039;),
  2  to_char(last_change#,&#039;999999999999&#039;) from v$datafile;

     FILE# TO_CHAR(CHECKPOINT_CHANGE# TO_CHAR(LAST_CHANGE#,&#039;9999
---------- -------------------------- --------------------------
         1        870009                     870009
         2        870009                     870009
         3        870009                     870009
         4        870009                     870009
         5        868415                     868810

SQL&gt; recover database until cancel;
ORA-00279: change 869697 generated at 03/15/2012 12:11:57 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_29_777766629.dbf
ORA-00280: change 869697 for thread 1 is in sequence #29


Specify log: {&lt;RET&gt;=suggested &#124; filename &#124; AUTO &#124; CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: &#039;/u01/oracle/oradata/ora11g/sysaux01.dbf&#039;


ORA-01112: media recovery not started


SQL&gt; select file#,to_char(checkpoint_change#,&#039;999999999999&#039;),
  2  to_char(RESETLOGS_CHANGE#,&#039;999999999999&#039;)
  3  from v$datafile_header;

     FILE# TO_CHAR(CHECKPOINT_CHANGE# TO_CHAR(RESETLOGS_CHANGE#,
---------- -------------------------- --------------------------
         1        869697                     787897
         2        869732                     787897
         3        869768                     787897
         4        869768                     787897
         5        868415                     787897

SQL&gt; create pfile=&#039;/tmp/pfile&#039; from spfile;
 
File created.
 
在pfile中增加
_allow_resetlogs_corruption=true
_allow_error_simulation=TRUE(10g及其以上版本需要)

SQL&gt; shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


SQL&gt; startup pfile=&#039;/tmp/pfile&#039; 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.
SQL&gt; alter session set events &#039;10015 trace name adjust_scn level 2&#039;;

Session altered.

SQL&gt; recover database until cancel;
ORA-00279: change 869697 generated at 03/15/2012 12:11:57 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_29_777766629.dbf
ORA-00280: change 869697 for thread 1 is in sequence #29


Specify log: {&lt;RET&gt;=suggested &#124; filename &#124; AUTO &#124; CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: &#039;/u01/oracle/oradata/ora11g/sysaux01.dbf&#039;


ORA-01112: media recovery not started

SQL&gt; alter database datafile 5 online;

Database altered.

SQL&gt; alter database open resetlogs;

Database altered.

SQL&gt; select file#,online_status,to_char(change#,&#039;999999999999&#039;) 
2         from v$recover_file;

no rows selected
[/sql]]]></description>
		<content:encoded><![CDATA[<p>补充一次无归档日志，scn不一致，有offline文件的恢复</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select file#,online_status,to_char(change#,'999999999999') from v$recover_file;

     FILE# ONLINE_STATUS  TO_CHAR(CHANGE#,'999999999
---------- -------------- --------------------------
         1 ONLINE                869697
         2 ONLINE                869732
         3 ONLINE                869768
         4 ONLINE                869768
         5 OFFLINE               868415

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        870009                     870009
         2        870009                     870009
         3        870009                     870009
         4        870009                     870009
         5        868415                     868810

SQL&gt; recover database until cancel;
ORA-00279: change 869697 generated at 03/15/2012 12:11:57 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_29_777766629.dbf
ORA-00280: change 869697 for thread 1 is in sequence #29


Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: '/u01/oracle/oradata/ora11g/sysaux01.dbf'


ORA-01112: media recovery not started


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        869697                     787897
         2        869732                     787897
         3        869768                     787897
         4        869768                     787897
         5        868415                     787897

SQL&gt; create pfile='/tmp/pfile' from spfile;
 
File created.
 
在pfile中增加
_allow_resetlogs_corruption=true
_allow_error_simulation=TRUE(10g及其以上版本需要)

SQL&gt; shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


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.
SQL&gt; alter session set events '10015 trace name adjust_scn level 2';

Session altered.

SQL&gt; recover database until cancel;
ORA-00279: change 869697 generated at 03/15/2012 12:11:57 needed for thread 1
ORA-00289: suggestion :
/u01/oracle/oradata/archivelog/ora11g/1_29_777766629.dbf
ORA-00280: change 869697 for thread 1 is in sequence #29


Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 2 was not restored from a sufficiently old backup
ORA-01110: data file 2: '/u01/oracle/oradata/ora11g/sysaux01.dbf'


ORA-01112: media recovery not started

SQL&gt; alter database datafile 5 online;

Database altered.

SQL&gt; alter database open resetlogs;

Database altered.

SQL&gt; select file#,online_status,to_char(change#,'999999999999') 
2         from v$recover_file;

no rows selected
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
