[20200120]ORA-54033 ORA-30556.txt $ oerr ora 54033 54033, 0000, "column to be modified is used in a virtual column expression" // *Cause: Attempted to modify the data type of a column that was used in a // virtual column expression. // *Action: Drop the virtual column first or change the virtual column // expression to eliminate dependency on the column to be modified. $ oerr ORA 30556 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. --//如果定义虚拟列或者函数索引,要修改列属性时可能遇到ORA-54033 ORA-30556错误,通过例子说明: 1.环境: SCOTT@book> @ ver1 PORT_STRING VERSION BANNER ------------------------------ -------------- -------------------------------------------------------------------------------- x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production SCOTT@book> create table tx ( id1 number(10),id2 number(10),flag1 varchar2(1),flag2 varchar2(1)); Table created. SCOTT@book> insert into tx select rownum id1,rownum id2, lpad('1',1) flag1, lpad('0',1) flag2 from dual connect by level<=1e4; 10000 rows created. SCOTT@book> commit ; Commit complete. SCOTT@book> @ desc tx Name Null? Type ------ ----- ----------- ID1 NUMBER(10) ID2 NUMBER(10) FLAG1 VARCHAR2(1) FLAG2 VARCHAR2(1) 2.测试函数索引: SCOTT@book> create index if_tx_id1 on tx(to_char(id1)); Index created. SCOTT@book> alter table tx modify id1 number (12); alter table tx modify id1 number (12) * ERROR at line 1: ORA-30556: either functional or bitmap join index is defined on the column to be modified SCOTT@book> drop index if_tx_id1; Index dropped. SCOTT@book> alter table tx modify id1 number (12); Table altered. SCOTT@book> create index if_tx_id1 on tx(to_char(id1)); Index created. --//另外函数还会导致shrink space失败。 SCOTT@book> alter table tx enable ROW MOVEMENT; Table altered. SCOTT@book> alter table tx shrink space cascade; alter table tx shrink space cascade * ERROR at line 1: ORA-10631: SHRINK clause should not be specified for this object 3.测试虚拟列: SCOTT@book> @ column_group '' tx flag1,flag2 SELECT dbms_stats.create_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,flag2)') c30 FROM dual exec dbms_stats.drop_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,flag2)') old 1: SELECT dbms_stats.create_extended_stats (ownname=> nvl('&&1',user) ,tabname=> '&&2' ,extension => '(&&3)') c30 FROM dual new 1: SELECT dbms_stats.create_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,flag2)') c30 FROM dual C30 ------------------------------ SYS_STUGVNB7PTIYWAVPJX#YT77WGD SCOTT@book> alter table tx modify flag1 varchar2(2); Table altered. --//如果修改字段类型。 SCOTT@book> alter table tx modify flag1 number(2); alter table tx modify flag1 number(2) * ERROR at line 1: ORA-54033: column to be modified is used in a virtual column expression SCOTT@book> exec DBMS_STATS.DROP_EXTENDED_STATS( user, 'TX','(flag1, flag2)' ); PL/SQL procedure successfully completed. SCOTT@book> alter table tx modify flag1 number(2); alter table tx modify flag1 number(2) * ERROR at line 1: ORA-01439: column to be modified must be empty to change datatype --//类型发生变化,不能这样修改。 4.增加一列date类型看看: SCOTT@book> alter table tx add (c date); Table altered. SCOTT@book> @ column_group '' tx flag1,c SELECT dbms_stats.create_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,c)') c30 FROM dual exec dbms_stats.drop_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,c)') old 1: SELECT dbms_stats.create_extended_stats (ownname=> nvl('&&1',user) ,tabname=> '&&2' ,extension => '(&&3)') c30 FROM dual new 1: SELECT dbms_stats.create_extended_stats (ownname=> nvl('',user) ,tabname=> 'tx' ,extension => '(flag1,c)') c30 FROM dual C30 ------------------------------ SYS_STU3J7YBQL_AJTVPTCQJKBASQ_ SCOTT@book> alter table tx modify c timestamp; alter table tx modify c timestamp * ERROR at line 1: ORA-54033: column to be modified is used in a virtual column expression SCOTT@book> exec DBMS_STATS.DROP_EXTENDED_STATS( user, 'TX','(flag1, c)' ); PL/SQL procedure successfully completed. SCOTT@book> alter table tx modify c timestamp; Table altered.
[20200120]ORA-54033 ORA-30556.txt
来源:这里教程网
时间:2026-03-03 14:53:35
作者:
编辑推荐:
- [20200120]ORA-54033 ORA-30556.txt03-03
- Analytic Functions in Oracle03-03
- Script to Collect Log File Sync Diagnostic Information (lfsdiag.sql)03-03
- [20200121]CURRENT_TIMESTAMP LOCALTIMESTAMP SYSTIMESTAMP的不同.TXT03-03
- Oracle listener log配置与管理03-03
- 正常终止expdp作业03-03
- Oracle 11g升级到12C03-03
- vscode修改注解颜色03-03
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- Oracle 11g升级到12C
Oracle 11g升级到12C
26-03-03 - ASM集群文件系统ACFS(ASM Cluster File System)
- ORA-01195: online backup of file 1 needs more recovery to be consistent
- SharePlex安装配置、常用功能配置文档、常见故障处理文档
SharePlex安装配置、常用功能配置文档、常见故障处理文档
26-03-03 - Oracle 12c nocdb转换成cdb
Oracle 12c nocdb转换成cdb
26-03-03 - parameter table management,11.2.0.4 Bug 20564072
- 如果你的系统需要在一张很大的表上创建一个索引,你会考虑哪些因素?
如果你的系统需要在一张很大的表上创建一个索引,你会考虑哪些因素?
26-03-03 - oracle 12c 新增的LREG进程及其动态注册的过程
oracle 12c 新增的LREG进程及其动态注册的过程
26-03-03 - Bad check value found during backing up datafileBad check value found during bac
- 体系_表空间和数据文件的管理
体系_表空间和数据文件的管理
26-03-03
