第7章 處理塊損壞

zhengbao_jun發表於2009-02-18

第7章 處理塊損壞
使用ANALYZE命令
sql>analyze table test.t3 validate structure;
sql>analyze table test.t3 validate structure;

使用DBVERIFY命令
command>dbv blocksize=2048 file=users01.dbf
command>dbv blocksize=8192 file=users01.dbf
command>dbv blocksize=8192 file=users01.dbf logfile=c:\temp\users01.log

使用DB_BLOCK_CHECKING
command>edit initora101.ora
db_block_checking=true

使用DBMS_REPAIR程式包
1.
sql>connect / as sysdba
sql>analyze table test.t3 validate structure;
2.
3.
sql>host repair_tab.sql
sql>@repair_tab
4.
sql>host edit check_obj.sql
sql>@check_obj.sql
5.
sql>select object_name,block_id,corrupt_type,marked_corrupt,
corrupt_description,repair_description from repair_table;
sql>select object_name,corrupt_description from repair_table;
sql>select object_name,repair_desription from repair_table;
6.
sql>connect test/test
sql>create table t3_bak as
select * from t3
where dbms_rowid.rowid_blokc_number(rowid) = 5
and dbms_rowid.rowid_to_absolute_fno(rowid,'TEST','T3')=4;
sql>select c1 from t3_bak;
7.
sql>host edit fixblocks.sql
sql>@fix_blocks
sql>select object_name,block_id,marked_corrupt from repair_table;
sql>select * from test.t3;
8.
sql>host more orphan.sql
sql>host more orphan_dump.sql
sql>@orphan_dump
sql>select index_name,count(*) from orphan_key_table group by index_name;
10.
sql>host more corrupt_block_skip.sql
11.
sql>host more rebuild_freelists.sql
sql>@rebuild_freelists
12.
sql>drop index t3_pk;
sql>create index t3_pk on t3(c1);

塊媒介恢復
command>rman
rman>connect target
rman>blockrecover datafile 5 block 6;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/235507/viewspace-555224/,如需轉載,請註明出處,否則將追究法律責任。

相關文章