Use the BTEQ Procedure | Teradata Vantage - Procedure Using BTEQ - Analytics Database - Teradata Vantage

Database Administration

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-11-03
dita:mapPath
pgf1628096104492.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ujp1472240543947
lifecycle
latest
Product Category
Teradata Vantage™

Perform the following procedure to create the tables for the query capture database using BTEQ.

The procedure assumes that you have already created QCD_database_name.

  1. Start BTEQ.
  2. Change your current database or user to the database in which the QCD tables are to be created as follows.

      DATABASE QCF_database_name;

    where QCF_database_name is the name of the database you created for the QCD tables.

  3. Perform the following steps in the indicated order.
    1. .SET WIDTH 254
    2. .EXPORT FILE = file_name
    3. SELECT TabDefinition

      FROM systemfe.CreateQCF

      ORDER BY SeqNumber;

    4. .EXPORT FILE = file_name
    5. .RUN FILE = file_name

      where file_name is the name of the file you create to contain the output of the SELECT request.

  4. Secure QCD by granting the appropriate privileges to the users who will be analyzing its data.

    To use the BEGIN QUERY CAPTURE request to insert data into the QCD tables in TDQCD, you must have the ALL privilege.

    See Teradata Vantage™ - SQL Data Control Language, B035-1149 for information about how to implement column-level and row-level security for your tables.

    You can implement additional secured access by creating views on QCD.

  5. Populate the QCD tables using the appropriate tools.
    • Use BEGIN QUERY CAPTURE requests to capture query plans. For the syntax of this statement, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
    • Use INSERT EXPLAIN requests to capture request plans. For the syntax of this statement, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.
    • Use the following statements to capture statistical and demographic data.
      • COLLECT DEMOGRAPHICS
      • COLLECT STATISTICS (QCD Form)
      • INSERT EXPLAIN WITH STATISTICS
    • Use the appropriate workload macros to create workloads for index analysis.