Function and Rules for Global Temporary Trace Tables | Teradata Vantage - Function of Global Temporary Trace Tables - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

Like global temporary tables, global temporary trace tables have a persistent definition, but do not retain rows across sessions.

Global temporary trace tables are not hashed. Instead, each table row is assigned a sequential hash sequence. You can perform an INSERT … SELECT operation on the table to copy its rows into a normal hashed table with a primary key, indexes, or additional attributes common to other base table types if you need to do so.

Define the information you want to trace as the input to the UDF. The UDF can then call the FNC_Trace_Write_DL function that places the information in a global temporary trace table. If the trace is not turned on, the system does no function traceback, though there is still some overhead because the system still calls the UDF. SeeTeradata Vantage™ - SQL External Routine Programming, B035-1147 and SET SESSION FUNCTION TRACE.

Run the trace UDF in non-protected mode once it has been debugged to ensure that it executes in-line with the procedure. A premature end of the procedure or a rollback of the transaction has no impact on the global temporary trace table, and its contents are not deleted until the session logs off. Enabling function traceback makes your procedure run more slowly because each trace call forces the data to be written into the trace table. Nothing is buffered to ensure that nothing is lost while you are testing a function.