Use the BTEQ Procedure | VantageCloud Lake - Creating the Query Capture Database Tables Procedure Using BTEQ - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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 must analyze 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 Column-Level Privileges and Teradata Row Level Security Privileges 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.
    Purpose Tool
    Capture query plans BEGIN QUERY CAPTURE
    Capture request plans INSERT EXPLAIN
    Capture statistical and demographic data These statements:
    • COLLECT DEMOGRAPHICS
    • COLLECT STATISTICS (QCD Form)
    • INSERT EXPLAIN WITH STATISTICS
    Create workloads for index analysis Workload macros