Re: renaming tables

From: Janis Griffin <janis_at_solbourne.com>
Date: Thu, 15 Oct 1992 14:56:17 GMT
Message-ID: <Bw645t.954_at_solbourne.com>


When you rename a table, the grants and indexes go with it. Therefore, when you create a new table with the same name as the old, you'll need to give new grants and create new indexes for that table.

I've created sql scripts that read the data dictionary and re-create the 'create index' and grant statements. Then I do the following:

  1. Run the 'create index' and grant scripts for the table that I'm going to rename. This produces two files with the commands to to rebuild the indexes and grants.
  2. Rename the table.
  3. Drop the indexes... that is, if I want to use the same names for the indexes on the new table.
  4. Create the new table with the same name as the old table.
  5. Execute the scripts that I created from step 1.

If you have synonyms for the table, you don't need to change them as these do not get updated when you rename the table. However, it's a good idea to check them out to make sure they are working properly after the rename.

Hope this helps.

Jan Griffin, DBA 	Solbourne Computers
303-678-4331		1900 Pike Road
			Longmont, Co. 80501
Received on Thu Oct 15 1992 - 15:56:17 CET

Original text of this message