Podcast
Questions and Answers
Ktorá z nasledujúcich možností je dôvodom na zotavenie z detekcie vzájomného zablokovania?
Ktorá z nasledujúcich možností je dôvodom na zotavenie z detekcie vzájomného zablokovania?
Metóda časového razítka používa zámky na zabránenie vzájomného zablokovania.
Metóda časového razítka používa zámky na zabránenie vzájomného zablokovania.
False (B)
Čo je časové razítko v kontexte metódy časového razítka v databázovom systéme?
Čo je časové razítko v kontexte metódy časového razítka v databázovom systéme?
Jedinečný identifikátor vytvorený systémom správy databázy (DBMS), ktorý udáva relatívny čas spustenia transakcie.
Pri metóde časového razítka sa konflikt rieši ______ a ______ transakcie.
Pri metóde časového razítka sa konflikt rieši ______ a ______ transakcie.
Signup and view all the answers
Aké operácie sú navrhnuté na riešenie obmedzení spôsobených ACID vlastnosťami?
Aké operácie sú navrhnuté na riešenie obmedzení spôsobených ACID vlastnosťami?
Signup and view all the answers
Funkcia split_transaction rozdeľuje transakciu na tri samostatné transakcie.
Funkcia split_transaction rozdeľuje transakciu na tri samostatné transakcie.
Signup and view all the answers
Čo sa stane, ak transakcia A zlyhá po rozdelení do A a B?
Čo sa stane, ak transakcia A zlyhá po rozdelení do A a B?
Signup and view all the answers
Operácia, ktorá zlúči prebiehajúce práce dvoch alebo viacerých nezávislých transakcií, sa nazýva ________.
Operácia, ktorá zlúči prebiehajúce práce dvoch alebo viacerých nezávislých transakcií, sa nazýva ________.
Signup and view all the answers
Zarovnajte nasledujúce podmienky s ich popisom:
Zarovnajte nasledujúce podmienky s ich popisom:
Signup and view all the answers
Aké sú hlavné výhody dynamického reštrukturalizovania?
Aké sú hlavné výhody dynamického reštrukturalizovania?
Signup and view all the answers
Dynamické reštrukturalizovanie môže naďalej zdieľať čiastočné výsledky transakcie.
Dynamické reštrukturalizovanie môže naďalej zdieľať čiastočné výsledky transakcie.
Signup and view all the answers
Kedy môže byť transakcia rozdelená do A a B?
Kedy môže byť transakcia rozdelená do A a B?
Signup and view all the answers
Čo je výhodou modelu vnorených transakcií?
Čo je výhodou modelu vnorených transakcií?
Signup and view all the answers
Model vnorených transakcií nemusí dodržiavať tradičné vlastnosti ACID pre hlavné transakcie.
Model vnorených transakcií nemusí dodržiavať tradičné vlastnosti ACID pre hlavné transakcie.
Signup and view all the answers
Aký je účel savepointov v transakciách?
Aký je účel savepointov v transakciách?
Signup and view all the answers
Transakcia typu _______ zaručuje, že buď všetky transakcie sú úspešne dokončené, alebo sa vykonajú kompenzačné transakcie.
Transakcia typu _______ zaručuje, že buď všetky transakcie sú úspešne dokončené, alebo sa vykonajú kompenzačné transakcie.
Signup and view all the answers
Spojte termíny s ich definíciami:
Spojte termíny s ich definíciami:
Signup and view all the answers
Aké je hlavné obmedzenie savepointov v porovnaní s vnorenými transakciami?
Aké je hlavné obmedzenie savepointov v porovnaní s vnorenými transakciami?
Signup and view all the answers
Ak sa subtransakcia zruší, má to vplyv na jej nadradené transakcie.
Ak sa subtransakcia zruší, má to vplyv na jej nadradené transakcie.
Signup and view all the answers
Aké dve vlastnosti majú vnorené transakcie v porovnaní s plochými transakciami?
Aké dve vlastnosti majú vnorené transakcie v porovnaní s plochými transakciami?
Signup and view all the answers
Problém [BLANK] sa vyskytuje, keď transakcia číta viacero hodnôt, ale druhá transakcia niektoré z nich aktualizuje počas vykonávania prvej.
Problém [BLANK] sa vyskytuje, keď transakcia číta viacero hodnôt, ale druhá transakcia niektoré z nich aktualizuje počas vykonávania prvej.
Signup and view all the answers
V dôsledku problému s nekorektnou analýzou môže transakcia dosiahnuť nesprávny výsledok, ak aktualizuje hodnotu počas čítania inou transakciou.
V dôsledku problému s nekorektnou analýzou môže transakcia dosiahnuť nesprávny výsledok, ak aktualizuje hodnotu počas čítania inou transakciou.
Signup and view all the answers
Ako sa dá problém nekorektnej analýzy vyriešiť?
Ako sa dá problém nekorektnej analýzy vyriešiť?
Signup and view all the answers
Ktorý z nasledujúcich výrazov sa nepoužíva na opis problému s nekorektnou analýzou?
Ktorý z nasledujúcich výrazov sa nepoužíva na opis problému s nekorektnou analýzou?
Signup and view all the answers
Spárujte nasledujúce pojmy s ich definíciami:
Spárujte nasledujúce pojmy s ich definíciami:
Signup and view all the answers
Všetky sériové plány vedú k rovnakým výsledkom pre danú sadu transakcií.
Všetky sériové plány vedú k rovnakým výsledkom pre danú sadu transakcií.
Signup and view all the answers
Cieľom protokolu riadenia súbežnosti je naplánovať transakcie tak, aby sa zabránilo akejkoľvek [BLANK].
Cieľom protokolu riadenia súbežnosti je naplánovať transakcie tak, aby sa zabránilo akejkoľvek [BLANK].
Signup and view all the answers
Čo je cieľom serializácie?
Čo je cieľom serializácie?
Signup and view all the answers
Aký je hlavný rozdiel medzi prísnym 2PL a prísnym 2PL?
Aký je hlavný rozdiel medzi prísnym 2PL a prísnym 2PL?
Signup and view all the answers
Pri traversácii indexu sa vždy vraciame späť na vyžšie úrovne uzlov.
Pri traversácii indexu sa vždy vraciame späť na vyžšie úrovne uzlov.
Signup and view all the answers
Čo je to deadlock?
Čo je to deadlock?
Signup and view all the answers
Pri vkladaní nového indexu do listového uzla sa zámok musí udržiavať až do ______.
Pri vkladaní nového indexu do listového uzla sa zámok musí udržiavať až do ______.
Signup and view all the answers
Zlučte nasledujúce techniky uzamykania s ich popisom:
Zlučte nasledujúce techniky uzamykania s ich popisom:
Signup and view all the answers
Aký je optimistický prístup ku zámkom pri vkladaní?
Aký je optimistický prístup ku zámkom pri vkladaní?
Signup and view all the answers
Pri vkladaní, ak uzol nie je plný, vkladanie nezmení vyššie úrovne uzlov.
Pri vkladaní, ak uzol nie je plný, vkladanie nezmení vyššie úrovne uzlov.
Signup and view all the answers
Aký je účel zámkov pri hľadaní v indexovej štruktúre?
Aký je účel zámkov pri hľadaní v indexovej štruktúre?
Signup and view all the answers
Aké sú dôsledky konfliktu pri transakciách s časovým razítkom?
Aké sú dôsledky konfliktu pri transakciách s časovým razítkom?
Signup and view all the answers
Transakcie s väčšími časovými razítkami majú prednosť pred staršími transakciami.
Transakcie s väčšími časovými razítkami majú prednosť pred staršími transakciami.
Signup and view all the answers
Čo určuje systémové hodinové razítko pri generovaní časového razítka?
Čo určuje systémové hodinové razítko pri generovaní časového razítka?
Signup and view all the answers
Pokiaľ je ______ podmienka splnená, transakcia musí byť zrušená a reštartovaná.
Pokiaľ je ______ podmienka splnená, transakcia musí byť zrušená a reštartovaná.
Signup and view all the answers
Spárujte časové razítko s ich definíciou:
Spárujte časové razítko s ich definíciou:
Signup and view all the answers
Ktoré z nasledujúcich tvrdení sú pravdivé o transakciách s časovým razítkom?
Ktoré z nasledujúcich tvrdení sú pravdivé o transakciách s časovým razítkom?
Signup and view all the answers
Časové razítko je možné generovať aj inkrementovaním logického počítadla.
Časové razítko je možné generovať aj inkrementovaním logického počítadla.
Signup and view all the answers
Ak transakcia číta už aktualizovaný dátový prvok, musí byť ______ použitá na reštartovanie.
Ak transakcia číta už aktualizovaný dátový prvok, musí byť ______ použitá na reštartovanie.
Signup and view all the answers
Trvalosť znamená, že zmeny vykonané spustenou transakciou sú natrvalo uložené, aj keď sa systém po dokončení transakcie zrúti.
Trvalosť znamená, že zmeny vykonané spustenou transakciou sú natrvalo uložené, aj keď sa systém po dokončení transakcie zrúti.
Signup and view all the answers
Ktorý z nasledujúcich scenárov opisuje problém straty aktualizácie?
Ktorý z nasledujúcich scenárov opisuje problém straty aktualizácie?
Signup and view all the answers
________ kontrola je proces riadenia súčasných operácií na databáze, aby sa zabránilo vzájomnému rušeniu.
________ kontrola je proces riadenia súčasných operácií na databáze, aby sa zabránilo vzájomnému rušeniu.
Signup and view all the answers
Popíšte problém závislosti od nespracovanej transakcie s použitím príkladu.
Popíšte problém závislosti od nespracovanej transakcie s použitím príkladu.
Signup and view all the answers
Spojte vlastnosti transakcií s ich definíciami:
Spojte vlastnosti transakcií s ich definíciami:
Signup and view all the answers
Ktorý z nasledujúcich problémov je spôsobený tým, že jedna transakcia vidí medzičlánkové výsledky inej transakcie, ktorá sa neskôr zruší?
Ktorý z nasledujúcich problémov je spôsobený tým, že jedna transakcia vidí medzičlánkové výsledky inej transakcie, ktorá sa neskôr zruší?
Signup and view all the answers
Problém straty aktualizácie sa vyskytne, keď jedna transakcia prečíta hodnotu z databázy a aktualizuje ju, ale táto aktualizácia sa neskôr zruší.
Problém straty aktualizácie sa vyskytne, keď jedna transakcia prečíta hodnotu z databázy a aktualizuje ju, ale táto aktualizácia sa neskôr zruší.
Signup and view all the answers
Ako sa dá predísť problému straty aktualizácie?
Ako sa dá predísť problému straty aktualizácie?
Signup and view all the answers
Flashcards
Izolácia
Izolácia
Čiastočné efekty neukončených transakcií by nemali byť viditeľné pre iné transakcie.
Trvácnosť
Trvácnosť
EFEKTY potvrdenej transakcie sú trvalé a nemali by byť stratené z dôvodu neskorších chýb.
Kontrola súbežnosti
Kontrola súbežnosti
Správa súčasných operácií na databáze, aby sa navzájom nerušili.
Problém strateného updatu
Problém strateného updatu
Signup and view all the flashcards
Problém nezáväznej závislosti
Problém nezáväznej závislosti
Signup and view all the flashcards
Vylúčenie prečítania
Vylúčenie prečítania
Signup and view all the flashcards
Serializácia
Serializácia
Signup and view all the flashcards
Nevhodné výsledky
Nevhodné výsledky
Signup and view all the flashcards
Nekonzistentná analýza
Nekonzistentná analýza
Signup and view all the flashcards
T6
T6
Signup and view all the flashcards
T5
T5
Signup and view all the flashcards
Zabránění nekonzistentnosti
Zabránění nekonzistentnosti
Signup and view all the flashcards
Serializabilita
Serializabilita
Signup and view all the flashcards
Sériový plán
Sériový plán
Signup and view all the flashcards
Nesériový plán
Nesériový plán
Signup and view all the flashcards
Serializovateľný plán
Serializovateľný plán
Signup and view all the flashcards
Graf čakania (WFG)
Graf čakania (WFG)
Signup and view all the flashcards
Detekcia mŕtveho uzla
Detekcia mŕtveho uzla
Signup and view all the flashcards
Časová pečiatka (Timestamp)
Časová pečiatka (Timestamp)
Signup and view all the flashcards
Prerozdelenie konfliktu
Prerozdelenie konfliktu
Signup and view all the flashcards
Čítací časový pečiatka
Čítací časový pečiatka
Signup and view all the flashcards
Zápisový časový pečiatka
Zápisový časový pečiatka
Signup and view all the flashcards
Zacielené zrušenie transakcie
Zacielené zrušenie transakcie
Signup and view all the flashcards
Odložené prerozdelenie
Odložené prerozdelenie
Signup and view all the flashcards
Rigorous 2PL
Rigorous 2PL
Signup and view all the flashcards
Strict 2PL
Strict 2PL
Signup and view all the flashcards
Obsah indexu
Obsah indexu
Signup and view all the flashcards
Traversal indexu
Traversal indexu
Signup and view all the flashcards
Zámky pri vkladaní
Zámky pri vkladaní
Signup and view all the flashcards
Locking Strategy
Locking Strategy
Signup and view all the flashcards
Upgrade zámkov
Upgrade zámkov
Signup and view all the flashcards
Deadlock
Deadlock
Signup and view all the flashcards
Nesting transakcií
Nesting transakcií
Signup and view all the flashcards
ACID vlastnosti
ACID vlastnosti
Signup and view all the flashcards
Commit podtransakcie
Commit podtransakcie
Signup and view all the flashcards
Modularita
Modularita
Signup and view all the flashcards
Drobnejšia granularita
Drobnejšia granularita
Signup and view all the flashcards
Uložené body (Savepoints)
Uložené body (Savepoints)
Signup and view all the flashcards
Sagas
Sagas
Signup and view all the flashcards
Kompenzačné transakcie
Kompenzačné transakcie
Signup and view all the flashcards
Dynamické reštruktúrovanie
Dynamické reštruktúrovanie
Signup and view all the flashcards
split_transaction
split_transaction
Signup and view all the flashcards
join_transaction
join_transaction
Signup and view all the flashcards
Podmienky rozdelenia
Podmienky rozdelenia
Signup and view all the flashcards
Celková serializácia
Celková serializácia
Signup and view all the flashcards
Dôsledky abortu
Dôsledky abortu
Signup and view all the flashcards
Výhody dynamického reštruktúrovania
Výhody dynamického reštruktúrovania
Signup and view all the flashcards
Study Notes
Chapter 20 - Transaction Management Transparencies
- Transaction management is about the function and importance of transactions, properties of transactions, concurrency control, meaning of serializability, how locking ensures serializability, deadlock resolution, timestamping for serializability, optimistic concurrency control, and granularity of locking.
- Concurrency control manages simultaneous database operations without interference.
- It prevents interference when multiple concurrent users access and update database data.
- Problems can arise due to concurrency such as lost updates, uncommitted dependency, and inconsistent analysis.
Chapter 20 - Objectives (Recovery Control)
- Recovery control addresses database failure causes and the importance of transaction logs and checkpointing.
- It outlines recovery procedures after database failure and alternative models for long-duration transactions.
Chapter 20 - Objectives (Transaction Support)
- A transaction is an action or series of actions by a user or application.
- It reads or updates database contents.
- A logical unit of work, often comprising several smaller operations.
- Transactions can modify the database from one consistent state to another.
Example Transaction
- Example transaction shows a sequence of operations: reading staff number and salary, increasing salary, writing new salary, and deleting staff details.
- Contains statements to modify data.
- Illustrates reading and modifying, deleting and inserting property records.
- Demonstrates examples of successful and failed transactions.
Transaction Support (Outcomes)
- Transactions can succeed, committing to a new consistent database state.
- Or they might fail, aborting to restore the database to its previous consistent state.
Properties of Transactions
- Atomicity: all or nothing, either all operations complete or none do.
- Consistency: transforms the database from one consistent state to another.
- Isolation: partial effects of incomplete transactions should not be visible to other transactions.
- Durability: effects of a committed transaction are permanent and will not be lost due to later failures.
DBMS Transaction Subsystem
- Illustrates components of a Database Management System (DBMS) transaction subsystem.
- Describes how different components interact and coordinate transaction processing.
Need for Concurrency Control
- Lost Update Problem: one user's update is overwritten by another.
- Uncommitted Dependency Problem: one transaction reads data updated by an uncommitted transaction.
- Inconsistent Analysis Problem: one transaction reads multiple values, while another updates some, yielding an inconsistent result.
Serializability
- Objective: To schedule transactions to avoid interference.
- Transactions can run serially, but limits concurrency.
- Serializability identifies transaction executions that guarantee consistency.
Serializability (Conflict and View)
- Conflict serializability: ordering of read/write operations on data items is critical.
- View serializability: considers initial and final values of data items as the ordering basis.
Precedence Graph
- Used to check for cycles, indicating non-serializability.
Example - Non-conflict serializable schedule
- Example of a schedule where operations are interleaved that is not conflict serializable.
View Serializability
- View serializability describes a less stringent method for determining how concurrent executions of transactions affect overall consistency.
Recoverability
- Serializability ensures that database consistency is maintained, assuming no transaction fails.
- Could evaluate recoverability of a transaction schedule if there is a failure.
- Atomicity ensures if a transaction fails, that its changes to the database are completely undone.
- Durability: effects of a committed transaction are permanent, not lost due to later failures.
Concurrency Control Techniques
- Two main techniques: locking and timestamping.
Locking
- Transactions use locks to prevent interference.
- A shared lock allows read access.
- An exclusive lock allows read/write access, preventing other transactions from modifying the data.
Locking - Basic Rules
- If a transaction has a shared lock on an item, it can only read.
- If a transaction has an exclusive lock on an item, it can both read and update.
Locking - Basic Rules (Upgrade/Downgrade)
- Some systems permit locks to be upgraded (exclusive to shared) or downgraded (shared to exclusive).
Example - Incorrect Locking Schedule
- Example of a schedule that violates locking rules, resulting in inconsistent results or deadlock.
Two Phase Locking (2PL)
- Two phases (growing and shrinking) ensure mutual exclusion during a transaction without deadlock.
Preventing Problems with 2PL
- Demonstrates how Two Phase Locking prevents lost updates, uncommitted read issues, etc.
Timestamping
- Transactions take numbers denoting the time they are initiated.
- Higher number timestamped operations have priority over lower numbers operations.
- Timestamp orders have the objective of guaranteeing consistency when many transactions are performed by many users.
- If there's conflict, the older operation is rolled back.
Timestamping – Read(x) and Write(x)
- Describes conditions under which timestamped reads or writes are successful.
- Also describes cases that force rollback due to conflicts with higher priority transactions.
Multiversion Timestamp Ordering
- Allow multiple versions of data items enabling concurrent updates
Optimistic Techniques
- Optimistic protocols assume concurrency conflicts are rare.
- Transactions make changes locally and only commit after validation to check for conflicts.
Optimistic Techniques (Phases)
- Read: transaction reads values and store them.
- Validation: checks for conflicts in a commit stage.
- Write: updates are applied to DB only if no conflicts are found during validation.
Granularity of Data Items
- Refers to the size of data items that concurrency controls protect.
- Granularity can range from the entire database, to a file, page, record, or even a single data item.
Hierarchy of Granularity
- Locking strategy based on a hierarchical structure of data (database, files, pages, records).
Levels of Locking
- Describes a hierarchical structure representing different levels at which locks can be applied in a transaction.
- For example, a lock on a file might automatically lock all records within that file.
Database Recovery
- Processes and procedures to restore a database to a consistent state after a failure.
Types of Failures
- System crashes.
- Media failures.
- Application errors.
- Natural disasters or damage.
- Human error.
Transactions and Recovery
- Transactions are the basic unit of recovery.
Log File
- Log file records operations; includes a transaction identifier, operation type (e.g., read, write), data items (modified), and timestamps.
- Used for recovery.
Checkpointing
- Point of synchronization between database and log file.
- Forces all data to the secondary storage.
- Ensures complete recovery from errors or failures.
Recovery Techniques
- Methods to restore a database to a consistent state following damage or failure:
- Using backup copies of DBs.
- Applying committed transaction updates through the log file.
- Undoing uncompleted transactions.
Main Recovery Techniques
- Deferred update.
- Immediate update.
- Shadow paging.
Deferred Update
- Updates are not written to the database until after a transaction commits.
Immediate Update
- Updates are written to the database immediately after they occur.
- Transactions may be undone if they end up causing conflicts.
Shadow Paging
- Maintains two page tables: one current and one shadow.
Advanced Transaction Models
- Addresses issues specific to long-duration and complex transactions, often in distributed environments
Nested Transaction Model
- Views transaction as a hierarchy of subtransactions to better support concurrency control and recovery.
Sagas
- Sequences of transactions that need to be interleaved, often in distributed environments.
Multi-level Transaction Model
- Allows multiple transaction levels, making it better suited for complex applications.
Dynamic Restructuring
- Allows splitting or merging transactions to improve isolation and efficiency.
Workflow Models
- Supports highly coordinated transactions that span multiple steps frequently found in business applications.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on the timestamp method used in database systems to prevent deadlocks. This quiz covers key concepts such as the use of locks and how transactions resolve conflicts. Explore the mechanisms that ensure smooth transaction processing in databases.