Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop a table and recreate to effect a column name change?

Status
Not open for further replies.

jamesdb

Technical User
Oct 1, 2002
9
US
Hi, I have been asked to rename a column that is unused in one table. We have Oracle 8.05. I could make a copy of the table and insert the data in it, then drop the table (with cascade constraints) and recreate it with the column's name changed, and then insert the data back into it. The name of the table would not change, only the column name. This would preserve the primary key numbers but is rowid a consideration? The primary key for this table is a foreign key in about a dozen tables. If I then recompile all views and packages/procedures is this enough or are there any other risks?
 
You can also upgrade to 8I and rename the column, or do as you say but dont forget to start the RDBMS in exlusive mode while you are recreating the table and enabling the constraints for integrity reasons. Too bad I.T. is not cash business

Luc Foata
Unix sysadmin, Oracle DBA
 
The column may be renamed on 9.2 only. On 8i it may dropped (and of course recreated). Regards, Dima
 
backup backup backup backup backup backup backup FIRST DaPi - no silver bullet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top