The Oracle synonym management feature brings you surprises and attention

Source: Internet
Author: User
Oracle Database provides the synonym management function. Synonyms are aliases of database solution objects. They are often used to simplify object access and improve object access security.

Oracle Database provides the synonym management function. Synonyms are aliases of database solution objects. They are often used to simplify object access and improve object access security.

Oracle Database provides the synonym management function. Synonyms are aliases of database solution objects. They are often used to simplify object access and improve object access security. When a synonym is used, the Oracle database translates it into the name of the corresponding solution object. Similar to a view, synonyms do not occupy the actual storage space. Only the definition of synonyms is saved in the data dictionary. In Oracle databases, most database objects, such as tables, views, synonyms, sequences, stored procedures, functions, JAVA classes, packages, and so on, can be defined by the database administrator as needed. Using Oracle Database synonym management can surprise database administrators and application developers.

Surprise 1: Application Development can ignore the specific object name of the database.

In applications, you must constantly call Oracle database objects, such as tables, views, and objects. To this end, when managing software development, if the application has completed the development of some functions. In this case, the database administrator must change the name of a database object. Then, the application needs to be adjusted. This is inconvenient in actual work. In particular, if some applications provide a function-defined platform, it will be very troublesome. For example, a custom report function is provided in an ERP software. In the system, there is a detailed list of supplier products. However, the user thinks that the report information is incomplete. The user wants to display the finished product corresponding to a part. In this case, you can modify the original database object to complete the customization. However, this is often not recommended. If you accidentally modify the error, it is difficult to modify it back. Therefore, if you need to make major changes to the original report on the custom platform, we recommend that you create another view to collect the information you need. In this case, the user not only needs to define the database object, but also needs to re-adjust the report format of the foreground application. Obviously, the workload is huge.

Now, with the synonym function, all of this will become convenient. Because the foreground application does not need to be adjusted, you only need to redefine the database object synonym. This not only guarantees the recoverability of foreground applications, but also reduces the workload. This is the first surprise of Oracle Database synonyms.

Surprise 2: preventing applications from directly accessing database objects and improving database security.

When developing database applications, a common rule that should be followed is to avoid Directly Drinking database tables, views, functions, or other objects. This will greatly damage the security of the database.

For example, if a database object is directly called in a foreground application, attackers can easily understand the basic logical structure of the background database by analyzing the objects referenced by the application. This will obviously provide great convenience for attackers. Therefore, in order to ensure database security, it is best for foreground applications to access the background database through synonyms. In this case, it is difficult for an attacker to analyze the objects in the background database and the relationships between objects through calling the foreground application.

Surprise 3: simplified access to database objects.

Sometimes, the name of a database object may be very long, such as AD_USER_ROLE_NAME_TRL. If you enter such a long object name every time you call this database object, it will certainly cause a headache for the database administrator. However, if the name definition is too short, the readability will be poor. In other databases, the names of database objects are minimized at the cost of readability.

But in Oracle databases, you don't need to worry about it. Because we can set a synonym for this database object, just like an alias. In this case, you only need to access the object through synonyms without entering such a long object name.

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.