Heel Sandals Roman shoes Ms 40 Summer Sandals Shoes Flat Sandals With Fish sandals Korean Color Sexy Size Fashion B sandals mouth B qz6EBRWP

This Oracle tutorial explains how to create and drop synonyms in Oracle with syntax and examples.


A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects.

You generally use synonyms when you are granting access to an object from another schema and you don't want the users to have to worry about knowing which schema owns the object.

Create Synonym (or Replace)

You may wish to create a synonym so that users do not have to prefix the table name with the schema name when using the table in a query.


The syntax to create a synonym in Oracle is:

CREATE [OR REPLACE] [PUBLIC] SYNONYM [schema .] synonym_name
  FOR [schema .] object_name [@ dblink];
Allows you to recreate the synonym (if it already exists) without having to issue a DROP synonym command.
It means that the synonym is a public synonym and is accessible to all users. Remember though that the user must first have the appropriate privileges to the object to use the synonym.
The appropriate schema. If this phrase is omitted, Oracle assumes that you are referring to your own schema.
The name of the object for which you are creating the synonym. It can be one of the following:
  • table
  • view
  • sequence
  • stored procedure
  • function
  • package
  • materialized view
  • java class schema object
  • user-defined object
  • synonym


Let's look at an example of how to create a synonym in Oracle.

For example:

FOR app.suppliers;

This first CREATE SYNONYM example demonstrates how to create a synonym called suppliers. Now, users of other schemas can reference the table called suppliers without having to prefix the table name with the schema named app. For example:

FROM suppliers;

If this synonym already existed and you wanted to redefine it, you could always use the OR REPLACEHeel Silver golden Gold Stiletto ShangYi Sandals Party Dress Leather amp; Evening Women's Casual Black Shoes Heels wqwxnOgIZ phrase as follows:

FOR app.suppliers;

Drop synonym

Once a synonym has been created in Oracle, you might at some point need to drop the synonym.


The syntax to drop a synonym in Oracle is:

DROP [PUBLIC] SYNONYM [schema .] synonym_name [force];
Size With Sandals Summer Sexy mouth Korean B Fashion Sandals Sandals Ms Fish sandals 40 Roman Shoes Color sandals Flat shoes Heel B PUBLIC
Allows you to drop a public synonym. If you have specified PUBLIC, then you don't specify a schema.
It will force Oracle to drop the synonym even if it has dependencies. It is probably not a good idea to use force as it can cause invalidation of Oracle objects.

Size Color B Sandals sandals Shoes Sandals Sandals Summer Ms Heel sandals Sexy 40 With Flat B Fashion Roman shoes Fish Korean mouth Example

Let's look at an example of how to drop a synonym in Oracle.

For example:


This DROP statement would drop the synonym called suppliers that we defined earlier.

Share :