Managing Synonyms
A synonym is an alias for a schema object. Use Object Browser to create, view and drop a synonym.
Synonyms can provide a level of security by masking the name and owner of an object and providing location transparency for remote objects of a distributed database. Synonyms are also convenient to use and reduce the complexity of SQL statements for database users.
See Also: Managing Views_ Sequences_ and Synonyms in Oracle AI Database Administrator’s Guide for information about synonyms
Creating Synonyms
Use Object Browser to create synonyms.
To create a synonym:
-
In Object Browser, click the Create Database Objects menu and select Synonym.
Tip: To create new objects from the Object Tree, right-click the object and select the Create option.
The Create Synonym dialog appears.
On Create Synonym:
-
Synonym Name - Identify the name of the synonym. Synonym names must conform to Oracle naming conventions and cannot contain spaces, or start with a number or underscore.
-
Object Owner - Specify the database schema (or username) that owns the object upon which you wish to create your synonym.
-
If your schema contains database links, additional fields display depending on configuration:
-
Create Synonym On - Choose whether to create a synonym on a Local Object object from the local database or a Remote Object from a remote database.
-
Remote Object - Enter the name of the remote object upon which you wish to create a synonym.
-
Database Link - Select a database link to be used to access the Remote Object.
-
-
Object - Select an object upon which you wish to create a synonym.
Tip: The SQL Script region displays SQL generated by this dialog. To copy the SQL, click the Copy icon.
-
Click Create Synonym.
The Object Details tab appears.
Viewing a Synonym
View existing synonyms in Object Browser.
To view an existing synonym:
-
In Object Browser, Object Tree, expand Synonyms and select a synonym to view.
-
The Object Detail View appears and displays the following tab:
-
Object Details - Displays details about the synonym. Clicking the object name (for example, a table name) displays the details of that object. Available actions include:
-
Drop
-
Refresh
-
-
Dropping a Synonym
Select a synonym from the Object Selection pane and click Drop on the Object Details tab.
To drop a synonym:
-
In Object Browser, Object Tree, expand Synonyms and select a synonym to view.
The Object Detail View appears.
-
Click Drop.
In the Drop dialog:
-
Drop - Review the details.
-
SQL - The SQL Script region displays the SQL generated to drop the synonym. To copy the displayed SQL, click the Copy icon.
-
Confirm your selection and click Drop again.
-