-STOP FUNCTION SPECIFIC command (Db2)

The -STOP FUNCTION command SPECIFIC prevents Db2 from accepting SQL statements with invocations of the specified functions.

This command does not prevent SQL statements with invocations of the functions from running if they have already been queued or scheduled by Db2. You cannot use this command to stop built-in functions or user-defined functions that are sourced on another function.

Db2 implicitly issues the command STOP FUNCTION SPECIFIC ACTION(REJECT) for any function that exceeds the maximum abend count. That count is set by the MAX ABEND COUNT field of installation panel DSNTIPX.

Abbreviation: -STO FUNC SPEC

Environment

This command can be issued from a z/OS® console, a DSN session under TSO, a DB2I panel (DB2 COMMANDS), an IMS or CICS® terminal, or a program using the instrumentation facility interface (IFI).

Data sharing scope: Group or member

Authorization

To execute this command, you must use a privilege set of the process that includes one of the following authorities for each function:
  • Ownership of the function
  • System DBADM authority
  • SYSOPR authority
  • SYSCTRL authority
  • SYSADM authority
If you specify STOP FUNCTION SPECIFIC *.* or schema.partial-name *, the privilege set of the process must include one of the following authorities:
  • SYSOPR authority
  • SYSCTRL authority
  • SYSADM authority

Db2 commands that are issued from a logged-on z/OS console or TSO SDSF can be checked by Db2 authorization using primary and secondary authorization IDs. Start of changeA logged-on z/OS user ID must be defined in RACF or a similar security server.End of change

Syntax for -STOP FUNCTION SPECIFIC

Read syntax diagramSkip visual syntax diagramSTOP FUNCTION SPECIFIC( *.*)(,schema.specific-function-nameschema.partial-name*)ACTION(QUEUEREJECT)SCOPE(LOCALGROUP)

Option descriptions for -STOP FUNCTION SPECIFIC

(*.*)
Stops access to all functions, including functions that Db2 applications have not yet accessed.

If no functions are named, all functions are stopped.

schema.specific-function-name
Stops one specific function name. You cannot specify a function name as you can in SQL; you must use the specific name. If a specific name was not specified on the CREATE FUNCTION statement, query SYSIBM.SYSROUTINES for the correct specific name:
SELECT SPECIFICNAME, PARM_COUNT
  FROM SYSIBM.SYSROUTINES
   WHERE NAME='function_name'
    AND SCHEMA='schema_name';
For overloaded functions, this query can return multiple rows.
schema.partial-name *
Stops a set of functions in the specified schema. The specific names of all functions in the set begin with partial-name and can end with any string, including the empty string. For example, schema1.ABC* stops all functions with specific names that begin with ABC in schema1.
ACTION
Indicates what to do with an SQL statement that invokes the function while the function is stopped. If you issue STOP FUNCTION SPECIFIC more than once for a given function, the action that is taken is determined by the ACTION option on the most recent command.
(QUEUE)
Queues the request until either of the following conditions is true:
  • The wait exceeds the installation timeout value.
  • You issue START FUNCTION SPECIFIC command for the function.
(REJECT)
Rejects the request.
SCOPE
Specifies the scope of the command.
(LOCAL)
Specify to stop the function on the local member only.
(GROUP)
Specify to stop the function on all members of the data sharing group.

Usage notes for -STOP FUNCTION SPECIFIC

Limitations of STOP FUNCTION SPECIFIC
STOP FUNCTION SPECIFIC is only applicable to external functions that run in the WLM application environment or non-inline SQL functions. STOP FUNCTION SPECIFIC cannot stop a built-in function, an inline SQL function, or a user-defined function that is sourced on another function.
Permanently disabling a function
A stopped function does not remain stopped if Db2 is stopped and restarted. To disable a function permanently, you can:
  • Use ALTER FUNCTION to change the LOADMOD name to a nonexistent z/OS load module
  • Rename or delete the z/OS load module
Considerations for SQL functions
The STOP FUNCTION SPECIFIC command affects all versions of the SQL functions that you specify in the command.
Trace information for commands issued with group scope
If this command is issued with options that specify group scope in a Db2 data sharing member, it also runs on all other active members. IFICID 090 trace records for other group members can show that the same command was issued by the SYSOPR authorization ID from the 016.TLPKN5F correlation ID, in addition to the trace records from the member where the original command was issued. See Command scope in Db2 data sharing.

Examples for -STOP FUNCTION SPECIFIC

Example 1: Stop access to all functions. While the STOP FUNCTION SPECIFIC command is in effect, Db2 queues all attempts to execute functions.
-STOP FUNCTION SPECIFIC ACTION(QUEUE)
This command produces output similar to the following output:
DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL FOR *.* 
DSN9022I - DSNX9COM '-STOP FUNC' NORMAL COMPLETION
Example 2: Stop access to all functions. While the STOP FUNCTION SPECIFIC command is in effect, Db2 rejects attempts to execute functions.
-STOP FUNCTION SPECIFIC ACTION(REJECT)
This command produces output similar to the following output:
DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL FOR *.* 
DSN9022I - DSNX9COM '-STOP FUNC' NORMAL COMPLETION
Example 3: Stop functions PAYROLL.USERFN1 and PAYROLL.USERFN3. While the STOP FUNCTION SPECIFIC command is in effect, Db2 queues all attempts to execute functions.
-STOP FUNCTION SPECIFIC(PAYROLL.USERFN1,PAYROLL.USERFN3)
This command produces output similar to the following output:
DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL
FOR PAYROLL.USERFN1

DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL 
FOR PAYROLL.USERFN3

DSN9022I - DSNX9COM '-STOP FUNC' NORMAL COMPLETION 
Example 4: Stop functions PAYROLL.USERFN1 and PAYROLL.USERFN3. While the STOP FUNCTION SPECIFIC command is in effect, Db2 rejects attempts to execute either of these functions.
-STOP FUNCTION SPECIFIC(PAYROLL.USERFN1,PAYROLL.USERFN3) ACTION(REJECT)
This command produces output similar to the following output:
DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL
FOR PAYROLL.USERFN1

DSNX974I - DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL 
FOR PAYROLL.USERFN3

DSN9022I - DSNX9COM '-STOP FUNC' NORMAL COMPLETION