Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Help: Changing Column Names
In article <5cb03u$nnl_at_nr1.ottawa.istar.net>,
R. Wayne Linton <linton_wayne/SCAN6_at_shell.ca> wrote:
>john messina wrote:
>>
>> Hello,
>>
>> I'm currently looking for a method to change column
>> names in a table without effecting the data already in the
>> table. I'm currently using Oracle version 7 and I'm stumped.snip ...
>
>John, you are on the right track. Create a new table with the new column
>name(s), copy the data to this new table. Drop your constraints on the
>old table, drop the old table. Rename the new table to the original name
>and then re-apply all the RI constraints. If you have an RI constraint
>that operated on a column that you have now renamed, you will have to
>change that constraint.
There could be a problem here if anything goes wrong you've drop the original table.
Back up the data base.
When creating the new table use the unrecoverable option
(it eliminates logging)
Check the constraints on the new table before droping the old.
You may want to rename the old table just in case.
Just my $0.02 worth.
Mark Rosenbaum Otey-Rosenbaum & Frazier, Inc. mjr_at_netcom.com Consultants in High Performance and (303) 727-7956 Scalable Computing and Applications POB 1397 ftp://ftp.netcom.com/pub/mj/mjr/resume/Boulder CO 80306 Received on Sat Jan 25 1997 - 00:00:00 CST
![]() |
![]() |