ADMIN_FMP_TERM procedure
The ADMIN_FMP_TERM routine is used to shut down a fenced mode process (db2fmp) process either on last usage by a routine or on next access, if pooled.
Note: The ADMIN_FMP_TERM procedure is available in Db2 11.5.8 and later.
Fenced mode
processes are created as separate system entities in order to isolate user-written fenced mode code
from the database manager agent process.Authorization
One of the following authorities is required to execute the procedure:
- SYSADM
- SYSCTRL
- SYSMAINT
Syntax
The schema is SYSPROC.
Procedure parameters
-
pid_of_db2fmp_process
- An input parameter of type INTEGER that specifies the process id of the db2fmp process to be terminated. Specify 0 to terminate all db2fmp processes in the system. member
- An optional input argument of type INTEGER that specifies a valid member number. If this argument is not specified, or if -1 or the NULL value is specified, then the currently connected member is used.
Restrictions
The procedure will return error SQL2032N if the following values are specified for
pid_of_db2fmp_process:
- A process id that doesn’t exist.
- A process id that is not a db2fmp process.
- A process id of a Db2 autonomics computing daemon. This process is a db2fmp process, but not a general db2fmp that is used to run a user’s routines. The process cannot be shut down by this procedure.
- A member id that doesn’t exist.
Usage notes
- The purpose of this procedure is to shut down a db2fmp process on either last
usage by a routine or on next access, if pooled. It provides a graceful cleanup of the
db2fmp process without impacting any executing routines. This procedure does not
terminate the fmp process proactively, it only changes the status of the
fmp process. The fmp process is removed on the next reuse
attempt. You can check the status of the fmp process by running
b2pd -fmp
and viewing the Flags field. The Flags value indicates the status of the fmp process. refer to the example below. - Use the db2fmpterm command to terminate the fmp process
of any executing routine. This tool will cause currently executing routine to fail with SQL1131N as
a most likely error code. The db2fmpterm tool uses the following
syntax:
The db2fmpterm command does not interfere with future reruns of the terminated routine.db2fmpterm <pid_of_db2fmp_process>
Examples
The following example shows the output from running the db2pd -fmp command to
view how fmp is set up for your Db2 instance:
FMP:
Pool Size: 5000
Max Pool Size: 200 ( Automatic )
Keep FMP: YES
Initialized: YES
Trusted Path: /home/sqllib/function/unfenced
Fenced User: nobody
Shared Memory: 0x0000000201D40460
IPC Pool: 0x0000000201D404C0
The following example shows the output from running the db2pd -fmp command to
view the status of each active fmp process. Each fmp process is identified by the
FmpPid
value:FMP Process:
Address FmpPid Bit Flags ActiveThrd PooledThrd ForcedThrd Active IPCList FmpUser
0x00000002037DEF80 10042 64 0x00000000 1 0 0 Yes 0x00000002043AFFC0
Active Threads:
Address FmpPid EduPid ThreadId
0x00000002037DEF90 10042 236 0
Pooled Threads:
Address FmpPid ThreadId
No pooled threads.
Forced Threads:
Address FmpPid ThreadId
No forced threads.
When there are multiple fmp process running on the system, the output
shows the status of all fmp processes.