Oracle As a data transformation in the original relevant database, the view is mainly used to view some data in the relevant table. You can set Oracle A view is a moving window through which you can see the data you are interested in.
A view is obtained from one or more actual tables whose data is stored in the database. The tables used to generate a view are called the base tables of the view. One view can also be generated from another view.
The view definition exists in the database, and the data related to this definition is not stored in the database. The data displayed in the view is stored in the base table.
A view looks very similar to a physical table of a database and operates on it like any other table. When you modify data through a view, the data in the base table is actually changed. On the contrary, the changes to the base table data are automatically reflected in the view generated by the base table. For logical reasons Oracle The view can modify the corresponding base table, but some cannot (only query ).
Role of a view
*Simplicity. What you see is what you need. A view not only simplifies users' understanding of data, but also simplifies their operations. Frequently Used queries can be defined as views, so that you do not have to specify all the conditions for each subsequent operation.
* Security. Users can only query and modify the data they can see through the view. Other data in the database is neither visible nor accessible. Database authorization commands allow each user to restrict the retrieval of a database to a specific database object, but cannot authorize the database to a specific row or column. Pass Oracle View, which can be restricted to different subsets of data:
The permission can be restricted to a subset of rows in the base table.
The permission can be restricted to a subset of columns in the base table.
The permission can be restricted to the row and column subsets of the base table.
The permission can be restricted to the rows restricted by the connection of multiple base tables.
The permission can be restricted to the Statistical Summary of data in the base table.
The permission can be restricted to a subset of another view, or a subset of some views and merged base tables.
*Logical Data independence. View helps you avoid the impact of changes in the real table structure.
View Security
View security prevents unauthorized users from viewing specific rows or columns. You can only view specific rows in the table as follows:
1Add a column indicating the user name in the table;
2 Create Oracle View: you can only see rows marked with your username;
3Authorize the view to other users.
Logical Data independence
View allows applicationsProgramAnd database tables to a certain extent. If there is no view, the application must be created on the table. With the view, the program can be built on the view, so that the program and the database table are separated by the view. The view can separate the program from the data in the following aspects:
1If an application is created on a database table, you can create a view on the table when the database table changes. The view shields the changes in the table, so that the application does not move.
2If an application is created on a database table and the application changes, you can create a view on the table to mask application changes through the view so that the database table does not move.
3If the application is created on the view, when the database table changes, you can modify the view on the table and use the view to shield the table changes, so that the application can not move.
4If an application is created on a view, you can modify the view on the table when the application changes. The view shields the application changes, so that the database does not move.