Professional Documents
Culture Documents
Sequences are used to generate primary key values or unique key values
automatically either in ascending or descending order.
Synonyms
Synonyms provide both data independence and location transparency.
Synonyms permit applications to function without modification
regardless of which user owns the table or view and regardless of
which database holds the table or view.
However, synonyms are not a substitute for privileges on database
objects. Appropriate privileges must be granted to a user before the
user can use the synonym.
There are two major uses of synonyms:
o Object invisibility: Synonyms can be created to keep the
original object hidden from the user.
o Location invisibility: Synonyms can be created as aliases
for tables and other objects that are not part of the local
database.
Types of Synonyms
1) Public synonyms
2) Private synonyms
Example
create public synonym suppliers
for app.suppliers;
Snapshots:
Snapshots in Oracle work like views but with a small difference. When views are created
database stores only the query defining the view. In contrast, a snapshot is a view whose
contents are computed and stored.
Snapshot constitute redundant data, in that their contents can be inferred from the view
definition and the rest of the database contents. However, it is much cheaper in many cases to
read the contents of a Snapshot than to compute the contents of the view by executing the
query defining the view.
Syntax:
CREATE SNAPSHOT Snapshot Name<option list> AS <SQL query>;
Example:
Create snapshot snap1 as select * from emp;