Re: Rebuild table

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Mon, 27 Jun 2011 10:37:04 +0200
Message-ID: <4E084130.1040002_at_gmail.com>


Well,
triggers should be manually created on the new table, if necessary.

And another quite important detail: FK constraints pointing to the table to be reorganized using CTAS and rename need to be recreated, because after the rename they will point to the old table.

Dimitre

> On Fri, Jun 24, 2011 at 7:03 AM, Radoulov, Dimitre
> <cichomitiko_at_gmail.com <mailto:cichomitiko_at_gmail.com>> wrote:
>
> On 23/06/2011 23:39, Wayne Smith wrote:
>>
>> Am I missing something?
>>
>>
>> Public and private synonyms?
>>
>
> If you're using CTAS + rename you don't need to worry about them
> (unless I'm missing something):
>
>
> SQL> create table t as select * from dual;
>
> Table created.
>
> SQL> create public synonym t_pub for t;
>
> Synonym created.
>
> SQL> create synonym t_priv for t;
>
> Synonym created.
>
>
> SQL> create table tt as select * from t;
>
> Table created.
>
> SQL> drop table t;
>
> Table dropped.
>
> SQL> rename tt to t;
>
> Table renamed.
>
> SQL> select * from t_pub;
>
> D
> -
> X
>
> SQL> select * from t_priv;
>
> D
> -
> X
>
>
> The status of those synonyms changes after the drop
> but they become valid again the first time they are referenced
> after the rename.
>
>
> Regards
> Dimitre
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 27 2011 - 03:37:04 CDT

Original text of this message