二
CHECK_OBJECT procedure檢查指定的object
SQL> @checkObject
SQL> set serveroutput on
SQL>
SQL> declare
repair count:
PL/SQL procedure successfully completed
repair_table的結構如下
SQL> desc repair_table
Name Null? Type
OBJECT_ID NOT NULL NUMBER
TABLESPACE_ID NOT NULL NUMBER
RELATIVE_FILE_ID NOT NULL NUMBER
BLOCK_ID NOT NULL NUMBER
CORRUPT_TYPE NOT NULL NUMBER
SCHEMA_NAME NOT NULL VARCHAR
OBJECT_NAME NOT NULL VARCHAR
BASEOBJECT_NAME VARCHAR
PARTITION_NAME VARCHAR
CORRUPT_DESCRIPTION VARCHAR
REPAIR_DESCRIPTION VARCHAR
MARKED_CORRUPT NOT NULL VARCHAR
CHECK_TIMESTAMP NOT NULL DATE
FIX_TIMESTAMP DATE
REFORMAT_TIMESTAMP DATE
我們可以從repair_table中查詢壞塊的情況
SQL> select object_name
OBJECT_NAME BLOCK_ID CORRUPT_TYPE MARKED_COR
CORRUPT_DESCRIPTION
REPAIR_DESCRIPTION
T
kdbchk: row locked by non
table=
lockid=
mark block software corrupt
三
從repair_table中可以知道file
下面的查詢可以用來從壞塊中搶救數據
建立一個臨時表(temp_t
SQL> create table temp_t
Table created
SQL> select col
COL
四
FIX_CORRUPT_BLOCKS procedure用來根據repair table中的信息修正指定objects中的壞塊
SQL> declare
fix count:
PL/SQL procedure successfully completed
查詢repair_table可以看到block
SQL> select object_name
OBJECT_NAME BLOCK_ID MARKED_COR
T
這時再對table t
SQL> select * from system
select * from system
*
ERROR at line
ORA
ORA
[
From:http://tw.wingwit.com/Article/program/SQL/201311/16168.html