Summary of Oracle synonyms (synonyms)

Source: Internet
Author: User

The Oracle synonym (synonyms) is literally an alias. Similar to the attempted function, it is a ing relationship. This topic describes how to create a synonym statement, delete a synonym, and view a synonym statement.

Summary of oracle Synonyms:

The meaning of an alias is literally the same as that of an attempt. Is a ing relationship.

1. Create a synonym statement:

Create public synonym table_name for user. table_name;


The first user_table and the second user_table can be different.

In addition, to create a synonym for a table on a remote Database, you must first create a Database Link (Database connection) to expand the access, and then create a Database synonym using the following statement: create synonym table_name for table_name @ DB_Link;

Of course, you may need to authorize the current user (user2) in the user: grant select/delete/update on user2

2. Delete Synonyms:

Drop public synonym table_name;


3. view all synonyms:

Select * from dba_synonyms


Synonyms have the following benefits: they save a lot of database space and have little difference in operating the same table for different users; they extend the scope of use of databases, allows seamless interaction between different database users. synonyms can be created on different database servers and connected over the network.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.