When the DB2 configuration parameter KEEPFENCED is enabled, which of the following can be kept in memory to improve performance?

Difficulty: Medium

Correct Answer: Stored procedure processes after they have been run

Explanation:


Introduction / Context:
This question examines DB2 configuration related to fenced routines, specifically the KEEPFENCED parameter. Fenced stored procedures and user defined functions run in separate processes for protection. Enabling KEEPFENCED allows DB2 to keep these external processes alive after they finish execution, which can reduce overhead when routines are called repeatedly.


Given Data / Assumptions:

    The DB2 database uses fenced stored procedures or user defined functions.

    The configuration parameter KEEPFENCED can be set to keep or terminate external processes.

    The administrator is concerned with performance related to routine startup costs.

    Only one of the options describes objects that KEEPFENCED directly affects.


Concept / Approach:
Fenced routines run in separate operating system processes for safety. Starting and stopping those processes for every call introduces overhead. When KEEPFENCED is enabled, DB2 keeps the external process running after completion so that subsequent calls can reuse it, reducing process creation overhead. The parameter does not keep SQL descriptors, referential maps or table data in memory, because those are handled through other mechanisms such as buffer pools and internal memory management.


Step-by-Step Solution:
1. Recall that KEEPFENCED controls whether fenced routine processes remain active after execution. 2. Examine option C, which describes stored procedure processes staying in memory after they run. 3. Recognize that SQL descriptor areas and referential integrity maps are internal structures managed within DB2 engine memory, not controlled by KEEPFENCED. 4. Understand that table data in the buffer pool is governed by buffer pool settings, not by fenced routine options. 5. Conclude that option C matches the behavior of KEEPFENCED and is therefore correct.


Verification / Alternative check:
DB2 documentation states that when KEEPFENCED is set to YES, fenced routine processes remain available, improving performance when routines are invoked frequently. Setting it to NO causes DB2 to terminate the process after each call.


Why Other Options Are Wrong:
SQL descriptor areas are tied to cursors and statement execution, not to fenced routine processes.
Referential integrity maps are part of query execution and constraint enforcement and are not controlled by KEEPFENCED.
Table pages in buffer pools remain in memory based on buffer pool size and replacement algorithms, not based on fenced routine configuration.


Common Pitfalls:
A frequent confusion is thinking that any configuration parameter that keeps something in memory must relate to buffer pools or cache. In reality, KEEPFENCED is specifically about operating system processes used for fenced routines. Another pitfall is failing to consider the trade off between performance and resource usage when many routines are kept active.


Final Answer:
With KEEPFENCED enabled, DB2 can keep stored procedure processes in memory after they run so they can be reused.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion