Creating a Synonym

Note

This feature is not available for MySQL database services.
You can create or edit a synonym in SQL Worksheet.

There are two ways of creating a synonym for a selected schema:

  • In the Navigator tab, right-click the object for which you want to create the synonym, and select Add Synonym. In this case, the only fields that you can edit in the Properties pane are Public and Synonym Name. The values of the remaining fields are predetermined by the object selected.

  • Iin the Navigator tab, select the object type as Synonyms or Public Synonyms from the drop-down list. Click Object submenu, and select Create Object. All the fields are available for edit.

The different panes are described in the following sections:

Properties pane

  • Public: If this option is checked, the synonym is accessible to all users. However, each user must have appropriate privileges on the underlying object to use the synonym. If this option is not checked, the synonym is a private synonym, and is accessible only within its schema.

  • Synonym Schema: Database schema in which to create the synonym.

  • Synonym Name: Name of the synonym. A private synonym must be unique within its schema. A public synonym must be unique within the database.

  • Object Type: Specify the type of object to which this synonym refers.

  • Object Schema: Schema containing the object or name to which this synonym refers.

  • DB Filter: After selecting the Object Type and Object Schema, the list of objects of the selected type may be very long. To filter the object names, enter the search entry and click Refresh. The Object Name field is auto-filled with appropriate object names in the drop-down list.

  • Object Name: Select the name of the object to which this synonym refers.

  • DB Link: Enter a complete or partial database link to create a synonym for a schema object on a remote database where the object is located. If you specify DB Link and omit schema, then the synonym refers to an object in the schema specified by the database link. Oracle recommends that you specify the schema containing the object in the remote database. If you omit DB Link, then Oracle Database assumes the object is located on the local database.