Dear Readers, Welcome to DB2 Interview Questions and Answers have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of DB2. These DB2 Questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular questions during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
DB2 is a subsystem of the MVS operating system. It is a Database Management System (DBMS) for that operating system.
The path that is used to get to data specified in SQL statements.
It is an alternate name that can be used in SQL statements to refer to a table or view in the same or remote DB2 subsystem.
Plan is a DB2 object (produced during the bind process) that associates one or more database request modules with a plan name.
Bind is a process that builds “access paths” to DB2 tables. A bind uses the Database Request Modules(s) (DBRM(s)) from the DB2 pre-compile step as input and produces an application plan.
It also checks the user’s authority and validates the SQL statements in the DBRM(s).
The database request module produced during the pre-compile. The SYSIBM.SYSSTMT table of the DB2 catalog.
The attachment facility is an interface between DB2 and TSO, IMS/VS, CICS, or batch address spaces. It allows application programs to access DB2.
AUTO COMMIT is a SPUFI option that commits the effects of SQL statements automatically if they are successfully executed.
A base table is a real table - a table that physically exists in that there are physical stored records.
The buffer manager is the DB2 component responsible for physically transferring data between an external medium and (virtual) storage (performs the actual I/O operations). It minimizes the amount of physical I/O actually performed with sophisticated buffering techniques(i.e., read-ahead buffering and look-aside buffering).
A buffer pool is main storage that is reserved to satisfy the buffering requirements for one or more tablespaces or indexes, and is made up of either 4K or 32K pages.
There are four buffer pools: BP0, BP1, BP2, and BP32.
CLOSE physically closes the tablespace when no one is working on the object. DB2 (release 2.3) will logically close tablespaces.
It is a type of index that (1) locates table rows and (2) determines how rows are grouped together in the tablespace.
COMMIT will allow data changes to be permanent. This then permits the data to be accessed by other units of work. When a COMMIT occurs, locks are freed so other applications can reference the just committed data.
Concurrency is what allows more than one DB2 application process to access the same data at essentially the same time. Problems may occur, such as lost updates, access to uncommitted data, and un-repeatable reads.
It is cursor stability that “tells” DB2 that database values read by this application are protected only while they are being used. (Changed values are protected until this application reaches the commit point). As soon as a program moves from one row to another, other
programs may read or the first row.
The Data Manager is a DB2 component that manager the physical databases. It invokes other system components, as necessary, to perform detailed functions such as locking, logging, and physical I/O operations (such as search, retrieval, update, and index maintenance).
A DBRM is a DB2 component created by the DB2 pre-compiler containing the SQL source statements extracted from the application program. DBRMs are input to the bind process.
A data page is a unit of retrievable data, either 4K or 32K (depending on how the table is defined), containing user or catalog information.
They are attributes of columns, literals, and host variables. The data types are SMALLINT, INTEGER, FLOAT, DECIMAL, CHAR, VARCHAR, DATE and TIME.
DCLGEN is a facility that is used to generate SQL statements that describe a table or view.
These table or view descriptions are then used to check the validity of other SQL statements at precompile time. The table or view declares are used by the DB2I utility DCLGEN to build a host language structure, which is used by the DB2 precompiler to verify that correct column names and data types have been specified in the SQL statement.
DSNDB07 is where DB2 does its sorting. It includes DB2’s sort work area and external storage.
It will drop(delete) that existing plan.
This is a data item that is used in an SQL statement to receive a value or to supply a value.
It must be preceded by a colon (:) to tell DB2 that the variable is not a column name.
The optimizer is a DB2 component that processes SQL statements and selects the access paths.
This is the unit of storage within a table space or indexspace that is accessed by DB2.
Pagespace refers to either to an unpartitioned table, to an index space, or to a single partition of a partitioned table of index space.
A predicate is an element of a search condition that expresses or implies a comparison operation.
The RCT is a table that is defined to a DB2/CICS region. It contains control characteristics which are assembled via the DSNCRCT macros. The RCT matches the CICS transaction ID to its associated DB2 authorization ID andplan ID(CICS attachment facility).
When an application program executes with repeatable read protection, rows referenced by the program can’t be changed by other programs until the program reaches a commit point.
A STOGROUP is a named collection of DASD volumes to be used by tablespaces and index spaces of databases. The volumes of STOGROUP must be of the same device type.
If the tablespace used is only allocated to that STOGROUP:
- ALTER STOGROUP - add volume (new) delete volume(old)
- REORG TABLESPACE or RECOVER TABLESPACE
Create a new STOGROUP that points to the new volume. ALTER the tablespace and REORG
or RECOVER the tablespace.
This is a seven part value that consists of a date (yymmdd) and time(hhmmss and microseconds).
This is a sequence of operations within a unit of work(i.e., work done between commit points).
Exclusive, update, and share.
DB2 can be invoked by TSO users by using the DSN RUN command.
The DB2 catalog is a set of tables that contain information about all of the DB2 objects(tables, views, plans etc.).