Reliability & Recovery

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

25 Terms

1
New cards

What are possible failures in a database?

  • system crashes

    • loss of main memory

  • hardware failure

    • loss of database storage

  • natural disaster

    • destruction of database system

  • human errors

    • corruption/destruction of data,hardware/software


2
New cards

How is reliability achieved in a database?

  • minimising frequency of failures + side-effects

  • maximsing ability to recover


3
New cards

What are the 2 types of reliability?

  • primary - design, implementation

  • secondary - operating procedures


4
New cards

What are examples of primary reliability?

  • avoid single point of failure

  • hardware replication

  • backup power sources

  • secure, air conditioned machine rooms

  • carefully designed operating procedures


5
New cards

What are examples of secondary reliability?

  • rigorously implemented operating procedures

  • access controls

  • reliable backup and recovery mechanisms


6
New cards

What are 4 database system failure types?

  • transaction failure

  • system failure

  • communication failure

  • media failure


7
New cards

What is an example of a transaction failure and itโ€™s desired effect?

Example: deadlock

Effect: handled by transaction rollback + restart

8
New cards

What is an example of a system failure and itโ€™s desired effect?

Example: power failure

Effect: system should recover to consistent state on re-start

9
New cards

What is an example of a communication failure and itโ€™s desired effect?

Example: network losses

Effect: must be handled in distributed systems

10
New cards

What is an example of a media failure and itโ€™s desired effect?

Example: disk failure - loss of stable storage

Effect: recover from backup

11
New cards

What is database recovery?

process of restoring the DB to a correct state following a failure

12
New cards

What should a recovery mechanism do?

  • ensure DB completely executed/not at all (atomicity)

  • ensure committed updates permanently stored (durability)

  • guarantee database consistency

  • have minimal impact on normal processing


13
New cards

What are the 3 disk units a typical DBMS installation uses for performance reasons?

  • system & DBMS software

  • live data

  • transaction logs


(beneficial for recovery)


14
New cards

What facilities does a DBMS provide to aid recovery?

  • backup system

    • periodically backup copies of DB

  • logging facility

    • keep track of DB transactions

  • checkpoint facility

    • store DB updates on secondary storage

  • recovery manager

    • restore DB to consistent state in event of failures


15
New cards

What is a DBMS log file?

  • cotnains info about current states of transactions & database updates

    • transaction records e.g.

      • transaction ID

      • type of log record (transaction start/commit/abort records)

      • pages affected by insert/update/delete actions

        • data page ID, before image, after image

    • checkpoint records

      • where changes made to DB are on the disk


16
New cards

What is the transaction processing model?

  • pages needed to process transactions read from disk into memory buffers

  • buffer pages updated

  • records of updates are written to log

  • on commit, log records flushed to disk before releasing locks


17
New cards

What does a buffer manager do?

  • controls buffer pool

    • pages fetched from disk (as required)

    • pages removed (when no longer required)

      • LRU - least recently used

    • dirty (modified) pages flushed to disk at end of transaction/buffer is full


18
New cards

What are 3 types of lof-based recovery?

  • normal recovery - after normal shutdown

  • warm recovery - after system failure

  • cold recovery - after media failure


19
New cards

What happens in a normal log-based recovery?

start from last log record (checkpoint written at shutdown)

20
New cards

What happens in a warm log-based recovery?

  • revert to last checkpoint in log

  • apply committed transactions

  • remove effects of un-committed transactions


21
New cards

What happens in a cold log-based recovery?

  • restore from backup/dump

  • apply log records to reach latest consistent state


22
New cards

What happens at a checkpoint?

  • all dirty pages in memroy written to disk

    • accurate record of all current transactions in the log

  • record describing checkpoint written to log

    • includes list of current transactions


23
New cards

What are the 5 states at failure a transaction can be at?

  • A: committed before last checkpoint

  • B: started before checkpoint, committed before failure

  • C: started before checkpoint, in progress at failure

  • D : started after checkpoint, committed before failure

  • E: started after checkpoint, in progress at failure


24
New cards

What is an exmaple of a warm recovery algorithm?

  • undo/redo alogorithm

    • widely used

    • allows buffer manager to flush dirty pages before/during/after commit

    • optimal for normal processing

    • expensive in terms of recovery time


25
New cards

What are the steps of an undo/redo algorithm?

knowt flashcard image