Oracle 视图 DBA_REPAIR_TABLE 官方解释,作用,如何使用详细说明

本站中文解释

Oracle视图DBA_REPAIR_TABLE存储了有关需要修复的表格或分区的信息。该视图只在11g及以上版本中可用。

用途:

DBA_REPAIR_TABLE视图可用于检查需要修复的表格或分区,这些表格或分区可能出现数据不一致等状况。当检测到情况时,常规的导出导入方法将无法解决数据不一致的问题,所以可以使用 DBA_REPAIR_TABLE 视图和 DBMS_REPAIR 包来解决该问题。

使用方法:

1、查询带有异常表信息的视图:SELECT * FROM DBA_REPAIR_TABLE;

2、将 ID 选项传递给DBMS_REPAIR.FIX_CORRUPT_BLOCKS,如下所示:

DBMS_REPAIR.FIX_CORRUPT_BLOCKS(ID=>101);

3、在结束DBMS_REPAIR.FIX_CORRUPT_BLOCKS操作时,再次查询DBA_REPAIR_TABLE视图,如果当前ID字段为NULL,则表示修复操作已经成功完成。

官方英文解释

DBA_REPAIR_TABLE describes any corruptions found by the DBMS_REPAIR.CHECK_OBJECT procedure.

This information is used by the DBMS_REPAIR.FIX_CORRUPT_BLOCKS procedure on execution. To create this view, first run the DBMS_REPAIR.ADMIN_TABLES procedure. To populate the resulting repair table for an object, run the DBMS_REPAIR.CHECK_OBJECT procedure on the object.

Note:

The table created by the DBMS_REPAIR.ADMIN_TABLES procedure is called REPAIR TABLE by default. If you specify a different name, this view will have the name you specify, preceded by “DBA_REPAIR_“.

Column Datatype NULL Description

OBJECT_ID

NUMBER

NOT NULL

Dictionary object number of the object with the corruption

TABLESPACE_ID

NUMBER

NOT NULL

Tablespace number of the corrupt object

RELATIVE_FILE_ID

NUMBER)

NOT NULL

Relative file number of the corrupt object

BLOCK_ID

NUMBER

NOT NULL

Block number of the corruption

CORRUPT_TYPE

NUMBER

NOT NULL

Type of corruption encountered

SCHEMA_NAME

VARCHAR2(128)

NOT NULL

Schema of the corrupt object

OBJECT_NAME

VARCHAR2(128)

NOT NULL

Name of the corrupt object

BASEOBJECT_NAME

VARCHAR2(128)

NULL

If the object is an index, the name of its base table

PARTITION_NAME

VARCHAR2(128)

NULL

Partition or subpartition name, if applicable

CORRUPT_DESCRIPTION

VARCHAR2(2000)

NULL

Description of corruption

REPAIR_DESCRIPTION

VARCHAR2(200)

NULL

Description of repair action

MARKED_CORRUPT

VARCHAR2(10)

NOT NULL

Whether the block is marked corrupt (TRUE | FALSE)

CHECK_TIMESTAMP

DATE

NOT NULL

Date and time when this row was inserted into the repair table

FIX_TIMESTAMP

DATE

NULL

Date and time when the block was modified by the FIX_CORRUPT_BLOCKS procedure, if applicable

REFORMAT_TIMESTAMP

DATE

NULL

Reserved for future use

See Also:

Oracle Database PL/SQL
Packages and Types Reference
for more information about the DBMS_REPAIR package


数据运维技术 » Oracle 视图 DBA_REPAIR_TABLE 官方解释,作用,如何使用详细说明