请输入您要查询的百科知识:

 

词条 Database schema
释义

  1. Ideal requirements for schema integration

  2. Example of two schema integrations

  3. Oracle database specificity

  4. See also

  5. References

  6. External links

{{Short description|Visual representation of database system relationships}}{{Use mdy dates|date=January 2019}}{{Use American English|date=January 2019}}

The database schema of a database system is its structure described in a formal language supported by the database management system (DBMS). The term "schema" refers to the organization of data as a blueprint of how the database is constructed (divided into database tables in the case of relational databases). The formal definition of a database schema is a set of formulas (sentences) called integrity constraints imposed on a database.{{citation needed|date=January 2016}} These integrity constraints ensure compatibility between parts of the schema. All constraints are expressible in the same language. A database can be considered a structure in realization of the database language. The states of a created conceptual schema are transformed into an explicit mapping, the database schema. This describes how real-world entities are modeled in the database.

"A database schema specifies, based on the database administrator's knowledge of possible applications, the facts that can enter the database, or those of interest to the possible end-users."[2] The notion of a database schema plays the same role as the notion of theory in predicate calculus. A model of this "theory" closely corresponds to a database, which can be seen at any instant of time as a mathematical object. Thus a schema can contain formulas representing integrity constraints specifically for an application and the constraints specifically for a type of database, all expressed in the same database language. In a relational database, the schema defines the tables, fields, relationships, views, indexes, packages, procedures, functions, queues, triggers, types, sequences, materialized views, synonyms, database links, directories, XML schemas, and other elements.

A database generally stores its schema in a data dictionary. Although a schema is defined in text database language, the term is often used to refer to a graphical depiction of the database structure. In other words, schema is the structure of the database that defines the objects in the database.

In an Oracle Database system, the term "schema" has a slightly different connotation.

Ideal requirements for schema integration

The requirements listed below influence the detailed structure of schemas that are produced. Certain applications will not require that all of these conditions are met, but these four requirements are the most ideal.

Overlap preservation

Each of the overlapping elements specified in the input mapping is also in a database schema relation.[4]

Extended overlap preservation

Source-specific elements that are associated with a source’s overlapping elements are passed through to the database schema.[4]

Normalization

Independent entities and relationships in the source data should not be grouped together in the same relation in the database schema. In particular, source specific schema elements should not be grouped with overlapping schema elements, if the grouping co-locates independent entities or relationships.[4]

Minimality

If any elements of the database schema are dropped then the database schema is not ideal.[4]

Example of two schema integrations

Suppose we want a mediated (database) schema to integrate two travel databases, Go-travel and Ok-travel.

Go-travel has two relations:

Go-flight(f-num, time, meal(yes/no))

Go-price(f-num, date, price)

(f-num being the flight number)

Ok-travel has just one relation:

Ok-flight(f-num, date, time, price, nonstop(yes/no))

The overlapping information in Ok-travel’s and Go-travel’s schemas could be represented in a mediated schema:[4]

Flight(f-num, date, time, price)

Oracle database specificity

In the context of Oracle Databases, a schema object is a logical data storage structure.[1]

An Oracle database associates a separate schema with each database user.[2]

A schema comprises a collection of schema objects. Examples of schema objects include:

  • tables
  • views
  • sequences
  • synonyms
  • indexes
  • clusters
  • database links
  • snapshots
  • procedures
  • functions
  • packages

On the other hand, non-schema objects may include:[3]

  • users
  • roles
  • contexts
  • directory objects

Schema objects do not have a one-to-one correspondence to physical files on disk that store their information. However, Oracle databases store schema objects logically within a tablespace of the database. The data of each object is physically contained in one or more of the tablespace's datafiles. For some objects (such as tables, indexes, and clusters) a database administrator can specify how much disk space the Oracle RDBMS allocates for the object within the tablespace's datafiles.

There is no necessary relationship between schemas and tablespaces: a tablespace can contain objects from different schemas, and the objects for a single schema can reside in different tablespaces.

See also

  • Data element
  • Data mapping
  • Database design
  • Entity–relationship model
  • Knowledge representation and reasoning
  • Object-role modeling
  • Schema matching
  • Three-schema approach

References

1. ^{{cite book|first1= Lance |last1= Ashdown|first2= Tom |last2= Kyte|others= et al.|title= Oracle Database Concepts 11g Release 2 (11.2)|url= http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/tablecls.htm#CNCPT111|accessdate= 2010-04-14 |date=February 2010|publisher= Oracle Corporation|quote= A database schema is a logical container for data structures, called schema objects. Examples of schema objects are tables and indexes. }}
2. ^{{cite book|title= Oracle Database Concepts 10g Release 2 (10.2)Part Number B14220-02 |url= http://docs.oracle.com/cd/B19306_01/server.102/b14220/schema.htm|accessdate= 2012-11-26|quote= A schema is a collection of logical structures of data, or schema objects. A schema is owned by a database user and has the same name as that user. Each user owns a single schema. Schema objects can be created and manipulated with SQL. }}
3. ^{{cite book|first1= Lance|last1= Ashdown|author1-link=|first2= Tom|last2= Kyte|author2-link=|others= et al.|title= Oracle Database Concepts 11g Release 2 (11.2)|url= http://download.oracle.com/docs/cd/E11882_01/server.112/e10713/tablecls.htm#CNCPT111|accessdate= 2010-04-14|date=February 2010|publisher= Oracle Corporation|location=|isbn=|quote= Other types of objects are also stored in the database and can be created and manipulated with SQL statements but are not contained in a schema. These objects include database users, roles, contexts, and directory objects.}}
4. ^{{cite book |last= Pottinger |first=P. |last2=Berstein |first2=P. |year=2008 |title= Schema merging and mapping creation for relational sources |journal= Proceedings of the 11th International Conference on Extending Database Technology: Advances in Database Technology (EDBT '08) |publisher=ACM |location= New York, NY |pages=73–84 |doi= 10.1145/1353343.1353357|isbn=9781595939265 |citeseerx=10.1.1.405.2990 }}
5. ^{{cite book |last= Imielinski |first=T. | authorlink= Tomasz Imieliński | last2=Lipski |first2=W. |year=1982 |title=A systematic approach to relational database theory |journal= Proceedings of the 1982 ACM SIGMOD International Conference on Management of Data (SIGMOD '82) |publisher=ACM |location= New York, NY |pages=8–14 |doi= 10.1145/582353.582356|isbn=978-0897910736 }}
[4][5]
}}

External links

  • [https://weblogs.asp.net/scottgu/Tip_2F00_Trick_3A00_-Online-Database-Schema-Samples-Library Tip/Trick: Online Database Schema Samples Library]
  • [https://web.archive.org/web/20081217074637/http://msdn.microsoft.com/en-us/library/bb187299%28SQL.80%29.aspx Database Schema Samples]
  • [https://web.archive.org/web/20080828210315/http://ciobriefings.com/Publications/WhitePapers/DesigningtheStarSchemaDatabase/tabid/101/Default.aspx Designing the Star Schema Database]
{{DEFAULTSORT:Database Schema}}

2 : Data management|Data modeling

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 15:50:55