set sql tracing database argument: Change database tracing (SQL administration API)

Use the set sql tracing database argument with the admin() or task() function to start or stop tracing for a database, or list which databases are being traced.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-EXECUTE FUNCTION--+-admin-+---------------------------------->
                     '-task--'   

                                        .------------------------.     
                                        V                        |     
>--(--+-"set sql tracing database add"----+--------------------+-+-+-->
      |                                   '-,--"database_name"-'   |   
      +-"set sql tracing database clear"---------------------------+   
      +-"set sql tracing database list"----------------------------+   
      '-"set sql tracing database remove"--,--"database_name"------'   

>--)--;--------------------------------------------------------><

Element Description Key Considerations
database_name The name of the database. Specify one database name.

Usage

Use the set sql tracing database add argument to specify tracing for one or more databases, rather than for all databases. The default is all databases. Specify up to six arguments in a single admin() or task() function. The maximum number of database names that can be set is 16.

Use the set sql tracing database clear argument to clear all databases from the list of databases being traced. Returns tracing back to the default of all databases.

Use the set sql tracing database list argument to list the databases that are being traced.

Use the set sql tracing database remove argument to remove a single database from the list of databases being traced.

When you use the set sql tracing database argument, you can specify only the name of one database. While you can have a maximum of 16 database names, you must specify each additional database name in separate function calls. Each time you call the function, the function adds another database to the list, until the list contains 16 databases.

Example

The following example sets SQL tracing for three databases with the names db1, db2 and db3:

EXECUTE FUNCTION task("set sql tracing database add","db1");
EXECUTE FUNCTION task("set sql tracing database add","db2");
EXECUTE FUNCTION task("set sql tracing database add","db3");

Copyright© 2019 HCL Technologies Limited