OceanBase Developer Center (ODC) allows you to create a synonym on a GUI. This topic describes how to create a synonym in ODC.
Prerequisites
A table or view has been created in OceanBase Database in Oracle mode.
Overview
Log on to OceanBase Developer Center (ODC) and click the name of the target connection to go to the corresponding connection management page. You can click Synonym in the left-side navigation pane to get a list of synonyms or a list of public synonyms. To create a synonym, click + in the upper-right corner of the synonym list or click Create in the navigation bar on the top of the page.
Note
At present, synonyms are supported only in Oracle mode of OceanBase Database. Therefore, you must go to the management page of an Oracle connection to create a synonym.
Procedure
Step 1: Create a synonym
Click Create. In the Create Synonym dialog box, specify the following information:
Synonym Name: specifies the name of the synonym. The name cannot be empty and must be less than 128 characters in length.
Object Owner: specifies the schema to which the synonym belongs. Select the schema from the drop-down list. This parameter must be specified.
Object Type: specifies the type of the object that the synonym represents. Select the type from the drop-down list. You can create a synonym for a TABLE object or a VIEW object. This parameter must be specified.
Object Name: specifies the object that the synonym represents. This parameter must be specified.
Synonym Type: specifies the type of the synonym. Supported types: Synonym and Public Synonym. This parameter must be specified.
Step 2: Confirm the statement
After you specify the information, click Next to go to the statement editing page, where a synonym definition statement is generated based on the information specified in the Create Synonym dialog box. You can modify this statement. After you confirm the statement, click the Create button in the upper-right corner of the page to complete the creation. A synonym cannot be modified after it is created.
In addition, the toolbar on the editing page provides the following buttons:
| Description | Description |
|---|---|
| Format | Click this button to apply formatting, such as indentation, line break, and keyword highlighting, to the selected SQL statements or all the SQL statements in the current SQL window. |
| Find and Replace | You can enter text in the search field to find the specific content and enter text in the replacement field to replace the content found. |
| Undo | Click this button to undo the last operation. |
| Redo | Click this button to reverse an Undo operation. |
| Case Sensitivity | The system supports three configurations: All Caps, All Lowercase, and Capitalize the first letter. Click this button to convert the selected statements in the script to the corresponding capitalization format. |
| Indent | You can add indents to or delete indents from the statements that you selected. |
| Remarks | You can click Add Comments to convert the statements that you select into comments or click Delete Comment to convert comments to SQL statements. |