Flashcards
Additional Material For Final
Cards in this deck (9)
- 1TransactionLogical unit of work, they have a beginning and end. Transactions start with DB query function, either UPDATE, INSERT, DELETE, or SELECT. They end with ROLLBACK(undo) or COMMIT (makes permanent).
- 2Each transaction has a time stamp, what is this used for?This is used to mark transactions, in case they happen at the same time.
- 3Lost UpdateOccurs when two transactions are trying to update the same column, on the same row, within a database at the same time. Usually the first transaction makes an update, the second transaction shortly follows- but the second transaction misses the first update. As a result, the second transaction overwrites the initial update with it's own.
- 4Example of Lost UpdateFor example, two editors make an electronic copy of the same document. Each editor changes the copy independently and then saves the changed copy thereby overwriting the original document. The editor who saves the changed copy last overwrites the changes made by the other editor. This problem could be avoided if one editor could not access the file until the other editor had finished and committed the transaction.
- 5Uncommitted DependencyOccurs when a seccond transaction selectcs a row that is being updated by another transaction. The second transaction is reading non-committed data, and may be changed by transaction updating row.
- 6Example of Uncommitted Dependency.For example, an editor is making changes to an electronic document. During the changes, a second editor takes a copy of the document that includes all the changes made so far, and distributes the document to the intended audience. The first editor then decides the changes made so far are wrong and removes the edits and saves the document. The distributed document contains edits that no longer exist and should be treated as if they never existed. This problem could be avoided if no one could read the changed document until the first editor does the final save of modifications and commits the transaction.
- 7Log FileSequential record of all activity on the database. Records writes, updates, and reads. Each I/O will have a pre and post images of data, as well as transaction IDs
- 8Synch Point Process1. All DB Processing is halted
2. All buffers are flushed to DB
3. Records all transactions
4. Restart process - 9Algorithm Complete Recovery of Non-Media FailureForm lists of undo and redo.
I. Read log file backwards until you reach a synch point.
II. Put all transactions on undo list.
III. Read forward.
IV. If new transaction, put on undo list. If end of transaction (commit or rollback), move to redo list.
V. Read backward to start of oldest transaction. Note: "Undoing" is writing pre-images.
IV. Read forward, apply post images for all redos.
Information
- Description
- Database Systems (Reviews) Flashcards on Additional Material For Final, created by SERGIO GUTIERREZ on 02/12/2017.
- Created by
- SERGIO GUTIERREZ
- Views
- 0
- Rating