Note
This view is available starting with V2.2.30.
Purpose
This view displays all synonyms accessible to the current user.
Applicability
This view is applicable only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the synonym. |
| SYNONYM_NAME | VARCHAR2(128) | NO | The name of the synonym. |
| TABLE_OWNER | VARCHAR2(128) | NO | The name of the object referenced by the synonym. The TABLE_NAME column is merely a column name. A synonym can also refer to other objects, such as views. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the object referenced by the synonym. |
| DB_LINK | VARCHAR2(128) | NO | If the synonym references a database link, this column specifies the name of the database link. |
Sample query
Query all synonyms accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_SYNONYMS;
The query result is as follows:
+----------+--------------+-------------+------------+---------+
| OWNER | SYNONYM_NAME | TABLE_OWNER | TABLE_NAME | DB_LINK |
+----------+--------------+-------------+------------+---------+
| __public | SYN_PUB | SYS | TEST | NULL |
| SYS | S1 | SYS | TEST | NULL |
+----------+--------------+-------------+------------+---------+
2 rows in set
References
Query all synonyms in the current tenant: DBA_SYNONYMS
Query synonyms owned by the current user: USER_SYNONYMS
For more information about synonyms, see Manage synonyms.
