Oracle database-Concept of views

Source: Internet
Author: User
Tags definition modify query oracle database
oracle| Concept | view | data | The database view is a transformation of the original database data and is another way to view the data in the table. A view can be viewed as a moving window through which you can see data of interest.

Views are obtained from one or more actual tables, and the data for those tables is stored in the database. The table that is used to produce the view is called the base table for the view. One view can also be generated from another view.

The definition of a view exists in the database, and the data associated with this definition is not stored in the database. The data you see through the view is stored in the base table.

The view looks very much like the physical table of the database, and it operates like any other table. When you modify data through a view, you are actually changing the data in the base table; Conversely, changes to the base table data are automatically reflected in the view produced by the base table. For logical reasons, some views can modify the corresponding base table, and some cannot (only query).

The function of the two views

* Simple nature. What you see is what you need. Views can not only simplify the user's understanding of the data, but also simplify their operations. Queries that are frequently used can be defined as views so that users do not have to specify all the conditions for subsequent operations.

Security Users can only query and modify the data they can see through the view. Other data in the database is either invisible or not. Database authorization commands allow each user to restrict the retrieval of a database to a specific database object, but not to a specific row and a specific column on the database. With views, users can be limited to different subsets of data:

Use permissions can be limited to a subset of the rows of a base table.

Use permissions can be limited to a subset of the columns of the base table.

Use permissions can be limited to a subset of the rows and columns of the base table.

Use permissions can be limited to rows that are qualified by the connections of multiple base tables.

Use permissions can be limited to the statistical summary of the data in the base table.

Permission can be restricted to a subset of another view, or to a subset of views and base tables merged.

* Logical data Independence. Views help users to mask the impact of real-world table structure changes.

Security for three views

The security of a view prevents unauthorized users from viewing a particular row or column, and the only way a user can see a specific row in a table is as follows:

1 Add a column in the table that flags the user name;

2 The view is established, the user can only see the line marked with their own user name;

3 Authorize the view to other users.

Four logical data Independence

Views allow applications and database tables to be isolated to some degree. If there is no view, the application must be based on the table. With a view, the program can be built on top of the view, and the program is separated from the database table by the view. Views can make programs and data independent in the following ways:

1 if the application is based on the database table, when the database table changes, you can set up a view on the table, through the view screen changes, so that the application can not move.

2 If the application is based on the database table, when the application changes, you can set up a view on the table, through the view screen application changes, so that the database table does not move.

3 If the application is based on the view, when the database table changes, you can modify the view on the table, through the view mask changes in the table, so that the application can not move.

4 If the application is based on the view, when the application changes, you can modify the view on the table, through the view mask application changes, so that the database can not move.



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.