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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Alter name of a table

Re: Alter name of a table

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Thu, 23 Sep 1999 12:49:17 GMT
Message-ID: <37EA21CD.A4317D02@edcmail.cr.usgs.gov>


I haven't heard of this one. It might be worth investigating.

If you use the "RENAME table1 TO table2;" command, then Oracle actually moves the data. It doesn't just change the name. This can cause performance problems, especially if the table is very big. You will also have to verify that your constraints and indexes aren't dropped. I'm not sure if they get "renamed" too.

But everyone missed the easiest solution: SYNONYMS! Why not just create a synonym for the table? Quick and easy.

HTH,
Brian

Chetan Wagle wrote:
>
> Hi niall,
>
> I have heard of an undocumented command called 'alter table <name> rename
> <newname>'
>
> Check it out. The other solutions won't give you your triggers and
> referential constraints.
>
> HTH,
>
> Chetan
> Bangalore, India
>
> Niall Litchfield wrote in message <7saos6$b9l$1_at_soap.pipex.net>...
> >or if you want to create a backup of the existing one as well, for when
> that
> >app breaks..
> >
> >create table table2 as select * from table1
> >
> >Niall
> >Oracle DBA Audit Commission UK
> ><owais_anjum_at_my-deja.com> wrote in message
> >news:7rq6uv$sb2$1_at_nnrp1.deja.com...
> >> In article <7rpcf7$hfg$1_at_perki.connect.com.au>,
> >> "Tom Zamani" <tom_at_taten.com.au> wrote:
> >> > Is there any way to change the name of a table?
> >> > Like alter table .....
> >> > Please help me out.
> >> > Tom
> >> >
> >> >
> >>
> >> rename table1 to table2;
> >>
> >> pretty straight forward hmmm :)
> >>
> >>
> >> Sent via Deja.com http://www.deja.com/
> >> Share what you know. Learn what you don't.
> >
> >
Received on Thu Sep 23 1999 - 07:49:17 CDT

Original text of this message

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