Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Altering char(2) to char(4) causing entire table rewrite?

Re: Altering char(2) to char(4) causing entire table rewrite?

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1996/12/12
Message-ID: <4xjniRAGSEsyEwVM@jimsmith.demon.co.uk>#1/1

In article <58nne5$r0r_at_falcon.inetnebr.com>, Michael Nolan <nolan_at_inetnebr.com> writes
>I need to alter a char(2) field in a table to char(4). At present this
>column is null for all rows in the table (over 3 million rows, total
>table size around 300MB.)
>
>However, when I attempt to make the change, it looks like it is
>rewriting every row in the table, because it is producing great quantities
>of archive logs. This brings my production users to a grinding halt.
>
>Is there any way around this, or am I going to have to schedule this
>modification to run over a weekend?
>--
>Mike Nolan
>nolan_at_inetnebr.com

CHAR fields are fixed length and are always padded out to the full length with spaces. Your alter table is effectively doing

update tablea
set columna=columna||' ';

Try using varchar2 instead, these are variable length and will not be automatically padded

-- 
Jim Smith
Received on Thu Dec 12 1996 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US