Stopping global trace activity

The -STOP TRACE command terminates trace activity.

Begin program-specific programming interface information.

In a data sharing group, you can stop the trace only on one subsystem, or, if the trace was started with SCOPE(GROUP), you can stop the trace for the entire group by issuing the -STOP TRACE command with the SCOPE(GROUP) option.

Stopping a trace might not require specifying all the keywords specified when starting the trace. Just provide sufficient detail to stop the trace.

The command -STOP TRACE is invalid. To stop all active traces, issue the following command:

-STOP TRACE(*)

You might, for example, have started a trace with the following command:

-START TRACE(GLOBAL) DEST(GTF) RMID(10,12,24)

This command contains several keywords that limit the trace. Assuming this is the only global trace active, you can issue this command to stop it:

-STOP TRACE(GLOBAL)

If several global traces were active and you wanted to stop only one of them, you need to provide more details in the -STOP TRACE command. For instance, assume three traces are started as follows:

-START TRACE(GLOBAL) DEST(GTF) RMID(10,12,24)
-START TRACE(GLOBAL) RMID(10,12,24)
-START TRACE(GLOBAL) AUTHID(SYSADM1)

To stop the first of these three traces without disturbing the other two, you can enter:

-STOP TRACE(GLOBAL) DEST(GTF)

Because only the first trace sends data to GTF, specifying the trace destination provides sufficient detail.

The trace number (TNO) can also be used to stop trace activity. For instance, you might have previously started two traces with the following commands:

-START TRACE(GLOBAL) DEST(GTF)
-START TRACE(GLOBAL) AUTHID(USER1)

If output from -START TRACE or -DISPLAY TRACE commands indicate that the traces that were started were assigned trace numbers 1 and 2, respectively, then the first trace can be stopped by entering:

-STOP TRACE(GLOBAL) TNO(1)

When a trace number is specified, you do not need to specify any other keywords or parameters. The trace number provides a sufficient level of detail for Db2 to stop or display trace activity.

End program-specific programming interface information.