DB2 interview questions and answers
Do you know DB2 was the first name given to Database management System
This is a must know for every Android developer as this new era of application is keenly focused on mobile devices and is becoming increasingly important in large enterprises.
For those who desire progress in their android developing career, the knowledge of DB2 concept gives a kick start and helps for the furtherance.
Here we have got you some DB2 interview questions, which are specially designed to get you acquainted with the nature of questions you may encounter while being interviewed.
1. What is DB2 and what is the use of DB2 Optimizer?
Use of DB2 Optimizer:
The DB2 optimizer processes the SQL statements and helps to select the access path.
2. Mention data types used in DB2 ?
3. What is Buffer pool and list some of them?
There are four Buffer pools in DB2.
4. Explain PACKAGE in DB2 and its advantages?
Below are some advantages of Packages:
- It ensures that you do not have to bring a large collection of DBRM members together for a particular plan.
- In case of making changes in a program that will eventually lead to errors, then the decrease in fallback complexities can be made with the help of Package.
- It is advisable to go for a small collection instead of a large one. Abstain from the cost of large collection of a bind.
- In the course of automatic binding or rebinding of a specific plan, ensure that the total transactions attached to the process are unavailable.
5. Describe major components of DB2?
- System services component: It supports system operations, other communication, logging and similar functions. It handles startup and shutdowns.
- Locking services component:It provides the necessary controls for managing concurrent access to data. This component is known as Internal Resource Lock Manager (IRLM) and it manages the concurrency issues and deadlocks.
- Database services component: It supports the definition, retrieval, and update of user and system data. It is responsible for the execution of SQL statements and it also manages the buffer pool.
- Distributed data facility component: It provides DB2’s, distributed database support.
6. Give a brief description of DB2 Isolation Levels?
- It is good for accessing read-only tables and read-only queries.
- No record Locking is done.
CS- Cursor Stability:
- It is a default isolation level.
- It locks or unlocks each row at a time.
- It guarantees to return only data which was committed at the time of reading.
RS- Read Stability:
- It releases Locks on rows that do not satisfy the query predicates.
- It is used for result set stability or when the future actions on returned rows may be taken.
RR- Repeatable Read:
- It allows the application to retrieve and operate on rows as many times as needed.
- It locks the entire table.
7. What are the full forms of SPUFI and DCLGEN and why are they used?
Usage- It allows direct input of SQL commands in the time sharing option environment.
DCLGEN- DeCLarations GENerator
Usage- It is used to create the DECLARE table and to create the host language copy books for the table definitions.
8. Explain various types of Locks in DB2?
- S Lock (Share): This mode allows the Lock owner and any concurrent process to read but not change the locked page or row.
- U Lock (Update): This mode allows the Lock owner to read but not change the locked page. This lock mode reduces the chance of deadlocks.
- X Lock (Exclusive): This mode allows the Lock owner to read or change the Locked page or row.
9. Mention and explain the contention situations caused by locks?
- Suspension: This situation is encountered by an application when it requests the lock that is already held by another application and cannot be shared. This suspended process temporarily stops running and resumes when all the processes that hold the conflicting lock release them.
- Timeout: This situation is encountered by an application process when it terminates because of a suspension that exceeds the preset level. DB2 then terminates the process, issues message and returns the error codes.
- Deadlock: This situation occurs when two or more application processes each hold locks on resources that others need and without which they cannot proceed.
10. Explain about RCT in DB2?
11. What is meant by UNION and UNION ALL?
UNION ALL – It is the function used to retain the duplicates in the table.
Both the functions are used to combine the results generated by multiple SELECT statements.