Validating Tables, Indexes, Clusters, and Materialized Views

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17086096/viewspace-1973745/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值