2.18 Managing Synonyms

A synonym is an alias for a schema object. You can create, view and drop a synonym.

Synonyms can provide a level of security by masking the name and owner of an object and by providing location transparency for remote objects of a distributed database. Also, they are convenient to use and reduce the complexity of SQL statements for database users.

See Also:

"Oracle Database Administrator’s Guide" for information about synonyms

2.18.1 Creating Synonyms

Create synonyms using Object Browser.

To create a synonym:

  1. On the Workspace home page, click SQL Workshop and then Object Browser.

    Object Browser appears.

  2. Click the Create icon.
  3. From the list of object types, select Synonym.
  4. For Define:
    1. Synonym Name - Enter a name.

    2. Public or Private - Specify whether the synonym should be public or private.

    3. Schema - Select the database schema (or user name) which owns the object upon which you want to create your synonym.

    4. Object - Enter the name of the object upon which you want to create a synonym.

    5. Database Link - Enter the name of the database link to use if the synonym is to be created on a remote object.

    6. Click Next.

    A confirmation page appears, which displays the SQL used to create the synonym.

  5. Click Create Synonym.

2.18.2 Viewing a Synonym

Select a synonym from the Object Selection pane.

To view a synonym:

  1. On the Workspace home page, click SQL Workshop and then Object Browser.

    Object Browser appears.

  2. From the Object list, select Synonyms.
  3. From the Object Selection pane, select a synonym.

    The Object Details view appears displaying the following:

    • Synonym Owner

    • Synonym Name

    • Object Owner

    • Object Name

    • Object Type

    • Status

2.18.3 Dropping a Synonym

Select a synonym from the Object Selection pane and click Drop.

To drop a synonym in Object Browser:

  1. On the Workspace home page, click SQL Workshop and then Object Browser.

    Object Browser appears.

  2. From the Object list, select Synonyms.
  3. From the Object Selection pane, select a synonym and click Drop.
  4. To confirm, click Finish.