Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between oracle Synonyms and Views.
Rene Nyffenegger wrote:
>>Prem:
>>
>>True to form, that wanker Dan Morgan doesn't know the answer and once
>>again sends someone to an unsupported reference site.
>>
>>Quite simply:
>>
>>A Synonym creates a copy of the data but under a different name. You
>>see, you don't want people having to remember difficult names. Plus it
>>allows for data redundancy which cuts down on having to buy more kit.
>>This may influence the backup schedule but, who knows, give 'er a try.
>>
>>
>
>Apart from the comments of others in this group about the technical
>accuracy of your post (which I share): If people don't want to remember
>difficult names, why not create the objects with easy names in the first
>place?
>
>Rene
>
>
That is only one reason. I was teaching synonyms to my students at the U
last night and one example
mirrors your statement:
CREATE TABLE obnoxiouslynamedtable (
test VARCHAR2(20));
CREATE SYNONYM simple FOR obnoxiouslynamedtable;
But another was, perhaps, more to the point:
SELECT * FROM sys.v_$session;
CREATE SYNONYM sess FOR sys.v_$sessions;
SELECT * FROM sess;
One great use for synonyms is the ability to modularize. To eliminate the hard-coded pointing to specific objects in specific schemas.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Wed Oct 29 2003 - 12:12:05 CST