Alter Table Modify - Taking too long?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Alter Table Modify - Taking too long?

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    5

    Unhappy Alter Table Modify - Taking too long?

    Hi Guys:

    I ran the exact following statement:

    Alter table THBK0 modify GL_ref char(9);

    to alter the column gl_ref to char(9).. it was previously char(6). The table has around 20 columns and record count of 250,000. This statement ran for 3 hours and i had to kill it.

    Can anyone help me, what is going on or wrong here? Thank you.

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    CHAR is padded with spaces, so EVERY row will have to be updated to add 3 space characters to the column.

    Another reason to use VARCHAR2
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  3. #3
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Quote Originally Posted by bluemetal
    Hi Guys:

    I ran the exact following statement:

    Alter table THBK0 modify GL_ref char(9);

    to alter the column gl_ref to char(9).. it was previously char(6). The table has around 20 columns and record count of 250,000. This statement ran for 3 hours and i had to kill it.

    Can anyone help me, what is going on or wrong here? Thank you.
    Use CTAS.
    I remember one instance happened 3 years ago. On a 200 M rows table, changing a column data type from varchar2(3) to char(3) ran for 3 days and never finished, finally we aborted it.

    Tamil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width