Database Reference
In-Depth Information
Figure 22.8
CREATE
SYNONYM
Syntax.
type of thing can cause serious performance problems, but not in smaller-
scale client-server environments.
Synonyms can be created as publicly or privately available. All users
automatically have access to public synonyms. Private synonyms are avail-
able to the schema they are created in, although access can be granted to
other users. Access privileges and security are covered in Chapter 23.
22.2.1
Creating Public Synonyms
In the syntax diagram in Figure 22.8, the PUBLIC option determines if a
synonym is created publicly or not.
To create a public synonym, you would have to have the system privilege
CREATE PUBLIC SYNONYM. Use your SQL*Plus Worksheet session to
perform these steps so the MUSIC user is able to create a public synonym.
You would have to be logged in as a database administration user such as
SYS or SYSTEM to execute these commands.
GRANT CREATE SYNONYM TO MUSIC;
GRANT CREATE PUBLIC SYNONYM TO MUSIC;
To create a public synonym for the ARTIST table in the MUSIC
schema, available to all users, the following command would be executed:
CREATE PUBLIC SYNONYM CD FOR MUSICCD;
 
Search WWH ::




Custom Search