Oracle中檢查是否需要重構(gòu)索引的sql
SELECT
height, /*Height of the B-Tree*/
blocks, /* Blocks in the index segment */
name, /*index name */
lf_rows, /* number of leaf rows in the index */
lf_blks, /* number of leaf blocks in the index */
del_lf_rows, /* number of deleted leaf rows in the index */
rows_per_key /* average number of rows per distinct key */
blk_gets_per_access /* consistent mode block reads (gets) */
FROM INDEX_STATS
WHERE NAME='INDEX_NAME';
ANALYZE index INDEX_NAME VALIDATE STRUCTURE
HEIGHT:
This column refers to the height of the B-tree index, and it's usually at the 1, 2, or 3 level.
If large inserts push the index height beyond a level of 4, it's time to rebuild, which flattens the B-tree.
DEL_LF_ROWS:
This is the number of leaf nodes deleted due to the deletion of rows.
Oracle doesn't rebuild indexes automatically and, consequently, too many deleted leaf rows can lead to an unbalanced B-tree.
BLK_GETS_PER_ACCESS:
You can look at the BLK_GETS_PER_ACCESS column to see how much logical I/O it takes to retrieve data from the index. If this row shows a double-digit number, you should probably start rebuilding the index.
相關(guān)文章
expdp 中ORA-39002、ORA-39070錯(cuò)誤詳解及解決辦法
這篇文章主要介紹了expdp 中ORA-39002、ORA-39070錯(cuò)誤詳解及解決辦法的相關(guān)資料,需要的朋友可以參考下2017-02-02Oracle數(shù)據(jù)庫(kù)數(shù)據(jù)丟失恢復(fù)的幾種方法總結(jié)
相信大家無(wú)論是開(kāi)發(fā)、測(cè)試還是運(yùn)維過(guò)程中,都可能會(huì)因?yàn)檎`操作、連錯(cuò)數(shù)據(jù)庫(kù)、用錯(cuò)用戶、語(yǔ)句條件有誤等原因,導(dǎo)致錯(cuò)誤刪除、錯(cuò)誤更新等問(wèn)題。當(dāng)你捶胸頓足或嚇得腿軟時(shí),肯定希望有辦法來(lái)恢復(fù)這些數(shù)據(jù)。oracle就提供了一些強(qiáng)大的方法或機(jī)制,可以幫到有需要的你。2016-12-12oracle中 procedure(存儲(chǔ)過(guò)程)和function(函數(shù))本質(zhì)區(qū)別
這篇文章主要介紹了 oracle中 procedure(存儲(chǔ)過(guò)程)和function(函數(shù))本質(zhì)區(qū)別,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-02-02PLSQL一些常用知識(shí)點(diǎn)梳理總結(jié)
這篇文章主要為大家介紹了PLSQL一些常用的知識(shí)點(diǎn)梳理總結(jié),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-05-05關(guān)于Oracle Dataguard 日志傳輸狀態(tài)監(jiān)控問(wèn)題
ORACLE DATAGUARD的主備庫(kù)同步,主要是依靠日志傳輸?shù)絺鋷?kù),備庫(kù)應(yīng)用日志或歸檔來(lái)實(shí)現(xiàn)。這篇文章主要給大家介紹了關(guān)于Oracle Dataguard 日志傳輸狀態(tài)監(jiān)控問(wèn)題,感興趣的朋友跟隨小編一起看看吧2019-05-05淺談Oracle數(shù)據(jù)庫(kù)的建模與設(shè)計(jì)
淺談Oracle數(shù)據(jù)庫(kù)的建模與設(shè)計(jì)...2007-03-03關(guān)于ORA-04091異常的出現(xiàn)原因分析及解決方案
這篇文章主要介紹了關(guān)于ORA-04091異常的出現(xiàn)原因分析及解決方案,本文給大家分享異常出現(xiàn)的場(chǎng)景及解決代碼,感興趣的朋友跟隨小編一起看看吧2023-05-05怎么才能限制SQL Server只能讓指定的機(jī)器連接
怎么才能限制SQL Server只能讓指定的機(jī)器連接...2007-03-03