ITPub博客

首页 > 数据库 > Oracle > Validating Tables, Indexes, Clusters, and Materialized Views

Validating Tables, Indexes, Clusters, and Materialized Views

翻译 Oracle 作者:startay 时间:2016-01-08 12:08:28 0 删除 编辑

Validating Tables, Indexes, Clusters, and Materialized Views

使用ANALYZE VALIDATE STRUCTURE验证 表、索引、群集、物化视图结构的完整性。如果对象的结构有效,则会顺利验证通过,反之则会报错。(如:表异常的ORA-01498,索引的ORA-01499)
To verify the integrity of the structure of a table, index, cluster, or materialized view, use the ANALYZE statement with the VALIDATE STRUCTURE option. If the structure is valid, no error is returned. However, if the structure is corrupt, you receive an error message.

例如:在极少情况下,硬件或系统出现异常时,索引可能会出现损坏且不能被正常使用。 当Validating验证索引时,会逐条的检查索引条目与关联表对应记录的准确性。 如果发现索引出现异常,可删除它重建。
For example, in rare cases such as hardware or other system failures, an index can become corrupted and not perform correctly. When validating the index, you can confirm that every entry in the index points to the correct row of the associated table. If the index is corrupt, you can drop and re-create it.

如果表、索引、群集验证是损坏的,可以删除,重建。如果是物化视图,可以使用complete refresh来修复该问题,如果仍然有误,则需要重建。
If a table, index, or cluster is corrupt, you should drop it and re-create it. If a materialized view is corrupt, perform a complete refresh and ensure that you have remedied the problem. If the problem is not corrected, drop and re-create the materialized view.

The following statement analyzes the emp table:
下面是检验table的语句:

ANALYZE TABLE emp VALIDATE STRUCTURE;

You can validate an object and all related objects (for example, indexes) by including the CASCADE option. The following statement validates the emptable and all associated indexes:
可以使用cascade选项,检验与表相关联的对象(如:所有索引

ANALYZE TABLE emp VALIDATE STRUCTURE CASCADE;

ou can specify that you want to perform structure validation online while DML is occurring against the object being validated. There can be a slight performance impact when validating with ongoing DML affecting the object, but this is offset by the flexibility of being able to perform ANALYZE online. The following statement validates the emp table and all associated indexes online:

ANALYZE TABLE emp VALIDATE STRUCTURE CASCADE ONLINE;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17086096/viewspace-1973745/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-07-29

  • 博文量
    45
  • 访问量
    85788