Home > php教程 > PHP开发 > ORACLE Schemas and Schema Objects

ORACLE Schemas and Schema Objects

黄舟
Release: 2016-12-15 10:25:30
Original
1417 people have browsed it

A schema is a collection of schema objects, and each database user corresponds to a schema. Schema objects are logical structures that directly reference database data. Schema objects include structures such as tables, views, indexes, aggregations, sequences, synonyms, database chains, procedures, and packages. Schema objects are logical data storage structures, and each schema object does not have a corresponding file on disk to store its information. A schema object is logically stored in a table space in the database, and the data for each object is physically contained in one or more data files in the table space.
2.4.1 Table
Table is the basic unit of data storage in the database, and its data is stored in rows and columns. Each table has a table name and a set of columns. Each column has a column name, data type, width or precision, and scale. A row is a collection of column information corresponding to a single record.
2.4.2 View
A view (view) is a customized representation of the data in one or more tables (or other views). It is defined with a query, so it can be considered as a stored query. Or a virtual table. Views can be used in many places where tables are used.
Since views are derived from tables, there are many similarities between views and tables. Views can be queried, with certain restrictions on modification, insertion, or deletion. All operations performed on the view truly affect the data in the view's base table, subject to the integrity constraints and triggers of the base table.
Views are different from tables. A view does not allocate any storage space and the view does not actually contain data. A view defined by a query corresponds to the data in the table referenced by the view. Views only store their definitions in the data dictionary.
Introducing views has the following benefits:
·Provide additional security for the table by restricting access to a predefined set of rows of the table
·Hide data complexity
·Simplify commands for users
·Provide additional security for basic table data One point of view
·Can isolate applications from modifications to basic table definitions
·Used for queries that cannot be represented without views
·Can be used to save complex queries
2.4.3 Clusters
Aggregation (cluster) is an alternative method of storing table data . An aggregation is a set of tables that stores rows with the same common column value together and that are often used together. These common columns form the aggregation code. For example: the EMP table and the DEPT table share the DEPTNO column, so the EMP table and the DEPT table can be aggregated together, and the column of the aggregation code is the DEPTNO column.
2.4.4 Index
Index (index) is a selection structure related to tables and aggregations. Indexes are built to improve the performance of data retrieval, allowing you to quickly determine specific information. ORACLE indexes provide fast access paths to table data. The index is suitable for querying a certain range of rows or querying specified rows.
An index can be established on one or more columns of a table. Once established, it is automatically maintained and used by ORACLE and is completely transparent to users. Indexes are logically and physically independent of the data; their creation or deletion has no impact on the table and the application can continue processing. Retrieval performance for indexed data remains almost constant, whereas performance for modify, delete, and insert operations degrades when there are many indexes on a table.
Indexes include unique indexes and non-unique indexes. A unique index guarantees that no two rows in the table have duplicate values ​​on the column that defines the index.
A composite index is an index created on a certain column of the table. A composite index can speed up the retrieval of a SELECT statement, and all or a major part of the composite index can be referenced in its WHERE clause. Therefore, the order of the columns is given in the definition, and the frequently accessed or most selected columns are placed first.
When creating an index, an index segment will be automatically created in the table space.
2.4.5 Program unit
Program unit refers to stored procedures, functions and packages. A procedure and function is a combination of SQL statements and PL/SQL statements, which is an executable unit that performs a certain task.
A procedure or function can be created, its compiled form stored in the database, and executed by the user or database application. The difference between a procedure and a function is that a function always returns a single value to the caller, while a procedure returns no value to the caller.
Packages provide related procedures, functions, variables and methods, allowing managers and application developers to use methods to write programs to provide more functions and improve performance.

The above is the content of ORACLE mode and mode objects. For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template