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

同类推荐
  • 国家负荷·国家电网科技创新实录:英文

    国家负荷·国家电网科技创新实录:英文

    《国家负荷:国家电网科技创新实录》反映了那些不断研究科技创新的电网科技精英们,那些持续探索技术革新的普通工人们,他们从来都只把饱满的激情投入到火热的工作中,他们不谈功,只说业。
  • 谜语绕口令英语

    谜语绕口令英语

    谜语和绕口令是英语文学中两种比较独特的语言艺术形式。前者既饶有情趣,又可以启发心智,增进思考和想像能力;后者结构巧妙,诙谐风趣,富有音乐性,最适合口头背诵,深受广大英语读者的喜爱。
  • 看古希腊神话故事学英语

    看古希腊神话故事学英语

    神话是远古人类思想与生活的反映,是原始信仰的产物。希腊神话故事经历了丰富的时代变迁和历史风云,几乎成为希腊乃至欧洲一切文学和艺术活动的基本素材。马克思曾说:“希腊神话不只是希腊艺术的宝库,而且是它的土壤”。希腊神话也是欧美文艺取之不尽的艺术源泉。希腊神话具有无穷的认识价值和永久的审美魅力。希腊神话还为现代奥林匹克运动会的形成奠定了基础。在古希腊这个神话王国中,优美动人的神话故事和曲折离奇的民间传说为古奥运会的起源蒙上一层神秘的色彩。那些经久不衰的神话故事让我们着迷,那些如雷贯耳的名字至今仍被我们尊为“大师”。时隔千年,希腊神话还对我们产生影响。
  • 汉译英翻译能力研究

    汉译英翻译能力研究

    本书绝无大而无当的空论,细节照顾得非常周到,从词语搭配、句法结构、语义结构,到审美篇章,乃至百科常识、专业背景,均在翻译能力的总框架下得到关照。作者还讨论了学界争论已久的教学翻译与翻译教学,也触及了翻译经验与翻译能力的关系等议题。本书可称得上是汉译英翻译能力研究领域的扛鼎之作。相信无论是理论研究领域的学者,还是教学前沿的教师,或是翻译专业的学生,都能从本书中各取所需,从中获益。
  • 理智与情感(纯爱·英文馆)

    理智与情感(纯爱·英文馆)

    《理智与情感》是简·奥斯丁富于幽默情趣的处女作。埃莉诺和玛丽安娜两姐妹生在一个英国乡绅家庭,姐姐善于用理智来控制情感,妹妹的情感却毫无节制,因此面对爱情时,她们作出了不同的反映……
热门推荐
  • 腊月十五

    腊月十五

    岁月亏欠的一直都是那些记忆力好,有偏偏念旧的人。很早想写下这个故事,但是每次都是欲言又止,最近每每想起心如刀绞。于是我冒着勇气去写下青葱时期人的坚持和爱的速朽的故事。
  • 穷人羊性 富人狼性2

    穷人羊性 富人狼性2

    穷人与富人之间的差异在哪儿。穷人与富人的理念、行为、眼光、命理、人脉、知识、目标、机遇、财富有何不同。穷人为什么像羊一样生活得很凄惨,而富人却似狼,他们随心所欲地做着自己喜欢做的事。富人有着辉煌的事业,穷人却勉强糊口。
  • 莎士比亚戏剧故事集

    莎士比亚戏剧故事集

    本书是英国兰姆姐弟改写的莎士比亚的戏剧故事,基本囊括了莎翁著名的悲剧和喜剧,例如《无事生非》《麦克白》《罗密欧与朱丽叶》《仲夏夜之梦》《威尼斯商人》《第十二夜》等。全书是把原著的精华和神韵,以浅显易懂的故事叙述方式向青少年读者呈现。出版以来,成为除莎士比亚全集以外,全世界最畅销的莎士比亚主题作品。
  • 星际少年游

    星际少年游

    地球已经进入超文明混乱时代,异能强者叶晗在一次任务时打碎了星际罪犯手里的核心能量魔方,能量倾泻打开了一个微型虫洞将叶晗吸了进去。空间跳跃,阴差阳错叶晗竟然变回了十二岁的模样,罪犯也逃了。叶晗在这无垠的宇宙中继续追猎着罪犯,慢慢发现天大的阴谋,迷雾一层一层的揭开……Ps.书友交流扣扣群【974972157】书名改了一下
  • 追妻无门:女boss不好惹

    追妻无门:女boss不好惹

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

    我的文明帝国

    带着文明空间穿越异界,游戏、动漫电影、小说等无数个世界,无数种超凡职业被召唤出来,成就最强文明帝国!这个世界、这个世界还有这个世界,都由我统治了。
  • 暗害

    暗害

    他来了,怀着豪赌的心情,带着复仇的烈焰,义无反顾地来了。虽然是初春时节,但对于东北的林区来说还十分的寒冷。这是一个不太陡峭的山坡,长满着成片的森林,主要有杠树、椴树,还有白桦、红桦和红杉松之类,密密麻麻,很笔直地矗立在那里。树木的颜色已经开始反青,有了一种明显的嫩绿气息。枝条上隐隐约约地,有殷红的雀舌大小的嫩芽儿探头探脑地长了出来。树根下面堆积着厚厚的枯黄的树叶,踩上去松软而富有弹性,有如质量上乘的栽绒地毯,上面还残留着一坨坨、一片片的积雪,脏兮兮地反着青光,正在吱吱地融化着。
  • 鸾天下

    鸾天下

    去年今日此门中,人面桃花相映红,人面不知何处去,桃花依旧笑春……京城第一才女与书生殉情了,此事闹的京城里沸沸扬扬,不料等她醒来,爱的至死不渝的那人与某女相好,她从此身败名裂,无人敢娶。王爷的宴请偷溜出来,夜黑风高,被人带去河边赏月。此人脑子有毛病,城中的高楼不选,偏偏跑这大槐树上赏什么月,这儿是风又大,天又黑,二月的天气,夜晚能冻死个人,喝西北风还差不多。那人却道:“月上枝头,美人为伴,这才叫赏月。”那人自称秦昙公子……长平伯府的公子沈澜月斯斯文文的,他是京城第一才子,一手《望兰图》被世人敬仰,称为经典之作。两人一见如故,说起美食,还十分的投缘……
  • 爱的预兆

    爱的预兆

    所有的故事都来源于真实的生活,我的故事来源于我的生活,可究竟哪些是真实发生过的,哪些是在层层的追忆中被改写,被虚拟过的,我已分不清——也许就像一句诗一样,“此情可待成追忆”,当微风轻拂封尘的往事,这关于纯真年代的一点点纯真的事,又有谁会在乎真假呢?
  • 我从死亡中归来

    我从死亡中归来

    宇宙面临危机,而在一次宇宙战争中所有高级文明覆灭殆尽,如今宇宙中最高级的文明只有地球文明,宇宙神明会用什么方式选拔拯救者呢...