-START PROCEDURE command (Db2)

The Db2 command START PROCEDURE activates the definition of a stored procedure that is stopped or refreshes one that is stored in the cache. You can qualify stored procedure names with a schema name.

On successful completion of the command, queued requests for the specified stored procedures begin to execute. The abend counts for the specified procedures are set to zero. Db2 resets the MAXQUE and TIMEOUT statistics to 0 each time that you execute the START PROCEDURE command.

You do not need to issue START PROCEDURE when you define a new stored procedure to Db2. Db2 automatically activates the new definition when it first receives an SQL CALL statement for the new procedure.

Abbreviation: -STA PROC

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:
  • Ownership of the stored procedure
  • System DBADM authority
  • 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

Read syntax diagramSkip visual syntax diagramSTART PROCEDURE( *.*)(,schema.procedure-nameschema.partial-name*procedure-namepartial-name*)SCOPE(LOCALGROUP)

Option descriptions

(*.*)
Marks all stored procedures in all schemas as available to be called.
( schema.procedure-name )
Starts the specified stored procedure in the specified schema.
( schema.partial-name *)
Starts a set of stored procedures in the specified schema. The names of all procedures in the set begin with partial-name and can end with any string, including the empty string. For example, PAYROLL.ABC* starts all stored procedures with names that begin with ABC in the PAYROLL schema.
procedure-name
Marks one or more specific stored procedures as available to be called.
partial-name *
Marks a set of stored procedures in the SYSPROC schema as available to be called. The names of all procedures in the set begin with partial-name and can end with any string, including the empty string. For example, ABC* starts all stored procedure names that begin with ABC in the SYSPROC schema.
SCOPE
Specifies the scope of the command.
( LOCAL )
Starts the specified stored procedures in only the local members.
(GROUP)
Starts the specified stored procedures in all members of the data sharing group.

Usage notes

Errors in a definition of a stored procedure
Errors are detected at create time for a stored procedure.
Considerations for native SQL procedures
The START PROCEDURE command affects all versions of the native SQL procedures 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

Example 1: Start all stored procedures.
-START PROCEDURE
This command produces output that is similar to the following output:
DSNX946I - DSNX9ST2 START PROCEDURE SUCCESSFUL FOR *.*
DSN9022I - DSNX9COM '-START PROC' NORMAL COMPLETION
Example 2: Make the stored procedures USERPRC1 and USERPRC2 available to be called, and start any requests that are waiting for those procedures.
-START PROCEDURE(USERPRC1,USERPRC2)
This command produces output that is similar to the following output:
DSNX946I - DSNX9ST2 START PROCEDURE SUCCESSFUL FOR USERPRC1
DSNX946I - DSNX9ST2 START PROCEDURE SUCCESSFUL FOR USERPRC2
DSN9022I - DSNX9COM '-START PROC' NORMAL COMPLETION