Resolve Dependencies of Function-Based Indexes【每日一译】--20121213

本文详细介绍了基于函数的索引依赖性及其在数据库操作中的应用。包括当函数或包含函数的包体定义发生变化时,如何使索引失效、禁用及重新启用的过程。通过示例展示了查询在禁用索引时的错误提示,以及如何通过ALTERINDEX...UNUSABLE和ALTERINDEX...ENABLE语句来管理索引状态。
Resolve Dependencies of Function-Based Indexes 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:

解决基于函数索引依赖性,一个函数索引取决于这个索引上的任何函数。如果函数或者包含

函数的包体的定义重定义(或者如果索引的拥有者的EXECUTE权限被收回),那么以下条件将

保持 :

■ 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.

#索引被标记为DISABLED.

#查询在DISABLED索引将失败如果优化器选择使用这个索引。

#DML操作在一个DISABLED索引上表将失败除非索引被标记为UNUSABLE并且初始化参数

SKIP_UNUSABLE_INDEXES设置为TRUE.

为了重新启动索引在一个函数改变后,可以使用ALTER INDEX...ENABLE语句。


---------------------------------------------操作记录-----------------------------------------------

SQL> update a set comoon='dd' where object_id=28;
update a set comoon='dd' where object_id=28
*
ERROR at line 1:
ORA-30554: function-based index AIKI.IDX_001 is disabled


SQL> alter index idx_001 unusable;

Index altered.

SQL> update a set comoon='dd' where object_id=28;

1 row updated.

SQL> rollback;


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值