Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which is the fast way to add a column with a value?
Hi Luis,
yes, the alter table *will* use the rollback segment.
You can avoid flooding your rollback segments by the following:
Martin
Luis Santos wrote:
>
> Hi,
>
> We have to add a column to a partitioned table. The table is over
> 12G in size, divided in 12 partiotion, of similar value (1G).
>
> The column must contain the value 'N' on it.
>
> We have limited rollback space.
>
> If we use a PL/SQL similiar to
>
> for reg in (select rowid from tab) loop
> update tab set new_column-'N' where rowid=reg.rowid
> (commit at each 20000 lines)
> end loop;
>
> the PL runs for days...
>
> Can we use ALTER TABLE tab ADD new_column char(1) default 'N'?
>
> Will this use rollback segment, as it is a DDL command?
>
> --
> Luis Santos
> Oracle DBA
>
> Sent via Deja.com
> http://www.deja.com/
Received on Sat Feb 17 2001 - 04:23:49 CST