<?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; ORA-600 13011</title>
	<atom:link href="https://www.xifenfei.com/tag/ora-600-13011/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, 24 Oct 2026 14:05:24 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>ORACLE异常恢复后awr异常处理</title>
		<link>https://www.xifenfei.com/2015/08/oracle%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e5%90%8eawr%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.html</link>
		<comments>https://www.xifenfei.com/2015/08/oracle%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e5%90%8eawr%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.html#comments</comments>
		<pubDate>Fri, 28 Aug 2015 17:21:47 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[awr异常]]></category>
		<category><![CDATA[kewrose_1]]></category>
		<category><![CDATA[ORA-600 13011]]></category>
		<category><![CDATA[ORA-600 6002]]></category>
		<category><![CDATA[ORA-600 kewrose_1]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=6072</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2015/08/oracle%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e5%90%8eawr%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.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/2015/08/oracle%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e5%90%8eawr%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.html" target="_blank">ORACLE异常恢复后awr异常处理</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>有一个通过非常规方法恢复过的客户数据库出现问题awr无法收集统计信息(几个月前非常规方法恢复的库,因为未重建库),不太方便跟踪数据库性能,让其帮忙分析跟踪问题.<br />
<strong>人工收集统计信息报错RA-00001: 违反唯一约束条件 (SYS.WRM$_SNAPSHOT_PK)</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; execute dbms_workload_repository.create_snapshot();
BEGIN dbms_workload_repository.create_snapshot(); END;

*
第 1 行出现错误:
ORA-13509: 更新 AWR 表时出错
ORA-00001: 违反唯一约束条件 (ORA-00001: 违反唯一约束条件 (SYS.WRM$_SNAPSHOT_PK)
.)
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 99
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 122
ORA-06512: 在 line 1
</pre>
<p><strong>通过分析trace文件问题如下</strong></p>
<pre class="brush: bash; title: ; notranslate">
Trace file D:\APP\ADMINISTRATOR\diag\rdbms\rac\rac2\trace\rac2_m000_1628.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing option
Windows NT Version V6.1 Service Pack 1 
CPU                 : 32 - type 8664, 32 Physical Cores
Process Affinity    : 0x0x0000000000000000
Memory (Avail/Total): Ph:83326M/131035M, Ph+PgF:214386M/262068M 
Instance name: rac2
Redo thread mounted by this instance: 2
Oracle process number: 61
Windows thread id: 1628, image: ORACLE.EXE (M000)


*** 2015-08-28 11:39:51.967
*** SESSION ID:(2062.93) 2015-08-28 11:39:51.968
*** CLIENT ID:() 2015-08-28 11:39:51.968
*** SERVICE NAME:(SYS$BACKGROUND) 2015-08-28 11:39:51.968
*** MODULE NAME:(MMON_SLAVE) 2015-08-28 11:39:51.968
*** ACTION NAME:(Auto-Flush Slave Action) 2015-08-28 11:39:51.968
 
*** KEWROCISTMTEXEC - encountered error: (ORA-00001: 违反唯一约束条件 (SYS.WRM$_SNAPSHOT_PK)
)  
  *** SQLSTR: total-len=342, dump-len=240, 
      STR={insert into   WRM$_SNAPSHOT  (snap_id, dbid, instance_number, startup_time,begin_interval_time, 
end_interval_time, snap_level,    status, error_count, bl_moved, snap_flag, snap_timezone)  
values   (:snap_id, :dbid, :instance_number, :sta}
*** KEWRAFS: Error=13509 encountered by Auto Flush Slave.
</pre>
<p>这里可以明确的定位到,由于insert WRM$_SNAPSHOT表之时出现主键冲突导致无法收集统计信息.因为awr的数据都是历史数据,可以全部清理,因此尝试删除掉awr相关数据看是否能够解决问题<br />
<br />
<strong>对收集快照做10046 跟踪发现</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; oradebug setmypid
已处理的语句
SQL&gt; alter session set events '10046 trace name context forever, level 12';

会话已更改。

SQL&gt; oradebug tracefile_name
D:\APP\ADMINISTRATOR\diag\rdbms\rac\rac2\trace\rac2_ora_5944.trc
SQL&gt; execute dbms_workload_repository.create_snapshot();
BEGIN dbms_workload_repository.create_snapshot(); END;

*
第 1 行出现错误:
ORA-13509: 更新 AWR 表时出错
ORA-00001: 违反唯一约束条件 (ORA-00001: 违反唯一约束条件 (SYS.WRM$_SNAPSHOT_PK)
.)
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 99
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 122
ORA-06512: 在 line 1


--trace文件分析
PARSING IN CURSOR #1362260992  lid=0 tim=22781405124 hv=438921370 ad='148fd90590' sqlid='15rbgh4d2ku4u'
insert into WRM$_SNAPSHOT(snap_id, dbid, instance_number, startup_time,begin_interval_time, end_interval_time,
snap_level,status, error_count, bl_moved,snap_flag, snap_timezone)values(:snap_id, :dbid, :instance_number, 
:startup_time, :begin_interval_time, :end_interval_time, :snap_level,    :status, 0, 0, :bind1, :bind2)
END OF STMT
PARSE #1362260992:c=0,e=474,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,plh=0,tim=22781405122
BINDS #1362260992:
 Bind#0
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=208 off=0
  kxsbbbfp=513a6bf8  bln=22  avl=03  flg=05
  value=9277
 Bind#1
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=24
  kxsbbbfp=513a6c10  bln=22  avl=06  flg=01
  value=2429481020
 Bind#2
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=48
  kxsbbbfp=513a6c28  bln=22  avl=02  flg=01
  value=2
 Bind#3
  oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=09 pre=00
  oacflg=00 fl2=8000000 frm=00 csi=00 siz=0 off=72
  kxsbbbfp=513a6c40  bln=11  avl=07  flg=01
  value=28-8月 -15 10.06.53 上午
 Bind#4
  oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=09 pre=00
  oacflg=00 fl2=8000000 frm=00 csi=00 siz=0 off=88
  kxsbbbfp=513a6c50  bln=11  avl=07  flg=01
  value=28-8月 -15 10.06.53 上午
 Bind#5
  oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=09 pre=00
  oacflg=00 fl2=8000000 frm=00 csi=00 siz=0 off=104
  kxsbbbfp=513a6c60  bln=11  avl=11  flg=01
  value=28-8月 -15 04.11.40.017000000 下午
 Bind#6
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=120
  kxsbbbfp=513a6c70  bln=22  avl=02  flg=01
  value=1
 Bind#7
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=144
  kxsbbbfp=513a6c88  bln=22  avl=02  flg=01
  value=1
 Bind#8
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=168
  kxsbbbfp=513a6ca0  bln=22  avl=02  flg=01
  value=1
 Bind#9
  oacdty=183 mxl=11(11) mxlc=00 mal=00 scl=09 pre=09
  oacflg=01 fl2=8000000 frm=00 csi=00 siz=0 off=192
  kxsbbbfp=513a6cb8  bln=11  avl=11  flg=01
  value=Unhandled datatype (183) found in kxsbndinf
</pre>
<p>这里可以明确定位到,awr在收集信息的时候就是插入的值和库中本身存在的记录冲突,从而出现此类问题<br />
<br />
<strong>清理awr数据</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select max(snap_id),min(snap_id) from WRM$_SNAPSHOT;

MAX(SNAP_ID) MIN(SNAP_ID)
------------ ------------
        9277         9081

SQL&gt; exec DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(9081,9277);

PL/SQL 过程已成功完成。

SQL&gt;
SQL&gt; select max(snap_id),min(snap_id) from WRM$_SNAPSHOT;

MAX(SNAP_ID) MIN(SNAP_ID)
------------ ------------
        9277         9277

SQL&gt; exec DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(9080,9278);

PL/SQL 过程已成功完成。

SQL&gt; select max(snap_id),min(snap_id) from WRM$_SNAPSHOT;

MAX(SNAP_ID) MIN(SNAP_ID)
------------ ------------
        9277         9277

SQL&gt; delete from  WRM$_SNAPSHOT where snap_id=9277;
delete from  WRM$_SNAPSHOT where snap_id=9277
             *
第 1 行出现错误:
ORA-00600: 内部错误代码, 参数: [13011], [6653], [8456911], [2], [8456911], [3],
[], [], [], [], [], []


SQL&gt; delete /*+ RULE */ from  WRM$_SNAPSHOT where snap_id=9277;

已删除0行。
</pre>
<p>这里有几分诡异,snap_id=9277的记录无法清理,而且正常删除报ORA-00600[13011].根据经验,出现该问题,很可能是由于表和index的记录问题<br />
<br />
<strong>尝试rebuild index</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; analyze table WRM$_SNAPSHOT validate structure cascade;
analyze table WRM$_SNAPSHOT validate structure cascade
*
第 1 行出现错误:
ORA-01499: 表/索引交叉引用失败 - 请参阅跟踪文件


SQL&gt; select index_name from dba_indexes where table_name='WRM$_SNAPSHOT';

INDEX_NAME
------------------------------
WRM$_SNAPSHOT_PK

SQL&gt; alter index WRM$_SNAPSHOT_PK rebuild;

索引已更改。

SQL&gt; select /*+ full(t) */ max(snap_id),min(snap_id) from WRM$_SNAPSHOT t;

MAX(SNAP_ID) MIN(SNAP_ID)
------------ ------------


SQL&gt; select max(snap_id),min(snap_id) from WRM$_SNAPSHOT;

MAX(SNAP_ID) MIN(SNAP_ID)
------------ ------------
        9277         9277
</pre>
<p>这里很明确的定位了,由于表和index的记录不一致,而且通过rebuild,发现index依旧有问题<br />
<br />
<strong>重建index</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; set linesize 180
SQL&gt; set pages 999
SQL&gt; set long 90000
SQL&gt; select dbms_metadata.get_ddl('INDEX','WRM$_SNAPSHOT_PK','SYS') from dual;

DBMS_METADATA.GET_DDL('INDEX','WRM$_SNAPSHOT_PK','SYS')
--------------------------------------------------------------------------------

  CREATE UNIQUE INDEX &quot;SYS&quot;.&quot;WRM$_SNAPSHOT_PK&quot; ON &quot;SYS&quot;.&quot;WRM$_SNAPSHOT&quot; (&quot;DBID&quot;, &quot;SNAP_ID&quot;, &quot;INSTANCE_NUMBER&quot;)
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE &quot;SYSAUX&quot;


SQL&gt; DROP INDEX &quot;SYS&quot;.&quot;WRM$_SNAPSHOT_PK&quot; ;
DROP INDEX &quot;SYS&quot;.&quot;WRM$_SNAPSHOT_PK&quot;
                 *
第 1 行出现错误:
ORA-02429: 无法删除用于强制唯一/主键的索引


SQL&gt; alter table &quot;SYS&quot;.&quot;WRM$_SNAPSHOT&quot; drop  constraint &quot;SYS&quot;.&quot;WRM$_SNAPSHOT_PK&quot;;
alter table &quot;SYS&quot;.&quot;WRM$_SNAPSHOT&quot; drop  constraint &quot;SYS&quot;.&quot;WRM$_SNAPSHOT_PK&quot;
                                                        *
第 1 行出现错误:
ORA-01735: 无效的 ALTER TABLE 选项


SQL&gt; alter table &quot;WRM$_SNAPSHOT&quot; drop  constraint &quot;WRM$_SNAPSHOT_PK&quot;;

表已更改。

SQL&gt;alter table &quot;WRM$_SNAPSHOT&quot; add constraint &quot;WRM$_SNAPSHOT_PK&quot; primary key(&quot;DBID&quot;, &quot;SNAP_ID&quot;, &quot;INSTANCE_NUMBER&quot;);

表已更改。
</pre>
<p><strong>再次尝试做快照</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; execute dbms_workload_repository.create_snapshot();
BEGIN dbms_workload_repository.create_snapshot(); END;

*
第 1 行出现错误:
ORA-00600: 内部错误代码, 参数: [kewrose_1], [600], [ORA-00600: 内部错误代码, 参数: [6002], [6], [104], 
[4], [0], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 99
ORA-06512: 在 &quot;SYS.DBMS_WORKLOAD_REPOSITORY&quot;, line 122
ORA-06512: 在 line 1
</pre>
<p>悲剧再次发生,收集快照之时遭遇悲催的ORA-00600[kewrose_1]/ORA-600[6002]的错误.范围awr的以前数据都不要了,也就采用最极端的处理方法,定位到表,然后处理之<br />
<br />
<strong>继续10046跟踪</strong></p>
<pre class="brush: sql; title: ; notranslate">
PARSING IN CURSOR #1495840456 tim=24328721585 hv=4050667988 ad='146f9948f8'sqlid='84qubbrsr0kfn'
insert into wrh$_latch(snap_id, dbid, instance_number, latch_hash, level#, gets, misses, sleeps,
 immediate_gets,immediate_misses, spin_gets, sleep1, sleep2, sleep3, sleep4, wait_time)  
select :snap_id, :dbid, :instance_number, hash, level#, gets,    misses, sleeps, 
immediate_gets, immediate_misses, spin_gets,    sleep1, sleep2, sleep3, 
sleep4, wait_time  from    v$latch  order by    hash
END OF STMT
PARSE #1495840456:c=0,e=376,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,plh=0,tim=24328721584
BINDS #1495840456:
 Bind#0
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=72 off=0
  kxsbbbfp=60471350  bln=22  avl=03  flg=05
  value=9280
 Bind#1
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=24
  kxsbbbfp=60471368  bln=22  avl=06  flg=01
  value=2429481020
 Bind#2
  oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
  oacflg=00 fl2=0000 frm=00 csi=00 siz=0 off=48
  kxsbbbfp=60471380  bln=22  avl=02  flg=01
  value=2
ORA-00600: 内部错误代码, 参数: [6002], [6], [104], [4], [0], [], [], [], [], [], [], []
</pre>
<p>通过这里可以定位到问题是发生在wrh$_latch表的insert操作之上<br />
<br />
<strong>分析并truncate table</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; SELECT COUNT(*) FROM wrh$_latch;

COUNT(*)
--------
     0

SQL&gt; truncate table wrh$_latch;

表被截断
</pre>
<p><strong>再次收集快照信息</strong></p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; execute dbms_workload_repository.create_snapshot();

PL/SQL 过程已成功完成。

SQL&gt; @?/rdbms/admin/awrrpt.sql
--工作正常
</pre>
<p>经过一些列处理,终于让awr能够正常工作了,特别是在做过异常恢复之后,awr数据可能有各种问题导致工作不正常,可以考虑重建awr,也可以考虑类似我这样彻底清理awr数据,然后放手处理.当然对于使用非常规方法恢复的Oracle数据库,在条件允许的情况下,建议逻辑方式重建库.因为有数据字典不一致,有逻辑坏块,有表和index不一致等问题,在后续的使用中逐渐被显露出来,从而导致很多麻烦,重建库彻彻底底解决问题.</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/%e9%80%9a%e8%bf%87sql%e8%af%ad%e5%8f%a5%e8%8e%b7%e5%8f%96awrstatspack%e9%80%bb%e8%be%91%e8%af%bb%e7%89%a9%e7%90%86%e8%af%bb.html" rel="bookmark" class="crp_title">通过sql语句获取awr/statspack逻辑读/物理读</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2023/07/wrh_latch-wrh_sysstat-wrh_parameter.html" rel="bookmark" class="crp_title">WRH$_LATCH, WRH$_SYSSTAT, WRH$_PARAMETER对象较大</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/06/oracle-12c-cdb%e4%b8%adpdb%e5%8f%82%e6%95%b0%e7%ae%a1%e7%90%86%e6%9c%ba%e5%88%b6.html" rel="bookmark" class="crp_title">ORACLE 12C CDB中PDB参数管理机制</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/ora-00001-unique-constraint-perfstat-statssql_summary_pk-violated.html" rel="bookmark" class="crp_title">ORA-00001: unique constraint (PERFSTAT.STATS$SQL_SUMMARY_PK) violated</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/05/%e4%bd%bf%e7%94%a8dbms_metadata-get_ddl%e5%87%ba%e7%8e%b0ora-31605%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">使用dbms_metadata.get_ddl出现ORA-31605错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2015/04/%e6%ad%a3%e5%b8%b8%e5%85%b3%e9%97%ad%e6%95%b0%e6%8d%ae%e5%ba%93sequence-cache%e4%b8%8d%e4%b8%ba0-sequence%e4%b8%8d%e8%b7%b3%e8%b7%83.html" rel="bookmark" class="crp_title">正常关闭数据库sequence cache不为0 sequence不跳跃</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/05/ora-00600-16515.html" rel="bookmark" class="crp_title">收集统计信息报ORA-00600 16515问题解决</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/08/oracle-12c-dbms_utility-expand_sql_text-%e6%9f%a5%e7%9c%8bsql%e8%a7%86%e5%9b%be%e5%9f%ba%e8%a1%a8.html" rel="bookmark" class="crp_title">ORACLE 12C dbms_utility.expand_sql_text 查看SQL视图基表</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e5%85%b3%e4%ba%8esmon_scn_time%e8%8b%a5%e5%b9%b2%e9%97%ae%e9%a2%98%e8%af%b4%e6%98%8e.html" rel="bookmark" class="crp_title">关于SMON_SCN_TIME若干问题说明</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/%e4%bd%bf%e7%94%a8copy%e5%ae%9e%e7%8e%b0long%e7%b1%bb%e5%9e%8b%e8%bd%ac%e7%a7%bb%e8%a1%a8%e7%a9%ba%e9%97%b4.html" rel="bookmark" class="crp_title">使用copy实现long类型转移表空间</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/02/statspack%e6%8a%a5%e5%91%8a%e4%b8%ad%e9%80%bb%e8%be%91%e8%af%bb%e4%b8%ba%e8%b4%9f%e5%80%bc.html" rel="bookmark" class="crp_title">statspack报告中逻辑读为负值</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/01/%e8%b7%b3%e8%bf%87obj%e5%9d%8f%e5%9d%97%e6%96%b9%e6%b3%95.html" rel="bookmark" class="crp_title">跳过obj$坏块方法</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2015/08/oracle%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d%e5%90%8eawr%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>记录一次system表空间坏块(ORA-01578)数据库恢复</title>
		<link>https://www.xifenfei.com/2014/08/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1system%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html</link>
		<comments>https://www.xifenfei.com/2014/08/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1system%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html#comments</comments>
		<pubDate>Fri, 29 Aug 2014 16:38:04 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle备份恢复]]></category>
		<category><![CDATA[ORA-01578]]></category>
		<category><![CDATA[ORA-600 13011]]></category>
		<category><![CDATA[ORA-600 13013]]></category>
		<category><![CDATA[ORA-600 2662]]></category>
		<category><![CDATA[ORA-600 6749]]></category>
		<category><![CDATA[ORACLE恢复]]></category>
		<category><![CDATA[system坏块]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5475</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2014/08/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1system%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.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/08/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1system%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html" target="_blank">记录一次system表空间坏块(ORA-01578)数据库恢复</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>半夜朋友打来求救电话,说xx医院his系统因为存储异常导致system坏块无法正常启动,因为是win平台无法使用bbed,无法修复system 坏块,请求技术支持<br />
<strong>dbv检查system文件报坏块</strong><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/1.jpg" alt="1" width="455" height="101" class="alignleft size-full wp-image-5476" /></p>
<hr />
对应具体地址为:file 1 block 39041和66738<br />
<br />
<strong>判断控制文件异常</strong><br />
通过<a href="//www.xifenfei.com/oracle_recovery_check" title="数据库恢复检查脚本(Oracle Database Recovery Check)" target="_blank">数据库恢复检查脚本(Oracle Database Recovery Check)脚本</a>检测数据库发现控制文件明显异常(checkpoint scn<datafile scn>)<br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/2.jpg" alt="2" width="1412" height="136" class="alignleft size-full wp-image-5477" /><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/3.jpg" alt="3" width="1418" height="660" class="alignleft size-full wp-image-5478" /></p>
<hr />
<strong>尝试恢复数据库</strong><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/4.jpg" alt="4" width="722" height="382" class="alignleft size-full wp-image-5479" /></p>
<hr />
因此对该库进行了不完全恢复,然后尝试resetlogs打开数据库,数据库报ORA-600 2662错误</p>
<pre class="brush: bash; title: ; notranslate">
Fri Aug 29 02:35:08 2014
alter database open resetlogs
Fri Aug 29 02:35:11 2014
RESETLOGS after complete recovery through change 451371288
Resetting resetlogs activation ID 1232269761 (0x4972f1c1)
Fri Aug 29 02:35:15 2014
Setting recovery target incarnation to 3
Fri Aug 29 02:35:15 2014
Assigning activation ID 1384652231 (0x52881dc7)
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid=17, OS id=1084
Fri Aug 29 02:35:15 2014
ARC0: Archival started
ARC1: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC1 started with pid=18, OS id=2836
Fri Aug 29 02:35:15 2014
Thread 1 opened at log sequence 1
  Current log# 1 seq# 1 mem# 0: Z:\ORACLE\PRODUCT\10.2.0\ORCL\REDO01.LOG
Successful open of redo thread 1
Fri Aug 29 02:35:15 2014
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Fri Aug 29 02:35:15 2014
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
Fri Aug 29 02:35:15 2014
ARC0: Becoming the heartbeat ARCH
Fri Aug 29 02:35:15 2014
SMON: enabling cache recovery
Fri Aug 29 02:35:16 2014
Errors in file d:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_4824.trc:
ORA-00600: 内部错误代码, 参数: [2662], [0], [451371311], [0], [451374534], [8388977], [], []

Fri Aug 29 02:35:16 2014
Errors in file d:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_4824.trc:
ORA-00600: 内部错误代码, 参数: [2662], [0], [451371311], [0], [451374534], [8388977], [], []

Fri Aug 29 02:35:16 2014
Error 600 happened during db open, shutting down database
USER: terminating instance due to error 600
Fri Aug 29 02:35:17 2014
Errors in file d:\oracle\product\10.2.0\admin\orcl\bdump\orcl_smon_2928.trc:
ORA-00600: ??????, ??: [], [], [], [], [], [], [], []

Instance terminated by USER, pid = 4824
ORA-1092 signalled during: alter database open resetlogs...
</pre>
<p>ORA-600 2662 该错误解决思路很明显,推进scn,数据库报ORA-01578</p>
<pre class="brush: bash; title: ; notranslate">
Fri Aug 29 02:42:47 2014
SMON: enabling cache recovery
Fri Aug 29 02:42:47 2014
Successfully onlined Undo Tablespace 1.
Dictionary check beginning
Dictionary check complete
Fri Aug 29 02:42:49 2014
SMON: enabling tx recovery
Fri Aug 29 02:42:49 2014
Database Characterset is ZHS16GBK
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 16
replication_dependency_tracking turned off (no async multimaster replication found)
Fri Aug 29 02:42:50 2014
Errors in file d:\oracle\product\10.2.0\admin\orcl\bdump\orcl_smon_4804.trc:
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01578: ORACLE 数据块损坏 (文件号 1, 块号 39041)
ORA-01110: 数据文件 1: 'Z:\ORACLE\PRODUCT\10.2.0\ORCL\SYSTEM01.DBF'

Fri Aug 29 02:42:50 2014
LOGSTDBY: Validating controlfile with logical metadata
Fri Aug 29 02:42:51 2014
LOGSTDBY: Validation complete
ORA-604 signalled during: alter database open...
</pre>
<p>对坏块进行处理，启动数据库成功</p>
<pre class="brush: bash; title: ; notranslate">
Fri Aug 29 02:48:59 2014
SMON: enabling cache recovery
Fri Aug 29 02:49:00 2014
Successfully onlined Undo Tablespace 1.
Fri Aug 29 02:49:00 2014
SMON: enabling tx recovery
Fri Aug 29 02:49:00 2014
Database Characterset is ZHS16GBK
Opening with internal Resource Manager plan
where NUMA PG = 1, CPUs = 16
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
QMNC started with pid=34, OS id=3096
Fri Aug 29 02:49:01 2014
db_recovery_file_dest_size of 4096 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Fri Aug 29 02:49:01 2014
Completed: alter database open
</pre>
<p><strong>查询坏块对象</strong><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/5.jpg" alt="5" width="742" height="300" class="alignleft size-full wp-image-5480" /><br />
<img src="//www.xifenfei.com/wp-content/uploads/2014/08/6.jpg" alt="6" width="734" height="355" class="alignleft size-full wp-image-5481" /></p>
<hr />
因为这些对象均不是核心对象,直接进行truncate然后插入老数据<br />
<br />
<strong>后续还有大量错误修复</strong></p>
<pre class="brush: bash; title: ; notranslate">
ORA-12012: error on auto execute of job 1
ORA-08102: index key not found, obj# 239, file 1, block 1674 (2)

ORA-00600: 内部错误代码, 参数: [kcbz_check_objd_typ], [0], [0], [1], [], [], [], []

ORA-00600: internal error code, arguments: [6749], [3], [12606796], [173], [], [], [], []

ORA-00600: 内部错误代码, 参数: [13013], [52898], [52895], [38288618], [44], [38288618], [17], []

ORA-00600: 内部错误代码, 参数: [13013], [5001], [52895], [38286476], [5], [38286476], [17], []
</pre>
<p>再次说明,很多时候数据库恢复不要看成多神秘,就是几个参数搞定,更加不要神化有坏块就bbed修复,当然非常极端,使用N中工具,N种尝试的也存在.做好备份重于一切</p>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/10/%e9%80%9a%e8%bf%87%e5%a4%9a%e6%ac%a1%e8%a7%84%e9%81%bf%e7%b1%bb%e4%bc%bcora-01248-file-n-was-created-in-the-future-of-incomplete-recovery%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">通过多次resetlogs规避类似ORA-01248: file N was created in the future of incomplete recovery错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/06/%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d%e5%8e%86%e5%8f%b2%e5%86%8d%e6%ac%a1%e5%88%b7%e6%96%b0%e5%88%b0oracle-7-3-2%e7%89%88%e6%9c%ac-redo%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">数据库恢复历史再次刷新到Oracle 7.3.2版本&#8212;redo异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/08/%e5%8f%88%e4%b8%80%e8%b5%b7%e5%ad%98%e5%82%a8%e6%95%85%e9%9a%9c%e5%af%bc%e8%87%b4ora-00333-ora-00312%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">又一起存储故障导致ORA-00333 ORA-00312恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/07/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1ora-600-3004-%e6%81%a2%e5%a4%8d%e8%bf%87%e7%a8%8b%e5%92%8c%e5%a4%84%e7%90%86%e6%80%9d%e8%b7%af.html" rel="bookmark" class="crp_title">记录一次ORA-600 3004 恢复过程和处理思路</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/03/ora-00600kcrf_resilver_log_1%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORA-00600[kcrf_resilver_log_1]异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/06/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1ora-00600kdxlinpsno-out-of-rangeora-006003020ora-006004000ora-006004193%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">记录一次ORA-00600[kdxlin:psno out of range]/ORA-00600[3020]/ORA-00600[4000]/ORA-00600[4193]的数据库恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/07/%e8%af%afdrop-tablespace%e5%90%8e%e4%bd%bf%e7%94%a8flashback-database%e9%97%aa%e5%9b%9e%e5%bc%82%e5%b8%b8%e5%a4%84%e7%90%86.html" rel="bookmark" class="crp_title">误drop tablespace后使用flashback database闪回异常处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/07/%e6%9f%90%e9%9b%86%e5%9b%a2ebs%e6%95%b0%e6%8d%ae%e5%ba%93redo-undo%e4%b8%a2%e5%a4%b1%e5%af%bc%e8%87%b4%e6%82%b2%e5%89%a7.html" rel="bookmark" class="crp_title">某集团ebs数据库redo undo丢失导致悲剧</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/08/oracle-8-1-7-%e6%95%b0%e6%8d%ae%e5%ba%93ora-600-4000%e6%95%85%e9%9a%9c%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">ORACLE 8.1.7 数据库ORA-600 4000故障恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/10/ora-27069-skgfdisp-%e5%b0%9d%e8%af%95%e5%9c%a8%e6%96%87%e4%bb%b6%e8%8c%83%e5%9b%b4%e5%a4%96%e6%89%a7%e8%a1%8c-io.html" rel="bookmark" class="crp_title">ORA-27069: skgfdisp: 尝试在文件范围外执行 I/O</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2014/02/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1ora-00316-ora-00312-redo%e5%bc%82%e5%b8%b8%e6%81%a2%e5%a4%8d.html" rel="bookmark" class="crp_title">记录一次ORA-00316 ORA-00312 redo异常恢复</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2025/05/ora-01171.html" rel="bookmark" class="crp_title">ORA-01171: datafile N going offline due to error advancing checkpoint</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2014/08/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1system%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae%e5%ba%93%e6%81%a2%e5%a4%8d.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
