HDBP200-1 - Teaching and Learning Solutions W9 (Unit 9) - 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Teaching and Learning Solutions

Module: Database Programming 2 (HDBP200-1)


Week number (Date): 9 (01 October 2020)
Unit covered: Unit 9

1 As a Database Designer, you are required to keep the database integrity and
consistency after transactions have been processed. Differentiate between the SQL
transaction commands that make changes to the Database and those that do not.

Answer

Commands for Commands that do not


changes make changes
✓ Insert ✓ Select
✓ Update
✓ Modify
✓ Alter
✓ Delete
✓ Commit
✓ Create

2 You are the Database Administrator for your Organization and have been tasked to
assist users. A Records user has noticed that the number of a Students grade does
not appear on the system, even though they have submitted the number. On
troubleshooting you notice that the update to that Students records was being
performed by An Accounts user and prevented an update of the grade value.

Describe two possible transaction problems that could have occurred and recommend
a recovery solution to the problem.

Answer
✓ Lost Update – The Accounts Users transaction update to the grade may have
committed before the Records User. This in effect would mean that the Records
Grade was not entered into the Database as it was not committed.
✓ Uncommitted Data – This occurs because the Accounts user obtained access to
the Students Records before the Records user and the Records user was denied
access to the Record for committing and had read only access.
✓ Identify the last checkpoint in the transaction log

1 HDBP200-1- July-Dec2020-T&L-W9-CMu-23092020
✓ For the transaction that committed after the last checkpoint the DBMS redoes the
transaction, using the after values of the transaction log
✓ For any transaction that had a Rollback operation after the last checkpoint or that
was active (with neither a COMMIT nor a ROLLBACK) before the failure occurred,
the DBMS uses the transaction log records to ROLLBACK or undo the operations,
suing the ‘before’ values in the transaction log. Changes are applied in reverse
order, from the newest to the oldest.
✓ After ensuring the database consistency and integrity, rerun the uncommitted
transaction.
✓ Implement Concurrency Control measures to ensure future transactions do not get
affected eg Lock granularity, Two phase locking, Timestamping.

2 HDBP200-1- July-Dec2020-T&L-W9-CMu-23092020

You might also like