尝试从非分区表创建分区表。表从dba_tables列为partitioned = NO,所有索引都是从user_indexes读取的index_type = NORMAL。使用Oracle 12.2,也处于兼容模式12.2。
尝试运行以下代码:
ALTER TABLE my_big_table MODIFY
PARTITION BY RANGE (year) INTERVAL (5) (
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN (2005),
PARTITION p3 VALUES LESS THAN (2010),
PARTITION p4 VALUES LESS THAN (2015),
PARTITION p5 VALUES LESS THAN (2020))
UPDATE INDEXES ONLINE;
返回的错误是 ORA-14427:table不支持修改分区状态DDL 。
但是,在同一个数据库,方案和同一用户的另一个大表上运行上述SQL代码,成功地对另一个表进行分区。
如何获得有关my_big_table无法分区的详细信息?
这是从dbms_metadata.get_ddl('TABLE','MY_BIG_TABLE','MY_SCHEME')导出的DDL。所有名称都是匿名的:
CREATE TABLE "..."."..."
(
"..." VARCHAR2(3) NOT NULL ENABLE,
"..." VARCHAR2(30) NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER NOT NULL ENABLE,
"..." VARCHAR2(20),
"..." VARCHAR2(20) NOT NULL ENABLE,
"..." VARCHAR2(20) NOT NULL ENABLE,
"..." VARCHAR2(1) NOT NULL ENABLE,
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(12),
"..." VARCHAR2(30),
"..." VARCHAR2(1) NOT NULL ENABLE,
"..." DATE,
"..." DATE,
"..." DATE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." FLOAT(126),
"..." VARCHAR2(20),
"..." VARCHAR2(20),
"..." FLOAT(126),
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(30),
"..." VARCHAR2(3),
"..." VARCHAR2(80),
"..." VARCHAR2(30),
"..." VARCHAR2(30) DEFAULT '',
"..." VARCHAR2(30),
"..." VARCHAR2(30),
"..." VARCHAR2(30),
"..." VARCHAR2(30),
"..." VARCHAR2(30),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." NUMBER NOT NULL ENABLE,
"..." DATE NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0,
"..." FLOAT(126),
"..." FLOAT(126) NOT NULL ENABLE,
"..." FLOAT(126) DEFAULT 0 NOT NULL ENABLE,
"..." DATE,
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." VARCHAR2(38),
"..." DATE,
"..." NUMBER(10,8) DEFAULT 0 NOT NULL ENABLE,
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(1) DEFAULT 'N' NOT NULL ENABLE,
"..." VARCHAR2(20),
"..." NUMBER,
"..." DATE,
"..." FLOAT(126),
"..." NUMBER,
"..." NUMBER,
"..." FLOAT(126),
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(1),
"..." VARCHAR2(1) DEFAULT 'Y' NOT NULL ENABLE,
"..." FLOAT(126),
"..." DATE,
"..." NUMBER NOT NULL ENABLE,
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(20),
"..." FLOAT(126),
"..." FLOAT(126),
"..." FLOAT(126),
"..." NUMBER,
"..." NUMBER,
"..." VARCHAR2(5) DEFAULT 'USD' NOT NULL ENABLE,
CONSTRAINT "..." UNIQUE ("...")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 11550720 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "..." ENABLE,
CONSTRAINT "..." CHECK ( ASSUMED_OS_DATE_UPDATE_IND IN ('Y','N')) ENABLE,
CONSTRAINT "..." CHECK ( KEEP_ALL_QUOTES_IND IN ('Y','N')) ENABLE,
CONSTRAINT "..." PRIMARY KEY ("...", "...", "...", "...", "...", "...")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 8396800 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "..." ENABLE,
CONSTRAINT "..." UNIQUE ("...")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "..." ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...", "...", "...", "...", "...")
REFERENCES "..."."..." ("...", "...", "...", "...", "...") ON DELETE CASCADE ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE,
CONSTRAINT "..." FOREIGN KEY ("...")
REFERENCES "..."."..." ("...") ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 77905920 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "..."
答案 0 :(得分:0)
解决方案:
错误是由于实例化视图依赖性引起的。删除实例化视图可解决此问题,并且不会出现有关无法对未分区表进行分区的错误。使用SQL Developer在要分区的表上列出的依赖项。
Oracle数据库应更具体地显示错误消息。错误应告知相关性问题,即,物化视图的特定名称,而不是显示通用的 ORA-14427:表不支持对分区状态DDL的修改。
已创建Oracle支持票证(SR 3-19188124751),并已将有关此问题的信息与修复信息一起提供。