DB2 Interview Questions and Answers

DB2 Interview Questions

Share This Post

Best DB2 Interview Questions and Answers

Have you completed your IBM DB2 training and about to give your DB2 interview? If yes, then you have arrived at the perfect place. Prior preparation is always important to clear any interview, but many would fail to do that because of a lack of access to proper material. We at CourseJet have collected a list of frequently asked DB2 Interview Questions and Answers suitable for both freshers and experienced. Preparing these top DB2 interview questions will make you an expert in the subject knowledge and build confidence to attend the interview. Whether you are a fresher or experienced candidate these questions will simplify your interview preparation process.  All these questions are covered here are going to give you a brief knowledge of IBM DB2 and cover end to end concepts to make you confident enough. 

DB2 is a database product developed by IBM. It is a Relational Database Management System (RDBMS). DB2 designed and developed in a way to store, analyze, and retrieve the data in a faster and effective manner. In the beginning, DB2 was designed to support only relational models but later its capabilities extended to support the non-relational structures with XML, and Object-Oriented features. Increased demand for database management and skilled professionals have created a good number of job opportunities for skilled DB2 professionals.

Best DB2 Interview Questions and Answers

Here we have gathered all top DB2 interview questions and answers. All these DB2 interview questions are collected and prepared by DB2 experts who hold 10+ years of database management experience.  The frequently asked DB2 questions cover the fundamental concepts such as Information Model, Authorization, Relational Data Model, XQuery, Label-Based Access Control, SQL/XML, XQuery, etc. These questions are helpful for the professionals like Database administrators, and System administrators in clearing the DB2 interview with ease. Without wasting much time let’s get into the frequently asked DB2 interview questions part. 

These DB2  Interview Questions divided into 3 types for making the learning simple

Want to explore your DB2 skills? Join CourseJet, DB2 online training, get certified and pave way for the best career.

Basic DB2 Interview Questions and Answers

DB2 is a database product developed by IBM. DB2 is a Relational Database Management System (RDBMS). It is planned and developed to store, analyze, and retrieve the data in a faster and effective manner. In the beginning, DB2 was designed to support only the relational model but later its capabilities extended to support the non-relational structures with XML, and Object-Oriented features. DB2 is a family of products and services which include DB2 database, DB2 warehouse, DB2 on the cloud, DB2 hosted, DB2 warehouse on the cloud, DB2 Big SQL, and DB2 event store.

You can use the COMMIT to make the data changes permanent. COMMIT also allows other users to access the data by other applications who have a reference to the committed data. 

Following are the data types available in DB2 

  • SMALLINT
  • FLOT
  • CHAR
  • DATE
  • INTEGER 
  • DECIMAL 
  • VARCHAR
  • TIME

Using DB2 Optimizer you can choose the access path and process the SQL statements.  

SQLCA is an acronym for Structured Query Language Communication Area. It is defined as a structure of variables and these variables are updated after every execution of SQL statements. Even though an application contains many numbers of SQL statements you need only a single SQLCA.  For a programming language like java, there is no requirement for SQLCA.  

A Check constraint defines the values to be inserted in one or columns of a database table.  It is similar to referential constraints and is optional to use. When defining a check constraint you can use either of these two statements which are ALTER TABLE or CREATE TABLE. Using a Check constraint you can define the values that a particular table can contain. It acts as a condition or policy to achieve data integrity.  

The SCALA maximum length is 136. 

The process which helps you in accessing the DB2 table is called a bind. Bind acts as a communication medium by using database request modules from DB2 pre-compile step as input. It also cross-checks user authentication and checks SQL statements in the DBRM(S).

We have 3 types of page locks in DB2, which are: 

  • Update 
  • Share 
  • Exclusive
The buffer pool is nothing but a portion of the main memory space allocated by the database manager. The main intention of the buffer pool is to index data from disk and cache tables.   Every database has its own buffer pools. A buffer pool is created by default when you create a fresh database.  You can create as many buffers as possible based on the user requirements.

Looking for Best DevOps Hands-On Training?

Get DevOps Practical Assignments and Real time projects

Yes! A user can be allowed to use multiple cursors for a single program.

For effectively migrating the SVN to Git, we can use SubGit tool. With SubGit tool, we can al

The database manager is one of the core components of DB2 and it is responsible for managing the databases. It coordinates all other system components together to perform necessary functions such as logging, locking, and physical I/O operations (such as update, search, retrieve, and maintenance). 

A data page is defined as a place or unit of data that is retrievable whether it maybe 32K, or 4K (based on the table definition), consists of the catalog or containing user information. 

The short form of Declaration Generator is (DCLGEN) and it is being used for generating SQL statements that define a view or table. These views or table descriptions are utilized for checking the validity of other statements at precompile time. The table or View declarations help the Declaration generator to build a host language structure.    

The host variable is nothing but a data item and is used in SQL statements to supply a value or receive a value. It should be preceded by a colon (:) to inform DB2 the variable specified is not a column name. 

A  recovery log is a collection of records that defines the series of events that get processed in DB2. The information recorded in the recovery log is highly helpful in the event of execution failure. 

The resource control table (RCT)  consists of control characteristics that are grouped together using the DSN CRCT macros. The RCT maps the CICS transaction ID to the relevant DB2 plan ID and authorization ID. 

Repeatable read is a protection feature and helps in application execution. When you use repeatable read protection to execute an application program, the rows referenced by the program are not going to affect until the program reaches a commit point.  

We have four types of buffer pools in DB2 and they are: 

  • BP32
  • BP0
  • BP1
  • BP2 

The clustering index is an index that helps you in locating the table rows and explain the procedure to group the rows together in the tablespace. 

Become DevOps Certified Expert in 35 Hours

Get DevOps Practical Assignments and Real time projects

Intermediate DB2 Interview Questions and Answers

Concurrency in an environment or ability where multiple applications can have access to the same data at the same time.  However, Concurrency has been designed in a way to prevent problems during multiple applications accessing the same data. The common problems that arise during the concurrency execution are uncommon data, lost data, and unrepeatable reads. The DB2 uses one of the basic ways to control concurrency through units of locking. When a unit is locked it is still in locking mode till the work is completed and then it is released back to normal.  

DBRM is abbreviated as a Database Request Module and it is one of the major components resided inside DB2. DBRM contains SQL source statements that can be easily extracted from the application program. It generates inputs that play a key role in executing the binding process.  

RCT is abbreviated as a Resource Control Table and resides in the DB2/CICS region. All the features of RCT are collected through macros of DSNCRCT. 

The buffer manager is a major component that resides inside DB2 and acts as a medium for data transfer between virtual as well as the external medium. The buffer manager has the capability to bring down the number of physical inputs and output operations by using various highly sophisticated buffering techniques.  

PACKAGES play an important role in DB2 and act as a place for control structures. DB2 uses packages to control structures while executing SQL statements. Packages are created during program preparation. 

Below mentioned are the advantages of Packages: 

  • It eliminates all the unnecessary stuff and gives you small collections and saves you cost. 
  • Makes the process simple by eliminating the need to bring a large number of members of DBRM together for a specific plan. 
  • The programmatic changes and errors associated with them can be minimized by using Packages. 
  • When the process of automatic binding or rebinding takes place for a specific plan, Packages ensure that the entire transaction attracted to the process remains in isolation or unavailable. 

The major purpose of using DCLGEN is to detect the misspelt column names during the precompilation process. There is no such mandate to use the DCLGEN. It is a common tool that helps in generating variable definitions for hosts and minimizes the chance of occurring errors. 

The EXPLAIN statement gathers and stores the data about access path selection that is useful for an explainable statement. A statement is considered as an explainable one if it is a MERGE, SELECT, or INSERT statement, or searched form of DELETE or UPDATE statement. The information obtained will be stored in a supplied set of user tables and these tables are called EXPLAIN tables. 

A DB2 unit is a list of recoverable series of tasks or operations executed by DB2 for executing an application. There is always coordination between the units of recovery and works together in a process to make changes to other recoverable resources. If an application process is using a relational database as their single most recoverable resource, then the scope of the unit of recovery and unit of recovery are the same. 

DB2 manages a list of tables that consists of data about the information that can be controlled by DB2. All these tables together are called a catalogue. These catalogue tables hold information about DB2 objects which include views, tables, and indexes. Whenever you alter, create, or drop an object the DB2 updates, inserts, or deletes rows of the catalogue.  A DB2 catalogue consists of complete data about each aspect defined in the DB2 system which includes indexes, tablespaces, copies of indexes and tablespaces, and storage groups. 

Become a master in DevOps Course

Get DevOps Practical Assignments and Real time projects

The SQL communication area consists of a wide range of variables that holds status and error information accessible by a program.  All this information displayed in the SQL communication area is related to execute embedded SQL database statements. It also acts as a mandatory data structure that should be included in any host-language program. SQL communication area consists of fields such as return codes, handling codes, error messages, and warnings.  

There are two commonly used ways to execute a DB2-batch program which are: 

  • Using DNS utility to execute a DB2-batch program 
  • By using the IKJEFT01 utility program

SQLCA fields are: 

  • SQLERRM
  • SQLCODE
  • SQLERRD

DB2 typically uses 3 methods while choosing a lock-size. Which are: 

  • By taking into consideration the lock size defined at the time of creating a tablespace. 
  • Programming can define what lock-size suites best
  • If any lock size is defined, then the DB2 selects the lock-size of PAGE. 

Lock escalation is a task to release a large number of row, LOB, page, or XML locks specified by an application process on a tablespace or on a single table. Lock Escalation helps you acquire a table space lock, or a table, or a group of partition locks of X or S mode. When the Lock Escalation happens the DB2 passes the information to DSNI031 and helps in identifying the tablespace that has got the lock escalation.  

Alter is an SQL statement that is being used for making modifications to the definition of DB2 objects.   

DBRM is abbreviated as a Database Request Module and consists of a list of SQL statements collected from the host language program by the pre-compiler. A PLAN statement is created during the BIND process and contains the executable code for the SQL statements in the DataBase Request Model. 

A collection is a nothing but a user-defined name and ranges between 1 to 128 characters and it is mandatory to specify for each package by a programmer. It consists of a group of DB2 packages. 

RUNSTATS is a DB2 utility that grasps and records the complete information about DB2 objects, indexes, tables, etc. The entire information collected by RUNSTATS gets stored in the DB2 catalogue. DB2 uses the RUNSTATS data to analyze and provide the best possible access path for getting the data requested by the SQL. 

The SYSIBM.SYSLINK  table holds the data on the links related to the tables created by referential constraints.  

Looking for DevOps Hands-On Training?

Get DevOps Practical Assignments and Real time projects

Advanced DB2 Interview Questions and Answers

Yes, we can use MAX on a CHAR column.  

To select the row using index you need to declare the indexed columns in the where Clause query. 

The Database services component is responsible and looks after the execution process of SQL statements. Moreover, it also manages the buffer pool. 

The DB2 Startup and Shutdown tasks are handled by the System service component. 

Following are the three levels at which we can apply the locks: 

  • Tablespace
  • Page 
  • Table 

If a program abends while the transaction is in the process then the DB2 executes an auto rollback. 

Locks can be classified based on three aspects which are size, mode and duration. 

Uncommitted read is the isolation level that gives the maximum concurrency. 

Repeatable read is the isolation level at which the highest data integrity level is available. This happens because it holds the page and locks rows till it reaches a COMMIT point.  

A table can only consist of a single primary key. 

With this, we have come to the end of this frequently asked DB2 interview questions blog. Hope you enjoyed reading and found some useful information. Going through these top DB2 interview questions would help you in acquiring the required knowledge and confidence to clear the interview in the very first attempt. All these questions presented here are commonly asked in an interview and simplifies your way of cracking the interview with ease. Happy learning!

🚀Fill Up & Get Free Quote