BTEQ Process - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2020-02-20
dita:mapPath
kil1527114222313.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

This section describes the BTEQ process.

For a more detailed description of the Teradata Database system components and their roles in processing input and output, see Introduction to Teradata (B035-1091).
  1. Issue BTEQ commands and submit SQL requests in a batch- or interactive-mode BTEQ session.
  2. The Call-Level Interface (CLI) packages the input and forwards it to the Teradata Director Program (TDP), in mainframe-attached systems, or the Micro Teradata Director Program (MTDP) in workstation-attached systems.
  3. The TDP, or MTDP, establishes a session and manages communication between the CLI and the Teradata server.
  4. The Teradata Server parses, interprets, plans access for, and dispatches the request to the Teradata Database.
  5. The Teradata Database processes the request and sends a response message back to the TDP or MTDP.
  6. The TDP, or MTDP, unpackages the response and makes it available to the CLI.
  7. The CLI makes the response available to BTEQ, which routes the output to the specified terminal, file, or printer.

By default, BTEQ enables CLI's configuration parameter wait_across_delay, which means that once BTEQ has submitted a request, CLI will wait to return control to BTEQ if there is delay in the response due to a crashed, restarting or slow database. CLI will automatically redrive the request depending on its Automatic Redrive and Recoverable Network Protocol settings.

This can lead to scenarios where a logon attempt from BTEQ to a database that is down, might be seen as a hang in BTEQ. Similar hanging can be experienced if after a successful logon, a request is sent from BTEQ and database goes down while the request is being processed. This would be due to CLI trying to automatically redrive the request indefinitely.

For interactive mode, such hangs can be halted using BTEQ's BREAK key sequence (typically Ctrl-C) to abort the in-progress request or exit BTEQ. See Discarding Input and Abort Requests for details.

To prevent such hang situations, one could make use of BTEQ's EXITONDELAY command. Timers will then be employed on CLI calls so that CLI can return process control to BTEQ after the timer expires, even while allowing CLI to run with its Automatic Redrive feature for the duration of the timer.

See EXITONDELAY for details.