oracle alter index unusable,可能导致index unusable的维护操作

Six types of maintenance operations

can mark index partitions INDEX UNUSABLE.

In all cases, you must rebuild the index partitions when the

operation is

complete.

1) Operations like Import Partition or conventional

path SQL*Loader

that offer an option to bypass local index

maintenance. When the

Import is complete, the affected local index partitions are

marked

IU.

2) Direct path SQL*Loader leaves affected local

index partitions and

global indexes in an IU state if the index is out of date

with

respect to the data that it indexes. The index

can be out of date

for the following reasons:

a) The index was not maintained during the load

due to a space

management error (for example, out of extents ORA-1653 or

ORA-1652).

b) The user requested the SKIP_INDEX_MAINTENANCE

clause.

3) Partition maintenance operations like ALTER TABLE

MOVE PARTITION

that change rowids. These operations mark the

affected local index

partition and all global index partitions IU.

4) Partition maintenance operations like ALTER TABLE

TRUNCATE PARTITION

or DROP PARTITION that remove rows from the

table. These operations

mark the affected local index partition and all global index

partitions IU.

5) Partition maintenance operations like ALTER TABLE

SPLIT PARTITION

that modify the partition definition of local indexes but do

not

automatically rebuild the index data to match the new

definitions.

These operations mark the affected local index partitions

IU. ALTER

TABLE SPLIT PARTITION also marks all global index partitions

IU

because it results in changes to rowids.

6) Index maintenance operations like ALTER INDEX

SPLIT PARTITION that

modify the partitioning definition of the index but do not

automatically rebuild the affected partitions. These operations

mark the affected index partitions IU. However,

if you split a

USABLE partition of a global index, resulting partitions are

created

USABLE. If the partition that was split was

marked IU, then so are

the partitions resulting from the split. Note

that dropping a

partition of a global index that is either IU or is not empty

causes

the next partition of the index to become IU.

The ALTER INDEX REBUILD PARTITION statement can be used to

regenerate a single

partition in a local or global partitioned index. This saves you from having

to perform DROP INDEX and then CREATE INDEX, which would affect all

partitions

in the index.

To prevent indexes to become unusable during

partition maintenance operations, you can use 'update global

indexes' clause in 9.2,

'update global indexes' or 'update indexes' clauses in 10g and

above. For more details please consult the SQL Reference at ALTER

TABLE for more details. Also, there are certain scenarios where the

indexes are not marked unusable, e.g. DROP, TRUNCATE partition

normally marks global indexes unusable, but not when the partition

to be dropped/truncated is empty. Similar with SPLIT partition,

when the split results in adding a new empty partition to the table

(all the rows of the partition to be split goes into one of the

resulting partition, and the other partition remains empty).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值