 |
|
Oracle Synonyms
Oracle Tips by
Burleson
|
When a typical user references an object without a schema
qualifier, it is quite uncommon for the referenced object to exist in
that user’s schema. You’re probably thinking, “Didn’t I just read that
objects are presumed to exist inside the user’s schema?” You did.
The objects being referenced do exist inside the user’s schema, but
the user is not accessing the real objects; instead, that user
is referencing a synonym that points to the real object (much
like your telephone number isn’t you, but still allows people to get
in touch with you). Because the user accesses a synonym for an object,
the user is able to reference objects without using schema qualifiers.
A public synonym is a synonym to which all database users
have access, unless overridden by a private synonym. A private
synonym works only for the user who owns the synonym. Public
synonyms are created by the DBA to allow all users to reference an
object; private synonyms are created by the DBA for specific users as
the need arises. If a private and public synonym have the same name,
the private synonym takes precedence. Figure 2.4 illustrates this
concept.
This is an
excerpt from the book "High Performance Oracle Database
Automation" by Jonathan Ingram and Donald K. Burleson, Series
Editor. |