gorddbds 060001JCXS Visits (1478)
DB2 LUW provides the db2pd tool with two fmp options that when used in conjunction with each other can provide information which will identify the routine that was running in a particular db2fmp. The following technote documents a method to determine which db2fmp a routine ran in using the db2pd tool.
If a db2fmp entry is logged in the db2diag.log, the entry should contain the process ID (PID) and thread ID (TID). Below is a sample of a db2diag.log entry which identifies the db2fmp PID and TID.
PID : 59900132 TID : 0 PROC : db2fmp
Since the db2pd -fmp command described in the above technote returns the PID and TID as well as the routine name and time of the run, it is possible to use the information in the db2diag.log to map a routine to its db2fmp. Below is a sample of the output.
59900132 0 2012
So we can see from the above output that the db2fmp error occurred while running the routine SYSPROC.ADMIN_CMD
gorddbds 060001JCXS Visits (1285)
DB2 LUW is capable of running Java applications as stored procedures or user defined functions (Stored Procedures and UDFs are collectively referred to as routines). When a Java routine is invoked DB2 will load the class and start a JVM in a process called the db2fmp. Unlike other DB2 processes, this process is owned by the fenced user, so it is necessary for the fenced user ID to have access to the libraries containing the application classes and the JVM. By default the JDK that is shipped with DB2 is used. You can use a JDK other than the one shipped with DB2 by modifying the JDK_PATH dbm cfg variable to point to the location of the desired JDK. If you are using a 1.6 JDK it will be necessary to set the environment variable DB2LIBPATH to the path containing the JDK. Not every JDK is supported for running routines. Supported JDKs are documented in the DB2 Infocenter. The JDKs supported for version 9.7 are listed at the following URL.
In order to execute a Java routine DB2 will start a JVM in the db2fmp. On AIX systems the db2fmp will be unable to start a JVM if the Stack Execution Disable mode is set to “all' or “setidfiles”. If the SED is set to one of these modes it will be necessary to change the mode in order to run Java routines. You can verify the setting of the SED by issuing the command sedmgr.
For information on General routine performance including additional information on Java routines see the following URL.
See the following URL for information on modifying the dbm cfg variable JDK_PATH
gorddbds 060001JCXS Visits (1428)
100 Tech Tips: #86 What information is in the name of the db2fmp
The db2fmp or DB2 Fenced Mode Process is used to run untrusted external routines. These routines can be created in a variety of languages and can be thread-safe (meaning it is safe to run them in a multi-threaded db2fmp process with other unrelated routines), or not thread-safe (meaning they will be run in a single db2fmp process). The name of the db2fmp in the ps output can be used to determine the language and thread-safeness of the db2fmp. The name also indicates if the db2fmp is associated with one or more agents or is currently in the fenced pool. For example here is the output of the command ps -elf | grep db2fmp
242001 A nobody 6881336 10616948
0 60 20 850f65590 39372 * Apr 30 - 0:03 db2fmp
242001 A nobody 7143552 13697146
0 60 20 8f36cf590 4024 * 16:00:10 - 0:00 db2fmp (C)
242001 A nobody 36831440 22282262
0 60 20 892889590 2176 * 09:19:08 - 0:00 db2fmp
242001 A nobody 8913102 10616948 0 60 20 963616590 3876 * 14:54:10 - 0:00 db2fmp (idle)
The first db2fmp in the output with the (Java) in its name is associated with one or more agents and is being used to run thread-safe Java routines.
The second db2fmp with the (C) in its name is also associated with one or more agents and is being used to run thread-safe C routines.
The db2fmp with the (2829) in its name is currently associated with a single agent with the thread or process id that matches the number in the brackets. The routine run by this db2fmp is not thread-safe. If it were thread-safe the db2fmp name would contain the name of the routine's programming language instead of a number.
The db2fmp with (idle) in its name is currently in the fenced pool waiting for reuse and not associated with an agent.