DBMS_REPAIR makes the object usable by ignoring corruptions during table and
index scans.
任务3:使用对象可用
DBMS_REPAIR使用得对象可用通过忽略损坏块在表和索引扫描时。
Corruption Repair: Using the FIX_CORRUPT_BLOCKS and
SKIP_CORRUPT_BLOCKS Procedures
You can make a corrupt object usable by establishing an environment that skips
corruptions that remain outside the scope of DBMS_REPAIR capabilities.
坏块修复:使用FIX_CORRUPT_BLOCKS和SKIP_CORRUPPT_BLOCKS过程
你可以使一个坏对象可用通过建立一个跳过坏块,那个坏块是DBMS_REPAIR包不能完成的;
If corruptions involve a loss of data, such as a bad row in a data block, all such blocks
are marked corrupt by the FIX_CORRUPT_BLOCKS procedure. Then you can run the
SKIP_CORRUPT_BLOCKS procedure, which skips blocks that are marked as corrupt.
When the SKIP_FLAG parameter in the procedure is set, table and index scans skip all
blocks marked corrupt. This applies to both media and software corrupt blocks.
如果损坏引起了数据丢失,像一个坏行在一个数据块中,所有的这些块就被标记为损坏通过
FIX_CORRUPT_BLOCK过程。然后你可以运行SKIP_CORRUPT_BLOCKS过程,它跳过
那些被标记为损坏的块。当SKIP_FLAG参数在过程中设置了,表和索引扫描跳过所有的损坏
的块和索引。这些应用适合于介质或者是软件损坏的块。
Implications when Skipping Corrupt Blocks
If an index and table are not synchronized, then a SET TRANSACTION READ ONLY
transaction can be inconsistent in situations where one query probes only the index,
and a subsequent query probes both the index and the table. If the table block is
marked corrupt, then the two queries return different results, thereby breaking the
rules of a read-only transaction. One way to approach this isnot to skip corruptions in
a SET TRANSACTION READ ONLY transaction.
跳过损坏块的影响
如果一个索引和表不同步,那么设置TRANSACTION READ ONLY事务在这种情形下将不
一致的当一个查询仅在使用索引时,并且后续查询同时使用表和索引。如果表块被标识为
CORRUPT,那么两个查询将返回不同的结果,所以将打断只读事务的规则。一种适合方法不是
跳过损坏块而是设置一个只读ONLY的事务。
A similar issue occurs when selecting rows that are chained. A query of the same row
may or may not access the corruption, producing different results.
一个同样问题发生当选择行是链接行。对于同行的查询可能或不可能访问损坏块,产生
不同的结果。
Task 4: Repair Corruptions and Rebuild Lost Data
After making an object usable, perform the following repair activities.
Recover Data Using the DUMP_ORPHAN_KEYS Procedures
The DUMP_ORPHAN_KEYS procedure reports on index entries that point to rows in
corrupt data blocks. All such index entries are inserted into an orphan key table that
stores the key and rowid of the corruption.
任务4:修改损坏块和重建丢失数据
当使一个对象可用后,执行以后修复行为。
还原数据使用DUMP_ORPHAN_KEYS过程。DUMP_ORPHAN_KEYS进程显示索引条目,
这个条目对应于损坏数据块。所有的这些索引条目被插入到ORPHAN主键表,这个表存储
了损坏块的键值和ROWID。
After the index entry information has been retrieved, you can rebuild the index using
the ALTER INDEX...REBUILD ONLINE statement.
当索引条目信息已经返回后,你可以重建索引使用ALTER INDEX...REBUILD ONLINE语句。
Fix Segment Bitmaps Using the SEGMENT_FIX_STATUS Procedure
Use this procedure if free space in segments is being managed by using bitmaps
(SEGMENT SPACE MANAGEMENT AUTO).
修复段的位图使用SEGMENT_FIX_STATUS过程
使用这个过程它将释放使用位图管理在段中的空间。
This procedure recalculates the state of a bitmap entry based on the current contents of
the corresponding block. Alternatively, you can specify that a bitmap entry be set to a
specific value. Usually the state is recalculated correctly and there is no need to force a
setting.
这个过程重新计算位图条目的状态在基于当前对应块的内容上。另外,你也可以指定那个位
图条目设置成一个指定值。通常这个状态会被重新正确计算并且不需要去强制设定一个值。