analyze index時,validate structure和compute statistics的區別?

validate structure和compute statistics的區別?

analyze index index1 validate structure:
analyze   index index1 compute statistics:

在分析索引的時候,一般會用到以上二個命令,那么這二個命令是用來干嘛呢?
analyze index index1 validate structure:
是用來分析索引的數據塊是否有壞塊,以及根據分析得到的數據(存放在index_stats)來判斷索引是否需要重新建立。
見:http://space.itpub.net/26684/viewspace-207197
validate structure有二中模式: online, offline, 默認是offline模式。
以offline模式分析時, 會對表加一個4級別的鎖(表共享),對run系統可能趙成一定的影響。
而online模式則沒有表lock的影響,但當以online模式分析時, 在視圖index_stats沒有統計信息。

analyze   index index1 compute statistics:是用來統計index的分析信息,來為CBO服務的。從9i開始,Oracle以建議使用dbms_stats package代替 analyze 了。
 

posted on 2009-02-01 23:08  一江水  阅读(1390)  评论(0)    收藏  举报