數(shù)據(jù)庫(kù)管理系統(tǒng)簡(jiǎn)介(英文與譯文)
Introduction to DBMS
A database management system (DBMS) is an important type of programming system, used today on the biggest and the smallest computers.As for other major forms of system software, such as compilers and operating systems, a well-understood set of principles for database management systems has developed over the years, and these concepts are useful both for understanding how to use these systems effectively and for designing and implementing DBMS's. DBMS is a collection of programs that enables you to store, modify, and extract information from a database. There are many different types of DBMS's, ranging from small systems that run on personal computers to huge systems that run on mainframes. The following are the location of database between application programs and end-users.
There are two qualities that distinguish database management systems from other sorts of programming systems.
1) The ability to manage persistent data, and
2) The ability to access large amounts of data efficiently.
Point 1) merely states that there is a database which exists permanently; the contents of this database is the data that a DBMS accesses and manages. Point 2) distinguishes a DBMS from a file system, which also manages persistent data. A DBMS's capabilities are needed most when the amount of data is very large, because for small amounts of data, simple access techniques, such as linear scans of the data, are usually adequate.
While we regard the above two properties of a DBMS as fundamental, there are a number of other capabilities that are almost universally found in commercial DBMS's. These are:
Support for at least one data model, or mathematical abstraction through which the user can view the data.
Support for certain high-level languages that allow the user to define the structure of data, access data, and manipulate data.
Transaction management, the capability to provide correct, concurrent access to the database by many users at once.
Access control, the ability to limit access to data by unauthorized users, and the ability to check the validity of data.
Resiliency, the ability to recover from system failures without losing data.
Data Models Each DBMS provides at least one abstract model of data that allows the user to see information not as raw bits, but in more understandable terms. In fact, it is usually possible to see data at several levels of abstraction. At a relatively low level, a DBMS commonly allows us to visualize data as composed of files.
Efficient File Access The ability to store a file is not remarkable: the file system associated with any operating system does that. The capability of a DBMS is seen when we access the data of a file. For example, suppose we wish to find the manager of employee "Clark Kent". If the company has thousands of employees, It is very expensive to search the entire file to find the one with NAME="Clark Kent". A DBMS helps us to set up "index files," or "indices," that allow us to access the record for "Clark Kent" in essentially one stroke no matter how large the file is. Likewise, insertion of new records or deletion of old ones can be accomplished in time that is small and essentially constant, independent of the file’s length. Another thing a DBMS helps us do is navigate among files, that is, to combine values in two or more files to obtain the information we want.#p#
Query Languages To make access to files easier, a DBMS provides a query language, or data manipulation language, to express operations on files. Query languages differ in the level of detail they require of the user, with systems based on the relational data model generally requiring less detail than languages based on other models.
Transaction Management Another important capability of a DBMS is the ability to manage simultaneously large numbers of transactions, which are procedures operating on the database. Some databases are so large that they can only be useful if they are operated upon simultaneously by many computers: often these computers are dispersed around the country or the world. The database systems used by banks, accessed almost instantaneously by hundreds or thousands of automated teller machines (ATM), as well as by an equal or greater number of employees in the bank branches, is typical of this sort of database. An airline reservation system is another good example.
Sometimes, two accesses do not interfere with each other. For example, any number of transactions can be reading your bank balance at the same time, without any inconsistency. But if you are in the bank depositing your salary check at the exact instant your spouse is extracting money from an automatic teller, the result of the two transactions occurring simultaneously and without coordination is unpredictable. Thus, transactions that modify a data item must “l(fā)ock out” other transactions trying to read or write that item at the same time. A DBMS must therefore provide some form of concurrency control to prevent uncoordinated access to the same data item by more than one transaction.
Even more complex problems occur when the database is distributed over many different computer systems, perhaps with duplication of data to allow both faster local access and to protect against the destruction of data if one computer crashes.
Security of Data A DBMS must not only protect against loss of data when crashes occur, as we just mentioned, but it must prevent unauthorized access. For example, only users with a certain clearance should have access to the salary field of an employee file, and the DBMS must be able associate with the various users their privileges to see files, fields within files, or other subsets of the data in the database. Thus a DBMS must maintain a table telling for each user known to it, what access privileges the user has for each object. For example, one user may be allowed to read a file, but not to insert or delete data; another may not be allowed to see the file at all, while a third may be allowed to read or modify the file at will.
DBMS Types
Designers developed three different types of database structures: hierarchical, network, and relational. Hierarchical and network were first developed but relational has become dominant. While the relational design is dominant, the older databases have not been dropped. Companies that installed a hierarchical system such as IMS in the 1970s will be using and maintaining these databases for years to come even though new development is being done on relational systems. These older systems are often referred to as legacy systems.#p#
譯文:
DBMS簡(jiǎn)介
數(shù)據(jù)庫(kù)管理系統(tǒng)是編程系統(tǒng)中的重要的一種,現(xiàn)今可以用在最大的以及最小的電腦上。其他主要形式的系統(tǒng)軟件,比如說(shuō)匯編以及操作系統(tǒng),近些年來(lái)開(kāi)發(fā)出一系列容易理解的數(shù)據(jù)庫(kù)管理系統(tǒng)原則,并且這些概念既有助于理解如何有效利用系統(tǒng),又可以幫助設(shè)計(jì)和執(zhí)行DBMS系統(tǒng)。DBMS是一個(gè)程序的集合,它使你能夠存儲(chǔ)、修改以及從數(shù)據(jù)庫(kù)中提取信息。有很多種不同類型的DBMS系統(tǒng),從運(yùn)行在個(gè)人電腦上的小型系統(tǒng)到運(yùn)行在大型主機(jī)上的巨型系統(tǒng)。下圖是數(shù)據(jù)庫(kù)在應(yīng)用程序和終端用戶之間的位置。
DBMS的功能
有兩種功能使數(shù)據(jù)庫(kù)管理系統(tǒng)區(qū)別于其他設(shè)計(jì)系統(tǒng):
1)管理固有數(shù)據(jù)的能力,以及
2)高效訪問(wèn)大量數(shù)據(jù)的能力。
第一點(diǎn)只是表明現(xiàn)有一個(gè)固定存在的數(shù)據(jù)庫(kù);而這個(gè)數(shù)據(jù)庫(kù)的內(nèi)容也就是DBMS所要訪問(wèn)和管理的那些數(shù)據(jù)。第二點(diǎn)將DBMS和同樣能管理固有數(shù)據(jù)的文件系統(tǒng)區(qū)分開(kāi)來(lái)。通常在數(shù)據(jù)量非常大的時(shí)候才需要用到DBMS系統(tǒng)的功能,因?yàn)閷?duì)于小量數(shù)據(jù)而言,簡(jiǎn)單的訪問(wèn)技術(shù)(如對(duì)數(shù)據(jù)的線性掃描)就足夠了。
雖然我們將以上兩點(diǎn)作為DBMS的基本特性,但是其他一些功能也是在商業(yè)DBMS系統(tǒng)中常見(jiàn)的,它們是:
·支持至少一種用戶可以據(jù)之瀏覽數(shù)據(jù)的數(shù)據(jù)模式或數(shù)學(xué)提取方式。
·支持某種允許用戶用來(lái)定義數(shù)據(jù)的結(jié)構(gòu)、訪問(wèn)和操縱數(shù)據(jù)的高級(jí)語(yǔ)言。
·事務(wù)管理,即對(duì)多個(gè)用戶提供正確、同時(shí)訪問(wèn)數(shù)據(jù)庫(kù)的能力。
·訪問(wèn)控制,即限制未被授權(quán)用戶對(duì)數(shù)據(jù)的訪問(wèn)能力,以及檢測(cè)數(shù)據(jù)有效性的能力。
·恢復(fù)功能,即能夠從系統(tǒng)錯(cuò)誤中恢復(fù)過(guò)來(lái)而不丟失數(shù)據(jù)的能力。
數(shù)據(jù)模型 每個(gè)DBMS提供了至少一種允許用戶不是以原始比特位的方式,而是以更容易理解的術(shù)語(yǔ)來(lái)觀看信息的抽象數(shù)據(jù)模型。實(shí)際上,通常要觀察以幾個(gè)不同級(jí)別提取出來(lái)的數(shù)據(jù)是可能的。在相關(guān)的低級(jí)別中,DBMS一般允許我們將數(shù)據(jù)形象化為文件的組成部分。#p#
高效數(shù)據(jù)訪問(wèn) 存儲(chǔ)一個(gè)文件的能力并不特別:操作系統(tǒng)中結(jié)合的文件系統(tǒng)都能夠如此。DBMS的能力在我們?cè)L問(wèn)文件的數(shù)據(jù)時(shí)才能顯露出來(lái)。比如,假設(shè)我們希望找到員工經(jīng)理“克拉克·肯特”。如果這個(gè)公司有上萬(wàn)員工,則要通過(guò)NAME=“克拉克·肯特”搜索整個(gè)文件來(lái)找到這個(gè)人是非常費(fèi)時(shí)的。而DBMS幫助我們建立“索引文件”或“索引”,不管文件有多大,它都使我們能夠一舉訪問(wèn)到“克拉克·肯特”的記錄。同樣的,新記錄的插入或者原有記錄的刪除都可以在較短并且本質(zhì)上恒定的時(shí)間內(nèi)完成,而不依賴于文件的長(zhǎng)度。DBMS還可以幫助我們進(jìn)行文件間的導(dǎo)航,即,通過(guò)結(jié)合兩個(gè)或更多文件的值來(lái)獲得我們所需的信息。
查詢語(yǔ)言 為了使訪問(wèn)文件更容易,DBMS提供了查詢語(yǔ)言(或者說(shuō)數(shù)據(jù)控制語(yǔ)言)來(lái)表達(dá)對(duì)文件的操作。查詢語(yǔ)言對(duì)用戶所提供的細(xì)節(jié)的詳細(xì)程度要求有所不同,基于關(guān)系數(shù)據(jù)模型的系統(tǒng)通常比基于其他模型的系統(tǒng)所需的細(xì)節(jié)要少。
事務(wù)管理 DBMS的另外一項(xiàng)重要功能就是同時(shí)管理大量事務(wù)的能力。事務(wù)即是數(shù)據(jù)庫(kù)中運(yùn)行的進(jìn)程。某些數(shù)據(jù)庫(kù)是如此之大,它們只有在被多臺(tái)計(jì)算機(jī)同時(shí)操作時(shí)才有用武之地:通常這些計(jì)算機(jī)分散在全國(guó)甚至世界各地。銀行中使用的數(shù)據(jù)庫(kù)系統(tǒng)就是這類數(shù)據(jù)庫(kù)的一個(gè)典型,它們兒乎同時(shí)被成千上萬(wàn)的自動(dòng)取款機(jī)所訪問(wèn),也同時(shí)被同樣多甚至更多的支行員工所訪問(wèn)。機(jī)票預(yù)定系統(tǒng)是另一個(gè)好例子。
兩個(gè)訪問(wèn)不會(huì)互相打擾。舉個(gè)例了說(shuō),任意多的事務(wù)可以同時(shí)讀取你銀行的結(jié)余而不引起任何沖突。但是如果你正在銀行里查詢工資,與此同時(shí),你的愛(ài)人在一臺(tái)自動(dòng)取款機(jī)上取款,兩個(gè)事務(wù)同時(shí)發(fā)生且沒(méi)有彼此協(xié)調(diào),那你的查詢結(jié)果就很難說(shuō)了。因此,會(huì)引起數(shù)據(jù)項(xiàng)改變的事務(wù)必須“上鎖”,將其他在同一時(shí)刻試圖讀寫該項(xiàng)數(shù)據(jù)的事務(wù)關(guān)在外面。因此,DBMS必須提供某種并發(fā)控制狀態(tài)以阻止多個(gè)事務(wù)對(duì)于同一數(shù)據(jù)項(xiàng)的非協(xié)調(diào)訪問(wèn)。
更復(fù)雜的問(wèn)題發(fā)生在數(shù)據(jù)庫(kù)分布在許多不同計(jì)算機(jī)系統(tǒng)上的時(shí)候,它們多半使用數(shù)據(jù)副本來(lái)允許高速的本地訪問(wèn)以及避免由于某臺(tái)計(jì)算機(jī)崩潰而破壞數(shù)據(jù)。
數(shù)據(jù)安全 DBMS不只可以在計(jì)算機(jī)崩潰時(shí)保護(hù)數(shù)據(jù)不被丟失,正如上文提到的那樣,而且它還能夠阻止非法訪問(wèn)。比如,只有擁有特定權(quán)限的用戶可以訪問(wèn)職工文件的工資區(qū)域,DBMS還能結(jié)合不同用戶的權(quán)利來(lái)判定他們有權(quán)看到哪些文件,文件的哪些區(qū)域或者數(shù)據(jù)庫(kù)中數(shù)據(jù)的哪些子集。因此DBMS必須擁有一個(gè)表,表中給出每個(gè)用戶對(duì)于每個(gè)對(duì)象的訪問(wèn)權(quán)限。比如,某個(gè)用戶可能被允許讀取文件,但不能夠插入或刪除數(shù)據(jù);另一個(gè)用戶可能根本都不被允許看文件,而第三個(gè)用戶可能被允許讀取或隨意修改文件。
DBMS類型
設(shè)計(jì)人員開(kāi)發(fā)了三種不同類型的數(shù)據(jù)庫(kù)結(jié)構(gòu):層次數(shù)據(jù)庫(kù),網(wǎng)狀數(shù)據(jù)庫(kù)以及關(guān)系數(shù)據(jù)庫(kù)。層次數(shù)據(jù)庫(kù)和網(wǎng)狀數(shù)據(jù)庫(kù)是首先被開(kāi)發(fā)出來(lái)的,但關(guān)系數(shù)據(jù)庫(kù)己經(jīng)成為了主導(dǎo)數(shù)據(jù)模型。盡管關(guān)系數(shù)據(jù)庫(kù)的設(shè)計(jì)己經(jīng)成為主導(dǎo),但舊的數(shù)據(jù)庫(kù)也仍然沒(méi)有被拋棄。盡管關(guān)系數(shù)據(jù)庫(kù)不斷得到發(fā)展,但在20世紀(jì)70年代安裝了層次數(shù)據(jù)庫(kù)的一些公司,如IMS,在未來(lái)仍然將維持使用這些數(shù)據(jù)庫(kù)。這些舊的數(shù)據(jù)庫(kù)系統(tǒng)通常被稱作遺留系統(tǒng)。
【編輯推薦】