Difficulty: Medium
Correct Answer: A DBRM is a module created by the DB2 precompiler that contains the extracted SQL statements and related information for a program, and it is later used during the BIND process.
Explanation:
Introduction / Context:
DBRM, or Database Request Module, is an important concept in traditional DB2 for z slash OS application development. This interview question checks whether the candidate understands the precompile and bind phases and how SQL statements are separated from source code into DB2 specific modules.
Given Data / Assumptions:
Concept / Approach:
During precompilation, DB2 scans the source program, strips out the embedded SQL statements, and places them into a separate object called a DBRM. The precompiler also converts the host language source with calls to DB2. Later, the DBRM is input to the BIND process, which creates a plan or package containing executable access paths. The correct option therefore must describe the DBRM as a module produced by the precompiler that holds SQL and related metadata, not as a runtime log or utility.
Step-by-Step Solution:
Step 1: Recall that embedded SQL programs are processed by a DB2 precompiler before the normal compiler.
Step 2: The precompiler removes SQL statements from the code and places them into a DBRM, while replacing them with appropriate host language calls.
Step 3: The DBRM contains the SQL statements and information needed for the optimizer to build access paths.
Step 4: During the BIND step, the DBRM is transformed into a plan or package that DB2 uses at run time.
Step 5: Therefore, select the option that describes a DBRM as a precompile produced module containing SQL, used during bind.
Verification / Alternative check:
Standard DB2 build flows show a clear sequence: source code to precompile to DBRM and modified source, then compilation and link edit, and finally BIND of the DBRM into a plan or package. This verified process matches the description in option A and confirms that the DBRM is not a simple log file or a reorganization utility.
Why Other Options Are Wrong:
Option B is wrong because runtime error logs are not called DBRMs; they are separate diagnostic or logging artifacts.
Option C is wrong because index rebuild and reorganization are handled by utilities such as REORG or REBUILD INDEX, not by DBRMs.
Option D is wrong because job scheduling is managed by operating system components and job control systems, not by DB2 DBRMs.
Common Pitfalls:
A common misunderstanding is to think of DBRMs as executable code, when in fact they are intermediate objects that must be bound into executable plans or packages. Another pitfall is ignoring the need to rebind plans or packages when catalog statistics change significantly, even though the DBRM content remains the same. Understanding DBRMs and their role helps developers and DBAs manage change and performance more effectively.
Final Answer:
A DBRM is a module created by the DB2 precompiler that contains the extracted SQL statements and related information for a program, and it is later used during the BIND process.
Discussion & Comments