The database manager uses the buffer pool to apply additions, modifications,
and deletions to much of the database data.
Storage keys is a new feature in IBM® Power6 processors and the AIX® operating system that allows the protection
of ranges of memory using hardware keys at a kernel thread level.
Storage key protection reduces buffer pool memory corruption problems
and limits errors that might halt the database. Attempts to illegally
access the buffer pool by programming means cause an error condition
that the database manager can detect and deal with.
Note: Buffer pool
memory protection works on a per-agent level; any particular agent has access
to buffer pool pages only when that agent needs access.
The database manager protects buffer pools by restricting access
to buffer pool memory. When an agent requires access to the buffer
pools to perform its work, it is temporarily granted access to the
buffer pool memory. When the agent no longer requires access to the
buffer pools, access is revoked. This behavior ensures that agents
are only allowed to modify buffer pool contents when needed, reducing
the likelihood of buffer pool corruptions. Any illegal access to buffer
pool memory results in a segmentation error. Tools to diagnose these
errors are provided, such as the db2diag, db2fodc, db2pdcfg,
and db2support commands.
To enable the buffer pool memory protection feature, in order to
increase the resilience of the database engine, enable the
DB2_MEMORY_PROTECT registry
variable:
- DB2_MEMORY_PROTECT registry variable
- This registry variable enables and disables the buffer pool memory
protection feature. When DB2_MEMORY_PROTECT is enabled
(set to YES), and a DB2® engine
thread tries to illegally access buffer pool memory, that engine thread
traps. The default is NO.
- Note:
- The buffer pool memory protection feature depends on the implementation
of AIX Storage Protect Keys
and it might not work with the pinned shared memory. If DB2_MEMORY_PROTECT is
specified with DB2_PINNED_BP or DB2_LARGE_PAGE_MEM setting, AIX Storage Protect Keys may not
be enabled. For more information about AIX Storage Protect Keys,
see http://publib.boulder.ibm.com/infocenter/systems/scope/aix/index.jsp?topic=/com.ibm.aix.genprogc/doc/genprogc/storage_protect_keys.htm.
- You cannot use the memory
protection if DB2_LGPAGE_BP is set to YES.
Even if DB2_MEMORY_PROTECT is set to YES, DB2 database manager will fail to
protect the buffer pool memory and disable the feature.