登陆注册
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.

同类推荐
  • 美国流行俚语

    美国流行俚语

    本书收录了约1500条美国流行俚语,例句选自现代英语报纸杂志、电影、电视、文学作品、网络等主流媒体。
  • 临时应急会话宝典

    临时应急会话宝典

    本书主要是为英语口语学习者准备的,以句子的形式表达各种情况。句子中包括了实用的词汇及短语。对于有相同说法的词语或句子,书中也做了说明。本书以主题划分,分为十大主题,主题以下又划分为具体的状况,比如:逛街购物时如何讨价还价,挑选衣服;面试找工作时,应聘者如何自我介绍,面试者如何提问;身在外国时需要去药店、去医院等等,涉及日常生活、工作、出国等方方面面,读者可以很轻松地找到应急的那句话。同时还配备MP3,让你听到原汁原味的英音。
  • 课外英语-异域风情录(双语版)

    课外英语-异域风情录(双语版)

    本册书带您了解异国他乡的风俗民情,便于同学们更好的阅读和理解,真正进入文字的内涵当中,准确地和文字进行交流。
  • 玩转生活英语

    玩转生活英语

    本书是一本涵盖日常生活的英语口语书籍。全书信息量丰富,趣味性强,适合不同英语阶段的学习者使用。本书在内容编排上为了帮助读者巩固和提高英语能力,专门设计了“跟我练”栏目,保证能活学活用。
  • 你值得拥有这美好的世界

    你值得拥有这美好的世界

    本书精选了世界最著名的旅行散文,关于大山、溪水、房东;关于冬雪、森林、松鼠;还有秋枫、野苹果和月亮。这些充满未知及探索美景的作品,细细品读,你能感受到每个地方在每个人生阶段的一段情,收获对生活和生命的思考与感悟。
热门推荐
  • 我要炸天道

    我要炸天道

    第一卷很水,可以跳过。从第19章起阅读,不影响剧情。无限流的空间,都不是什么好玩意儿,长着这么粗、这么长触手的天道空间更不可能是什么良善之辈。可我……也不是什么好人啊!那不是好人的我为什么要炸天道?等等,你不觉得章鱼烧很好吃么?正在进行中:武大郎的传奇(销)人生
  • 享用一生一世的恩赐

    享用一生一世的恩赐

    我有一个小小的想法,希望每个人的一生中。部能找到几本好书,与其终生相伴相依。这些书是先人赐予的、可以享用一生一世的恩赐,我们要以感恩的心来慢慢地读。请将这些书放在你的身边,当你的心受到伤害时,当你对生活失去希望时,当你感到寂寞孤独时,请翻开这些书。你没有必要一次读完,一个月也好。一年也好,即使用更长的时间也没有关系,因为这些是可以读一辈子的书。我们曾无数次地跟自己说:“有空的时候一定要慢慢地品、细细地读。”然而,我们却无法停下匆匆的脚步。在走过的路上我们丢失了许多东西,这些东西难道竟是那些支撑着我们的信仰吗?
  • 直播位面求生

    直播位面求生

    直播间版本:欢迎各位客官来到‘求生’直播间!我们这里有非常出色的直播资源,非常真实的求生直播!走过路过,千万不能错过!小说版本:这是描述一个作者,闲着无聊,挖了一个大坑,然后坑了一批求生者,最后必须要想方设法,在一年内弄死他们的‘死神来了’!弄不死?还有二周目噩梦级,以及三周目地狱级!
  • 读懂女人,看清男人

    读懂女人,看清男人

    两性关系是这个世界上最复杂的关系,它让围城内外的红男绿女们感到头疼。其实,只要掌握了对方得心理及情感需求,一切问题就能迎刃而解。为什么男人喜欢撒谎,为什么女人总是唠叨;为什么女人常常感叹“男人没一个好东西”,男人总觉得“女人都不好惹”,为什么男人好面子,女人喜欢攀比……难道男人和女人就真的不能和谐相处吗?《读懂女人看清男人》系统地讲述了现实生活中男女不同的情感需求,以及如何进行有效沟通、如何和平相处的秘诀。爱情需要保鲜,婚姻需要经营,通过对这些问题的深入探讨,让读者全面了解两性关系,从而能够愉悦相处,拥抱幸福人生。《读懂女人看清男人》由问道、孙亚兰编著。
  • 错惹七“弟”

    错惹七“弟”

    他,冷氏集团总裁,冷酷邪魅、俊美无俦、那夜酒里被人下了毒,他发现了七弟是娇美少女,从此对七弟夜夜索欢,兽宠无敌……她,冷氏集团七少,灵动可爱、俊俏无双、谁曾想那夜被他吻了,自己女孩儿的身份被发现,她变成了他的小白兔,夜夜痴缠。--情节虚构,请勿模仿
  • 天下尤物

    天下尤物

    三十三重天外天,白云深处有神仙,天外有座云中山,登山犹若难登天。天外世间如蝼蚁,蝼蚁憾树尚无力,如何能登天?是横是纵,蝼蚁已登山,登天有何难?
  • 升仙阶

    升仙阶

    “我这一生中,走过许多的‘升仙阶’。每走一次,都对我的人生产生了极大的影响……”“于队,别顾着瞎吹牛皮了,快点过来看看我们下次要做什么任务啊!”“好吧,我先去看看任务。有空再聊啊。”他重新戴上黑色兜帽,慢慢走远了。
  • 嗜血嫡女:痴女也轻狂

    嗜血嫡女:痴女也轻狂

    皓月九天!天动大陆!天地玄黄执掌乾坤,逆天改命命皆在手,强者如云的皓月大陆,她痴傻成性十四载,当终于神智归来时,却是家门被血洗小弟生死劫。十四岁那一年未婚夫上门嚣张休弃,“我堂堂天谕传人怎可要你痴女为妻,要怪就怪你自己痴傻怨不得人,”十四岁那一年她与小弟被抓,成为血祭奴,生死一线神智归,却终究难保家人全,一夜血洗她势要报仇。别人笑我痴,别人笑我傻,别人说我毒,别人说我阴,我只知辱我者,废之!伤我者,杀之!叛我者,十倍还之!害我全家者,满门灭之!
  • 钟氏侧妃

    钟氏侧妃

    皇室公主?将门嫡女?王府侧妃?她身份贵重,但也正因这份贵重才身不由己;琴棋书画?岐黄要术?绝世轻功?她身负绝技,但也正因这些绝技使她屡陷险境。王爷与侧妃的忠贞之恋,朝廷与江湖的自由切换。看娇柔侧妃如何与王爷笑傲官场,浪迹江湖!
  • 攻略反派大佬的三十六计

    攻略反派大佬的三十六计

    苏辞穿书了,穿进了自己闺蜜写的一本小说里,成为她吐槽的最多的那个恶毒女配苏辞,说实话,她在看这本书的时候会下意识的带入自己,然后……她就穿越了……穿越以后,她秉持着“小命要紧,远离男女主”的九字真言,躲得那是一个远远的,但为了自己的未来,她还是决定抱紧男二的大腿,向他发起了追求攻势……“高二七班厉言泽同学,承蒙关照咯!”看着眼前一束花的厉言泽,面无表情的从她身边走了过去,连衣袖都不带挥一下的。“……”被忽视的彻底的苏辞一点也不生气,没办法呀,谁让人家未来那么牛气呢,她忍。……在努力辛苦了不知道多少个日夜后,苏辞忍无可忍的把他堵在了厕所门边,单手挑起他的下巴,但声音却很委屈,“我都这么喜欢你了,表个态会死啊。”厉言泽看着眼前的这张脸,不知怎么的就叹了一口气,很轻很轻的说了一句,“说好的三十六,我还是做不到啊。”原来我在向你靠近的时候,你已经向我张开了双手。