开发者

Why am I getting "ORA-01429: Index-Organized Table" when trying to modify column from VARCHAR2(200) to VARCHAR2(1000)?

It's currently a VARCHAR2(200) in the database, but it needs to be raised to VARCHAR(1000), so I am attempting to run this script:

ALTER TABLE CONTRACTOR MODIFY
(
    NOTE VARCHAR2(1000)
);

Oracle gives me this:

ORA-01429: Index-Organized Table: no data segment to store overflow row-pieces

This is a 10g database. Any ideas what's up? I could create a duplicate column, copy the data over, and then drop the old column, 开发者_运维知识库but I would like to know what this error is first before I do that.


According to the documentation, you need to specify an overflow segment for rows that might be to large to fit in a single block.

Consider (10.2.0.3 -- 8k blocks):

SQL> CREATE TABLE contractor (
  2     ID NUMBER PRIMARY KEY,
  3     data_1 CHAR(1000),
  4     data_2 CHAR(1000),
  5     data_3 CHAR(1000),
  6     data_4 CHAR(1000),
  7     data_5 CHAR(1000),
  8     NOTE VARCHAR2(200)
  9  ) 
 10  ORGANIZATION INDEX;

ORA-01429: Index-Organized Table: no data segment to store overflow row-pieces

However, when you specify an overflow segment:

SQL> CREATE TABLE contractor (
  2     ID NUMBER PRIMARY KEY,
  3     data_1 CHAR(1000),
  4     data_2 CHAR(1000),
  5     data_3 CHAR(1000),
  6     data_4 CHAR(1000),
  7     data_5 CHAR(1000),
  8     NOTE VARCHAR2(200)
  9  )
 10  ORGANIZATION INDEX 
 11  OVERFLOW TABLESPACE USER_DATA;

Table created


I came across this highly ranked page when i googled 'ORA-01429'. I also faced the same exception when i was trying to split OVERFLOW partition in a Oracle 11G table.

*Incorrect*:
alter table sales SPLIT PARTITION OVERFLOW at (TO_DATE('01-FEB-2017 00:00:00', 'DD-MON-YYYY HH24:MI:SS')) 
  INTO (PARTITION sales_m01_2017, PARTITION OVERFLOW);

*Fixed*:
alter table sales SPLIT PARTITION OVERFLOW at (TO_DATE('01-FEB-2017 00:00:00', 'DD-MON-YYYY HH24:MI:SS')) 
  INTO (PARTITION sales_m01_2017, PARTITION "OVERFLOW");

I got the fix for my problem at following: https://community.oracle.com/thread/2244949?tstart=0

OVERFLOW has to be double quoted like "OVERFLOW". I though to share it here in the interest of other stackoverflow fans facing the same ORA exception while spliting OVERFLOW partition.


you can run sql: alter table table_name add overflow; then run your sql

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜