DBM Instance Memory Structure
DBM
Instance Memory (usually
called Global Control Block) has the following internal structure:
Database
Manager Instance memory elements:
-
Monitor Heap
Size
-
Directory
Cache
-
Audit Buffer
-
FCM Memory
Allocations
-
Backup and
Restore Buffer
Every DB2
instance has the same shown structure. Backup and restore buffers are allocated
and deallocated on demand and are not permanently present. The ESE DB2 database
with enabled intra_partition or inter-partition parallelism (logical or physical partitioned
DB2 database) has allocated an additional memory segment for the Fast
Communication Manager (FCM). FCM provides communication support between
database partitions.
The database's
instance memory allocation is controlled with the following parameters:
Database System Monitor Heap Size
|
Parameter
|
Configurable
Online
|
Automatic
|
|
mon_heap_sz
|
No
|
No
|
The Monitor
Heap Size is the memory segment used for collecting monitor data. The Monitor
heap size is measured in 4KB pages.
# db2 get dbm cfg | grep MON_HEAP_SZ
Database monitor heap size (4KB) (MON_HEAP_SZ) = 56
Activities
such as snapshots, activating or resetting monitor switches and event monitors
will populate the memory buffer allocated on the instance startup. Having the DBM
setting mon_heap_size=0 will prevent any collection of monitored
data. For a heavily used database with many applications connected and a high
demand for collecting monitor information, may cause a monitor buffer overflow.
Such situations with an inadequate monitoring buffer will result in an error condition,
entries in the database alert log and failures on starting additional monitor
sessions. The default monitor heap size is 56 in 4KB pages or 224KB. The maximum
size for the mon_heap_size is 240 MB or 60000 in 4KB pages.
Directory cache support or database
directory listings
|
Parameter
|
Configurable
Online
|
Automatic
|
|
dir_cache
|
No
|
No
|
The DBM
configuration parameter, dir_cache enables database directory caching. Database
directory is the common name for the system db directory, local database
directory, node directory and DCS directory. Each of them is used for storing
determined content:
-
system
database directory contains information related to all known databases
-
local database
directory contains information related to all local databases
-
node directory
contains connectivity information related to the remote databases
-
DCE directory
contains connectivity information for the host databases
Database
directory information caching reduces connection delay and directory file I/O.
DBM will
automatically govern the shared directory cache, while applications have to
manage a separate, private directory cache. The shared cache is populated
during DBM (instance) startup.
# db2 get dbm cfg | grep DIR_CACHE
Directory cache support (DIR_CACHE) = YES
After
startup, all local and remote database and node entries are cached in the
shared cache. Any newly created entry that results from catalog operations
(database catalog, uncatalog, create or drop) would not be cached in the shared
directory cache. Only on the next DBM restart will new entries be cached. By
default, dir_cache parameter is always enabled.
Listing node
directory entries for the test DB2 instance:
db2 => list node directory
Node Directory
Number of entries in the directory = 2
Node 1 entry:
Node name = ARTIST01
Comment = Article DB2 Server
Protocol = TCPIP
Hostname = ARTIST01.zg.tel.hr
Service name = 50000
Node 2 entry:
Node name = HOST99
Comment =
Protocol = TCPIP
Hostname = IBMHOST01.zg.tel.hr
Service name = 51100
Listing system
database directory entries for the test DB2 instance:
db2 => list database directory
System Database Directory
Number of entries in the directory = 3
Database 1 entry:
Database alias = ARTIST
Database name = ARTIST
Node name = JUPITER0001
Local database directory = /export/users/db2inst1/node0/artist
Database release level = 9.00
Comment = ARTICLE DB2
Directory entry type = Indirect
Authentication = SERVER
Catalog node number = 0
Database 2 entry:
Database alias = HOST01
Database name = HOST01
Node name = SATURN00010
Database release level = 9.00
Comment = IBM Host DB2
Directory entry type = Remote
Authentication = DCS_ENCRYPT
Catalog node number = -1
Database 3 entry:
Database alias = MARIN
Database name = MARIN
Local database directory = /export/users/db2inst1/node0/artist
Database release level = 9.00
Comment = ALIAS FOR LOCAL DB
Directory entry type = Indirect
Authentication = SERVER
Catalog node number = 0
Remark
following specific entries in the system database directory:
1- ARIST (Directory entry
type=Indirect) local
database entry
2- HOST01
(Directory
entry type=Remote) remote
Host DB2 database entry
3- MARIN (Directory entry
type=Indirect) local
database alias
Audit
Buffer Size
|
Parameter
|
Configurable
Online
|
Automatic
|
|
audit_buf_sz
|
No
|
No
|
The Audit Buffer Size parameter
specifies the size for the audit buffer, created during DBM start in the
instance control block and used for audit information caching.
# db2 get dbm cfg | grep AUDIT_BUF_SZ
Audit buffer size (4KB) (AUDIT_BUF_SZ) = 0
The
default value for audit_buf_sz parameter is 0. When this
parameter is set to the default of zero (0), DBM will not cache the audit
records but will write them ddirectly, synchronously to disk. The Audit buffer
values range from a minimum of 0 to a maximum of 65000 in 4KB pages, resulting
in a maximum audit buffer size of 254MB.