SQL 错误:ORA-30556:在要修改的列上定义了功能或位图连接索引

Dan*_*ish 2 oracle alter-table

当我尝试更改表的列长度时,我收到以下 Oracle 错误:

 SQL Error: ORA-30556: either functional or bitmap join index is defined on the column to be modified
 30556. 00000 -  "either functional or bitmap join index is defined on the column to be modified"
 *Cause:    An ALTER TABLE MODIFY COLUMN was issued on a column on which
            either a functional index or bitmap join index exists.
 *Action:   Drop the functional or bitmap join index before attempting to modify the column.
Run Code Online (Sandbox Code Playgroud)

我们如何改变我们的列大小?

Dan*_*ish 5

无需删除索引并更改列大小,然后再次创建索引。

我们在 Oracle 中有另一种方法,如下所示:

  1. 首先禁用索引。(例如:ALTER INDEX index_cust ON CUSTOMER DISABLE

  2. 然后改变客户表的列大小

  3. 然后启用索引。(例如:ALTER INDEX index_cust ON CUSTOMER REBUILD

注意:这仅对功能索引有效