Aktu’s Quantum Notes for Database Management System can help you succeed in your B.Tech studies. With these vital, repeating questions and notes, you’ll be able to master key topics and perform in exams. Unit-4 Transaction Processing Concept
Dudes 🤔.. You want more useful details regarding this subject. Please keep in mind this as well. Important Questions For Database Management System: *Quantum *B.tech-Syllabus *Circulars *B.tech AKTU RESULT * Btech 3rd Year * Aktu Solved Question Paper
Q1. Write a short note on transaction.
- 1. A transaction is a logical unit of database processing that includes one or more database access operations; these include insertion, deletion, modification or retrieval operations.
- 2. The database operations that form a transaction can be embedded within an application program.
- 3. By specifying explicit begin transaction and end transaction we can specify the transaction boundaries.
- 4. If the database operations in a transaction do not update the database but only retrieve data, the transaction is called a read-only transaction.
Q2. How can you implement atomicity in transactions ?
Ans. Implementation of atomicity in transaction can be done in two ways:
- 1. Completeness:
- a. All of the operations encapsulated within a database transaction represent an atomic unit of work.
- b. According to atomicity either all of transaction will run to completion (Commit) or none of them.
- c. There will not be any partial transaction in left over state from incomplete execution of one or more operations in a transaction.
- d. If the user decides to cancel everything (Rollback), all of the changes made by the transaction will be undone and the state would be as if the transaction never began by using undo operation.
- e. For every change made by operations in the database, it logs undo data to be used to rollback the effects of operations.
- 2. Mutual exclusion/locking :
- a. Only one transaction will be allowed to progress by taking an exclusive lock on the particular data item.
- b. The lock will not be released until the transaction ends (either through rollback, commit or abort).
- c.. Any other concurrent transaction interested in updating the same row will have to wait.
Q3. Discuss the rules to be followed while preparing a serializable schedule. Why should we prefer serializable schedules instead of serial schedules ?
Ans. The set of rules which must be followed for preparing serializable schedule are:
- 1. Take any concurrent schedule.
- 2. Draw the precedence graph for concurrent schedule.
- 3. If there is a cycle in precedence graph then schedule is not serializable.
- 4. If there is no cycle the schedule is serializable.
- 5. Prepare serializable schedule using precedence graph.
We prefer serializable schedule instead of serial schedule because :
- 1. The problem with serial schedule is that it limits concurrency or interleaving of operations.
- 2. In a serial schedule, if a transaction waits for an I0 operation to complete, we cannot switch the CPU processor to another transaction, thus wasting valuable CPU processing time.
- 3. If some transaction T’ is quite long, the other transactions must wait for T to complete all its operations before committing.
Q4. Describe shadow paging recovery technique.
- 1. Shadow paging is a technique in which multiple copies (known as shadow copies) of the data item to be modified are maintained on the disk.
- 2. Shadow paging considers the database to be made up of fixed-size logical units of storage called pages.
- 3. These pages are mapped into physical blocks of storage with the help of page table (or directory).
- 4. The physical blocks are of the same size as that of the logical blocks.
- 5. A page table with n entries is constructed in which the ith entry in the page table points to the ith database page on the disk as shown in Fig.
- 6. The main idea behind this technique is to maintain two page tables.
- a. In current page the entries points to the most recent database pages on the disk. When a transaction starts, the current page table is copied into a shadow page table (or shadow directory).
- b. The shadow page table is then saved on the disk and the current page table is used by the transaction. The shadow page table is never modified during the execution of the transaction.
When shadow paging does not require log:
It does not require the use of log in an environment where only one transaction is active at a time.
Q5. What is distributed databases ? What are the advantages and disadvantages of distributed databases ?
Ans. Distributed database:
- 1. A distributed database system consists of collection of sites, connected together through a communication network.
- 2. Each site is a database system site in its own right and the sites have agreed to work together, so that a user at any site can access anywhere in the network as if the data were all stored at the user’s local site.
- 3. Each side has its own local database.
- 4. A distributed database is fragmented into smaller data sets.
- 5. DDBMS can handle both local and global transactions.
Advantages of DDBMS:
- 1. DDBMS allows each site to store and maintain its own database, causing immediate and efficient access to data.
- 2. It allows access to the data stored at remote sites. At the same time users can retain the control to its own site to access the local data.
- 3. If one site is not working due to any reason (for example, communication link goes down) the system will not be down because other sites of the network can possibly continue functioning.
- 4. New sites can be added to the system anytime with no or little efforts.
- 5. If a user needs to access the data from multiple sites then the desired query can be subdivided into sub-queries in parallel.
Disadvantages of DDBMS:
- 1. Complex software is required for a distributed database environment.
- 2. The various sites must exchange message and perform additional calculations to ensure proper coordination among the sites.
- 3. A by-product of the increased complexity and need for coordination is the additional exposure to improper updating and other problems of data integrity.
- 4. If the data are not distributed properly according to their usage, or if queries are not formulated correctly, response to requests for data can be extremely slow.
Q6. Explain data fragmentation with types.
- 1. It is the decomposition of a relation into fragments.
- 2. It permits to divide a single query into a set of multiple sub-queries that can execute parallel on fragments.
- 3. Fragmentation is done according to the data selection patterns of applications running on the database.
Fragmentation techniques/types are as follows:
1. Vertical fragmentation:
- a. It divides a relation into fragments which contain a subset of attributes of a relation along with the primary key attribute of the relation.
- b. The purpose of vertical fragmentation is to partition a relation into a set of smaller relations to enable user applications to run on only one fragment.
2. Horizontal fragmentation:
- a. It divides a relation into fragments along its tuples. Each fragment is a subset of tuples of a relation.
- b. It identifies some specific rows based on some criteria and marks it as a fragment.
- c. Various horizontal fragmentation techniques are :
- i. Primary horizontal fragmentation: This type of fragmentation is done where the tables in a database are neither joined nor have dependencies. So, no relationship exists among the tables.
- ii. Derived horizontal fragmentation: Derived horizontal fragmentation is used for parent relation. It is used where tables are interlinked with the help of foreign keys. lt ensures that the fragments which are joined together are put on the same site.
3. Hybrid/mixed fragmentation:
- a. The mixed/hybrid fragmentation is combination of horizontal and vertical fragmentations.
- b. This type is most complex one, because both types are used in horizontal and vertical fragmentation of the DB application.
- c. The original relation is obtained back by join or union operations.
Important Question with solutions | AKTU Quantums | Syllabus | Short Questions
Database Management System Btech Quantum PDF, Syllabus, Important Questions
Database Management System Quantum PDF | AKTU Quantum PDF:
AKTU Important Links | Btech Syllabus
|Btech AKTU Circulars
|Btech AKTU Syllabus
|Btech AKTU Student Dashboard
|AKTU RESULT (One VIew)