Re: renaming tables

From: Andy Finkenstadt <andy_at_homebase.vistachrome.com>
Date: Thu, 15 Oct 1992 16:03:56 GMT
Message-ID: <1992Oct15.160356.23764_at_homebase.vistachrome.com>


ae0i+_at_andrew.cmu.edu (Albert L. Evans, IV) writes:
>I was wondering if anyone has had experience renaming tables using the
>SQL*Plus RENAME TO command. Specifically, are the grants and indexs
>associated with that table automatically updated to reference the new table
>name? My experience seems to indicate that this is the case, seeing as I
>have renamed a table and subsequently named a new table with the same old
>name. The newly created table w2as not indexed, nor were there any grants
>on the new table. Any responses appreciated.
>Bert Evans

Yes, the indexes automatically follow the previously created table to its new name. The reason for this is primarily - the OBJ$ table owned by SYS contains the Object Name and Type for each database object (Table, View, Sequence, Index, etc) and "All" a rename does is change the NAME of the object and nothing else. ALL other references to the object (except views which are a special case) refer to the object NUMBER, not its name.

Can you rename a column in the database? The definitive answer is YES, but I'll bet that Oracle doesn't support it. Because the data dictionary cache keeps the old name around and isn't updated when you update COL$ directly, you have to shutdown and restart the database to have the changes take effect without causing some really wierd errors. I would imagine that flushing the cache by references lots of other objects would affect this, but shutdown/startup was so easy to do.

-Andy

-- 
Andrew Finkenstadt       | Vista-Chrome, Inc.   |     NIC Handle: AF136
GEnie Unix Sysop/Manager | The Printing House   |    ...!uunet!rde!andy 
+1 904 222 2639 home     | 1600 Capital Cir SW  |   andy_at_GEnie.geis.com
+1 904 575 0189 work     | Tallahassee FL 32310 |  andy_at_vistachrome.com
 <> Send mail to ora-request_at_vistachrome.com to join Unix, CASE, and
 <> Desktop Oracle discussions.
Received on Thu Oct 15 1992 - 17:03:56 CET

Original text of this message