登陆注册
27082000000022

第22章 Database System(1)

4.1 An Introduction of Database

A database-management system (DBMS) consists of a collection of interrelated data and a set of programs to access those data. The collection of data, usually referred to as the database, contains information about one particular enterprise. The primary goal of a DBMS is to provide an environment that is both convenient and efficient to use in retrieving and storing database information.

Database systems are designed to manage large bodies of information. The management of data involves both the definition of structures for the storage of information and the provision of mechanisms for the manipulation of information. In addition, the database system must provide for the safety of the information stored, despite system crashes or attempts at unauthorized access. If data are to be shared among several users, the system must avoid possible anomalous results. The importance of information in most organizations,which determines the value of the database—has led to the development of a large body of concepts and techniques for the efficient management of data.

The storage structure and access methods used by the database system are specified by a set of definitions in a special of DDL called a data storage and definition language? The result of compilation of these definitions is a set of instructions to specify the implementation details of the database schemas--details are usually hidden from the users. A database schema is also specified by DDL. Tile result of compilation of DDL statements is a set of tables that is stored in a special file called data dictionary, or data directory. A data dictionary is a file that contains metadata--that is, data about data. This file is consulted before actual data are read or modified in the database system.

Transaction Management

A transaction is a collection of operations that performs a single logical function in a database application. Each transaction is a unit of both atomicity and consistency. Thus, we require that transactions do not violate any database-consistency constraints. That is, if the database was consistent when a transaction started, the database must be consistent when the transaction successfully terminates. However, during the execution of a transaction, it may be necessary temporarily to allow inconsistency. This temporary inconsistency, although necessary, may lead to difficulty if a failure occurs.

It is the responsibility of the programmer to define properly the various transactions, such that each preserves the consistency of the database. For example, the transactions to transfer funds from account A to account B could be defined to be composed of two separate programs: one that debits account A, and another that credits account B. The execution of these two programs one after the other will indeed preserve consistency. However, each program by itself does not transform the database from a consistent state to a new consistent state. Thus, those programs are not transactions.

Ensuring the atomicity and durability properties is the responsibility of the database system itself——specifically, of the transaction management component. In the absence of failures, all transactions complete successfully, and atomicity is achieved easily. However, due to various types of failure, a transaction may not always complete its execution successfully. If we are to ensure the atomicity property, a failed transaction must have no effect on the state of the database. Thus, the database must be restored to the state in which it was before the transaction in question started executing. It is the responsibility of the database system to detect system failures and to restore the database to a state that existed prior to the occurrence of the failure.

Storage Management

Database typically requires a large amount of storage space. Corporate databases are usually measured in terms of gigabytes or, for the largest databases, terabytes of data. A gigabyte is 1000 megabytes or 1 billion bytes, and a terabyte is 1 million megabytes (1 trillion bytes). Since the main memory of computers cannot store this much information, the information is stored on disks. Data are moved between disk storage and main memory as needed. Since the movement of data to and from disk is slow relative to the speed of the central processing unit, it is imperative that the database system structures the data so as to minimize the need to move data between disk and main memory.

The goal of a database system is to simplify and facilitate access to data.;High-level views help to achieve this goal. Users of tile system should not be burdened unnecessarily with the physical details of the implementation of the system. Nevertheless, a major factor in a user's satisfaction or lack thereof with a database system is that system's performance. If the response time for a request is too long, the value of the system is diminished. The performance of a system depends on what the efficiency is of the data structures used to represent tile data in the database, and on how efficiently the system is able to operate on these data structures. As is the case elsewhere in computer systems, a tradeoff must be made not only between space and time, but also between the efficiency of one kind of operation and that of another.

A storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible for the interaction with the file manager. The raw data are stored on the disk using the file system, which is usually provided by a conventional operating system. The storage manager translates the various DML statements into low-level file system commands. Thus, the storage manager is responsible for storing, retrieving, and updating of data in the database.

同类推荐
  • 课外英语-美国各州小知识(八)(双语版)

    课外英语-美国各州小知识(八)(双语版)

    本套书共50册,分为美国各州的小知识,七彩缤纷的音符,优美好看的小散文,开心时分的短文,经典流传的寓言,超级高效的短句,实际有用的词汇等等在这些书中,备有单词解释,相关简介,或中文翻译,便于同学们更好的阅读和理解,真正进入文字的内涵当中,准确地和文字进行交流。主要介绍新罕布什尔州、新泽西州、新墨西哥州和纽约州的概况、州长、州鸟、州花、州旗、州歌以及相关资料,附有话里话外部分,主要介绍美国人服装、饮食和景点。
  • Sense and sensibility(理智与情感)(英文版)

    Sense and sensibility(理智与情感)(英文版)

    小说的情节围绕着两位女主人公的择偶活动展开,着力揭示出当时英国社会潮流中,以婚配作为女子寻求经济保障、提高社会地位的恶习,重门第而不顾女子感情和做人权利的丑陋时尚。小说中的女主角均追求与男子思想感情的平等交流与沟通,要求社会地位上的平等权利,坚持独立观察、分析和选择男子的自由。在当时的英国,这几乎无异于反抗的呐喊。
  • 红字:The Scarlet Letter(英文朗读版)

    红字:The Scarlet Letter(英文朗读版)

    There could not be a more perfect work of the American imagination than The Scarlet Letter.— D. H. Lawrence "It is beautiful, admirable, extraordinary; it has in the highest degree that merit which I have spoken of as the mark of Hawthorne's best things—an indefinable purity and lightness of conception... One can often return to it; it supports familiarity and has the inexhaustible charm and mystery of great works of art."— Henry JamesThe Scarlet Letter is a work of historical fiction by American author Nathaniel Hawthorne, published in 1850, and was an instant best-seller. It is also one of the first mass-produced books in nuoha.vip in Puritan Massachusetts Bay Colony during the years 1642 to 1649, the novel tells the story of Hester Prynne who conceives a daughter through an affair and then struggles to create a new life of repentance and dignity. The book explores themes of legalism, sin, and nuoha.vip Scarlet Letter was one of the first mass-produced books in
  • 课外英语-美国各州小知识(四)(双语版)

    课外英语-美国各州小知识(四)(双语版)

    全书共50册,分为美国各州的小知识,七彩缤纷的音符,优美好看的小散文,开心时分的短文,经典流传的寓言,超级高效的短句,实际有用的词汇等等在这些书中,备有单词解释,相关简介,或中文翻译,便于同学们更好的阅读和理解,真正进入文字的内涵当中,准确地和文字进行交流。本册主要介绍加州、科罗拉多州、肯塔基州和路易斯安那州的概况、州长、州鸟、州花、州旗、州歌以及相关资料,附有话里话外部分,主要介绍美国公园和美国科学家。
  • 英语词汇常见错误例解

    英语词汇常见错误例解

    英语已成为一种国际性的语言,在我国英语学习者也日益增多,特别是在高等院校英语作为一种必修课程,广大师生投入了大量的时间和精力来完成这门课程的教学和学习任务。在近三十年英语教学实践中,我们常看到许多学生在英语词汇运用过程中出现这样或那样的错误,表现在词性不明,词义不清,固定搭配不当以及英语习惯用法不符等。如果我们能及时帮助他们改正这些错误,从而使他们的英语水平得到进一步提高,这就是编写本书的目的所在。
热门推荐
  • 被遗落在时光深处的他

    被遗落在时光深处的他

    十八岁,她遇到了转学而来的他,少年清秀俊雅,迷惑了少女的心。后来母亲告诉她,你俩的婚事是出生之前就已经定下来的,以玉为证。她和他脖子上都戴着一块翡翠玉蝴蝶,当做是信物。因为一桩陈年旧事,她被囚禁疯了,他被追杀,大难不死。他卷土重来娶她为妻,她却因误会恨他到痛不欲生.......
  • 少女死神有点狠

    少女死神有点狠

    原本,世界的死神都是经过天道选拔后,伴随着气运而生的男子。但这一届的死神,她不一样!不仅是个女孩子,还是自己吸纳天地灵气衍生的!懵懵懂懂,但是狠的一批。地狱每天都有数以千计的新魂进入,大大加重了地狱的工作量!冥王无法了,只能求助于天道!冥王:您管管她啊!啥也不知道,就知道每天搞死这么多人,地狱都要塞不下了!知不知道为了给这些灵魂安排投胎,他们已经累病好几个鬼差了!天道无法,只能先将新任死神投到小世界历练,希望她能学会做个合格的死神。但没想到,这一去,那叫一个鸡飞狗跳、鸡犬不宁…【本文1v1,甜宠文,剧情考究党慎入......】
  • 是爱呢

    是爱呢

    根据自己的记忆回忆写的故事,我的日记一样的存在。早就想写,但是很懒,不过又想着不写以后总会忘的。大概的构思就是分小学,初中,高中三个阶段来回忆。人物比较多,而且是会有狗血剧情,现在回想起来都觉得好笑。感情线比较多,不过只能说我爱学习的心比较坚定,哈哈哈。看完或许还有人想说我是白莲花,承认自己情商低,哈哈。
  • 无限赘婿

    无限赘婿

    古镜,地府最强勾魂使者,连大罗金仙都的魂魄都敢勾走,阎王为此头痛,送他轮回系统,骗他回到人界,附身在一个被人打死的赘婿身上!
  • 驭兽天下:狂宠绝色魔妃

    驭兽天下:狂宠绝色魔妃

    她本是修灵天赋冠绝天下的女尊,魂穿异界,回到被割喉而死的前世身上。新身份是没有灵脉,不能修炼的废物女?笑话!介子空间秘法、阵图、神器大把的她想说:你全家才是废物!帝释萱:四国皇裔,青络灵女,所谓天才看本皇不爽?夺了你司掌的神器,抢走你看中的圣兽,哔哔啥,有本事抢回去啊!六大圣地,界外妖域嚣张霸道?拿太古传承压死你们!十尾:吾主之下,除那几只想当本狐男主人的妖孽,余者皆是渣渣~驭圣兽掌神器,携紫脉动宸星,二十万年轮转,归来此界是我!
  • 时光书中的咖啡屋

    时光书中的咖啡屋

    忘川行,魂幽幽。地之底,天之头。血未灭,世无休。时光开,复混沌。破三戒,唯永生。有一个传说,僵尸是亘古之时,有人抱着最深的怨恨,跳入血池浴咒而生。本着世间万物“相生相克”的道理,血池里应运而生了一把斩幽冥的“忘川剑”,三界六行内外,神魔鬼怪无一不被其所克。但是传说总归是传说,没人知道血池在哪里,自然也不会有人见过那把忘川剑……
  • 校花之最强尊者

    校花之最强尊者

    在襁褓中时,他的家族就被灭门,在逃脱的路上,救他的人意外被一块石壁吸入而穿越到现代都市,长大后的他受命来到花都,从此之后,校花,萝莉,御女,俏护士统统融入怀抱,随而一切的纷争和杀戮也伴随在他身边,随着他一步步的强大,一群修真者也浮出水面。
  • 天行

    天行

    号称“北辰骑神”的天才玩家以自创的“牧马冲锋流”战术击败了国服第一弓手北冥雪,被誉为天纵战榜第一骑士的他,却受到小人排挤,最终离开了效力已久的银狐俱乐部。是沉沦,还是再次崛起?恰逢其时,月恒集团第四款游戏“天行”正式上线,虚拟世界再起风云!
  • 只对她无计可施

    只对她无计可施

    分开多年后,喻嫣回国继承家业,却意外在拍卖会上看见陆承屹。他冷漠的神情中隐藏着恨意,喻嫣不以为意。一去多年,当年那个穷小子翻身成了商界大佬,与喻氏集团平起平坐。他百般刁难,她步步为营。–喻嫣追陆承屹的时候,特意定制了一件印有陆承屹照片的T恤。陆承屹只看了一眼,丢下一句不知廉耻就离开了。可陆承屹自己没想到,这个不知廉耻的女孩在往后的年月里,成了他的肉中刺,他的朱砂痣。–新书《娘娘没有求生欲》求收藏!谈起尉迟渊,帝京人人都知道他温润如玉,不近女色。爱慕他的女子成百上千,却没有一个能入他的眼。后来,百姓看见他抱着一位女子在街上走。那女子额间一点朱砂痣,美艳动人。帝京女子见此大多不屑——不过是个太医之女,没家世没才华,殿下不可能真的喜欢她……——空有美貌的花瓶,殿下肯定是玩玩而已……没有人相信尉迟渊会动心。可是成亲那晚,叶璟禾看见他那双原本如山泉寒雪般清冷的眼睛浸染透了情·欲,他吻上她的耳垂,在她耳边轻声唤她:"娇娇……"叶璟禾知道,他动心了……那一刻,叶璟禾也有一瞬间的晃神,但她告诉自己,别陷进去,她是敌国细作,她还有未完成的任务……
  • 邪王宠妻:废材公主要逆天

    邪王宠妻:废材公主要逆天

    她,21世纪的雪皇一夕穿越到灵狐族最受宠的公主身上,废材是吗?看她如何逆苍天。呆萌灵宠,绝世药鼎在手还怕打不过,她上天入地,刀山火海任她闯可翩翩栽在了某位王爷身上,他邪魅一笑:灵儿,明天我们就成亲好吗?灵儿:......谁告诉我摊上了个怎样的无赖。