Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A brief introduction to the creation and function of synonyms in Dameng Database

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. The concept of synonyms

The function of synonym management is provided in Dameng database. A synonym is an alias for database schema objects, which is often used to simplify object access and improve object access security. When a synonym is used, the Dameng database translates it into the name of the corresponding scheme object. Similar to the view, synonyms do not take up actual storage space, only the definition of synonyms is saved in the data dictionary. Database administrators can define synonyms for most of the database objects in the Dameng database, such as tables, views, synonyms, sequences, stored procedures, packages, and so on.

two。 Create a user:

Description: when you create a user, a corresponding pattern is automatically generated and authorized.

Create user "YTH" identified by "yth"-create a user

Grant "PUBLIC", "RESOURCE" to "YTH";-- authorization

3. Create synonyms:

CREATE SYNONYM "YTH". "AAAA" FOR "SG_DATACENTER". AAAA "

4. Test query results:

Select * from AAAA

5. The functions and characteristics of synonyms for Dream:

1) in multi-user collaborative development, the names of objects and their holders can be shielded. If there is no synonym, you must pass the (schema name) when manipulating other users' tables. Table name), after using the synonym of Dameng, the pattern name can be hidden.

2) simplify sql statements for users. The above is actually a way to simplify sql, and if you create a table with a long name, you can create a synonym for the table to simplify sql development.

3) provide location transparency for remote objects in distributed databases.

The advantages of synonyms: save a lot of database space, there is no difference in the operation of the same table for different users; the expanded scope of use of the database can achieve seamless interaction between different database users; synonyms can be created on a different database server and connected through the network.

Delete synonym: drop public synonym table_name

View all synonyms: select * from dba_synonyms

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report