Resolve Dependencies of Function-Based Indexes (205)

tsinglee發表於2007-11-15

A function-based index depends on any function that it is using. If the function or
the specification of a package containing the function is redefined (or if the index owner’s
EXECUTE privilege is revoked), then the following conditions hold:
■ The index is marked as DISABLED.
■ Queries on a DISABLED index fail if the optimizer chooses to use the index.
■ DML operations on a DISABLED index fail unless the index is also marked
UNUSABLE and the initialization parameter SKIP_UNUSABLE_INDEXES is set to
true.
To re-enable the index after a change to the function, use the ALTER INDEX ... ENABLE
statement.

解決函式索引的依賴性
1. 如果函式索引中的函式或者包含該函式的包重新定義 ,以及索引擁有者的EXECUTE許可權被回收 ,則
a. 索引被標記為失效
b. 最佳化器如果選擇使用索引 , 利用該索引上的查詢失效
c. 如果索引被標記為UNUSABLE , 或者初始化引數SKIP_UNUSABLE_INDEXES為true , 則失效索引上的dml操作是失敗的
2. 當函式變更後 , 可以使用ALTER INDEX ... ENABLE來使索引ENABLE

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10599713/viewspace-982491/,如需轉載,請註明出處,否則將追究法律責任。

相關文章