Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle Table Rename

Oracle Table Rename

From: Wesley M. Stephens <wms_at_ornl.gov>
Date: 1997/03/31
Message-ID: <333FC3F9.1A84@ornl.gov>#1/1

I have a situation in which I would like to maintain two identical tables (same definition, but different names). I would like to have applications reference one or the other of these tables through either a synonym or a view. For example, I would like to have synonym T and have it point to either table T1 or T2. Whenever the synonym T points to T1, all application queries would be using the data in T1. During a window of serveral hours every night I will be truncating and loading new data into table T2. When that load is complete I would like to redirect the synonym to point to T2 so that applications would immediately get the new data. In this fashion I hope to minimize the time the table is "unavailable" during the reload.

My problem is of course that re-establihing the synonym to point to the new table invalidates all the procedures etc. that use the synonym. What I need is a mechanims for accomplishing this sleight-of-hand that does not invalidate anything?

Does anyone have any ideas? This is a simple process with a file system in that files can simply be renamed. I can't, however, come up with an approach that looks like it will work with Oracle...it's working entirely too hard to protect me from myself...

Thanks,

-w

-- 
+-------------------------------------------------------------------+

| Wesley M. Stephens Phone: (423) 576-1933 |
| Lockheed Martin Energy Systems Fax: (423) 576-0099 |
| P.O. Box 2009 Email: wms_at_ornl.gov |
| 701 Scarboro |
| Oak Ridge, Tennessee, 37831-8227 |
+-------------------------------------------------------------------+
Received on Mon Mar 31 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US