Chapter Summary
n Concurrency control is the process of managing simultaneous operations on the database without having
them interfere with one another. Database recovery is the process of restoring the database to a correct state
after a failure. Both protect the database from inconsistencies and data loss.
n A transaction is an action, or series of actions, carried out by a single user or application program, which
accesses or changes the contents of the database. A transaction is a logical unit of work that takes the database
from one consistent state to another. Transactions can terminate successfully (commit) or unsuccessfully
(abort). Aborted transactions must be undone or rolled back. The transaction is also the unit of concurrency
and the unit of recovery.
n A transaction should possess the four basic, or so-called ACID, properties: atomicity, consistency, isolation,
and durability. Atomicity and durability are the responsibility of the recovery subsystem; isolation and, to
some extent, consistency are the responsibility of the concurrency control subsystem.
n Concurrency control is needed when multiple users are allowed to access the database simultaneously.
Without it, problems of lost update, uncommitted dependency, and inconsistent analysis can arise. Serial
execution means executing one transaction at a time, with no interleaving of operations. A schedule shows
the sequence of the operations of transactions. A schedule is serializable if it produces the same results as
some serial schedule.
n Two methods that guarantee serializability are two-phase locking (2PL) and timestamping. Locks may be
shared (read) or exclusive (write). In two-phase locking, a transaction acquires all its locks before releasing
any. With timestamping, transactions are ordered in such a way that older transactions get priority in the
event of conflict.
n Deadlock occurs when two or more transactions are waiting to access data the other transaction has locked.
The only way to break deadlock once it has occurred is to abort one or more of the transactions.
n A tree may be used to represent the granularity of locks in a system that allows locking of data items of
different sizes. When an item is locked, all its descendants are also locked. When a new transaction requests
a lock, it is easy to check all the ancestors of the object to determine whether they are already locked. To show
whether any of the node’s descendants are locked, an intention lock is placed on all the ancestors of any node
being locked.
n Some causes of failure are system crashes, media failures, application software errors, carelessness, natural
physical disasters, and sabotage. These failures can result in the loss of main memory and/or the disk copy of
the database. Recovery techniques minimize these effects.
n To facilitate recovery, one method is for the system to maintain a log file containing transaction records that
identify the start/end of transactions and the before- and after-images of the write operations. Using deferred
updates, writes are done initially to the log only and the log records are used to perform actual updates to the
database. If the system fails, it examines the log to determine which transactions it needs to redo, but there is
Chapter Summary
n Concurrency control is the process of managing simultaneous operations on the database without having
them interfere with one another. Database recovery is the process of restoring the database to a correct state
after a failure. Both protect the database from inconsistencies and data loss.
n A transaction is an action, or series of actions, carried out by a single user or application program, which
accesses or changes the contents of the database. A transaction is a logical unit of work that takes the database
from one consistent state to another. Transactions can terminate successfully (commit) or unsuccessfully
(abort). Aborted transactions must be undone or rolled back. The transaction is also the unit of concurrency
and the unit of recovery.
n A transaction should possess the four basic, or so-called ACID, properties: atomicity, consistency, isolation,
and durability. Atomicity and durability are the responsibility of the recovery subsystem; isolation and, to
some extent, consistency are the responsibility of the concurrency control subsystem.
n Concurrency control is needed when multiple users are allowed to access the database simultaneously.
Without it, problems of lost update, uncommitted dependency, and inconsistent analysis can arise. Serial
execution means executing one transaction at a time, with no interleaving of operations. A schedule shows
the sequence of the operations of transactions. A schedule is serializable if it produces the same results as
some serial schedule.
n Two methods that guarantee serializability are two-phase locking (2PL) and timestamping. Locks may be
shared (read) or exclusive (write). In two-phase locking, a transaction acquires all its locks before releasing
any. With timestamping, transactions are ordered in such a way that older transactions get priority in the
event of conflict.
n Deadlock occurs when two or more transactions are waiting to access data the other transaction has locked.
The only way to break deadlock once it has occurred is to abort one or more of the transactions.
n A tree may be used to represent the granularity of locks in a system that allows locking of data items of
different sizes. When an item is locked, all its descendants are also locked. When a new transaction requests
a lock, it is easy to check all the ancestors of the object to determine whether they are already locked. To show
whether any of the node’s descendants are locked, an intention lock is placed on all the ancestors of any node
being locked.
n Some causes of failure are system crashes, media failures, application software errors, carelessness, natural
physical disasters, and sabotage. These failures can result in the loss of main memory and/or the disk copy of
the database. Recovery techniques minimize these effects.
n To facilitate recovery, one method is for the system to maintain a log file containing transaction records that
identify the start/end of transactions and the before- and after-images of the write operations. Using deferred
updates, writes are done initially to the log only and the log records are used to perform actual updates to the
database. If the system fails, it examines the log to determine which transactions it needs to redo, but there is
การแปล กรุณารอสักครู่..
สรุปบทที่ n การควบคุมพร้อมกัน คือ กระบวนการของการจัดการที่มีการดำเนินการในฐานข้อมูลโดยไม่มี
มันรบกวนคนอื่น กู้คืนฐานข้อมูลเป็นกระบวนการของการเรียกคืนฐานข้อมูลเพื่อ
รัฐถูกต้องหลังจากความล้มเหลว ทั้งปกป้องฐานข้อมูล จากความไม่สอดคล้องกันและการสูญหายของข้อมูล .
n ธุรกรรม การกระทำ หรือชุดของการกระทำที่ดำเนินการโดยผู้ใช้เดียวหรือโปรแกรมซึ่ง
เข้าถึงหรือการเปลี่ยนแปลงเนื้อหาของฐานข้อมูล ธุรกรรมเป็นตรรกะหน่วยงานที่ใช้ฐานข้อมูล
จากสอดคล้องรัฐอื่น การทำธุรกรรมสามารถยกเลิกเรียบร้อยแล้ว ( ผูกมัด ) หรือ 4
( ยกเลิก ) รายการถูกยกเลิกต้องยกเลิกหรือย้อนกลับ รายการยังเป็นหน่วยของการ
และหน่วยของการกู้คืน .
n รายการควรมีพื้นฐานสี่ , หรือที่เรียกว่า กรด คุณสมบัติ : ปรมาณู , ความสอดคล้อง , แยก ,
และความทนทาน ปรมาณูและความทนทานเป็นความรับผิดชอบของการกู้คืนระบบ ; การแยกและ
บางส่วน โดยมีความรับผิดชอบของการควบคุมระบบ .
- ควบคุมการใช้เมื่อผู้ใช้หลายคนสามารถเข้าถึงฐานข้อมูลพร้อมกัน
ไม่มี ปัญหาหายไปปรับปรุงไม่ได้ผูกมัดการพึ่งพา และการวิเคราะห์ที่ไม่สอดคล้องกัน อาจเกิดขึ้นได้ หมายถึงการประหารอนุกรม
ธุรกรรมหนึ่งที่เวลาไม่มี interleaving การดําเนินงาน ตารางแสดงลำดับของการดำเนินงานของ
รายการตารางเป็น serializable ถ้ามันก่อให้เกิดผลลัพธ์เดียวกัน
n บางอนุกรมตาราง สองวิธีที่ serializability รับประกันเป็น 2 ล็อค ( 2pl ) และ timestamping . ล็อคอาจจะมี
ร่วมกัน ( อ่าน ) หรือพิเศษ ( เขียน ) ในการล็อกธุรกรรมได้มาล็อคทั้งหมดก่อนที่จะปล่อย
ใด ๆ timestamping ด้วย ,รายการจะถูกจัดเรียงในลักษณะที่รายการเก่าได้รับความสำคัญในเหตุการณ์ความขัดแย้ง
.
n การหยุดชะงักเกิดขึ้นเมื่อสองหรือมากกว่ารายการที่กำลังรอที่จะเข้าถึงข้อมูลอื่น ๆรายการได้ล็อค .
วิธีเดียวเท่านั้นที่จะทำลายการหยุดชะงักเมื่อมันเกิดขึ้นจะถูกยกเลิกการหนึ่งหรือมากกว่าหนึ่งของธุรกรรม .
N ต้นไม้อาจจะใช้แทน granularity ล็อคในระบบที่ช่วยให้ล็อครายการข้อมูล
ขนาดแตกต่างกัน เมื่อสินค้าถูกล็อค , ลูกหลานของมันทั้งหมดจะถูกล็อค เมื่อธุรกรรมการร้องขอใหม่
ล็อค , มันเป็นเรื่องง่ายที่จะตรวจสอบทั้งหมดของบรรพบุรุษของวัตถุเพื่อตรวจสอบว่าพวกเขามีอยู่แล้วล็อค การแสดง
ไม่ว่าใด ๆของของโหนดลูกหลาน ถูกล็อคการล็อคอยู่ในบรรพบุรุษของโหนดใด ๆ
n ถูกล็อค บางสาเหตุของความล้มเหลวของระบบเกิดปัญหา สื่อ ความล้มเหลวของโปรแกรมซอฟต์แวร์ข้อผิดพลาดประมาทธรรมชาติ
ทางกายภาพ ภัยพิบัติ และการก่อวินาศกรรม ความล้มเหลวเหล่านี้สามารถส่งผลในการสูญเสียของหน่วยความจำหลักและ / หรือดิสก์สำเนา
ฐานข้อมูล เทคนิคการกู้คืนลดผลกระทบเหล่านี้ .
n เพื่อความสะดวกในการกู้คืนวิธีหนึ่งสำหรับระบบการรักษาเข้าสู่ระบบแฟ้มที่มีรายการบันทึกที่
ระบุเริ่มต้น / สิ้นสุดของธุรกรรมและก่อนและหลังภาพของเขียนงาน ใช้เลื่อน
ปรับปรุง เขียนเสร็จตั้งแต่เริ่มแรกเพื่อเข้าสู่ระบบและบันทึกเข้าสู่ระบบถูกใช้เพื่อแสดงการปรับปรุงจริง
ฐานข้อมูล หากระบบล้มเหลวมันตรวจสอบเข้าสู่ระบบเพื่อตรวจสอบธุรกรรมที่ต้องทำ แต่มันคือ
การแปล กรุณารอสักครู่..