CS411 - Transaction Management - Note 1

So who coined acid correctness of transactions 12 of

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (16 of 61) Transaction Manager (or TP Monitor) • Part of the DBMS • Main duties: • Starts transactions • locate and start the right program • ensure timely, fair scheduling • Logs their activities • especially start/stop, writes, commits, aborts • Detects or avoids conflicts • Takes recovery actions Correctness of Transactions (6 of 12) Transaction Management (17 of 61) DBMS Architecture User/Web Forms/Applications/DBA query transaction Query Parser Transaction Manager DDL Processor DDL commands Concurrency Control Logging & Recovery Query Rewriter Query Optimizer Query Executor Records Indexes Buffer Manager Storage Manager Storage Correctness of Transactions (7 of 12) Buffer: data, indexes, log, etc Lock Tables Main Memory data, metadata, indexes, log, etc Transaction Management (18 of 61) What’s on the Log File? • Transaction starts/stops • DB writes: "before" and/or "after" images of DB records • befores can be used to rollback an aborted transaction • afters can be used to redo a transaction (recovery from catastrophe) • COMMITs and ABORTs The log itself is as critical as the DB! Correctness of Transactions (8 of 12) Transaction Management (19 of 61) The Big TP Issues • Recovery • Taking action to restore the DB to a consistent state • Concurrency Control • Making sure simultaneous transactions don't interfere with one another Correctness of Transactions (9 of 12) Transaction Management (20 of 61) The ACID Properties • Atomicity • Consistency Preservation • Isolation • Durability Correctness of Transactions (10 of 12) Transaction Management (21 of 61) The ACID Properties: From Oracle Wiki Correctness of Transactions (11 of 12) Transaction Management (22 of 61) Behind the Scene: It’s Your Turn! So, who coined “ACID”? Correctness of Transactions (12 of 12) Transaction Management (23 of 61) Recovery Recovery (0 of 8) Transaction Management (24 of 61) Q: What Might Go Wrong? Recovery (1 of 8) Transaction Management (25 of 61) System Failures • Each transaction has internal state • When system crashes, internal state is lost • Don’t know which parts executed and which didn’t • Remedy: use a log • A file that records every single action of the transaction Recovery (2 of 8) Transaction Management (26 of 61) Transactions • Start Transaction • Oracle • autocommit is off by default, so a new transaction is started after each COMMIT or ROLLBACK • MySQL • START TRANSACTION • End Transaction • COMMIT or ROLLBACK Recovery (3 of 8) Transaction Management (27 of 61) Transaction Abstraction • Database is composed of elements • Usually 1 element = 1 block • Can be smaller (=1 record) or larger (=1 relation) • Each transaction reads/writes some elements Recovery (4 of 8) Transaction Management (28 of 61) Co...
View Full Document

Ask a homework question - tutors are online