- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
3#
发表于 2012-3-6 21:31:34
Note that the data inside the affected blocks is not salvageable. Methods like "Media Recovery" or "RMAN blockrecover" will not fix the problem unless the data file was backed up after the NOLOGGING operation was registered in the Redo Log.
In order to resolve the errors and if it is not an INDEX the segment can be recovered from a backup like an export dump or from another source. If backups are not available the segment might be recreated following the next steps:
Identify the object as described in Note 819533.1
If it is an INDEX, drop/create the index.
If it is a TABLE then procedure DBMS_REPAIR.SKIP_CORRUPT_BLOCKS can be used to skip the corrupt block in SQL statements and decide to re-create the table. Note 556733.1 has an example of DBMS_REPAIR.
If it is a LOB segment associated to a LOB column in a Table, use Note 293515.1
If the error is produced in a Physical STANDBY database, the option is to restore the affected file from the PRIMARY database (only if the problem is not present in the PRIMARY).
Run script provided in Note 472231.1 to identify any additional corrupted objects.
1. 因为涉及到NOLOGGING的segment , 所以物理备份恢复的方法是无效的
2. 如果仅仅涉及到 INDEX的话 , 建议还是drop后重建
利用一下查询语句定位 坏块和 具体的segment:- SELECT e.owner,
- e.segment_type,
- e.segment_name,
- e.partition_name,
- c.file#,
- greatest(e.block_id, c.block#) corr_start_block#,
- least(e.block_id + e.blocks - 1, c.block# + c.blocks - 1) corr_end_block#,
- least(e.block_id + e.blocks - 1, c.block# + c.blocks - 1) -
- greatest(e.block_id, c.block#) + 1 blocks_corrupted,
- null description
- FROM dba_extents e, v$database_block_corruption c
- WHERE e.file_id = c.file#
- AND e.block_id <= c.block# + c.blocks - 1
- AND e.block_id + e.blocks - 1 >= c.block#
- UNION
- SELECT s.owner,
- s.segment_type,
- s.segment_name,
- s.partition_name,
- c.file#,
- header_block corr_start_block#,
- header_block corr_end_block#,
- 1 blocks_corrupted,
- 'Segment Header' description
- FROM dba_segments s, v$database_block_corruption c
- WHERE s.header_file = c.file#
- AND s.header_block between c.block# and c.block# + c.blocks - 1
- UNION
- SELECT null owner,
- null segment_type,
- null segment_name,
- null partition_name,
- c.file#,
- greatest(f.block_id, c.block#) corr_start_block#,
- least(f.block_id + f.blocks - 1, c.block# + c.blocks - 1) corr_end_block#,
- least(f.block_id + f.blocks - 1, c.block# + c.blocks - 1) -
- greatest(f.block_id, c.block#) + 1 blocks_corrupted,
- 'Free Block' description
- FROM dba_free_space f, v$database_block_corruption c
- WHERE f.file_id = c.file#
- AND f.block_id <= c.block# + c.blocks - 1
- AND f.block_id + f.blocks - 1 >= c.block#
- order by file#, corr_start_block#;
复制代码 3. 重建索引可以 参考这个Note 加速索引重建 http://www.oracledatabase12g.com ... create-rebuild.html |
|