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 -> Re: alias for long object name

Re: alias for long object name

From: Chris O <itoys1>
Date: Sat, 26 Jul 2003 09:49:30 +1000
Message-ID: <3f21c1f9$0$20075$afc38c87@news.optusnet.com.au>


"Karsten Farrell" <kfarrell_at_belgariad.com> wrote in message news:MPG.198b044b47125b92989808_at_news.la.sbcglobal.net...
> Hi Christoph Seidel, thanks for writing this:
> > Hi,
> >
> > is it possible to use an alias for an object name like
schema.table_at_linkname
> > without creating a synomym? I have a stored proc which references this
long
> > name very offen and i do not want to type it again and again.
> >
>
> I can understand your reluctance to type schema.table_at_linkname over and
> over, but I'm not sure why you are reluctant to use a synonym. Think of
> the flexibility a synonym offers:
>
> 1. Suppose something happens to the db at linkname. The DBA restores the
> db to another host, so your linkname is no longer valid. Simply change the
> synonym to use a different linkname and - presto! - no code changes to
> your stored procedure.
>
> 2. Suppose someone decides to move table from schema=john to schema=jane.
> Simply change the synonym to use jane's schema and - presto! - no code
> changes to your stored procedure.
>
> PS - Do you get the feeling I like to use the word "presto?"
>
> --
> [:%s/Karsten Farrell/Oracle DBA/g]

I'd like to add an extra comment to what Karsten said.

Synonyms are useful when you need to support multiple instances of the same application within the one physical databases.

In this case you can create multple [private] synonyms allowing multiple instances to co-exist. Unfortunately, Oracle only supports a single global catalog so synonyms are the only way you can easily co-exist multiple instances of an application when it references objects outside of a single schema.

Cheers Received on Fri Jul 25 2003 - 18:49:30 CDT

Original text of this message

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