<?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; ORACLE坏块检查</title>
	<atom:link href="https://www.xifenfei.com/tag/oracle%e5%9d%8f%e5%9d%97%e6%a3%80%e6%9f%a5/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>ORACEL坏查询对象批量脚本</title>
		<link>https://www.xifenfei.com/2014/09/oracel%e5%9d%8f%e6%9f%a5%e8%af%a2%e5%af%b9%e8%b1%a1%e6%89%b9%e9%87%8f%e8%84%9a%e6%9c%ac.html</link>
		<comments>https://www.xifenfei.com/2014/09/oracel%e5%9d%8f%e6%9f%a5%e8%af%a2%e5%af%b9%e8%b1%a1%e6%89%b9%e9%87%8f%e8%84%9a%e6%9c%ac.html#comments</comments>
		<pubDate>Tue, 02 Sep 2014 08:54:28 +0000</pubDate>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
				<category><![CDATA[Oracle 开发]]></category>
		<category><![CDATA[ORACLE坏块检查]]></category>

		<guid isPermaLink="false">https://www.xifenfei.com/?p=5492</guid>
		<description><![CDATA[联系：手机/微信(+86 17813235971) QQ(107644445)  &#8230; <a href="https://www.xifenfei.com/2014/09/oracel%e5%9d%8f%e6%9f%a5%e8%af%a2%e5%af%b9%e8%b1%a1%e6%89%b9%e9%87%8f%e8%84%9a%e6%9c%ac.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/09/oracel%e5%9d%8f%e6%9f%a5%e8%af%a2%e5%af%b9%e8%b1%a1%e6%89%b9%e9%87%8f%e8%84%9a%e6%9c%ac.html" target="_blank">ORACEL坏查询对象批量脚本</a></p>
<p>作者：<a href="https://www.xifenfei.com" target="_blank">惜分飞</a>©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]</p>
</div>
<p>查询坏块</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; set lines 120
SQL&gt; select * from v$database_block_corruption;

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO      
---------- ---------- ---------- ------------------ ---------      
         3      35418          1                  0 FRACTURED      
         3      61344          1                  0 FRACTURED      
         3      31065          1                  0 CORRUPT        
         3      36673          1                  0 CORRUPT        
         3      36721          1                  0 CORRUPT        
         3      42881          1                  0 CORRUPT        
         1      66738          1                  0 CORRUPT        
         3      36329          1                  0 CORRUPT        
         3      36617          1                  0 CORRUPT        
         3      32404          1                  0 FRACTURED      
         3      36281          1                  0 FRACTURED      

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO      
---------- ---------- ---------- ------------------ ---------      
         3      36625          1                  0 FRACTURED      
         1      39041          1                  0 CORRUPT        
         3      36713          1                  0 CORRUPT        
        10      69927          1                  0 FRACTURED      
        26      94244          1                  0 CORRUPT        

已选择16行。
</pre>
<p>查询坏块对应对象</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; set pagesize 2000
SQL&gt;          set linesize 250
SQL&gt;      SELECT e.owner, e.segment_type, e.segment_name, e.partition_name, c.file#
  2       , greatest(e.block_id, c.block#) corr_start_block#
  3       , least(e.block_id+e.blocks-1, c.block#+c.blocks-1) corr_end_block#
  4       , least(e.block_id+e.blocks-1, c.block#+c.blocks-1)
  5         - greatest(e.block_id, c.block#) + 1 blocks_corrupted
  6       , null description
  7    FROM dba_extents e, v$database_block_corruption c
  8   WHERE e.file_id = c.file#
  9     AND e.block_id &lt;= c.block# + c.blocks - 1
 10     AND e.block_id + e.blocks - 1 &gt;= c.block#
 11  UNION
 12  SELECT s.owner, s.segment_type, s.segment_name, s.partition_name, c.file#
 13       , header_block corr_start_block#
 14       , header_block corr_end_block#
 15       , 1 blocks_corrupted
 16       , 'Segment Header' description
 17    FROM dba_segments s, v$database_block_corruption c
 18   WHERE s.header_file = c.file#
 19     AND s.header_block between c.block# and c.block# + c.blocks - 1
 20  UNION
 21  SELECT null owner, null segment_type, null segment_name, null partition_name, c.file#
 22       , greatest(f.block_id, c.block#) corr_start_block#
 23       , least(f.block_id+f.blocks-1, c.block#+c.blocks-1) corr_end_block#
 24       , least(f.block_id+f.blocks-1, c.block#+c.blocks-1)
 25         - greatest(f.block_id, c.block#) + 1 blocks_corrupted
 26       , 'Free Block' description
 27    FROM dba_free_space f, v$database_block_corruption c
 28   WHERE f.file_id = c.file#
 29     AND f.block_id &lt;= c.block# + c.blocks - 1
 30     AND f.block_id + f.blocks - 1 &gt;= c.block#
 31  order by file#, corr_start_block#;

OWNER            SEGMENT_TYPE       SEGMENT_NAME                 PARTITION_NAME                      FILE# CORR_START_BLOCK# CORR_END_BLOCK# BLOCKS_CORRUPTED DESCRIPTION
---------------- ----------------- ----------------------- ------------------------------- ------ ----------------- --------------- ---------------- --------------      
SYS              TABLE              OBJ$                                                        1             39041           39041                1                     
                                                                                                1             66738           66738                1 Free Block          
SYSMAN           INDEX              MGMT_METRICS_1HOUR_PK                                       3             31065           31065                1                     
SYS              TABLE              WRH$_SQL_BIND_METADATA                                      3             32404           32404                1                     
SYS              TABLE              WRH$_BG_EVENT_SUMMARY                                       3             35418           35418                1                     
SYS              INDEX PARTITION    WRH$_FILESTATXS_PK      WRH$_FILEST_1232289473_41482        3             36281           36281                1                     
SYS              TABLE PARTITION    WRH$_SYSTEM_EVENT       WRH$_SYSTEM_1232289473_41482        3             36329           36329                1                     
SYS              TABLE PARTITION    WRH$_SGASTAT            WRH$_SGASTA_1232289473_41482        3             36617           36617                1                     
SYS              INDEX PARTITION    WRH$_SGASTAT_U          WRH$_SGASTA_1232289473_41482        3             36625           36625                1                     
SYS              INDEX PARTITION    WRH$_PARAMETER_PK       WRH$_PARAME_1232289473_41482        3             36673           36673                1                     
SYS              TABLE PARTITION    WRH$_SERVICE_STAT       WRH$_SERVIC_1232289473_41482        3             36713           36713                1                     
SYS              INDEX PARTITION    WRH$_SERVICE_STAT_PK    WRH$_SERVIC_1232289473_41482        3             36721           36721                1                     
SYS              TABLE PARTITION    WRH$_LATCH              WRH$_LATCH_1232289473_41482         3             42881           42881                1                     
SYS              TABLE              WRI$_ADV_ACTIONS                                            3             61344           61344                1                     
EXAM             TABLE              EXAM_ITEMS_OLD                                             10             69927           69927                1                     
CPR              TABLE              NEED_MONITOR                                               26             94244           94244                1                     
                                                                                                                                                                         
已选择16行。                                                                                                                                                             
                                                                                                                                                                         
SQL&gt;                                                                                                                                                                     
SQL&gt; spool off
</pre>
<div id="crp_related"><ul><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/04/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1ora-00600kdsgrp1%e5%88%86%e6%9e%90.html" rel="bookmark" class="crp_title">记录一次ORA-00600[kdsgrp1]分析</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/09/%e5%81%87%e5%9d%8f%e5%9d%97%e5%bc%95%e8%b5%b7%e6%81%90%e6%85%8c.html" rel="bookmark" class="crp_title">假坏块引起恐慌</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/04/segment-header-ora-1578.html" rel="bookmark" class="crp_title">segment header异常对象删除处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/07/read-by-other-session%e7%ad%89%e5%be%85%e4%ba%8b%e4%bb%b6.html" rel="bookmark" class="crp_title">Read by other session等待事件</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2024/06/os-error-os-23.html" rel="bookmark" class="crp_title">O/S-Error: (OS 23) 数据错误(循环冗余检查)&#8212;故障处理</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/02/table%e4%b8%ad%e5%90%84%e7%a7%8d%e5%9d%8f%e5%9d%97%e5%af%b9selectdml%e6%93%8d%e4%bd%9c%e5%bd%b1%e5%93%8d.html" rel="bookmark" class="crp_title">table中各种坏块对select/dml操作影响</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/07/%e6%95%b0%e6%8d%ae%e5%ba%93%e6%8a%a5ora-00607ora-006004194%e9%94%99%e8%af%af.html" rel="bookmark" class="crp_title">数据库报ORA-00607/ORA-00600[4194]错误</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2013/05/shell%e8%84%9a%e6%9c%ac%e8%8e%b7%e5%be%97extents%e5%88%86%e5%b8%83.html" rel="bookmark" class="crp_title">shell脚本获得extents分布</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2012/03/%e8%ae%b0%e5%bd%95%e4%b8%80%e6%ac%a1ora-60013013%e5%a4%84%e7%90%86%e8%bf%87%e7%a8%8b.html" rel="bookmark" class="crp_title">记录一次ORA-600[13013]处理过程</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/06/latch-cache-buffers-chains.html" rel="bookmark" class="crp_title">latch: cache buffers chains</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2022/08/oracle-recovery-tools-repair-free-corruption-block.html" rel="bookmark" class="crp_title">Oracle Recovery Tools修复空闲坏块</a></li><li style="list-style-type:decimal;font-size:11px;" ><a href="https://www.xifenfei.com/2011/12/%e9%80%9a%e8%bf%87rowid%e6%89%be%e5%9b%9e%e5%9d%8f%e5%9d%97%e6%95%b0%e6%8d%ae.html" rel="bookmark" class="crp_title">通过ROWID找回坏块数据</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>https://www.xifenfei.com/2014/09/oracel%e5%9d%8f%e6%9f%a5%e8%af%a2%e5%af%b9%e8%b1%a1%e6%89%b9%e9%87%8f%e8%84%9a%e6%9c%ac.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
