DELETE DATABASE and Error 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™

When you delete a database that contains an error table, the system drops the error table regardless of the containing database for its data table. The system also drops the rows for the error table in the DBC.ErrorTbls system table. For more information, see Teradata Vantage™ - Data Dictionary, B035-1092.

You cannot delete a database that contains a data table with an error table that is contained by another database.

The remedy for this situation is as follows:
  • Find all the error tables that are defined on the tables in the database being deleted by using the following SELECT statement:
         SELECT  BaseTblDbName, BaseTblName, ErrTblDbName, ErrTblName
         FROM    DBC.ErrorTblsV
         WHERE   BaseTblDbName <> ErrTblDbName
         AND     BaseTblDbName = CurrentDBName;

    where CurrentDBName is the database name of the database being deleted.

  • Drop all error tables from the list produced by this query.
  • Resubmit the DELETE DATABASE statement.