| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Difference between oracle Synonyms and Views.
here's a flameless answer:
a synonym is a permanent alias. it can be public (available to all users) or private (owned by and used by one user, i.e., schema)
oracle's data dictionary views are accessed via public synonyms
for example, ALL_USERS is a public synonym for SYS.ALL_USERS
the synonym does not create a copy -- it simply provides a different, usually simpler name, typically masking the owner of the object
the synonym in itself does not imply access privileges on the object, these must be granted on the object as a separate action
a view is simple a stored SELECT statement -- literally, it is stored in the data dictionary. it can be used just about anywhere in a DML statement that an actual table name can be used -- i.e., the FROM clause of a SELECT statement, or in INSERT, UPDATE, and DELETE (with restrictions)
for example SYS.ALL_USERS is actually a view that select from a number of SYS tables, specifically:
select u.name, u.user#, u.ctime
from sys.user$ u, sys.ts$ dts, sys.ts$ tts
where u.datats# = dts.ts#
and u.tempts# = tts.ts#
and u.type# = 1
views hide complexity, and also add a layer of security. if a user can have privileges on a view without having any privileges on the underlying tables.
do a select from the data dictionary view ALL_VIEWS to get an idea of the kind of complexity that views can hide.
So, neither synonyms nor views have any affect on data storage or require any storage or imply any additional copies of any data.
Please follow Dan's Suggestion and read up on these matters in the Oracle Docs. The SQL Reference Manual and Concepts guide are good places to start.
![]() |
![]() |