登陆注册
3765300000022

第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.

同类推荐
  • 月亮和六便士:THE MOON AND SIXPENCE(英文版)

    月亮和六便士:THE MOON AND SIXPENCE(英文版)

    《月亮和六便士》是英国小说家威廉·萨默赛特·毛姆的创作的长篇小说,作品以法国印象派画家保罗·高更的生平为素材,描述了一个原本平凡的伦敦证券经纪人思特里克兰德,不惑之年,本来事业有成,家庭和睦,子女双全,但是为了追求自己内心的绘画梦想,抛妻弃子,离家跑到巴黎开始画画。最后去到了一座孤岛—塔希提岛,找到了自己的“归宿”,并创作了许许多多的惊世杰作,完成了自己对“月亮”的追逐。
  • 汤姆叔叔的小屋(英文版)

    汤姆叔叔的小屋(英文版)

    《汤姆叔叔的小屋》,19世纪极具影响力的小说(其销量仅次于《圣经》),并被认为是刺激1850年废奴主义兴起的一大因素。在其发表的头一年里,仅美国本土便销售出了三十多万册,这在19世纪中叶可是天文数字。《汤姆叔叔的小屋》对美国社会的影响如此巨大,以致在南北战争爆发的初期,当林肯接见斯托夫人时,曾说到:“你就是那位引发了一场大战的小妇人。”后来,这句话为众多作家竞相引用。
  • 说出日本人的每一天:日语会话4000句

    说出日本人的每一天:日语会话4000句

    本书共分13个单元,涵盖工作、学习和生活中的方方面面,根据不同主题中的关键词衍生出4000句日语会话,内容丰富实用且新颖,语言生动形象且地道。因为每句会话都有其关键词,所以读者可以通过关键词快速方便地检索到所需要的词句,并通过关键词进行记忆,在阅读本书的过程中同时提升词汇量和会话能力,日语能力也得以短时间内突飞猛进。
  • 英文疑难详解续篇

    英文疑难详解续篇

    本书作为《英文疑难详解》一书的续篇,延续使用问答模式,对名词、代名词、形容词副词、动词、助动词、准动词、连词、介词、成语、文句、中英不同的表现法、字句研究及辨异、发音、标点14大项150个英语疑难问题进行了详细解答。这部续篇更加注重对语言问题进行社会历史文化解析,同时也补充了《英文疑难详解》中缺乏的“发音”、“标点”等容易忽视的问题,使得这套疑难详解内容更加丰富完整。
  • 刀锋(双语译林)

    刀锋(双语译林)

    《刀锋》是英国作家毛姆的长篇小说代表作。书中讲述美国青年拉里因为好友在战争中猝然死亡,而开始向自己的内心展开深刻的追问:既然世间有善,为何恶亦相生?战后,拉里在故乡感受着美国建设一个“宏伟而繁荣的时代”的热潮,却难以置身其间。他执拗地要寻求心中那个让他难以割舍的疑问。他在书籍中发掘,在静思中梳理。为此,他几乎投入了自己全部的精力与热情,甚至解除了与恋人伊莎贝尔的婚约。之后远遁法国,再后,开始周游世界。在印度,他从东方的《奥义书》踏上了心灵自我完善之路。
热门推荐
  • 购物小窍门

    购物小窍门

    日常购物中的小窍门。米面油料的选购米质量辨别优质的大米颗粒整齐,富有光泽,比较干燥,无米虫,无沙粒,米灰极少,碎米极少,闻之有股清香味,无霉变味。
  • 铁血冷娃

    铁血冷娃

    1937年7月7日,侵华日军发动了“芦沟桥事变”,抗日战争全面爆发。日军闪电般攻城略地,大片国土相继沦丧。随着山西各主要关隘先后失守,中条山的战略地位就显得愈加重要。中条山位于山西南部、黄河北岸,横宽170公里,纵深50公里,与太行、吕梁、太岳互为犄角,自古为兵家必争之地。踞之,我军可俯瞰豫北、晋南,进则可直插敌后;退则可踞险而守,屏蔽洛阳、潼关;失之,日军则可占据此要地,渡河南下,图我陇海,侵我中原,进逼陕甘。因而,中条山地区被视为抗日战争时期“关系国家安危之要地”。
  • 诗境浅说

    诗境浅说

    《诗境浅说》是近代诗词大家俞陛云先生创作的古诗赏析入门读物。《诗境浅说》包括《诗境浅说》《诗境浅说续编》两个部分,是俞陛云先生为教育家中儿女学习古典诗歌选编的诗歌启蒙读物。《诗境浅说》收录了王勃、骆宾王、李白、杜甫、王维、孟浩然、白居易、李商隐等100多位诗人的400余首诗歌及诗歌摘句,并加以阐释点评,意在启发诗歌初学者领略诗歌的声调格律、字法句法之美。文字浅近纯正,点评阐幽发微,是学诗、读诗的指路之书。
  • 战神联盟与墨音双子

    战神联盟与墨音双子

    俩吃土少女我呸俩智障儿童的穿越之旅哈哈嗝~认真介绍什么的不存在啦!(坐等打脸……灵墨表示:有个闲得蛋疼瞎布置任务又没什么奖励的系统真特么是老子倒了八辈子的霉。言墨表示:每次搞完事想咸鱼是却又被莫名其妙下了任务的灵墨总会去做那些作得一手好死的任务,作为她朋友我是真心累。某系统:怪我咯╮( ̄▽ ̄)╭
  • 十楼d座

    十楼d座

    阿舍,女,原名杨咏,维吾尔族,1971年生,新疆尉犁人,西北第二民族学院毕业。银川文学院签约作家。出版长篇历史小说《乌孙》。散文《小席走了》获2004年第五届“PSI—新语丝”网络文学一等奖;散文《山鬼》获2011年《民族文学》年度奖。
  • 从今往后我是你的

    从今往后我是你的

    她经历了人生最低谷,哭得撕心裂肺,痛不欲生。他看到这样的她心很痛。他下意识地去牵住她的手,把她拉入怀中。那是他第一次抱主动抱一个人。“今后我就是你的了,你让我做什么我都愿意。”这是她说的,“或者,以身相许,也可以啊。”看着她眉开眼笑,他不知道她是否在开玩笑。反正,他当真了。可.....他还是让她受伤了。只是那晚之后,他就消失了,她身边的位置空了,她总感觉自己一个人迷失了方向。整整四年!他已是站在舞台上火遍全国的偶像歌手,所有的灯光打在他身上,他依然帅气,依然是她放不下的人。他就是那颗最亮的星,而她什么都不是,只能抬头仰望着他。时隔四年,说狠话,拥抱,助理.....“钱我会还给你的。”“做我的私人助理,听我的。”而今后,你我是彼此的。
  • 追妻无门:女boss不好惹

    追妻无门:女boss不好惹

    青涩蜕变,如今她是能独当一面的女boss,爱了冷泽聿七年,也同样花了七年时间去忘记他。以为是陌路,他突然向他表白,扬言要娶她,她只当他是脑子抽风,他的殷勤她也全都无视。他帮她查她父母的死因,赶走身边情敌,解释当初拒绝她的告别,和故意对她冷漠都是无奈之举。突然爆出她父母的死居然和冷家有丝毫联系,还莫名跳出个公爵未婚夫,扬言要与她履行婚约。峰回路转,破镜还能重圆吗? PS:我又开新文了,每逢假期必书荒,新文《有你的世界遇到爱》,喜欢我的文的朋友可以来看看,这是重生类现言,对这个题材感兴趣的一定要收藏起来。
  • 三个白力森

    三个白力森

    一九七四年秋天,中年白力森是个半边户,一家人只有他一个人吃商品粮。在矿务局像他这样的工人很多,多到有百分之五十。那时代,露天矿务局还是一个很好的单位,很多人因在这儿上班而自豪。白力森的木板房,是他在工地上搬了近两月的木板才搭起来的家。白力森搭好房子后就写信给乡下的老婆桂花,让她带上孩子来到矿上。白力森因此搬出了三个工人挤在一屋的职工单身楼,在职工楼边有了自己的家。当时,矿务局上班的工人百分之八十都是半边户,也就是亦工亦农。
  • 摄政王的毒妃

    摄政王的毒妃

    一旨废后诏书,一场漫天大火,她葬于黄泉,却死不瞑目!转世重生!平静的水眸下,是隐匿的智慧与惊天的博学!锦绣江山,笑看云起!妙手回春,救百姓于水火!一朝重入宫门,咫尺朝堂,恍若云烟。妾生君未生,君生妾已老妾离君天涯,君隔妾海角!--情节虚构,请勿模仿
  • 战后日本人的战争责任认识研究

    战后日本人的战争责任认识研究

    战后日本人的战争责任认识纷繁复杂,且动态多变。即使战后日本某一社会阶层,或同一阶层不同社会集团的战争责任认识,也有相当大的差异和变化。甚至同一个日本人在不同时期、不同场合,其战争责任认识也不尽相同。为总体把握战后日本人的战争责任认识的概貌和特征,本书以战后日本天皇、政府、保守派、进步派、普通民众的战争责任认识的连续性为“经”,以其因应国内外时局的阶段性为“纬”,重点阐述他们从战后至今的战争责任认识变迁史,探寻日本人的战争责任认识与中日历史认识问题的症结关系,从而增进彼此了解,加强中日互信,消除影响东亚和平、稳定与繁荣的思想障碍和历史因素。