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.