Statistics Tables - Teradata Database

Teradata Database Node Software Migration Guide

Product
Teradata Database
Release Number
15.10
Published
November 2017
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
heq1467819788761.ditamap
dita:ditavalPath
5942_Migrating_1510.ditaval.ditaval
dita:id
B035-5942
lifecycle
previous
Product Category
Software

Migrating Statistics Information

Before release 14.0, Teradata Database stored statistics information in columns in the TVFields and Indexes tables. Migrating to Teradata Database release 14.0 or later converts statistics information and saves it in system tables created specifically for this type of data.

Statistics Access Rights

Before Teradata Database release 14.0, any user with DROP TABLE and CREATE INDEX access rights could collect statistics. Teradata Database release 14.0 or later requires new access rights for statistics collection. The database administrator can limit the COLLECT STATISTICS rights to a subset of users. When statistics information is processed during migration, a program generates a script that gives the new access rights to any user that previously had DROP TABLE or CREATE INDEX rights. However, this script does not automatically execute. After the migration, the database administrator can edit the script as required before manually executing it.

The program that migrates the statistics information and generates the access rights script for statistics collection is called upgradestats.pl and is located in the PUTTools directory. In addition to this script, the program generates a number of bteq scripts, which the database administrator can also manually execute as appropriate. The following log file example illustrates the generated scripts.

$logfile      = "/var/log/upgradestatslog.out";
   open_logfile($logfile);   # Open script specific logfile as documented by IE.

   $tmp_dir               = /var/opt/teradata/PUTTools/upgradestats_dbs_release/ 
   $grantstatsrights      = "$tmp_dir/grantstatsrights.bteq";
   $showoldstatsvalues    = "$tmp_dir/showoldstatsvalues.bteq";
   $showoldstatstables    = "$tmp_dir/showoldstatstables.bteq";
   $dropoldstatstables    = "$tmp_dir/dropoldstatstables.bteq";
   $dropremainingoldstats = "$tmp_dir/dropremainingoldstats.bteq";
   $collstatsvalues       = "$tmp_dir/collstatsvalues.bteq";
   $recollectstats        = "$tmp_dir/recollectstats.bteq";