Saving diagnostics to a trace file

Once enabled, set tracefile saves all SQL text for the current session to the specified file, each SQL text batch appending to the previous batch.

The syntax to enable tracing is:

set tracefile file_name [off] [for spid

The syntax to disable tracing is:

set tracefile off [for spid]

Where:

Examples

These are the restrictions for set tracefile: