SlideShare a Scribd company logo
Justin Andrews
ACSG 552
Chapter 10 Questions

2. The three most common concurrent transaction execution problems are lost updates,
uncommitted data, and inconsistent retrievals.

Concurrency control can help avoid these problems through its ability to coordinate
simultaneous executions of transactions in a multiprocessing database system. This is
accomplished with various methods, including the use of a scheduler and locks.

3. The DBMS component responsible for concurrency control is a scheduler, which is a
process that establishes the order in which the many operations during each transaction
are executed.

5. Database recovery takes place through the use of data in a given transaction log to
recover a database from an inconsistent to a consistent state. A write-ahead-log protocol
ensures that transaction logs are always written before any database data are actually
updated, ensuring that the database can later be recovered to a consistent state. Redundant
transaction logs ensure a physical disk failure will not impair the DBMS’s ability to
recover data. Database buffers are used to store copies of data from physical disks, which
are themselves updated when a transaction updates data, to help speed up operations. The
updated copies of data in the buffers are eventually used to update the data on the
physical disks. Checkpoints are the process in which a DBMS writes updated buffers
onto a disk, with no other requests being executed during it.

Deferred-write techniques delay the update of a physical database, only allowing the
transaction log to update. The database itself will only update after a given transaction
reaches a commit point, which uses information from the transaction log. If the
transaction aborts, no changes will be made, preventing a need to undo the changes.

Write-through techniques differ from deferred-write techniques as they proceed to have
the database updated immediately. When a transaction aborts in this instance, the changes
need to be undone through a ROLLBACK operation.

6. a.   BEGIN TRANSACTION

        UPDATE CUSTOMER
        SET CUS_BALANCE = CUS_BALANCE + ((110 * 0.08) + 110)
         WHERE CUS_CODE = ‘10010’

        UPDATE CUSTOMER
        SET CUS_DATELSTPUR = ‘05/11/10’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
SET INV_NUMBER = ‘10983’
        WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_TERMS = ‘30’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_DATE = ‘05/11/10’
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_TOTAL = (110 * 0.08) + 110
         WHERE CUS_CODE = ‘10010’

        UPDATE INVOICE
        SET INV_STATUS = ‘OPEN’
         WHERE CUS_CODE = ‘10010’

        COMMIT;

6. b.   BEGIN TRANSACTION

        UPDATE CUSTOMER
        SET CUS_BALANCE = CUS_BALANCE – 100
         WHERE CUS_CODE = ‘10983’

        UPDATE CUSTOMER
        SET CUS_DATELSTPMT = ‘06/03/10’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_ID = ‘3428’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_DATE = ‘06/03/10’
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_AMT = 100
         WHERE CUS_CODE = ‘10983’

        UPDATE PAYMENT
        SET PMT_TYPE = ‘CASH’
         WHERE CUS_CODE = ‘10983’
COMMIT;

7.
TRANSACTION          TRANSACTION           WAIT/DIE               WOUND/WAIT
REQUESTING           OWNING LOCK           SCHEME                 SCHEME
LOCK
T1 (11194185)        T2 (13582019)         T1 waits until T2 is   T1 rolls back T2.
                                           completed and          T2 is rescheduled
                                           releases its locks.    while using the
                                                                  same time stamp.
T2 (13582019)        T1 (11194185)         T2 rolls back.         T2 waits until T1 is
                                           T2 is rescheduled      completed and
                                           using the same time    releases its locks.
                                           stamp.

8.    1. Table-level lock – Necessary as both the CUSTOMER and INVOICE tables
      are accessed.
      2. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      3. Data manipulation – Regarding five instances of editing in the INVOICE table.
      4. Table-level unlock – For when the data manipulation is finished.

9.    1. Row-level lock – Necessary for modifying information of a single customer in
      the CUSTOMER table.
      2. Row-level lock – Necessary for modifying information of a single invoice in
      the INVOICE table.
      3. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      4. Data manipulation – Regarding five instances of editing in the INVOICE table.
      5. Row-level unlock – For when one is finished modifying the information in the
      CUSTOMER table.
      6. Row-level unlock – For when one is finished modifying the information in the
      INVOICE table.

10.   1. Table-level lock – Necessary as both the CUSTOMER and PAYMENT tables
      are accessed.
      2. Data manipulation – Regarding two instances of editing in the CUSTOMER
      table.
      3. Data manipulation – Regarding four instances of editing in the PAYMENT
      table.
      4. Table-level unlock – For when the data manipulation is finished.

11.   1. Row-level lock – Necessary for modifying information of a single customer in
      the CUSTOMER table.
2. Row-level lock – Necessary for modifying information of a single invoice in
the PAYMENT table.
3. Data manipulation – Regarding two instances of editing in the CUSTOMER
table.
4. Data manipulation – Regarding four instances of editing in the PAYMENT
table.
5. Row-level unlock – For when one is finished modifying the information in the
CUSTOMER table.
6. Row-level unlock – For when one is finished modifying the information in the
PAYMENT table.

More Related Content

PDF
The CAP Theorem
PPTX
Different types of Symmetric key Cryptography
PDF
SSH - Secure Shell
PDF
Host-based Security
PDF
Approximate Nearest Neighbors and Vector Models by Erik Bernhardsson
PPTX
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
PPT
Sorting in Linear Time in Analysis & Design of Algorithm
PDF
Information Security 01- Basic Notions of Confidentiality Integrity Availabil...
The CAP Theorem
Different types of Symmetric key Cryptography
SSH - Secure Shell
Host-based Security
Approximate Nearest Neighbors and Vector Models by Erik Bernhardsson
BlueHat 2014 - The Attacker's View of Windows Authentication and Post Exploit...
Sorting in Linear Time in Analysis & Design of Algorithm
Information Security 01- Basic Notions of Confidentiality Integrity Availabil...

What's hot (20)

PPTX
Binary tree
PPT
Cryptography Fundamentals
PPT
Cryptography Intro
PPTX
PDF
Hashing and Hash Tables
PPTX
NoSQL and Couchbase
PDF
CNIT 126: 8: Debugging
PPT
6. cryptography
PPTX
Data encryption
PPT
Digital Signatures & Authentication Protocols
PDF
2. public key cryptography and RSA
PPT
ch15.ppt
PPTX
Attribute based encryption in cloud with significant reduction reviw2
PPTX
Uni Processor Architecture
PPT
Introduction to SSH
PPTX
Ids vs ips
PPTX
Abusing Microsoft Kerberos - Sorry you guys don't get it
PPT
Hashing
PPTX
My sql failover test using orchestrator
Binary tree
Cryptography Fundamentals
Cryptography Intro
Hashing and Hash Tables
NoSQL and Couchbase
CNIT 126: 8: Debugging
6. cryptography
Data encryption
Digital Signatures & Authentication Protocols
2. public key cryptography and RSA
ch15.ppt
Attribute based encryption in cloud with significant reduction reviw2
Uni Processor Architecture
Introduction to SSH
Ids vs ips
Abusing Microsoft Kerberos - Sorry you guys don't get it
Hashing
My sql failover test using orchestrator
Ad

Similar to Database chapter 10 questions (20)

PPT
Transaction concurrency control
PPT
Transaction management
PPTX
Welcome to the nightmare of locking, blocking and isolation levels!
PPT
Transaction
DOCX
Part A1. A lock on a larger data element increases both system ove.docx
PDF
SQL Transactions - What they are good for and how they work
PPTX
DBMS: Week 13 - Transactions and Concurrency Control
PPTX
database1.pptx
PDF
PDF
Chapter 5 Database Transaction Management
PPTX
Unit 5 Transcationrelationaldatabases.pptx
PPT
database management system Chapter 5
PPTX
Unit 5
PPT
These slides are about How to do The transaction.ppt
PDF
Database concurrency and transactions - Tal Olier
PPT
Svetlin Nakov - Database Transactions
PPT
CH09.ppt
PPT
Function
PDF
Database transaction isolation and locking in Java
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
Transaction concurrency control
Transaction management
Welcome to the nightmare of locking, blocking and isolation levels!
Transaction
Part A1. A lock on a larger data element increases both system ove.docx
SQL Transactions - What they are good for and how they work
DBMS: Week 13 - Transactions and Concurrency Control
database1.pptx
Chapter 5 Database Transaction Management
Unit 5 Transcationrelationaldatabases.pptx
database management system Chapter 5
Unit 5
These slides are about How to do The transaction.ppt
Database concurrency and transactions - Tal Olier
Svetlin Nakov - Database Transactions
CH09.ppt
Function
Database transaction isolation and locking in Java
Chapter 1 - Transaction Processing and Mgt.pptx
Ad

More from jandrewsxu (20)

DOCX
Resume
DOCX
Resume
DOCX
Chapter #11 lab
DOCX
Chapter #8 lab
DOCX
Chapter #4 lab
DOCX
Modulation schemes 8
DOCX
Modulation techniques 7
DOCX
Bluetooth wi fi wi max 2, 3
DOCX
Acsg 520 assignment #6 ---
DOCX
Acsg 520 assignment #4 --
DOCX
First hw assignment #1 --
DOC
Journal
DOC
Assumptions, applicable measures, er diagram
XLSX
Data dictionary
DOC
Assumptions, and applicable measures
PPTX
Final presentation(v5)
DOC
Database chapter 11 homework
DOC
Essay #2 ethical considerations
DOC
Midterm paper medical records
DOC
Essay #2 ethical considerations
Resume
Resume
Chapter #11 lab
Chapter #8 lab
Chapter #4 lab
Modulation schemes 8
Modulation techniques 7
Bluetooth wi fi wi max 2, 3
Acsg 520 assignment #6 ---
Acsg 520 assignment #4 --
First hw assignment #1 --
Journal
Assumptions, applicable measures, er diagram
Data dictionary
Assumptions, and applicable measures
Final presentation(v5)
Database chapter 11 homework
Essay #2 ethical considerations
Midterm paper medical records
Essay #2 ethical considerations

Database chapter 10 questions

  • 1. Justin Andrews ACSG 552 Chapter 10 Questions 2. The three most common concurrent transaction execution problems are lost updates, uncommitted data, and inconsistent retrievals. Concurrency control can help avoid these problems through its ability to coordinate simultaneous executions of transactions in a multiprocessing database system. This is accomplished with various methods, including the use of a scheduler and locks. 3. The DBMS component responsible for concurrency control is a scheduler, which is a process that establishes the order in which the many operations during each transaction are executed. 5. Database recovery takes place through the use of data in a given transaction log to recover a database from an inconsistent to a consistent state. A write-ahead-log protocol ensures that transaction logs are always written before any database data are actually updated, ensuring that the database can later be recovered to a consistent state. Redundant transaction logs ensure a physical disk failure will not impair the DBMS’s ability to recover data. Database buffers are used to store copies of data from physical disks, which are themselves updated when a transaction updates data, to help speed up operations. The updated copies of data in the buffers are eventually used to update the data on the physical disks. Checkpoints are the process in which a DBMS writes updated buffers onto a disk, with no other requests being executed during it. Deferred-write techniques delay the update of a physical database, only allowing the transaction log to update. The database itself will only update after a given transaction reaches a commit point, which uses information from the transaction log. If the transaction aborts, no changes will be made, preventing a need to undo the changes. Write-through techniques differ from deferred-write techniques as they proceed to have the database updated immediately. When a transaction aborts in this instance, the changes need to be undone through a ROLLBACK operation. 6. a. BEGIN TRANSACTION UPDATE CUSTOMER SET CUS_BALANCE = CUS_BALANCE + ((110 * 0.08) + 110) WHERE CUS_CODE = ‘10010’ UPDATE CUSTOMER SET CUS_DATELSTPUR = ‘05/11/10’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE
  • 2. SET INV_NUMBER = ‘10983’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_TERMS = ‘30’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_DATE = ‘05/11/10’ WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_TOTAL = (110 * 0.08) + 110 WHERE CUS_CODE = ‘10010’ UPDATE INVOICE SET INV_STATUS = ‘OPEN’ WHERE CUS_CODE = ‘10010’ COMMIT; 6. b. BEGIN TRANSACTION UPDATE CUSTOMER SET CUS_BALANCE = CUS_BALANCE – 100 WHERE CUS_CODE = ‘10983’ UPDATE CUSTOMER SET CUS_DATELSTPMT = ‘06/03/10’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_ID = ‘3428’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_DATE = ‘06/03/10’ WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_AMT = 100 WHERE CUS_CODE = ‘10983’ UPDATE PAYMENT SET PMT_TYPE = ‘CASH’ WHERE CUS_CODE = ‘10983’
  • 3. COMMIT; 7. TRANSACTION TRANSACTION WAIT/DIE WOUND/WAIT REQUESTING OWNING LOCK SCHEME SCHEME LOCK T1 (11194185) T2 (13582019) T1 waits until T2 is T1 rolls back T2. completed and T2 is rescheduled releases its locks. while using the same time stamp. T2 (13582019) T1 (11194185) T2 rolls back. T2 waits until T1 is T2 is rescheduled completed and using the same time releases its locks. stamp. 8. 1. Table-level lock – Necessary as both the CUSTOMER and INVOICE tables are accessed. 2. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 3. Data manipulation – Regarding five instances of editing in the INVOICE table. 4. Table-level unlock – For when the data manipulation is finished. 9. 1. Row-level lock – Necessary for modifying information of a single customer in the CUSTOMER table. 2. Row-level lock – Necessary for modifying information of a single invoice in the INVOICE table. 3. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 4. Data manipulation – Regarding five instances of editing in the INVOICE table. 5. Row-level unlock – For when one is finished modifying the information in the CUSTOMER table. 6. Row-level unlock – For when one is finished modifying the information in the INVOICE table. 10. 1. Table-level lock – Necessary as both the CUSTOMER and PAYMENT tables are accessed. 2. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 3. Data manipulation – Regarding four instances of editing in the PAYMENT table. 4. Table-level unlock – For when the data manipulation is finished. 11. 1. Row-level lock – Necessary for modifying information of a single customer in the CUSTOMER table.
  • 4. 2. Row-level lock – Necessary for modifying information of a single invoice in the PAYMENT table. 3. Data manipulation – Regarding two instances of editing in the CUSTOMER table. 4. Data manipulation – Regarding four instances of editing in the PAYMENT table. 5. Row-level unlock – For when one is finished modifying the information in the CUSTOMER table. 6. Row-level unlock – For when one is finished modifying the information in the PAYMENT table.