Вы находитесь на странице: 1из 250

Teradata® RDBMS

Data Dictionary

V2R4.1

B035-1092-061A
June 2001
The product described in this book is a licensed product of NCR Corporation.

BYNET is an NCR trademark registered in the U.S. Patent and Trademark Office.
CICS, CICS/400, CICS/600, CICS/ESA, CICS/MVS, CICSPLEX, CICSVIEW, CICS/VSE, DB2, DFSMS/MVS, DFSMS/
VM, IBM, NQS/MVS, OPERATING SYSTEM/2, OS/2, PS/2, MVS, QMS, RACF, SQL/400, VM/ESA, and VTAM are
trademarks or registered trademarks of International Business Machines Corporation in the U. S. and other countries.
DEC, DECNET, MICROVAX, VAX and VMS are registered trademarks of Digital Equipment Corporation.
HEWLETT-PACKARD, HP, HP BRIO, HP BRIO PC, and HP-UX are registered trademarks of Hewlett-Packard Co.
KBMS is a trademark of Trinzic Corporation.
INTERTEST is a registered trademark of Computer Associates International, Inc.
MICROSOFT, MS-DOS, MSN, The Microsoft Network, MULTIPLAN, SQLWINDOWS, WIN32, WINDOWS,
WINDOWS 2000, and WINDOWS NT are trademarks or registered trademarks of Microsoft Corporation.
SAS, SAS/C, SAS/CALC, SAS/CONNECT, and SAS/CPE are registered trademarks of SAS Institute Inc.
SOLARIS, SPARC, SUN and SUN OS are trademarks of Sun Microsystems, Inc.
TCP/IP protocol is a United States Department of Defense Standard ARPANET protocol.
TERADATA and DBC/1012 are registered trademarks of NCR International, Inc.
UNICODE is a trademark of Unicode, Inc.
UNIX is a registered trademark of The Open Group.
X and X/OPEN are registered trademarks of X/Open Company Limited.
YNET is a trademark of NCR Corporation.

THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN “AS-IS” BASIS, WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL NCR CORPORATION (NCR) BE
LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR
LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

The information contained in this document may contain references or cross references to features, functions, products,
or services that are not announced or available in your country. Such references do not imply that NCR intends to
announce such features, functions, products, or services in your country. Please consult your local NCR representative
for those features, functions, products, or services available in your country.

Information contained in this document may contain technical inaccuracies or typographical errors. Information may
be changed or updated without notice. NCR may also make improvements or changes in the products or services
described in this information at any time without notice.

To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization,
and value of this document. Please e-mail: info.products@SanDiegoCA.ncr.com

or write:

Information Engineering
NCR Corporation
100 North Sepulveda Boulevard
El Segundo, CA 90245-4361
U.S.A.

Any comments or materials (collectively referred to as “Feedback”) sent to NCR will be deemed non-confidential. NCR
will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display,
transform, create derivative works of and distribute the Feedback and derivative works thereof without limitation on
a royalty-free basis. Further, NCR will be free to use any ideas, concepts, know-how or techniques contained in such
Feedback for any purpose whatsoever, including developing, manufacturing, or marketing products or services
incorporating Feedback.

Copyright © 1996-2001, NCR Corporation


All Rights Reserved
Preface

Supported Software Release


This book supports Teradata RDBMS V2R4.1.

Changes to This Book


This book includes the following changes to support the current release:

Date Description

June 2001 • Added the following features:


– Single Sign On
– Database Query Manager
• Added referenced column(s)
• Added material on hex unicode constants
• Added two new views: ColumnStats and IndexStats
• Performed DR fixes and enhancement requests

June 2000 The new features added to this book for this release include the
following:
• Stored procedures, called Persistent Stored Modules (PSM) in
the ANSI SQL-99 specifications, are created in the user’s
database space as tables. A stored procedure consists of a set
of control and condition-handling statements that make SQL a
computationally complete programming language.
• Ability to preserve the same table version number when only
journaling options are used on the RDBMS to allow suitable
backup and recovery operations.
• Increased macro and view text limits to 26000 bytes based on
new 64KB row size.

Teradata RDBMS Data Dictionary i


Preface

Date Description

December 1999 This book has been redesigned for this release. Changes made to
this book include the following:
• Reorganization and consolidation of the listings of views and
view columns to add hypertext links and eliminate
redundancy.
• Added information on which tables are referenced by each
view.
• Addition of new chapter on tables that lists the tables and
columns of the DBC, noting the primary and secondary index
columns, data type, and format.
• Deletion of Appendix A that lists the differences between the
TOS and Teradata RDBMS versions of the Data Dictionary.

ii Teradata RDBMS Data Dictionary


Preface
About This Book

About This Book

Purpose
This book describes the Teradata RDBMS Data Dictionary and contains
information about system views that allow different types of users to access
underlying table information stored in Teradata RDBMS.
This includes specific information about the following:
• Database objects
• Sessions
• Resource usage

Audience
This book is intended for system administrators, database administrators, and
other technical personnel responsible for maintaining the Teradata Relational
Database Management System (RDBMS). More specifically, the manual
provides information for the following types of users:
• End users
• Supervisory users
• Teradata RDBMS database administrators
• Teradata RDBMS security administrators
• Operations control users

How This Book Is Organized


This book contains five chapters:
Chapter 1: “Teradata RDBMS Data Dictionary Overview” describes the
contents and organization of the Data Dictionary, how the system accesses the
DD, and how you use information obtained from the DD.
Chapter 2: “System Views” contains an alphabetically organized table of all the
DBC system views and a corresponding table that describes in detail each of
the columns selected by the views.
Chapter 3: “System Views: Usage and Examples” provides detailed
descriptions of the system views that allow users to obtain information from
the Data Dictionary.
Chapter 4: “System Tables” provides a listing and description of all the tables
and columns of the system DBC, including the formats and data types of the
columns.
Chapter 5: “Macros” provides information on system macros including the
TwoPCRule, ResUsage, and DIPVIEW macros.

Teradata RDBMS Data Dictionary iii


Preface
About This Book

Prerequisites
You should be familiar with relational databases in general and the Teradata
RDBMS in particular.
It may be helpful to review the following books:
• Introduction to Teradata RDBMS
• Teradata RDBMS Database Design
• Teradata RDBMS SQL Reference, Volume 1
• Teradata RDBMS Database Administration

iv Teradata RDBMS Data Dictionary


Preface
List of Acronyms

List of Acronyms

This book uses acronyms, which the following table lists in alphabetical order:

2PC Two-Phase Commit

AMP Access Module Process or Access Module Processor

ANSI American National Standards Institute

API Application Programming Interface

ASCII American Standard Code for Information Interchange

AWS Administration Workstation

ASF2 Archive Storage Facility 2

BTEQ Basic Teradata Query

CICS Customer Information Control System (IBM)

CLI Call-Level Interface

CPU Central Processing Unit

DBA Database Administrator

DBC Name of database with Teradata RDBMS system tables

DBQM Database Query Manager

DBS Database System or Database Software

DD Data Dictionary

DDL Data Definition Language

DIP Database Initialization Program or DBC Initialization Procedure or


DBC/1012 Initialization Program

DML Data Manipulation Language

DSU Disk Storage Unit

EBCDIC Extended Binary-Coded Decimal Interchange Code

HI Hash Index

HW Hardware

ID Identifier/Identification

I/O Input/Output

IMS Information Management System

JI Join Index

Teradata RDBMS Data Dictionary v


Preface
List of Acronyms

KB Kilobytes

LAN Local Area Network

MVS Multiple Virtual Storage

NUPI Non-unique Primary Index

NUSI Non-unique Secondary Index

ODBC Open Database Connectivity

OLCP Online Complex Processing

OLAP Online Analytical Processing

OS Operating System

PC Personal Computer

PDE Parallel Data Extension

PE Parser Engine

PI Primary Index (unique or non-unique)

PJ Permanent Journal

PM/API Performance Monitor Application Programming Interface

PMA Processor Module Assembly

RCC Recovery Control Catalog

RDBMS Relational Database Management System

ResUsage Resource Usage

RI Referential Integrity

SPL Stored Procedure Language

SQL Structured Query Language

SSO Single Sign-On

SW Software

TDN Teradata Network

TDP Teradata Director Program

TP Transaction Processor

TOS Teradata Operating System

TSO Time Sharing Option (IBM)

UPI Unique Primary Index

USI Unique Secondary Index

vi Teradata RDBMS Data Dictionary


Preface
List of Acronyms

VM Virtual Machine

VMS Virtual Memory System

Teradata RDBMS Data Dictionary vii


Preface
Technical Information on the Web

Technical Information on the Web

The NCR home page ( http://www.ncr.com) provides links to numerous


sources of information about Teradata. Among the links provided are sites that
deal with the following subjects:
• Contacting technical support
• Enrolling in customer education courses
• Ordering and downloading product documentation
• Accessing case studies of customer experiences with Teradata
• Accessing third party industry analyses of Teradata data warehousing
products
• Accessing white papers
• Viewing or subscribing to various online periodicals

viii Teradata RDBMS Data Dictionary


Contents

Preface

Supported Software Release ............................................................................................ i


Changes to This Book ....................................................................................................... i
About This Book .................................................................................................................iii
List of Acronyms ................................................................................................................. v
Technical Information on the Web................................................................................ viii

Chapter 1:
Teradata RDBMS Data Dictionary Overview
What is the Data Dictionary?......................................................................................... 1–2
Data Dictionary Users.................................................................................................. 1–2
Accessing the Data Dictionary.................................................................................... 1–3
Updating the Data Dictionary .................................................................................... 1–3
How the System Uses Data Dictionary Information............................................... 1–4
Organization of the Data Dictionary ............................................................................ 1–5
What are System Views? ................................................................................................ 1–6
Granted Rights on System Views............................................................................... 1–6
Extending View Privileges .......................................................................................... 1–6
System View Versions Non-X and X ......................................................................... 1–7
Views for Special Users .................................................................................................. 1–8
Security Logging Views............................................................................................... 1–9
Administrator Views.................................................................................................. 1–10
Operations and Recovery Control Views ............................................................... 1–11
Supervisory User Views ............................................................................................ 1–12
End User Views .......................................................................................................... 1–12
Querying the Data Dictionary ..................................................................................... 1–14
Special Keywords ....................................................................................................... 1–14
Querying X Versus Non-X Views ............................................................................ 1–14
Example for Non-X View Query .............................................................................. 1–15
Example for X View Query ....................................................................................... 1–15
Dictionary Information Using HELP and COMMENT ........................................ 1–16
Stored Procedures ......................................................................................................... 1–17
What Is a Stored Procedure?..................................................................................... 1–17
Relationship with DD ................................................................................................ 1–17

Teradata RDBMS Data Dictionary ix


Contents

PM/API Queries............................................................................................................ 1–18


MONITOR-Related Queries...................................................................................... 1–19
Monitoring Usage with Views..................................................................................... 1–20
AllSpace and TableSize Views.................................................................................. 1–20
AMPUsage View......................................................................................................... 1–21
Compiling AMPUsage Statistics .............................................................................. 1–22
Account String Expansion......................................................................................... 1–23
Additional Information ............................................................................................. 1–24
DIPVIEW Script ............................................................................................................. 1–25
Tracking Miscellaneous System Actions.................................................................... 1–26
Tracking System Events............................................................................................. 1–26
Tracking Logon Rules ................................................................................................ 1–26
Tracking Privileges..................................................................................................... 1–26
Sys_Calendar.................................................................................................................. 1–27
Maintaining System Logs............................................................................................. 1–28
Other System Objects .................................................................................................... 1–29
Columns with Hex Unicode Constants...................................................................... 1–30

Chapter 2:
System Views
Users of DD Views .......................................................................................................... 2–2
X Version Views............................................................................................................... 2–3
System Views Reference ................................................................................................. 2–4
System View Columns Reference ............................................................................... 2–22

Chapter 3:
System Views: Usage and Examples
AccessLog ......................................................................................................................... 3–2
AccLogRules..................................................................................................................... 3–4
AccountInfo[X]................................................................................................................. 3–7
AllRights ........................................................................................................................... 3–8
AllSpace[X] ..................................................................................................................... 3–10
AllTempTables[X] ......................................................................................................... 3–12
All_RI_Children............................................................................................................. 3–14
All_RI_Parents ............................................................................................................... 3–15
AMPUsage...................................................................................................................... 3–16
Association ..................................................................................................................... 3–17
CharSets .......................................................................................................................... 3–19
CharTranslations ........................................................................................................... 3–20
Children[X] ..................................................................................................................... 3–22
Collations ........................................................................................................................ 3–23

x Teradata RDBMS Data Dictionary


Contents

Columns[X] .................................................................................................................... 3–24


ColumnStats ................................................................................................................... 3–26
Databases[X]................................................................................................................... 3–28
Databases2 ...................................................................................................................... 3–29
Database_Default_Journals[X] .................................................................................... 3–30
DBCInfo .......................................................................................................................... 3–31
DeleteAccessLog[X] ...................................................................................................... 3–32
DeleteOldInDoubt ......................................................................................................... 3–33
DiskSpace[X] .................................................................................................................. 3–34
Events[X]......................................................................................................................... 3–37
Events_Configuration[X].............................................................................................. 3–39
Events_Media[X] ........................................................................................................... 3–41
Hardware_Event_Log................................................................................................... 3–43
HostsInfo ........................................................................................................................ 3–44
Indices[X]........................................................................................................................ 3–45
IndexStats ....................................................................................................................... 3–47
InDoubtLog .................................................................................................................... 3–49
Journals[X]...................................................................................................................... 3–50
LogOnOff........................................................................................................................ 3–51
LogonRules..................................................................................................................... 3–53
RCC_Configuration[X] ................................................................................................. 3–54
RCC_Media[X] ............................................................................................................... 3–55
RI_Child_Tables ............................................................................................................ 3–56
RI_Distinct_Children .................................................................................................... 3–57
RI_Distinct_Parents....................................................................................................... 3–58
RI_Parent_Tables........................................................................................................... 3–59
SecurityDefaults ............................................................................................................ 3–60
SecurityLog[X] ............................................................................................................... 3–61
SessionInfo[X] ................................................................................................................ 3–62
ShowColChecks ............................................................................................................. 3–64
ShowTblChecks ............................................................................................................. 3–65
Software_Event_Log ..................................................................................................... 3–66
Table_LevelConstraints ................................................................................................ 3–68
Tables[X] ......................................................................................................................... 3–69
Tables2 ............................................................................................................................ 3–71
TableSize[X].................................................................................................................... 3–72
Triggers .......................................................................................................................... 3–73
UserGrantedRights........................................................................................................ 3–75
UserRights ...................................................................................................................... 3–76
Users ................................................................................................................................ 3–78
User_Default_Journals[X] ............................................................................................ 3–80

Teradata RDBMS Data Dictionary xi


Contents

Chapter 4:
System Tables
Creating System Tables .................................................................................................. 4–2
Special Table Information .............................................................................................. 4–3
DBC.ALL Table ............................................................................................................. 4–3
DBC.TVM Table............................................................................................................ 4–3
DBC.TVFields Table ..................................................................................................... 4–3
Stored Procedures......................................................................................................... 4–3
ResUsage Tables ........................................................................................................... 4–4
Non-Hashed Tables......................................................................................................... 4–5
Data Dictionary FALLBACK Tables............................................................................. 4–6

Chapter 5:
Macros
TwoPCRule Macro .......................................................................................................... 5–2
Creating the TwoPCRule Macro ................................................................................ 5–2
TwoPCRule and the Resolver Base Module ............................................................. 5–2
ResUsage Macros............................................................................................................. 5–3
DIPVIEW Macros ............................................................................................................ 5–4
ARC_NonEmpty_List Macro...................................................................................... 5–4
ClearAccounting Macro............................................................................................... 5–5
ClearPeakDisk Macro................................................................................................... 5–6
CollAddStandard Macro ............................................................................................. 5–6
CollInstallMulti Macro................................................................................................. 5–7
DIPMarkNS10 Macro ................................................................................................... 5–7
LogonRule Macro ......................................................................................................... 5–8

Index.......................................................................................................................... Index–1

xii Teradata RDBMS Data Dictionary


Chapter 1:

Teradata RDBMS Data Dictionary


Overview

This chapter describes the Teradata RDBMS Data Dictionary (DD) and provides
information about the following topics:
• What the Data Dictionary consists of
• How the Data Dictionary is organized
• What views are and who uses them
• How to perform queries on the Data Dictionary
• What are stored procedures
• Monitoring system use
• DIPVIEW script
• Tracking system events
• System calendar
• Maintaining system logs
• Other system objects
• Columns with Hex Unicode constants

Teradata RDBMS Data Dictionary 1–1


Chapter 1: Teradata RDBMS Data Dictionary Overview
What is the Data Dictionary?

What is the Data Dictionary?

The Teradata RDBMS Data Dictionary is composed of tables and views that
reside in the system database called DBC. These tables and views are reserved
for use by the system and contain information about the system’s associated
data. DD system tables include current definitions, control information, and
general information about the following:
• Databases
• Character Sets
• Users
• Accounts
• Tables
• Views
• Columns
• Indices
• Sessions and Session Attributes
• Triggers
• Access Rights
• Journal Tables
• Disk space
• Events
• Resource Usage
• Macros
• Stored Procedures

Data Dictionary Users


End users typically use views to obtain information on objects and system
administrators generally create and update tables that system views reference.
When a table is created, the complete data definition is stored in the Data
Dictionary along with the following details:
• Table location, identification, database name, table name, creator name,
version, database name, and user names of all owners in the hierarchy.
• Each column in the table, including column name, data type, length, and
phrases.
• User/creator access privileges on the table.
• Indexes defined for the table.
• Constraints defined for the table.
• Table backup and protection including fallback status and permanent
journals.

1–2 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
What is the Data Dictionary?

• Date and time the object was created.


When a view or macro is created, the definition of the object is stored in the
Data Dictionary, along with the following details:
• The text of the view or macro
• Creation time attributes
• User and creator access privileges on the view or macro
When a user creates a stored procedure, the following details are automatically
entered in the Data Dictionary:
• Creation time attributes of the stored procedure.
• Parameters of the stored procedure, including parameter name, parameter
type, data type, and default format.
• User and creator access privileges on the stored procedure.
• Join and hash are maintained as regular tables.

Accessing the Data Dictionary


For security and data integrity reasons, the default SELECT privilege is granted
to PUBLIC for most views in both the X and non-X views in the Data
Dictionary. You cannot use the INSERT, UPDATE, or DELETE SQL commands
to alter the Data Dictionary in any way.

Updating the Data Dictionary


When a data definition statement is processed, the system tables are updated
automatically. For example, when a user creates a table, the system associates
the user with the new table and enters the following information about that
table into the Data Dictionary:
• Version count
• Location
• Owner
• Access rights
• Table name, column names and attributes
• Indexes
• Journaling
• Date and time
When a table is changed by an ALTER, CREATE, DROP, or RENAME
statement, the DBC automatically increments the version count for that table.
For more information about creating, changing, and dropping tables, see
Chapter 4: “System Tables.”

Teradata RDBMS Data Dictionary 1–3


Chapter 1: Teradata RDBMS Data Dictionary Overview
What is the Data Dictionary?

How the System Uses Data Dictionary Information


The system uses information provided by the Data Dictionary in the following
ways:

For each … The system …

request checks the DD to ensure that the requestor has the


appropriate access privileges.

approved query uses the DD information, along with all other available
statistics, to devise the best method of accessing the data.

approved request executes the macro according to the definition stored in the
that references a DD.
macro name

approved request assembles the view according to the definition stored in the
that references a view Data Dictionary, and returns data rows retrieved from the
name underlying tables or views to the user.

approved request obtains the stored procedure creation-time attributes from


that references a the DD and validates the usage of the submitted request.
stored procedure
name

1–4 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Organization of the Data Dictionary

Organization of the Data Dictionary

Data Dictionary entries are stored in system tables in a special database, named
DBC. Information in these system tables can be examined directly or through a
series of views.
System views are pre-defined views that provide users with a way to retrieve
frequently used data from underlying system tables. Views do not contain data
and are stored as entries in the data dictionary. Views, which look like tables to
users, display data in columns and rows only when a user submits an SQL
statement that uses them. View names, such as “DiskSpace, “Users” and
“Columns”are based on entries contained in the underlying tables.
The set of views that are available to a user is determined by the Teradata
RDBMS administrator. Specialized views are designed to meet the needs of the
following individuals:
• Teradata RDBMS security administrator
• Teradata RDBMS and system administrator
• A user who supervises other Teradata RDBMS users and accounts
• An end user or client logged on to a Teradata RDBMS session
• An operator using the database window of the Administration Workstation
(AWS) or responsible for running client utilities such as the
Archive/Recovery or Archive Storage Facility2 (ASF2)
References to specific views for certain users are described in detail later in this
chapter.

Teradata RDBMS Data Dictionary 1–5


Chapter 1: Teradata RDBMS Data Dictionary Overview
What are System Views?

What are System Views?

System views are part of the Teradata RDBMS Data Dictionary and reside in the
space owned by the system user DBC. View definitions are stored in the table
DBC.TVM.View column information is stored in DBC.TVFields.
The Teradata RDBMS system administrator loads the views for a site by
running the Database Initialization Program (DIP) from the Database Window
(DBW). For more information on running DIP from the DBW, see Teradata
RDBMS Utilities. DIP is used to execute one or more of the standard DIP SQL
scripts packaged with the Teradata RDBMS.
Supplied views allow the system administrator to provide a consistent image of
the data stored in the Data Dictionary. In most instances, only the Teradata
RDBMS administrator is allowed to update or delete a Data Dictionary view or
its underlying system tables.

Granted Rights on System Views


The system administrator can GRANT or REVOKE a privilege on any view for
a user at any time. In addition, since some views are applicable only to a
security administrator or a field engineer, access to these views is normally
restricted.
By default, the SELECT privilege is granted to PUBLIC on most views. This
privilege allows any user to retrieve view information via the SELECT
statement.
If no changes are made to the default access privilege (GRANT SELECT TO
PUBLIC) in the view definitions, any user can query a system view by
specifying its fully-qualified name (DBC.viewname).
For example, a user can review the current Teradata RDBMS version and
release by submitting the following query from any client:

SELECT * FROM DBC.DBCInfo ;

Extending View Privileges


In some cases, the system administrator may want to grant to other users the
SELECT or other privileges on certain administrator views. For example, it
might be useful for development personnel and financial planners to monitor
the use of system resources with information obtained from the AllSpace,
TableSize, DiskSpace, AMPUsage, and LogOnOff views.
In addition, if full security auditing is implemented on the Teradata RDBMS, a
security administrator user may need to be created and granted the privileges
necessary to execute BEGIN/END LOGGING statements.

1–6 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
What are System Views?

System View Versions Non-X and X


During system installation, two versions of the system views, non-X and X, are
available for loading into the DBC user space.
Availability of views depends on the system administrator, who can load either
or both versions. Generally, most available system views have a corresponding
X version.
The standard non-X views are named according to the contents of their
underlying tables, such as DBC.User_Default_Journals, DBC.DiskSpace, and
DBC.TableSize.These views return every row of every column defined on the
underlying table.
The X version of a view defines the same views followed with the character
“X”. For example, DBC.DiskSpaceX, DBC.TableSizeX, and
DBC.User_Default_JournalsX.
When using the X version of a view, you do not have to specify a WHERE
clause in your query to obtain selective data, since the “X” definition includes a
WHERE clause that limits the response data to objects associated only with the
requesting user. X views run slower than non-X views due to the fact that the X
views have security checks.
The WHERE clause limits the return from a view to only those rows associated
with the requesting user, such as databases, users, or objects owned or created
by the user, or on which the user has been granted privileges.

Example
For example, assume user Jones enters a query against the standard TableSize
view, as follows:
SELECT * FROM DBC.TableSize;
This query returns size information for every data table in the Teradata
RDBMS.
To limit the response, Jones could query the X version of the view. For example,
if Jones submits the following query:
SELECT * FROM DBC.TableSizeX;
then information is returned only for those tables that Jones created or is
otherwise associated with.

Teradata RDBMS Data Dictionary 1–7


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

Views for Special Users

Some views are generally available only to special system users, and are not
normally available to PUBLIC, although this depends solely on the privileges
that are granted to each user. The following table describes who typically uses
certain types of views:

View Type Description

Security Logging The security logs, which store information about access rules
and events, are populated as a result of executing BEGIN
LOGGING and END LOGGING statements.
These statements may be executed only if the AccLogRule
special security macro has been installed on the Teradata
RDBMS server.
The system administrator should create a security
administrator user, and grant to that user at least the SELECT
privilege on the access logging views.
For more information, see Teradata RDBMS Security
Administration.

SYSADMIN These views are generally available only to SYSADMIN. They


provide information about Parser Engine (PE) vprocs (virtual
processors) on the Teradata RDBMS, which are of interest to
system administrators of Teradata RDBMS server systems
that communicate with PC or workstation clients.

SYSTEMFE These views are generally available only to user SYSTEMFE.


They are normally used by Field Engineers to review data
about the automatic identification and recovery of bad disk
sectors.

The following sections describe the particular views that can be valuable to
different types of users.

1–8 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

Security Logging Views


The following Data Dictionary views are of interest to the user responsible for
security of the data on the Teradata RDBMS.

View Definition

AccessLog Returns information on the results of privilege checks


performed against user requests to access data, which are
logged as determined by the access logging rules.
To keep space consumption under control, archive and
empty the log regularly using the DeleteAccessLog[X] view.

AccLogRules Shows the rules generated as a result of successfully


executed BEGIN LOGGING statements.
The AccessLog view provides an audit trail of access events
logged as a result of applying these rules.

DeleteAccessLog[X] Used to remove AccessLog records that are more than 30


days old.

SecurityLog[X] Provides a subset of the information in the AccessLog view.

LogonRules What logon rules have been generated for username/hostid


pairs as a result of successfully executed GRANT LOGON
and REVOKE LOGON statements?

SecurityDefaults What password parameters, such as length, valid characters,


number of logon attempts, and elapsed time for password
expiration and re-use, are defined for your site?

These LOGGING statements may be executed only if the DBC.AccLogRule


security macro has been created in the DBC. Otherwise, logging of Teradata
SQL access requests is not performed. See Teradata RDBMS Security
Administration for more information on creating this macro.
If access logging is specified for a data object (for example, a table), log entries
will be generated only when that object is accessed by name. As an example, a
logging statement specifying “FIRST SELECT ON DatabaseA.Table1” causes a
log entry to be generated if an access statement is the following:

SELECT . . . FROM Table1

Logging will not occur on the following access statements unless a logging rule
specifies the view or macro used:
• SELECT . . . FROM View1_of_Table1
• EXECUTE MACRO1
(Where Macro1 contains the statement SELECT . . . FROM Table1)

Note: The behavior of not logging indirect access to underlying tables when
views or macros are executed was introduced with Teradata RDBMS Version

Teradata RDBMS Data Dictionary 1–9


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

2.0. In prior releases, if underlying tables had logging rules, then rows were
added even if access was through a view or macro.

Note: It is strongly recommended that you not install the macro unless your
site requires such security, since the logging feature extracts a performance
penalty even if little or no logging is performed.

Administrator Views
Data Dictionary views of specific interest to a Teradata RDBMS administrator
and a system administrator could include, but are not limited to the following:

View Description

AllRights What privileges on databases/users, tables, views, triggers,


stored procedures, and macros have been granted to any
user?

AllSpace[X] How much disk storage space or spool space is being used
by a given table, database/user, or account, on all AMPs or
specific AMPs?

AMPUsage What demands on Teradata RDBMS resources (AMP


usage, I/Os) are generated by a given user/account string?

CharSets The names of any user-defined character sets that are


installed and can be used in a session.

CharTranslations What names and hexadecimal codes have been defined in


order to create non-standard International character sets?
Note: If this view does not exist or no rows are found, then
no user-defined character sets have been inserted into the
system table.

Children[X] What databases and users are owned by other databases


and users?

ColumnStats Returns statistical information on the columns in a table for


which statistics have been collected.

DBCInfo What Teradata RDBMS software version and release are


running? What version and release are indicated after a
restart?

DiskSpace[X] How much disk storage space or spool space is being used
by a given database/user or account on all AMPs? On
specific AMPs?

HostsInfo What character sets have been assigned to what client


systems?

IndexStats Returns statistical information on the indexes defined on a


table for which statistics have been collected.

1 – 10 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

View Description

LogOnOff What is the logon/logoff activity for a user, including


account, date, time of day, and unsuccessful logon
attempts?

LogonRules What logon rules have been generated for


username/hostid pairs as a result of successfully executed
GRANT LOGON and REVOKE LOGON statements?

SecurityDefaults What password parameters, such as length, valid


characters, number of logon attempts, and elapsed time for
password expiration and re-use, are defined for your site?

SessionInfo[X] What user name, account, default database, collation, logon


hostid, logon sequence number, and logon source are
associated with each current Teradata RDBMS session?

Software_Event_Log What software events have been logged by the diagnostic


subsystem? What are the ids of the dump node and
originating node, and what is the severity and category?

TableSize[X] What is the current and peak disk space usage (not
including spool) for a given database/user, data table,
journal table, or account on all AMPs? On a specific AMP?

Note: When you are logging view accesses, only the access of the top view in a
hierarchy is logged. Actions based on base views or tables are not logged.

Operations and Recovery Control Views


These views are useful to the system operator. They provide audit trails on the
following activities:

View Description

Events[X] All archive and restore activity.

Events_Configuration[X] Archive and restore activity that did not affect all
AMPs.

Events_Media[X] Archive and restore events that involved removable


media.

RCC_Configuration[X] Utility events that did not affect all AMPs.

RCC_Media[X] Utility events that involved removable media.

Software_Event_Log Software events and error logging information.

Hardware_Event_Log Software events and error logging information.

Association Retrieves information about an object that was


imported from another Teradata RDBMS.

Teradata RDBMS Data Dictionary 1 – 11


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

Supervisory User Views


The following views are useful to a supervisory user:

View Description

AccountInfo[X] What accounts are available to a given user?

Users What users are owned, or have been created, by a user?

End User Views


The following views are useful to an end user:

View Description

Association What are the ported and original definitions of


databases, users, and objects that were moved to a
different Teradata RDBMS server via the Portable
Dump/Restore utility.

CharSets What user-defined International character sets are


currently installed on the Teradata RDBMS and
available for sessions?
If this view does not exist or no rows are found,
then either International character sets have not
been defined (see the CharTranslations view), or
those defined have not yet been installed.

CharTranslations What are the names and hexadecimal codes of all


the translation tables that have been inserted to
create International character sets?
If this view does not exist or no rows are found,
then no International character sets have been
defined.

Collations What are the names and hexadecimal codes of all


the defined collation sequences? Which one is
currently installed as the default sequence for
MULTINATIONAL collation?

Columns[X] What columns are associated with a table or view,


or what parameters are associated with a macro or
stored procedure, on which you have privileges?
What attributes have been defined for these
columns or parameters? What join indexes have
been defined using these columns?

Databases[X] What are the characteristics of the databases you


own or on which you have privileges?

1 – 12 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Views for Special Users

View Description

Database_Default_Journals[X] What databases are defined as having a default


journal table, and what are the journal table
names?

HostsInfo What character sets have been assigned as the


default to each Teradata RDBMS client connection
in the Teradata RDBMS configuration?
If this view does not exist or no rows are found,
then either user-defined International character
sets are not available (see CharSets view), or have
not been assigned as host defaults. In this case, the
standard default is used; that is, EBCDIC for IBM
mainframe hosts, ASCII for all others.

Indices[X] What kinds of indexes have been defined for a


table?

Journals[X] What data tables use what journal tables, and in


what database does each table reside?

Tables[X] What data tables, triggers, stored procedures,


views, join indexes, and macros have been created
in a database on which you have privileges?

TableSize{X] What is the AMP-by-AMP disk usage for each


database, table, or account?

Triggers What event-driven specialized procedures are


attached to a single table?

User_Default_Journals[X] What user spaces are defined as having a default


journal table, and what are the journal table
names?

UserGrantedRights What privileges have you granted to other users?

UserRights What privileges have you been granted to


databases, tables, triggers, stored procedures,
views, join indexes, and macros?

Teradata RDBMS Data Dictionary 1 – 13


Chapter 1: Teradata RDBMS Data Dictionary Overview
Querying the Data Dictionary

Querying the Data Dictionary

You can review entries in the Data Dictionary by performing a query on a


system view. Various utilities and tools, such as BTEQ and other third-party
tools, may be used to enter the SELECT statement, and to display or print the
results.
The examples included in this book show sample results of a query. The actual
formatting of the results may differ, depending on the utility or tool used.
The following sections explain and show various methods for retrieving
directory information.

Special Keywords
Three special keywords are used in queries of dictionary views. Although they
appear as database names in information returned from a view, these keywords
are not databases. Rather, they are character strings that serve as placeholders,
appearing only as special “database names” in the queries of certain views.
The three special keywords are:
• ALL
• DEFAULT
• PUBLIC
These keywords must be enclosed in quotation marks when they are used.
For example, the following query uses ALL as a keyword and returns the
logging rules that apply to all users:
SELECT * FROM DBC.AccLogRules WHERE UserName = ’ALL’;

Note: In general, users never reference these keywords in queries or other


SQL commands. These keywords, although appearing as database names,
actually have no content, no tables, and no views.

Querying X Versus Non-X Views


The amount of information that can be retrieved from system views at a
particular site depends on the following conditions:
• Whether an X version is available for a particular view
• The privilege granted, if any, on each available view
• Whether the statement references “viewname” or “viewnameX”

1 – 14 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Querying the Data Dictionary

Assuming that both the X and non-X versions of the views are installed, and
that the SELECT privilege is granted to PUBLIC on both versions, the
information returned by an unconditional SELECT depends on the specified
viewname, as follows:

FROM a view specified as … Information is returned on …

DBC.viewname all objects for which entries exist in the underlying table.
Note: Unconditional SELECTs on non-X views may cause
the result to exhaust the available spool space of the user.

DBC.viewnameX only those objects that the requesting user:


• owns
• created
• has been granted privileges on

Example for Non-X View Query


For example, user “Test1” may query the Databases view with the following
statement:
SELECT DatabaseName, CreatorName, OwnerName, PermSpace
FROM DBC.Databases ;
As a result, all the databases in the Teradata RDBMS would be listed, as shown
below:
DatabaseName CreatorName OwnerName PermSpace

pers SYSADMIN SYSADMIN 500,000


Accounting2 Jacobs Vettes 250,000
SQLDBA DBC SYSADMIN 150,000
abc123 SYSADMIN SYSADMIN 1,460,000
PERSONNEL SYSADMIN SYSADMIN 1,500,000
Accounting1 Hillstein Vettes 500,000
Test1 SYSADMIN Test1 1,000,000
Jane Jane Test1 500,000
. . . .
. . . .
. . . .

Example for X View Query


User “Test1” may use the same structure to query the X version of Databases, as
follows:
SELECT DatabaseName, CreatorName, OwnerName, PermSpace
FROM DBC.DatabasesX;
In contrast to the results of the previous example, only those databases that
Test1 owned or had access to would be listed:

Teradata RDBMS Data Dictionary 1 – 15


Chapter 1: Teradata RDBMS Data Dictionary Overview
Querying the Data Dictionary

DatabaseName CreatorName OwnerName PermSpace

SQLDBA DBC SYSADMIN 150,000


Jane Jane Test1 500,000
PERSONNEL SYSADMIN SYSADMIN 1,500,000
Test1 SYSADMIN Test1 1,000,000
. . . .
. . . .
. . . .

Dictionary Information Using HELP and COMMENT


If the SELECT privilege on one or more system views was revoked or not
granted to PUBLIC, the HELP and COMMENT statements can be used to
obtain directory information about a particular object.
HELP does not require long or complex queries and the returns can be
formatted for printing.
The COMMENT statement returns descriptive information about a database or
database object. This includes information about Data Dictionary views.
For example, the following COMMENT statement:
COMMENT ON DBC.UserGrantedRights ;
returns the following description:
The DBC.UserGrantedRights view provides information on access
rights that the current user has granted to other users. The
column names are: DatabaseName, TableName, ColumnName,
AccessRight, Grantee, Grant Authority, and Allnessflag.

1 – 16 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Stored Procedures

Stored Procedures

What Is a Stored Procedure?


A stored procedure is a combination of procedural constructs and SQL
statements specified with multiple parameters, local variables, and condition
handlers. It is defined and stored as a database object, although unlike objects
such as views and macros whose DDL statement text is stored in the Data
Dictionary, a stored procedure is created in the user’s database space as a table.
Stored procedures provide a procedural interface to the Teradata RDBMS using
the Stored Procedure Language (SPL). They use standard Teradata RDBMS
interfaces between the client and server software, and are similar to other
procedural interfaces, such as PP2, but reside and execute on the Teradata
RDBMS server, thereby reducing network traffic between the client and server.
The stored procedure table in the RDBMS server contains the following
information:
• SPL source text used for creating the stored procedure
• Corresponding SPL object code (the compiled stored procedure)

Relationship with DD
Information pertaining to stored procedures is included in the following
Teradata RDBMS DD tables:
• DBC.TVM
• DBC.TVFields
• DBC.AccLogRuleTbl
The privileges relating to stored procedures are CREATE PROCEDURE,
EXECUTE PROCEDURE, and DROP PROCEDURE.

Note: A stored procedure created on a Teradata RDBMS UNIX platform


cannot be executed on a Teradata RDBMS Windows platform and vice versa.

See Chapter 4: “System Tables” for more specific information on tables affected
by stored procedures.

Teradata RDBMS Data Dictionary 1 – 17


Chapter 1: Teradata RDBMS Data Dictionary Overview
PM/API Queries

PM/API Queries

Performance Monitor Application Programming Interface (PM/API) monitors


commands issued through a logon partition called MONITOR.
Using PM/API commands, performance data is collected on:
• Current system configuration
• Resource usage and status of an individual Access Module Process (AMP),
Parsing Engine (PE), or node
• Resource usage and status of individual sessions
PM/API affects the following:
• PM access rights (MONITOR SESSION, MONITOR RESOURCE, SET
SESSION RATE, SET RESOURCE RATE)
• ABORT SESSION, which can force a user off the system
• Execution of the commands SET RESOURCE, SET SESSION, and ABORT
SESSION are considered major system events and are, thus, logged to the
DBC.SW_Event_Log table
The LogonSource column, referenced by the SW_Event_Log and the SessionTbl
tables includes additional information about the source of sessions logged on
from an MVS or VM client, including information on the TDP and job name.
Queries against the following tables can possibly result in new PM/API-related
values for some columns:
• DBC.AccessRights
• DBC.SessionTbl
• DBC.SW_Event_Log
• DBC.Dbase
The following Data Dictionary views, which are built on those tables, are also
affected by PM/API:
• AllRights
• AllSpace(X)
• Databases(X)
• DiskSpace(X)
• Software_Event_Log
• LogOnOff
• SessionInfo
• UserGrantedRights
• UserRights

1 – 18 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
PM/API Queries

MONITOR-Related Queries
Queries related to the Performance Monitor are made in a manner similar to
other Data Dictionary queries.
The following queries provide information about MONITOR-related activities:
To determine who is using the monitor, enter the following:
SELECT UserName, IFPNo FROM DBC.SessionInfo
WHERE Partition = ’MONITOR’ ;
Queries regarding the use of system monitoring can be made much like other
SELECT queries. For example, to determine what users have the privilege to
force other users off the system, enter the following:
SELECT DISTINCT UserName FROM DBC.AllRights
WHERE AccessRight = ’AS’ ;
The ‘AS’ indicates the ABORT SESSION privilege.
To find out what users have been forced off the system in the past two days,
enter the following:
SELECT DISTINCT UserName FROM DBC.LogOnOff
WHERE Event = ’Forced Off’
AND LogDate > DATE - 3 ;

Teradata RDBMS Data Dictionary 1 – 19


Chapter 1: Teradata RDBMS Data Dictionary Overview
Monitoring Usage with Views

Monitoring Usage with Views

Information on the usage of the Teradata RDBMS is collected by user and by


account number. Control is determined by the definition of each CREATE
USER statement.
An account is a group of users whose usage charges are maintained by the
Teradata RDBMS. An account may be established for a user with the
ACCOUNT phrase in the CREATE USER statement. If ACCOUNT is not
specified, the default is the account of the immediate owner of the user. If the
owner has multiple ids, then the first id is taken for the user.
The following sections describe the accounting information available for any
Teradata RDBMS session.
You can monitor usage with the following system views:
• AccountInfo
• AllSpace
• AMPUsage
• DiskSpace
• LogOnOff
• TableSize
The AllSpace, DiskSpace, TableSize, and AMPUsage views are useful in
tracking Teradata RDBMS resources for accounting purposes, and in
determining how effectively resources are being utilized by accounts and users.

AllSpace and TableSize Views


You use the AllSpace, Diskspace, and TableSize views that access data from the
DatabaseSpace table to show how efficiently a table is distributed across the
AMPs on which it is stored.
For example, the following statement:
SELECT CurrentPerm, PeakPerm, AMP FROM DBC.AllSpace
WHERE TableName = ’Personnel.Department’;
returns a row for each AMP on which the Department table is stored. Data in
the CurrentPerm column shows, in bytes, how Department data is distributed
across the AMPs.
If the distribution is uneven, you can tell from the CurrentPerm data. In
addition, the PeakPerm column data indicates any fluctuations in distribution
since the table was created.

1 – 20 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Monitoring Usage with Views

AMPUsage View
The AMPUsage view supplies information about AMP CPU time consumed,
and the number of AMP to DSU read and write operations generated by a
given user or account.
This view also tracks the activities of any console utilities. A row is returned for
each AMP in the system unless aggregate figures are specified.
When you ask for resource usage logging, data about CPU overhead, user
service, and user execution is collected by vproc type and by node.
You can use the AMPUsage, AllSpace, DiskSpace, and TableSize views to
summarize resource usage for all AMPs, or for AMPs on which data is stored.

Example 1
To obtain a list (in the order of the amount of space used) of those databases
currently using more than 80% of their permanent space allocation, submit the
following statement:
SELECT DatabaseName, SUM(CurrentPerm)
FROM DBC.DiskSpace
GROUP BY DatabaseName
HAVING (SUM(CurrentPerm)/NULLIFZERO(SUM(MaxPerm))) >.8
ORDER BY SUM(CurrentPerm) DESC;
You can also use the AMPUsage and DiskSpace views to compile and maintain
usage statistics that can later be selected and analyzed as described in the
following sections.

Example 2
The DBC.AMPUsage, which is a view for the DBC.Acctg system table, provides
information about the usage of each AMP for each user and account.
For example, the CPU time in a given row is the cumulative CPU time of the
user since logon plus the cumulative previous logon time for that user. The I/O
entry in a row records the total I/O accesses for the user during any reporting
logon period.
The following occurs to DBC.Acctg, which is a non-fallback and non-hashed
system table when an AMP is down:
• Data rows on the down AMP are not available, and DML statements such
as SELECT, INSERT, UPDATE, and DELETE do not apply to the down
AMP.
• Resource accounting information for the down AMP temporarily
disappears until the AMP is back online.
• Any aggregate query on the DBC.Acctg includes only the online AMPs.
• No resource accounting information is recorded during the down AMP
recovery.

Teradata RDBMS Data Dictionary 1 – 21


Chapter 1: Teradata RDBMS Data Dictionary Overview
Monitoring Usage with Views

• The down AMP recovery is not associated with any particular user.
However, the resource accounting associated with the Transient Journal (TJ)
rolling back for the down AMP is charged to the user. (That is, no resource
accounting is charged to the user while the down AMP recovers from
offline to online except when the updates on the TJ apply to the down
AMP.)
• A system restart may impact the cumulative totals in the DBC.Acctg. (That
is, any accounting data accumulated in the cache since the last time the
cache was flushed before the restart will be lost completely and will not
contribute to the totals in DBC.Acctg resulting from the loss of cache
memory.)

Compiling AMPUsage Statistics


You can use the AMPUsage view to build and maintain a history table of CPU
time and disk input/output statistics for each username/accountname.
To create the history table, enter the following statement:
CREATE TABLE AMPUseHist
( AccountName VARCHAR(30),
UserName VARCHAR(30),
CPUtime INTEGER,
DiskIO INTEGER,
CollectDate DATE,
CollectTime FLOAT )
PRIMARY INDEX (UserName, AccountName);
Periodically, collect usage statistics using the following procedure:

Step Action

1 Select statistics from the AMPUsage view and insert them in the history table.

2 Reset AMPUsage counters to zero for the next collection period.

This procedure may be carried out using the following BTEQ script:
.LOGON username, password

INSERT INTO AMPUseHist


SELECT AccountName, UserName,
SUM(CPUtime), SUM(DiskIO),
DATE, TIME
FROM DBC.AMPUsage
GROUP BY AccountName, UserName, DATE, TIME;
UPDATE DBC.AMPUsage
SET CPUTime = 0, DiskIO = 0 ALL;
.QUIT

1 – 22 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Monitoring Usage with Views

The units in which Disk I/O are measured represent data block accesses. CPU
time is measured in seconds.
Refer to the DiskSpace View to see how you can use the DiskSpace view to
build and maintain a table of disk space usage.
After a collection period, you may select AMPUsage and DiskSpace statistics
from the history tables using BTEQ to archive the data on the client system.
BTEQ stores the selected data in sequential data sets on the host computer for
subsequent analysis.
A BTEQ script can be used to achieve the following:
• Creates a client-resident file (in this case, the client is MVS),
• Uses the BTEQ .EXPORT command to save the data being selected into that
file, and then
• Selects all rows from the DiskSpace history table
The following example shows how such a BTEQ job is used to select data from
the DiskSpace history table:
//JOBNAME JOB jobcard
//EXTRACT EXEC PGM=ITBMAIN
//STEPLIB DD DSN=TERADATA.APPLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SAVEDATA DD DSN=ACC.SAVEDATA.DATA,DISP=(NEW,CATLG)
// UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//SYSIN DD DATA,DLM=##
.LOGON somebody,password
.EXPORT DATA DDNAME=SAVEDATA
SELECT * FROM DiskSpaceHist
ORDER BY CollectDate,CollectTime;
.QUIT
##
Once selected and stored, historical data can be used for analysis, as follows:
• Client-resident software packages such as SAS can be used to perform trend
analysis and other statistical manipulation on the data.
• Graphic software packages can be used to display the data.

Account String Expansion


Another way to measure resource usage is by using the optional Account String
Expansion (ASE) feature. It allows you to append date, time, hour, or logon
time stamp data to the DBC.Acctg table.
This allows more precise measurement of individual Teradata SQL statement
execution, more precise statistics, more accurate capacity planning, and more
information for chargeback and accounting software.

Teradata RDBMS Data Dictionary 1 – 23


Chapter 1: Teradata RDBMS Data Dictionary Overview
Monitoring Usage with Views

Other Methods of Evaluating Capacity


You can use the ResNode macro to evaluate the capacity of current system
resources, and the Performance Monitor/Application Program Interface
(PM/API) feature to determine current capacity during an active session.

Additional Information
The following references provide additional information on resource usage:

Book Chapter Section

Teradata RDBMS Other AMPUsage View


PM/API Reference Performance
Monitoring Tools

Teradata RDBMS Resource Usage • ResUsage Macro Names


Resource Usage Macros Macros • ResUsage Macro Functions
and Tables
• ResNode Macros

1 – 24 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
DIPVIEW Script

DIPVIEW Script

The DIPVIEW script allows database administration to install the data


dictionary and system views. It is provided on the Teradata RDBMS CD-ROM
or release tape.
The DIPVIEW script also creates the special user DBQM used to support the
Database Query Manager (DBQM) feature. For details, see Teradata RDBMS
Administration.

Teradata RDBMS Data Dictionary 1 – 25


Chapter 1: Teradata RDBMS Data Dictionary Overview
Tracking Miscellaneous System Actions

Tracking Miscellaneous System Actions

Tracking System Events


The Software_Event_Log and Hardware_Event_Log views display, by date and
time, any events that have affected processing, such as a memory parity error, a
disabling of logons, a Teradata RDBMS restart, or execution of a PM/API SET
COLLECT command, along with an associated message. The processor is
identified when appropriate.
The LogOnOff view, because it chronologically records all logon and logoff
activity as well as the reasons for unsuccessful logons and logoffs, allows you
to detect actual and attempted security violations. This view also lets you know
how long any user is connected to the Teradata RDBMS.

Tracking Logon Rules


The LogonRules view is used to review the rules generated by the GRANT
LOGON and REVOKE LOGON statements. These statements define which
user can log on from what mainframe or LAN host connection, and whether
the logon string of the user is acceptable without a password.
The initial default is that all users may logon from all hosts, and that every
logon string must contain a password. To change the default, use the GRANT
LOGON and REVOKE LOGON statements.

Tracking Privileges
The UserRights view provides information about the privileges that have been
granted to any user.
See the description of the GRANT statement in the Teradata RDBMS SQL
Reference, Volume 4, for an explanation of the types of privileges and how they
are granted.
If a more detailed audit trail is necessary, this information may be
supplemented by log entries that provide an audit trail of the results of checks
against requests to access table data. See also Teradata RDBMS Security
Administration.

1 – 26 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Sys_Calendar

Sys_Calendar

The DIPCAL SQL script must be run from the DIP utilities by the administrator
to create the SYS_CALENDAR database and CALENDAR view.
The primary key of the calendar is the SQL “DATE” data type. The calendar
dates range from 1900 to 2100 and are stored in a table in the SYS_CALENDAR
database.
For more information on how to use the OLAP Calendar capabilities, see the
section on Data Definitions in Teradata RDBMS SQL Reference, Volume 1.

Teradata RDBMS Data Dictionary 1 – 27


Chapter 1: Teradata RDBMS Data Dictionary Overview
Maintaining System Logs

Maintaining System Logs

The resource usage logs and the tables underlying the AMPUsage, AccessLog,
LogOnOff, and Software_Event_Log views are not purged automatically by the
system.
Outdated information in these tables should be deleted periodically by an
authorized user such as a security, database, or system administrator, or by
NCR support personnel.
Because the errors and events that comprise Software_Event_Log information
are scrutinized in order to enhance the product, this information is often
maintained by NCR field support personnel.

Purging Outdated Information


You must purge outdated AMPUsage information using the Teradata SQL
DELETE statement. For example, the following statement could be used to
purge information for account $M619 after an accounting period has closed.
DELETE FROM DBC.AMPUsage
WHERE Accountname = ’$M619’;
A similar statement could be used to eliminate usage information after a user
has been dropped from the system.
LogOnOff information also should be purged periodically to reclaim disk
space. For example, the following statement purges LogOnOff information that
is more than 90 days old:
DELETE FROM DBC.LogOnOff
WHERE (DATE-Logdate) > 90;
Log entries that are more than 30 days old may be deleted from the access log
by using the name of the DeleteAccessLog view as the parameter of the
DELETE statement, as follows.
DELETE FROM DBC.DeleteAccessLog ALL ;
If preferred, you can periodically archive the contents of system tables to tape
using the BTEQ .EXPORT command, ASF2, or the Archive/Recovery utility.

1 – 28 Teradata RDBMS Data Dictionary


Chapter 1: Teradata RDBMS Data Dictionary Overview
Other System Objects

Other System Objects

The following system objects are not covered in detail in this manual:

Object Reference for More Information

SysAdmin.Fastlog table This internal table containing FastLoad


information does not needed to be accessed
directly by the user.

SystemFE database Teradata RDBMS SystemFE Macros

Resource Usage tables Teradata RDBMS Resource Usage Macros and


Tables

Sys_Calendar database Teradata RDBMS SQL Reference, Volume 3.

Teradata RDBMS Data Dictionary 1 – 29


Chapter 1: Teradata RDBMS Data Dictionary Overview
Columns with Hex Unicode Constants

Columns with Hex Unicode Constants

The columns listed in the following tables are stored with a CharType based on
the system’s support of Japanese Language (see ”System Initializer Utility” in
Teradata RDBMS Utilities).
Constants are converted to the _Unicode’..’XC format if they would otherwise
not be sharable (see Teradata SQL Reference, Volume 3, "Data Types and Literals").

Database Name Table Name Column Name

DBC TableConstraints TableCheck

DBC TriggersTbl CreateText

DBC TVFields ColumnCheck

DBC TVM CreateText

1 – 30 Teradata RDBMS Data Dictionary


Chapter 2:

System Views

This chapter serves as a reference for users of system views and consists of the
following:
• A brief description of the various types of users that have access to the
system DBC views.
• A reference table describing the DBC views, the tables referenced by each
view, the columns selected by that view, and the typical user of that view.
• A reference table that lists and describes all the columns referenced by the
system views in alphabetical order including the data type and format of
each column.

Note: In general, each column name is descriptive of the type of data


referenced by that column.

In the online document, hypertext links for the system views table exist that
allow you to go to the columns table and get the detailed information on any
column that you select for a specified view.

Teradata RDBMS Data Dictionary 2–1


Chapter 2: System Views
Users of DD Views

Users of DD Views

Many of the views in the Teradata RDBMS Data Dictionary may be restricted to
special types of users, while others are accessible by all users. The ability to
access views is controlled by granting of access rights by the system
administrator. The following table defines the information needs of various
types of users:

This type of user … Needs to know this information …

End • Objects to which the user has access


• Types of access available to the user
• Access rights the user has granted to other users

Supervisory • How to create and organize databases


• How to monitor space usage
• How to define new users
• How to allocate access privileges
• How to create indexes
• How to perform archiving operations

Teradata RDBMS • Performance


system • Status and statistics
administrator
• Errors
• Accounting

Teradata RDBMS • Access logging rules generated by the execution of BEGIN


security LOGGING statements
administrator • Results of access checking events, logged as determined by
the access logging rules

Operations Archive and recovery activities.


control

2–2 Teradata RDBMS Data Dictionary


Chapter 2: System Views
X Version Views

X Version Views

In views that include an X version, the additional tables that are referenced by
the X version of the same view are preceded by an X as the examples on this
page show.

Note The DBC.UserDB and DBC.OwnerDB system views will not be covered
in this section because they are not usually referenced directly by users. These
views are used only to join other system tables and views (especially the X
version of views).

View Name and Description Referenced Tables User Type Columns Selected

DBC.AccountInfo[X] Accounts Supervisory UserName


Provides information Dbase AccountName
about the accounts the
[X]AccessRights
user can control, that is,
[X]Userdb
accounts the user owns
or can modify. [X]Owners

Teradata RDBMS Data Dictionary 2–3


Chapter 2: System Views
System Views Reference

System Views Reference

The following table lists all the views included in the database DBC and
includes a brief description of how the view is used, the referenced tables, and
columns selected by that view.
You can view detailed information for a specific column in the view by using
the index in this book, or online by clicking on the blue hypertext link for
column name in the system views table, which automatically links you to that
column description in the columns table.

Referenced Tables and


View Name and Description User Type Columns Selected Referenced column(s)
Views

DBC.AccessLog AccLogTbl Security LogDate None


Administrator LogTime None
Displays, by row, the
LogonDate None
results of a privilege
LogonTime None
check performed in
LogicalHostId None
response to a request.
IFPNo None
SessionNo None
UserName Dbase.DatabaseName
AccountName None
OwnerName Dbase.DatabaseName
AccessType None
Frequency None
EventCount None
Result None
DatabaseName Dbase.DatabaseName
TVMName TVM.TVMName
ColumnName None
StatementType None
StatementText None

2–4 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.AccLogRules AccLogRuleTbl Security UserName Dbase.DatabaseName


Dbase Administrator AcclogTbl.UserName
Provides information TVM DatabaseName Dbase.DatabaseName
about logging rules AcclogTbl.UserName
that are currently in TVMName TVM.TVMName
effect on the system. AcrCheckpoint None
AcrCreateDatabase None
AcrCreateMacro None
AcrCreateProcedure None
AcrCreateTable None
AcrCreateUser None
AcrCreateView None
AcrDelete None
AcrDropDatabase None
AcrDropProcedure None
AcrDropMacro None
AcrDropTable None
AcrDropUser None
AcrDropView None
AcrDump None
AcrExecute None
AcrExecuteProcedure None
AcrGrant None
AcrIndex None
AcrInsert None
AcrReference None
AcrRestore None
AcrSelect None
AcrUpdate None
AcrCreateTrigger None
AcrDropTrigger None
CreatorName Dbase.DatabaseName
AcclogTbl.UserName
CreateTimeStamp None

DBC.AccountInfo[X] Accounts Supervisory UserName Dbase.DatabaseName


Dbase AcclogTbl.UserName
Gives the accounts [X]AccessRights AccountName None
the user can control, [X]Userdb
that is, accounts the [X]Owners
user owns or can
modify.

Teradata RDBMS Data Dictionary 2–5


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.AllRights AccessRights Administrator UserName Dbase.DatabaseName


Dbase AcclogTbl.UserName
Gives every explicit TVM DatabaseName Dbase.DatabaseName
right for the TVFields AcclogTbl.UserName
privileges on TableName TVM.TVMName
databases, users, ColumnName None
tables, views, stored AccessRight None
procedures, and GrantAuthority None
macros that have GrantorName None
been granted for AllnessFlag None
every user on the CreatorName Dbase.DatabaseName
system. CreateTimeStamp None

DBC.AllSpace[X] DatabaseSpace Administrator Vproc None


Dbase DatabaseName Dbase.DatabaseName
Gives both database TVM AccountName None
and table space [X]AccessRights TableName None
utilization. [X]Owners MaxPerm None
MaxSpool None
MaxTemp None
CurrentPerm None
CurrentSpool None
CurrentTemp None
PeakPerm None
PeakSpool None
PeakTemp None

DBC.AllTempTables[X] TempTables Administrator HostNo SessionTbl.HostNo


Dbase SessionNo SessionTbl.SessionNo
Gives the local TVM UserName Dbase.DatabaseName
temporary table SessionTbl B_DatabaseName None
materialized with the B_TableName None
exact same definition E_TableId TVM.TVMId
as the base table.

DBC.All_RI_Children ReferencingTbls All users IndexID None


Dbase IndexName None
Provides information TVM ChildDB Dbase.DatabaseName
about all tables in TVFields ChildTable None
child-parent order. It ChildKeyColumn None
is similar to the ParentDB Dbase.DatabaseName
RI_Child_Tables ParentTable None
view, but returns the ParentKeyColumn None
names of databases, InconsistencyFlag None
tables, and columns, CreatorName Dbase.DatabaseName
instead of IDs CreateTimeStamp None

2–6 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.All_RI_Parents ReferencedTbls All users IndexID None


Dbase IndexName None
Provides information TVM ParentDB Dbase.DatabaseName
about all tables in TVFields ParentTable None
parent-child order. It ParentKeyColumn None
is similar to the ChildDB Dbase.DatabaseName
RI_Parent_Tables ChildTable None
view, but returns the ChildKeyColumn None
names of databases, InconsistencyFlag None
tables, and columns, CreatorName Dbase.DatabaseName
instead of IDs. CreateTimeStamp None

DBC.AmpUsage Acctg Administrator AccountName None


UserName Dbase.DatabaseName
Gives CPU and I/O CPUTime None
accounting Vproc None
information saved by VprocType None
the DBC. Model None
DiskIO None

DBC.Association DBCAssociation Operations DatabaseName RCEvent.DatabaseName


Dbase Control Dbase.DatabaseName
Retrieves TVM TableName None
information about EventNum None
tables that have been Original_DatabaseName None
ported using the Original_TableName None
Dump/Restore Original_TableKind None
facility. Original_Version None
Original_ProtectionType None
Original_JournalFlag None
Original_CreatorName None
Original_CommentString None

DBC.CharSets Translation End CharSetName None

Returns the names


assigned to
user-defined
character sets
currently installed on
the RDBMS.

Teradata RDBMS Data Dictionary 2–7


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.CharTranslations Translation End CharSetName None


CharSetId None
Shows hexadecimal InstallFlag None
codes inserted by the E2I None
Teradata RDBMS E2IUp None
system administrator I2E None
to form translation I2EUp None
tables that enable the
Teradata RDBMS to
store and manipulate
non-English
character sets.

DBC.Children[X] Owners Administrator Child Dbase.DatabaseName


Dbase Parent Dbase.DatabaseName
Provides the names [X]AccessRights
of all the databases [X]Userdb
under a user.

DBC.Collations CollationTbl End CollName None


CollInstall None
Provides definitions CollEqvClass None
for standard Swedish CollOrderCS None
and Norwegian CollOrderUC None
collations as well as
custom collation
sequence definitions.

2–8 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Columns[X] TVFields End DatabaseName RCEvent.DatabaseName


Dbase AcclogTbl.UserName
Provides information TVM TableName None
about the columns of [X]AccessRights ColumnName None
tables or views, or the [X]Owners ColumnFormat None
parameters of stored ColumnTitle None
procedures and ColumnType None
macros that the user ColumnLength None
can access. DefaultValue None
Nullable None
CommentString None
DecimalTotalDigits None
DecimalFractionalDigits None
ColumnId Accessrights.FieldId
ReferencingTbls.
ForeignKeyFID
ReferencedTbls.
ParentKeyFID
Indexes.FieldId
UpperCaseFlag None
Compressible None
CompressValue None
ColumnConstraint None
ConstraintCount None
CreatorName Dbase.DatabaseName
CreateTimeStamp None
LastAlterName None
LastAlterTimeStamp None
CharType None
SPParameterType None

DBC.ColumnStats TVFields All users DatabaseNameI None


Dbase FieldID None
Displays statistics for TVM FieldStatistics None
the columns in a table TVMNameI None
for which statistics
have been collected.

DBC.CSPSessionInfo SessionTbl Operations SessionNo,


(Reserved for internal Control HostNo,
use.) StartMBox,
LogonSource
Returns information
on crashdumps.

Teradata RDBMS Data Dictionary 2–9


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Databases[X] Dbase End DatabaseName RCEvent.DatabaseName


[X]AccessRights AcclogTbl.UserName
Provides information [X]Userdb CreatorName Dbase.DatabaseName
about the databases [X]Owners OwnerName Dbase.DatabaseName
that the user can AccountName None
access. ProtectionType None
JournalFlag None
PermSpace None
SpoolSpace None
TempSpace None
CommentString None
CreateTimeStamp None
LastAlterName Dbase.DatabaseName
LastAlterTimeStamp None
DBKind None

DBC.Databases2 Dbase All users DatabaseName None


DatabaseId Accounts.UserId
Provides ID Databasespace.
definition DatabaseId
information about Accessrights.UserId
databases. Owners.OwnerId
TVM.DatabaseId
ReferencingTbls.Refer-
encing.DbId
DBCAssociation.
DatabaseId
Owners.OwneeId
ReferencedTbls.
ReferencedDbId
TableConstraints.
DbaseId
Triggertbl.DatabaseId
UnResolvedRICount None

DBC.Database_ Dbase End DatabaseName Dbase.DatabaseName


Default_Journals[X] TVM Journal_DB Dbase.DatabaseName
[X]AccessRights JournalName None
Provides the name [X]Owners
for each database that
has a default journal
table.

2 – 10 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.DBCInfo DBCInfoTbl Administrator InfoKey None


InfoData None
Provides information
on the current
version and release of
the DBC. It is
updated during each
system restart.

DBC.DeleteAccess AccLogTbl Security LogDate None


Log[X] [X]Dbase Administrator LogTime None
[X]Owners
Provides a means of [X]Userdb
controlling deletion
of the DBC.
AccLogTbl. Only
rows older than 30
days from the current
date can be deleted.

DBC.DeleteOld InDoubtResLog Administrator LogicalHostId None


InDoubt CoordTaskId None
LogonUserName Dbase.DatabaseName
Displays those rows CommitOrRollback None
in the CompletionDate None
DBC.InDoubtResLog UserLogonTime None
table that are more SessionNumber None
than 30 days old. RunUnitId None
ResolvingUserLogon Dbase.DatabaseName
Name
UserLogonDate None
CompletionTime None
Options None

DBC.DiskSpace[X] DatabaseSpace Administrator Vproc None


Dbase DatabaseName Dbase.DatabaseName
Provides AMP-by- [X]AccessRights AccountName None
AMP information [X]Userdb MaxPerm None
about disk space [X]Owners MaxSpool None
usage, including MaxTemp None
spool, for each CurrentPerm None
database or account CurrentSpool None
that the use can CurrentTemp None
access. PeakPerm None
PeakSpool None
PeakTemp None

Teradata RDBMS Data Dictionary 2 – 11


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Events[X] RCEvent Operations CreateDate None


[X]Dbase Control CreateTime None
Provides a row for [X]AccessRights EventNum RCConfiguration.
each execution of a [X]Userdb EventNum
Host Utility [X]Owners RCMedia.EventNumber
function or of a EventType None
DBC/SQL UserName Dbase.DatabaseName
checkpoint DatabaseName Dbase.DatabaseName
statement. ObjectType None
AllAMPsFlag None
RestartSeqNum RCConfiguration.
RestartSeqNum
OperationInProcess None
TableName TVM.TVMName
CheckpointName None
LinkingEventNum None
DataSetName None
LockMode None
JournalUsed None
JournalSaved None
IndexPresent None
DupeDumpSet RCMedia.Dupe
DumpSet

DBC.Events_Con- RCEvent Operations Vproc None


figuration[X] RCCon- Control CreateDate None
figuration CreateTime None
Provides a row for [X]Dbase EventNum RCConfiguration.
each execution of a [X]AccessRights EventNum
Host Utility function [X]Userdb RCMedia.EventNumber
or of a DBC/SQL [X]Owners EventType None
checkpoint UserName Dbase.DatabaseName
statement, which was LogProcessor None
executed on a subset PhyProcessor None
of the AMP ProcessorState None
processors. RestartSeqNum None

DBC.Events_Media[ RCEvent Operations CreateDate None


X] RCMedia Control CreateTime None
[X]Dbase EventNum RCConfiguration.
Provides a row for [X]AccessRights EventNum
each execution of a [X]Userdb RCMedia.EventNumber
Host Utility dump or [X]Owners EventType None
restore function, UserName Dbase.DatabaseName
which created or DataSetName None
used removable VolSerialId None
media. VolSequenceNum None
DupeDumpSet None

2 – 12 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Hardware_ HW_Event_Log Operations TheDate None


Event_Log Control TheTime None
Event_Tag None
Provides information Category None
about system Severity None
failures, error Primary_Part_Number None
conditions and other Revision_Level None
events originating in Secondary_Part_Number None
the Parallel Data Serial_Number None
Extensions (PDE) or PMA None
the Teradata RDBMS. Module_Type None
Slot None
Slot_Type None
SubSlot None
SubSlot_Type None
FW_Version None
Vcc_Margin None
Frequency_Margin None
Vcc_Volts None
Vcc_Amps None
Temperature None
Line None
Text None
Error_Data None

DBC.HostsInfo Hosts End LogicalHostId None


HostName None
Provides information DefaultCharSet None
about any
user-defined
character sets
assigned by the
Teradata RDBMS
system administrator
as the default for the
client systems in the
Teradata RDBMS
configuration.

DBC.IndexStats Indexes All users DatabaseNameI None


Displays statistics on Dbase IndexNumber None
the indexes defined TVM IndexStatistics None
on a table for which TVMNameI None
statistics have been
collected.

Teradata RDBMS Data Dictionary 2 – 13


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Indices[X] Indexes End DatabaseName Dbase.DatabaseName


Dbase TableName TVM.TVMName
Describes each of the TVM IndexNumber None
indexes on each table TVFields IndexType None
that the user can [X]AccessRights UniqueFlag None
access. [X]Owners IndexName None
ColumnName None
ColumnPosition None
CreatorName Dbase.DatabaseName
CreateTimeStamp None
LastAlterName Dbase.DatabaseName
LastAlterTimeStamp None

DBC.InDoubtLog InDoubtResLog Administrator LogicalHostId None


CoordTaskId None
Displays the contents LogonUserName Dbase.DatabaseName
of the UserLogonDate None
DBC.InDoubtResLog CompletionDate None
table. CommitOrRollBack None
SessionNumber None
RunUnitId None
ResolvingUserLogon Dbase.DatabaseName
Name
UserLogonTime None
CompletionTime None
Options None

DBC.Journals[X] Dbase End Tables_DB Dbase.DatabaseName


TVM TableName None
Provides specific [X]AccessRights Journals_DB RCEvent.DatabaseName
information about [X]Owners Dbase.DatabaseName
journal to table JournalName None
mapping for each
data table the user
can access.

DBC.LogOnOff EventLog Security LogDate None


Administrator LogTime None
Gives the DBA access UserName Dbase.DatabaseName
to the session event AccountName Dbase.AccountName
table that records Event None
logon, logoffs, and LogicalHostId None
attempted logons. IFPNo None
SessionNo None
LogonDate None
LogonTime None
LogonSource None

2 – 14 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.LogonRules LogonRuleTbl Security UserName Dbase.DatabaseName


Dbase Administrator AcclogTbl.UserName
Retrieves LogicalHostId None
information about LogonStatus None
logon rules generated NullPassword None
as a result of CreatorName Dbase.DatabaseName
successfully CreateTimeStamp None
processed
GRANT/REVOKE
LOGON statements.

DBC.RCC_Con- RCCon- Operations EventNum RCEvent.EventNum


figuration[X] figuration Control LogProcessor None
[X]Dbase PhyProcessor None
Provides a row for [X]AccessRights ProcessorState None
each execution of a [X]Userdb RestartSeqNum None
Host Utility function [X]Owners Vproc None
or of a Teradata SQL
checkpoint
statement, which was
executed on a subset
of the AMP
processors.

DBC.RCC_Media[X] RCMedia Operations EventNum RCMediaEventNumber


[X]Dbase Control VolSerialId None
Provides a row for [X]AccessRights VolSequenceNum None
each execution of a [X]Userdb DupeDumpSet None
Host Utility dump or [X]Owners
restore function that
created or used
removable media.

DBC.RI_Child_Tables ReferencingTbls All users IndexID None


Dbase IndexName None
The RI_Child_Tables ChildDbID Dbase.DatabaseId
view provides ChildTID TVM.TVMId
information about TVFields.TableId
tables in child-parent ChildKeyFID TVFields.FieldId
order. It is similar to ParentDbID Dbase.DatabaseId
the ParentTID TVM.TVMId
DBC.All_RI_Childre TVFields.TableId
n view but returns ParentKeyFID TVFields.FieldId
the internal IDs of InconsistencyFlag None
databases, tables, and CreatorName Dbase.DatabaseName
columns instead of CreateTimeStamp None
names.

Teradata RDBMS Data Dictionary 2 – 15


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.RI_Distinct_ ReferencingTbls All users IndexID None


Children Dbase IndexName None
TVM ChildDB Dbase.DatabaseName
Provides information ChildTable None
about tables in child- ParentDB Dbase.DatabaseName
parent order without ParentTable None
the duplication that InconsistencyFlag None
could result from CreatorName Dbase.DatabaseName
multi-column foreign CreateTimeStamp None
keys.

DBC.RI_Distinct_ ReferencingTbls All users IndexID None


Parents Dbase IndexName None
TVM ParentDB Dbase.DatabaseName
Provides information ParentTable None
about tables in ChildDB Dbase.DatabaseName
parent-child order ChildTable None
without the InconsistencyFlag None
duplication that CreatorName Dbase.DatabaseName
could result from CreateTimeStamp None
multi-column foreign
keys.

DBC.RI_Parent_Tables ReferencingTbls All users IndexID None


Dbase IndexName None
Provides information ParentDbID Dbase.DatabaseId
about all tables in ParentTID TVM.TVMId
parent-child order. TVFields.TableId
ParentKeyFID TVFields.FieldId
ChildDbID Dbase.DatabaseId
ChildTID TVM.TVMId
TVFields.TableId
ChildKeyFID TVFields.FieldId
InconsistencyFlag None
CreatorName Dbase.DatabaseName
CreateTimeStamp None

DBC.SecurityDefaults SysSecDefaults Security ExpirePassword None


Administrator PasswordMinChar None
Describes the PasswordMaxChar None
password features PasswordDigits None
selected on the site. PasswordSpecChar None
MaxLogonAttempts None
LockedUserExpire None
PasswordReuse None

2 – 16 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.SecurityLog[X] AccLogTbl Security LogDate None


[X]Dbase Administrator LogTime None
Provides access to the [X]Owners LogType None
DBC.AccLogTbl. [X]Userdb UserName Dbase.DatabaseName
Rows are logged as AccountName None
directed by DatabaseName Dbase.DatabaseName
BEGIN/END TableName TVM.TVMName
LOGGING. Text None

DBC.SessionInfo[X] SessionTbl Administrator UserName Dbase.DatabaseName


AccountName Dbase.AccountName
Gives one row for SessionNo Temptables.SessionNo
each time the user is DefaultDataBase Dbase.DatabaseName
logged on; used as a IFPNo None
review of accounts Partition None
set by user. LogicalHostId None
HostNo TempTables.HostNo
CurrentCollation None
LogonDate None
LogonTime None
LogonSequenceNo None
LogonSource None
ExpiredPassword None
TwoPCMode None
Transaction_Mode None

DBC.SHOWCOL TVFields All users DatabaseName Dbase.DatabaseName


CHECKS Dbase TableName TVM.TVMName
TVM ColumnName None
Provides information ColCheck None
about column CreatorName Dbase.DatabaseName
constraints for a table CreateTimeStamp None
in a database.

DBC.SHOWTBL TableConstraints All users DatabaseName Dbase.DatabaseName


CHECKS Dbase TableName TVM.TVMName
TVM CheckName None
Provides information TblCheck None
about table CreatorName Dbase.DatabaseName
constraints for a CreateTimeStamp None
database.

Teradata RDBMS Data Dictionary 2 – 17


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Software_Event SW_Event_Log Operations TheDate None


_Log Control TheTime None
Event_Tag None
Provides information Category None
about logged Severity None
software events PMA None
originating in the Vproc None
Parallel Data Partition None
Extensions (PDE) or Task None
the Teradata RDBMS. Function None
SW_Version None
Line None
Text None
Stacktrace None
Error_Data None

DBC.Table_Level TableConstraints All users DatabaseName Dbase.DatabaseName


Constraints Dbase TableName TVM.TVMName
TVM ConstraintName None
Provides information ConstraintText None
about table CreatorName Dbase.DatabaseName
constraints for a CreateTimeStamp None
database.

DBC.Tables[X] TVM All users DatabaseName Dbase.DatabaseName


Dbase TableName TVM.TVMName
Provides information [X]AccessRights Version None
about the tables, [X]Owners TableKind None
views, stored ProtectionType None
procedures, join JournalFlag None
indexes, or macros CreatorName Dbase.DatabaseName
that the user can RequestText None
access. CommentString None
ParentCount None
ChildCount None
NamedTblCheckCount None
UnnamedTblCheckExist None
PrimaryKeyIndexId None
CreateTimeStamp None
LastAlterName Dbase.DatabaseName
LastAlterTimeStamp None

2 – 18 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Tables2 TVM All users TVMName TVM.TVMName


TVMId AcclogRuleTbl.TVMId
Provides ID DatabaseSpace.tableId
definition Accessrights.TVMId
information about Temptables.BaseTableId
tables. It is similar to ReferencingTbls.Refer-
the Tables view but encingTblId
includes the ID of the ReferencedTbls.Refer-
table and database encedTblId
instead of the other DBCAssociation.TVMId
information (Version, TVFields.TableId
TableKind, etc.) Dbase.JournalId
provided by the Indexes.TableId
Tables view. Tableconstraints.TVMId
DatabaseId Accessrights.DatabaseId
Owners.owneeId
Dbase.DatabaseId
ParentCount None
ChildCount None

DBC.TableSize[X] DataBaseSpace End Vproc None


Dbase DatabaseName Dbase.DatabaseName
Provides AMP-by TVM AccountName None
AMP information [X]AccessRights TableName TVM.TVMName
about disk space [X]Owners CurrentPerm None
usage, excluding PeakPerm None
spool, for any
database, data table,
journal table, or
account the user can
access.

DBC.Triggers TriggersTbl End DatabaseName Dbase.DatabaseName


Dbase TableName TVM.TVMName
Provides information TVM TriggerName None
about event-driven, EnabledFlag None
specialized ActionTime None
procedures attached Event None
to a single table and Kind None
stored in the OrderNumber None
database. TriggerComment None
RequestText None
CreatorName Dbase.DatabaseName
CreateTimeStamp None
LastAlterName Dbase.DatabaseName
LastAlterTimeStamp None

Teradata RDBMS Data Dictionary 2 – 19


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.UserGranted AccessRights End DatabaseName Dbase.DatabaseName


Rights Dbase TableName None
TVM ColumnName None
Describes the explicit TVFields Grantee None
rights that the user Ownerdb GrantAuthority None
has granted to other AccessRight None
users. AllnessFlag None
CreatorName Dbase.DatabaseName
CreateTimeStamp None

DBC.UserRights AccessRights End DatabaseName Dbase.DatabaseName


Dbase TableName TVM.TVMName
Describes the explicit TVM ColumnName None
rights of each user for TVFields AccessRight None
access to tables, Userdb GrantAuthority None
views, join indexes, GrantorName None
stored procedures or CreatorName Dbase.DatabaseName
macros. CreateTimeStamp None

2 – 20 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System Views Reference

Referenced Tables
View Name and Description User Type Columns Selected Referenced column(s)
and Views

DBC.Users Dbase Supervisory UserName RCEvent.DatabaseName


AccessRights AcclogTbl.UserName
Describes in detail all Userdb CreatorName DbaseDatabaseName
information about Owners PasswordLastModDate None
users that you PasswordLastModTime None
control, including OwnerName Dbase.DatabaseName
passwords. PermSpace None
SpoolSpace None
TempSpace None
ProtectionType None
JournalFlag None
StartupString None
DefaultAccount None
DefaultDatabase Dbase.DatabaseName
CommentString None
DefaultCollation None
PasswordChgDate None
LockedDate None
LockedTime None
LockedCount None
TimeZoneHour None
TimeZoneMinute None
DefaultDateForm None
CreateTimeStamp None
LastAlterName RCEvent.DatabaseName
AcclogTbl.UserName
LastAlterTimeStamp None
DefaultCharType None

DBC.User_Default_ Dbase End UserName RCEvent.DatabaseName


Journals[X] TVM AcclogTbl.UserName
AccessRights Journal_DB RCEvent.DatabaseName
Describes the users Owners AcclogTbl.UserName
that have default JournalName None
journal tables,
including the name
and database for each
journal table.

Teradata RDBMS Data Dictionary 2 – 21


Chapter 2: System Views
System View Columns Reference

System View Columns Reference

The following columns table describes the columns of each of the system views
in the DBC in alphabetical order. In addition, it includes information on which
views select that column, and the data type and format of the column.
Using the information included in the view columns table, you can write a
SELECT statement that will return the information you want.

View Column Name Description Data Type Format Associated Views

AccessRight Returns a code that identifies CHAR X(2) AllRights


a privilege granted on the NOT NULL UserGrantedRights
object. Possible values for UserRights
privilege type are as follows:

• AS = ABORT SESSION • DV = DROP VIEW


• CD = CREATE DATABASE • E = EXECUTE (MACRO)
• CG = CREATE TRIGGER • I = INSERT
• CM = CREATE MACRO • IX = INDEX
• CP = CHECKPOINT • MR = MONITOR RESOURCE
• CT = CREATE TABLE • MS = MONITOR SESSION
• CU = CREATE USER • PC = CREATE PROCEDURE
• CV = CREATE VIEW • PD = DROP PROCEDURE
• D = DELETE • PE = EXECUTE PROCEDURE
• DD = DROP DATABASE • R = RETRIEVE/SELECT
• DG = DROP TRIGGER • RF = REFERENCE
• DM = DROP MACRO • RS = RESTORE
• DP = DUMP • SS = SET SESSION RATE
• DT = DROP TABLE • SR = SET RESOURCE RATE
• DU = DROP USER • U = UPDATE

2 – 22 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

AccessType Returns the type of privilege CHAR X(2) AccessLog


(for “Acr”-type for which the check that NOT NULL
columns) generated this log entry was
performed.

• AN=ANY PRIVILEGE * • E = EXECUTE


(Indicates a HELP or • G = GRANT
SHOW statement for
• I = INSERT
which at least one
privilege, but no specific • IX = INDEX
privilege, is required.) • HR = HUT RELEASE LOCK *
• AS = ABORT SESSION (Indicates that a client system utility lock is
involved, which could require a check for one or
• CD = CREATE DATABASE
more of the privileges associated with DUMP and
• CG = CREATE TRIGGER RESTORE.)
• CM = CREATE MACRO • MR = MONITOR RESOURCE
• CP = CHECKPOINT • MS = MONITOR SESSION
• CT = CREATE TABLE • PC = CREATE PROCEDURE
• CU = CREATE USER • PD = DROP PROCEDURE
• CV = CREATE VIEW • PE = EXECUTE PROCEDURE
• D = DELETE • R = RETRIEVE/SELECT
• DD = DROP DATABASE • RF = REFERENCE
• DG = DROP TRIGGER • RS = RESTORE
• DM = DROP MACRO • SS = SET SESSION RATE
• DP = DUMP • SR = SET RESOURCE RATE
• DT = DROP TABLE • U = UPDATE
• DU = DROP USER • WL = WRITE LOCK *
• DV = DROP VIEW (Indicates that a LOCKING objectname “FOR
WRITE” is involved, which may require checks for
one or more of the following privileges: INSERT,
UPDATE, DELETE.)
* Indicates the statement required multiple checks

Teradata RDBMS Data Dictionary 2 – 23


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

AccountName Returns the account in effect VARCHAR X(30) AccessLog


when the request that NOT NULL SecurityLog[X]
generated this log entry was
submitted.

Note: The system account CHAR X(30) AccountInfo[X]


name SYSTEMACCOUNTNO NOT NULL AllSpace[X]
tracks console utility activity AMPUsage
such as table rebuild, Databases[X]
Diskcopy, or Scandisk. DiskSpace[X]
LogOnOff
SessionInfo[X]
TableSize[X]

AcrCheckPoint Returns the logging in effect CHAR X(3) AccLogRules


for the CHECKPOINT NOT NULL Title: CPT
privilege on the objects or
users (or both) to which the
rule applies.

AcrCreateDatabase Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE DATABASE NOT NULL Title: CDB
privilege on the objects or
users (or both) to which the
rule applies.

AcrCreateMacro Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE MACRO NOT NULL Title: CMC
privilege on the objects or
users (or both) to which the
rule applies.

AcrCreateProcedure Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE NOT NULL Title: CSP
PROCEDURE privilege on the
objects or users (or both) to
which the rule applies.

AcrCreateTable Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE TABLE NOT NULL Title: CTB
privilege on the objects or
users (or both) to which the
rule applies.

AcrCreateTrigger Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE TRIGGER NOT NULL Title: CTG
privilege on the objects or
users (or both) to which the
rule applies.

2 – 24 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

AcrCreateUser Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE USER NOT NULL Title: CUS
privilege on the objects or
users (or both) to which the
rule applies.

AcrCreateView Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE VIEW NOT NULL Title: CVW
privilege on the objects or
users (or both) to which the
rule applies.

AcrDelete Returns the logging in effect CHAR X(3) AccLogRules


for the DELETE privilege on NOT NULL Title: DEL
the objects or users (or both)
to which the rule applies.

AcrDropDatabase Returns the logging in effect CHAR X(3) AccLogRules


for the DROP DATABASE NOT NULL Title: DDB
privilege on the objects or
users (or both) to which the
rule applies.

AcrDropMacro Returns the logging in effect CHAR NOT X(3) AccLogRules


for the DROP MACRO NULL Title: DMC
privilege on the objects or
users (or both) to which the
rule applies.

AcrDropProcedure Returns the logging in effect CHAR X(3) AccLogRules


for the DROP PROCEDURE NOT NULL Title: DSP
privilege on the objects or
users (or both) to which the
rule applies.

AcrDropTable Returns the logging in effect CHAR X(3) AccLogRules


for the DROP TABLE NOT NULL Title: DTB
privilege on the objects or
users (or both) to which the
rule applies.

AcrDropTrigger Returns the logging in effect CHAR X(3) AccLogRules


for the DROP TRIGGER NOT NULL Title: DTG
privilege on the objects or
users (or both) to which the
rule applies.

AcrDropUser Returns the logging in effect CHAR X(3) AccLogRules


for the DROP USER privilege NOT NULL Title: DUS
on the objects or users (or
both) to which the rule
applies.

Teradata RDBMS Data Dictionary 2 – 25


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

AcrDropView Returns the logging in effect CHAR X(3) AccLogRules


for the DROP VIEW privilege NOT NULL Title: DVW
on the objects or users (or
both) to which the rule
applies.

AcrDump Returns the logging in effect CHAR X(3) AccLogRules


for the DUMP privilege on the NOT NULL Title: DMP
objects or users (or both) to
which the rule applies.

AcrExecute Returns the logging in effect CHAR X(3) AccLogRules


for the EXECUTE privilege on NOT NULL Title: EXE
the objects or users (or both)
to which the rule applies.

AcrExecute Returns the logging in effect CHAR X(3) AccLogRules


Procedure for the EXECUTE NOT NULL Title: ESP
PROCEDURE privilege on the
objects or users (or both) to
which the rule applies.

AcrGrant Returns the logging in effect CHAR X(3) AccLogRules


for the GRANT privilege on NOT NULL Title: GRT
the objects or users (or both)
to which the rule applies.

AcrIndex Returns the logging in effect CHAR X(3) AccLogRules


for the CREATE/DROP NOT NULL Title: IDX
INDEX privilege on the
object(s) or users (or both) to
which the rule applies.

AcrInsert Returns the logging in effect CHAR X(3) AccLogRules


for the INSERT privilege on NOT NULL Title: INS
the objects or users (or both)
to which the rule applies.

AcrReference Returns the logging in effect CHAR X(3) AccLogRules


for the Reference privilege on NOT NULL Title: REF
the object(s) or users (or both)
to which the rule applies.

AcrRestore Returns the logging in effect CHAR X(3) AccLogRules


for the RESTORE privilege on NOT NULL Title: RST
the objects or users (or both)
to which the rule applies.

AcrSelect Returns the logging in effect CHAR X(3) AccLogRules


for the SELECT privilege on NOT NULL Title: SEL
the objects or users (or both)
to which the rule applies.

2 – 26 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

AcrUpdate Returns the logging in effect CHAR X(3) AccLogRules


for the UPDATE privilege on NOT NULL Title: UPD
the objects or users (or both)
to which the rule applies.

ActionTime Returns a code to signify CHAR X(1) Triggers


when, in relation to the SQL UPPERCASE
statement, the trigger is fired: NOT NULL
• B = Before
• A = After
• I = Instead of the
statement

AllAMPsFlag Returns a code that indicates CHAR X(1) Events[X]


whether the event was NOT NULL
executed on all AMPs,
clusters, or processors. The
codes are as follows:
• A = all AMPs used
• C = all Clusters
• P = all Processors

AllnessFlag Returns Y (yes) or N (no) to CHAR X(1) AllRights


indicate whether or not the UPPERCASE UserGrantedRights
privilege was granted to all NOT NULL
subordinate users, or to all
users who are owned by the
grantee.

B_DatabaseName Returns the name of the CHAR(30) X(30) AllTempTables[X]


database in which the NOT NULL
temporary table resides

B_TableName Returns the name of the base CHAR(30) X(30) AllTempTables[X]


temporary table. NOT NULL

Teradata RDBMS Data Dictionary 2 – 27


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Category Shows the category code BYTEINT Z9 Software_Event_Log


assigned to a software event.
Possible values are as follows:
• 0 None
• 1 CPU Hardware
• 2 Memory Hardware
• 3 TDN Hardware
• 4 Disk Hardware
• 5 Channel Hardware
• 6 Host
• 7 Driver
• 8 Resource
• 9 System
• 10 User
• 11 Occurrence
• 12 Abnormal
• 52 Base TP
• 64 Max TP

Returns the category code CHAR X(1) Hardware_Event_


assigned to a hardware event. Log
Possible values are:
P = Permanent events
T = Transient events

CharSetId Returns the number assigned BYTEINT ZZ9 CharTranslations


to the character set defined by NOT NULL
this row.

CharSetName Returns the name of a CHAR X(30) CharSets


user-defined character set that UPPERCASE CharTranslations
is installed and available for NOT NULL
the current session, or the
name assigned to the
character set defined by this
row.

CharType Returns the type of the SMALLINT ---,--9 Columns[X]


different character data types
as follows: 1 for Latin, 2 for
Unicode, 3 for KanjiSJIS, 4 for
Graphic, and 5 for Kanji1, and
0 for all other data types.

2 – 28 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

CheckName Returns the name of the table- CHAR X(30) SHOWTBLCHECKS


level check. This field is
NULL if this is an unnamed
table check.

CheckpointName Returns the checkpoint name VARCHAR X(30) Events[X]


as specified by the user in the
CHECKPOINT statement.
Child Returns the name of a CHAR X(30) Children[X]
referencing database or user. NOT NULL

ChildCountC Returns the count of the SMALLINT ---,--9 Tables[X]


referencing tables for the NOT NULL Tables2
table.

ChildDb Returns the name of the CHAR X(30) All_RI_Children


referencing database. NOT NULL All_RI_Parents
RI_Distinct_
Children
RI_Distinct_Parents

ChildDbId Returns the database ID of the BYTE X(8) RI_Child_Tables


referencing table. NOT NULL RI_Parent_Tables

ChildKeyColumn Returns the name of a column CHAR X(30) All_RI_Children


in the referencing key. NOT NULL All_RI_Parents

ChildKeyFID Returns the field ID of a SMALLINT ---,--9 RI_Child_Tables


column in the referencing key. NOT NULL RI_Parent_Tables

ChildTable Returns the name of the CHAR X(30) All_RI_Children


referencing table. NOT NULL All_RI_Parents
RI_Distinct_
Children
RI_Distinct_Parents

ChildTID Returns the table ID of the BYTE X(12) RI_Child_Tables


referencing table. NOT NULL RI_Parent_Tables

ColCheck Returns the unresolved text VARCHAR X(255) SHOWCOLCHECKS


for the column-level check (8192)
condition.

CollEqvClass Returns the value of the BYTE X(512) Collations


equivalence class assigned to NOT NULL
each character. Equivalence
also is the first level of
comparison in determining
the collation sequence.

Teradata RDBMS Data Dictionary 2 – 29


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

CollInstall Returns the install flag for the CHAR X(1) Collations
collation. The option returns NOT NULL
Y (yes) if the collation is
installed when the Teradata
RDBMS is started and N (no)
if the collation is not installed
when the Teradata RDBMS is
started. This flag applies only
to multinational collation.
Other collations are never
installed.

CollName Returns the name of the CHAR X(30) Collations


collation sequence. Only the NOT NULL
collation sequence with name
MULTINATIONAL and the
collInstall flag set to Y is
installed on the Teradata
RDBMS.

CollOrderCS Returns the value assigned to BYTE X(512) Collations


each character to determine NOT NULL
the relative order of the
characters within the same
class for second level,
case-specific comparison.

CollOrderUC Returns the value assigned to BYTE X(512) Collations


each character to determine NOT NULL
the relative order of the
characters within the same
class for second level,
uppercase comparison.

ColumnConstraint Returns the condition text for VARCHAR X(255) Columns[X]


column-level check. (8192)

ColumnFormat Returns the format of a CHAR X(30) Columns[X]


column or parameter.

ColumnId Returns a two-byte value SMALLINT ---,--9 Columns[X]


specifying the internal NOT NULL
identifier for this column.

ColumnLength Returns the length of a SMALLINT ZZ,ZZ9 Columns[X]


column as the maximum
number of bytes used to
physically store a column
value in the row of a table.

2 – 30 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ColumnName Returns the column name that VARCHAR X(30) AccessLog


was entered on the access log.

Returns the column name or CHAR X(30) Columns[X]


parameter. NOT NULL Indices[X]

Returns the column name to CHAR X(30) AllRights


which a privilege has been NOT NULL UserGrantedRights
granted. UserRights

Returns the column name CHAR X(30) SHOWCOLCHECKS


having column-level checks. NOT NULL

ColumnPosition Returns the position of the SMALLINT Z9 Indices[X]


column in the index. For a NOT NULL
composite index, this
indicates the order of the
columns making up the index.

ColumnTitle Returns any column heading. VARCHAR X(60) Columns[X]

Teradata RDBMS Data Dictionary 2 – 31


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ColumnType Returns column name or CHAR X(2) Columns[X]


parameter in the following
formats:
• AT = TIME
• BF = BYTE
• BV = VARBYTE
• CF = CHAR
• CV = VARCHAR
• D = DECIMAL
• DA = DATE
• DH = INTERVAL DAY TO
HOUR
• DM = INTERVAL DAY TO
MINUTE
• DS = INTERVAL DAY TO
SECOND
• DY = INTERVAL DAY
• F = FLOAT
• GF = GRAPHIC
• GV = VARGRAPHIC
• HM = INTERVAL HOUR
TO MINUTE
• HR = INTERVAL HOUR
• HS = INTERVAL HOUR
TO SECOND
• I1 = BYTEINT
• I2 = SMALLINT
• I8 = BYTEINTEGER
• I = INTEGER
• MI = INTERVAL MINUTE
• MO = INTERVAL MONTH
• MS = INTERVAL MINUTE
TO SECOND
• SC = INTERVAL SECOND
• SZ = TIMESTAMP WITH
TIME ZONE
• TS = TIMESTAMP
• TZ = TIME WITH TIME
ZONE
• YM = INTERVAL YEAR
TO MONTH
• YR = INTERVAL YEAR

2 – 32 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

CommentString Returns user-supplied text or VARCHAR X(255) Columns[X]


commentary on the column, Databases[X]
database, table, view, macro, Tables[X]
stored procedure, or the user. Users

CommitOrRollback Returns a code to indicate CHAR (1) X(1) DeleteOldInDoubt


whether the transaction was NOT NULL InDoubtLog
committed or rolled back.
• C = Committed
• R = Rolled Back

CompletionDate Returns the date the in-doubt DATE YY/MM/DD DeleteOldInDoubt


transaction was resolved. NOT NULL InDoubtLog

CompletionTime Returns the time the in-doubt FLOAT 99:99:99 DeleteOldInDoubt


transaction was resolved. NOT NULL InDoubtLog

Compressible Returns a C (Compress) if the CHAR X(1) Columns[X]


COMPRESS phrase is defined
for the column.

CompressValue Returns the constant value VARCHAR X(255) Columns[X]


specified for compression in
the COMPRESS phrase. If the
constant value is not defined,
a null value is returned.

ConstraintCount Returns the count of table SMALLINT ---,--9 Columns[X]


level constraints referencing NOT NULL
this column.

ConstraintName Returns the name of the table- CHAR X(30) Table_


level check. This field is LevelConstraints
NULL if this is an unnamed
table check.

ConstraintText Returns the unresolved text VARCHAR X(255) Table_


for the table-level check (8192) LevelConstraints
condition.

CoordTaskId Returns the coordinator that VARBYTE X(60) DeleteOldInDoubt


had the in-doubt transaction. (30) InDoubtLog
NOT NULL

CpuTime Returns total CPU time in FLOAT ---,---,---,--9.99 AMPUsage


seconds NOT NULL
(with resolution of .01 second)
used on an AMP (or on all
AMPs if SUM aggregate is
specified).

Teradata RDBMS Data Dictionary 2 – 33


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

CreateDate Returns the date that the DATE YY/MM/DD Events[X]


event took place. NOT NULL Events_
Configuration[X]
Events_Media[X]

CreateTime Returns the time that the FLOAT 99:99:99.99 Events[X]


event took place. NOT NULL Events_
Configuration[X]
Events_Media[X]

CreateTimeStamp Specifies the time the object TIMESTAMP yyyy-mm-dd AccLogRules


was created. hh:mm:ss AllRights
All_RI_Children
All_RI_Parents
Columns[X]
Databases[X]
Indices[X]
LogonRules
RI_Child_Tables
RI_Distinct_Children
RI_Distinct_Parents
RI_Parent_Tables
SHOWCOLCHECKS
SHOWTBLCHECKS
Tables[X]
Table_
LevelConstraints
Triggers
UserGrantedRights
UserRights
Users

2 – 34 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

CreatorName Returns the name of the user CHAR X(30) AccLogRules


who created the database, NOT NULL AllRights
table, or the name of the user‘s All_RI_Children
creator. All_RI_Parents
Columns[X]
Databases[X]
Indices[X]
LogonRules
RI_Child_Tables
RI_Distinct_Children
RI_Distinct_Parents
RI_Parent_Tables
SHOWCOLCHECKS
SHOWTBLCHECKS
Tables[X]
Table_
LevelConstraints
Triggers
UserGrantedRights
UserRights
Users

CurrentCollation Returns the current collation CHAR X(1) SessionInfo[X]


of the session with the UPPERCASE
following values: NOT NULL
• A = ASCII
• E = EBCDIC
• H = Host
• M = Multinational

CurrentPerm Returns an integer that FLOAT ---,---,---,---,--9 AllSpace[X}


represents the permanent NOT NULL DiskSpace[X]
space, in bytes, that is TableSize[X]
currently being used by the
database or table. Unless a
specific AMP is requested,
this value includes all AMPs.

CurrentSpool Returns an integer that FLOAT ---,---,---,---,--9 AllSpace[X}


represents the spool space, in NOT NULL DiskSpace[X]
bytes, that is currently being
used by the database on a
specified AMP (or on all
AMPs if the SUM aggregate is
specified).

CurrentTemp Returns the number of bytes FLOAT ---,---,---,---,--9 AllSpace[X}


currently used by a temporary NOT NULL DiskSpace[X]
table per vproc.

Teradata RDBMS Data Dictionary 2 – 35


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

DatabaseId Returns the ID of the database BYTE X(8) Databases2


with the indicated count of NOT NULL
unresolved references.

Returns the ID of the database BYTE X(8) Tables2


which contains both the Child NOT NULL
and Parent tables.

Returns the ID of the database BYTE X(4) Triggers


where the trigger resides. NOT NULL

DatabaseName Returns the database or user VARCHAR X(30) AccessLog


name of the object for which NOT NULL SecurityLog[X]
this log entry was made.

Returns the database to which CHAR X(30) AccLogRules


the access logging rule NOT NULL
applies; the special system
keyword ’ALL’ may be
specified.

Returns the name of the CHAR X(30) AllRights


database on which a privilege NOT NULL
was granted; either of the
following special system
keywords may be specified:
• ALL
• PUBLIC (indicates
performance monitoring
rights)

Returns the name of a CHAR X(30) AllSpace[X]


database or one of the NOT NULL Databases[X]
following special system DiskSpace[X]
keywords: UserGrantedRights
• ALL UserRights
• DEFAULT
• PUBLIC (denotes that a
user granted performance
monitoring rights is
granted those rights on all
users of the system [the
PUBLIC]). The values for
MaxPerm, CurrentPerm,
PeakPerm, CurrentSpool,
PeakSpool, CurrentTemp,
and Peak Temp are 0 for
the PUBLIC database.

2 – 36 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

DatabaseName Returns the name of the CHAR X(30) Association


(continued) database or user space in NOT NULL
which the imported object
now resides.

Returns the name of a CHAR X(30) Columns[X]


database. NOT NULL Indices[X]
TableSize[X]

Returns the name of a CHAR X(30) Database_Default_


database for which a default NOT NULL Journals[X]
journal table has been
defined.

Returns the name of a CHAR X(30) Databases2


database with the indicated NOT NULL
count of unresolved
references.

Returns the name of the CHAR X(30) Events[X]


database that was affected by NOT NULL
the event.

Returns the name of a CHAR X(30) SHOWCOL


database containing a table NOT NULL CHECKS
with a column-level check.

Returns the name of a CHAR X(30) SHOWTBLCHECKS


database containing a table NOT NULL Table_
with a table-level check. LevelConstraints

Returns the name of the CHAR X(30) Tables[X]


database that contains the NOT NULL
table.

Returns the name of the CHAR X(30) Triggers


database where the trigger NOT NULL
resides.

Returns the databasename of CHAR X(30) ColumnStats


the table, for which the NOT NULL IndexStats
column or index statistics are
requested.

DataSetName Returns the client system data VARCHAR X(44) Events[X]


set name for a dump or
Events_Media[X]
restore event.

DBKind Returns information that CHAR X(1) Databases[X]


indicates whether the row NOT NULL
information represents a
database (D) or a user (U).

Teradata RDBMS Data Dictionary 2 – 37


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

DecimalFractional Returns an integer indicating SMALLINT Z9 Columns[X]


Digits the total number of fractional
digits (if the column is defined
as decimal).

DecimalTotalDigits Returns an integer indicating SMALLINT Z9 Columns[X]


the total number of decimal
digits (if the column is defined
as a decimal)

DefaultAccount Returns the name of any CHAR X(30) Users


default account. NOT NULL

DefaultCharSet Returns the name of the CHAR X(30) HostsInfo


character set to be used as the NOT NULL
default for this client system.
Possible values are as follows:
• EBCDIC
• ASCII
• The name of a
user-defined character set
as displayed in the
CharSets view.

DefaultCharType Returns the type of the user SMALLINT ---,--9 Users


default character type as
follows:
• 1 - Latin
• 2 - Unicode
• 3 - KanjiSJIS
• 4 - Graphic
• 5 - Kanji1

DefaultCollation Returns the default collation CHAR X(1) Users


for the user as defined in a NOT NULL
CREATE/MODIFY USER
statement; if not defined, the
DefaultCollation is the
collation of the logon client
system. Possible values are as
follows:
• A = ASCII
• E = EBCDIC
• H = Host
• M = Multinational

2 – 38 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

DefaultDatabase Returns the name of the CHAR X(30) SessionInfo[X]


current default database for NOT NULL
the user.

Returns the name of the CHAR X(30) Users


default database for the user
as defined in a
CREATE/MODIFY USER
statement; if not defined, the
DefaultDatabase is the user
space and the value returned
is NULL.

DefaultDateForm Returns either an CHAR X(1) Users


INTEGERDATE or UPPERCASE
ANSIDATE that is set for a
USER with the CREATE or
MODIFY statement.

DefaultValue Returns any default value VARCHAR X(1024) Columns[X]


assigned to the column or
parameter.

DiskIO Returns the total number of FLOAT ---,---,---,--9 AMPUsage


reads and writes to DSU by NOT NULL
each AMP in the system (or
the total for all AMPs if the
sum aggregate is specified).

DupeDumpSet Returns a code to indicate CHAR X(1) Events[X]


whether the dump event
created a duplicate archive
dataset. The codes are as
follows:
• Y = Yes for a duplicate
dataset
• N = No for a single
dataset; the first dataset
created

Returns a code to indicate CHAR X(1) Events_Media[X]


whether the dump event NOT NULL RCC_Media[X]
created a duplicate archive
dataset. The codes are as
follows:
• Y = Yes for a duplicate
dataset
• N = No for a single
dataset; the first dataset
created

Teradata RDBMS Data Dictionary 2 – 39


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

E2I Returns the client system BYTE X(512) CharTranslations


(external) to Teradata RDBMS NOT NULL
(internal) Hex translation
codes.

E2IUp Returns the client system BYTE X(512) CharTranslations


(external) to Teradata RDBMS NOT NULL
(internal) and uppercase Hex
translation codes.

EnabledFlag Returns a code that indicates CHAR X(1) Triggers


whether the trigger is enabled UPPERCASE
or disabled: NOT NULL
• Y = Yes (default)
• N = No

Error_Data Returns event-specific data VARBYTE X(512) Software_Event_Log


supplied by the diagnostic
subsystem. This data can be
extracted for further analysis.

Returns event-specific data VARBYTE X(128) Hardware_Event_


supplied by the diagnostic Log
subsystem. This data can be
extracted for further analysis.

E_TableId Returns the identifier for the CHAR(30) X(30) AllTempTables[X]


materialized (effective) NOT NULL
temporary table.

2 – 40 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Event Returns a description of the CHAR X(12) LogOnOff


type of action, using the NOT NULL
following descriptions:
• Logon
• Logoff
• Logon failed
• Bad user
• Bad account
• Bad password
• Forced Off (indicates that
the user session was
terminated from the
Teradata RDBMS console
or the Performance
Monitor API)

Returns a code to signify CHAR X(1) Triggers


which of the following SQL UPPERCASE
statements fires the trigger: NOT NULL
• U = UPDATE
• I = INSERT
• D = DELETE

EventCount Returns the number of INTEGER --,---,---,--9 AccessLog


duplicate rows (that is, same
occurrences) that preceded a
’LAST-occurrence- only’ row.

EventNum Returns the client system INTEGER --,---,---,--9 Association


event number of the restore NOT NULL
operation.

Returns the value assigned by INTEGER --,---,---,--9 Events[X]


the Teradata RDBMS to each NOT NULL RCC_Media[X]
user archive or recovery Events_
command processed. Configuration[X]
Events_Media[X]

Returns the value assigned by INTEGER --,---,---,--9 RCC_


the Teradata RDBMS to each NOT NULL Configuration[X]
utility function performed or
CHECKPOINT statement
processed.

Teradata RDBMS Data Dictionary 2 – 41


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Event_Tag Returns an integer value INTEGER Z99-99999-99 Software_Event_Log


made up of the subsystem ID, NOT NULL
the event code, and the
subevent code. The event tag
is a unique identifier for the
type of event that occurred.
For Database Query Manager,
the Event_Tag contains the
error code for the DBQM error
that occured. You can find the
text of the error in the Text
column. (The text of the error
possibly spreads over
multiple lines, so you must
use the line number to extract
it.)

Returns the form of 10 digit DECIMAL rbbeeeeehh Hardware_Event_


decimal ‘rbbeeeeehh’ Log
according to the following
format:
• r = 0..3 Reserved
• bb = 0..99 Subsystem ID
• eeeee = 0..99999 Event ID -
Unique error code
• hh = 0..99 Event
Subcategory

EventType Returns the type of event that CHAR X(30) Events[X]


occurred, using the following: NOT NULL Events_
• CHECKPOINT Configuration[X]
Events_Media[X]
• RESTORE
• DELETE
• ROLLBACK
• DUMP
• ROLLFORWARD

2 – 42 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ExpiredPassword Returns a code that indicates CHAR (1) X(1) SessionInfo[X]


whether or not the defined UPPERCASE
session is in the process of a
logon for a user with an
expired password. The codes
are as follows:
• Y = Yes, by Session
Control procedures
• N = No, by the Parser
when a new password is
assigned to the user

ExpirePassword Returns the number of days to SMALLINT ---,--9 SecurityDefaults


elapse before the password NOT NULL
expires. 0 indicates
passwords do not expire.

FieldStatistics Returns the statistics for each VARBYTE X(55) ColumnStats


column in a table. (16383)

FW_Version Returns the version number of CHAR X(11) Hardware_Event_


the firmware running at the Log
time the event was logged.

Frequency Returns the specified logging CHAR X(1) AccessLog


frequency, which is NOT NULL
determined by the rule that
caused this entry (see
AccLogRules view). Possible
values are as follows:
• B = Both FIRST and LAS T
occurrences
• E = EACH occurrence
• F = FIRST occurrence only
• L = LAST occurrence only

Frequency_Margin Returns the value of the CHAR X(1) Hardware_Event_


frequency margin of the Log
environment. Values inlcude:
• H = High,
• N = Normal
• L = Low

Function Returns the identification VARCHAR X(32) Software_Event_Log


string for the entity reporting
a software event.

Teradata RDBMS Data Dictionary 2 – 43


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

GrantAuthority Returns the WITH GRANT CHAR X(1) AllRights


OPTION attribute of the NOT NULL UserGranted
access right held by the user. Rights
UserRights

Grantee Returns the name of a user CHAR X(30) UserGranted


who was granted a privilege; NOT NULL Rights
ALL can be specified.

GrantorName Returns the name of the user CHAR X(30) AllRights


who granted the privilege. NOT NULL UserRights

HostName Returns the unique name CHAR X(30) HostsInfo


defined for this client system. NOT NULL

HostNo Returns the number of the SMALLINT ---,--9 SessionInfo[X]


client system through which NOT NULL CSPSessionInfo
the user logged on to the AllTempTables[X]
Teradata RDBMS.

I2E Returns the Teradata RDBMS BYTE X(512) CharTranslations


(internal) to client system NOT NULL
(external) Hex translation
codes.

I2EUp Returns the Teradata RDBMS BYTE X(512) CharTranslations


(internal) to client system NOT NULL
(external) and uppercase Hex
translation codes.

IFPNo Returns the PE Vproc number SMALLINT -(4)9 AccessLog


of the PE through which the NOT NULL
session was connected.

Returns the PE Vproc number SMALLINT -(4)9 LogOnOff


of the PE to which the session NOT NULL SessionInfo[X]
was assigned.

2 – 44 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

InconsistencyFlag A code indicating whether CHAR X(1) All_RI_Children


inconsistencies may exist UPPERCASE All_RI_Parents
between the definitions of the NOT NULL RI_Child_Tables
related parent-child objects RI_Distinct_
after being restored (using Children
ARC), as follows: RI_Distinct_
• Y = Yes, the definitions Parents
could be inconsistent RI_Parent_Tables
• N = No, the definitions are
consistent
If Y, it may be possible to
validate the reference indexes
that have been marked as
inconsistent. See the
REVALIDATE REFERENCES
statement in Teradata RDBMS
SQL Reference.

IndexId Returns the reference index SMALLINT ---,--9 All_RI_Children


number. NOT NULL All_RI_Parents
RI_Child_Tables
RI_Distinct_Children
RI_Distinct_
Parents
RI_Parent_Tables

IndexName Returns the name of the CHAR X(30) All_RI_Children


reference index. NOT NULL All_RI_Parents
Indices[X]
RI_Child_Tables
RI_Distinct_
Children
RI_Distinct_
Parents
RI_Parent_Tables

IndexNumber Returns an internal index SMALLINT ZZ9 Indices[X]


number. NOT NULL

Returns the internal number SMALLINT ---,--9 IndexStats


assigned to the index. NOT NULL

IndexPresent Returns Y (yes) or N (no) to CHAR X(1) Events[X]


indicate whether or not the
INDEX option was used in a
dump event.

IndexStatistics Returns the statistics relating VARBYTE X(255) IndexStats


to the indexes on a table. The (16383)
output is sorted in the order of
the index numbers.

Teradata RDBMS Data Dictionary 2 – 45


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

IndexType Returns the type of an index CHAR X(1) Indices[X]


as: UPPERCASE
• P (Primary) NOT NULL
• S (Secondary)
• J (join index)
• N (hash index)
• K (primary key)
• U (unique constraint)
• V (value ordered
secondary)
• H (hash ordered ALL
covering secondary)
• O (valued ordered ALL
covering secondary)
• I (ordering column of a
composite secondary
index)
• 1 (field1 column of a join
or hash index)
• 2 (field2 column of a join
or hash index)

InfoData Returns the attribute VARCHAR X(16384) DBCInfo


identified by the contents of
the InfoKey field.

InfoKey Returns the attribute VARCHAR X(30) DBCInfo


described by the contents of NOT NULL
the InfoData field.

InstallFlag Returns a code to indicate CHAR X(1) CharTranslations


whether this character set is to UPPERCASE
be installed as currently NOT NULL
available on the Teradata
RDBMS. A maximum of six
character sets can be installed
at one time.
These are the codes:
• Y = Yes
• N = No

Journal_DB Returns the name of the CHAR X(30) Database_Default_


database or user space in NOT NULL Journals[X]
which the default journal User_Default_
table for DatabaseName Journals[X]
resides.

2 – 46 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

JournalFlag Returns a code to indicate the CHAR X(2) Databases[X]


journaling in effect for the NOT NULL Tables[X]
table, or the journal default for Users
the tables in the user space or
in the database. The first
character indicates the
BEFORE setting and the
second character indicates the
AFTER setting.
These are the codes:
• N = No journal (default)
• S = Single journal
• D = Dual journal
• L = Local AFTER journal
(not used for BEFORE)

JournalName Returns the name of the CHAR X(30) Database_Default_


journal table defined as the NOT NULL Journals[X]
default for UserName. Journals[X]
User_Default_
Journals[X]

JournalSaved Returns one of the following CHAR X(1) Events[X]


codes to indicate whether or
not the SAVE option was used
in the event:
• Y = Yes
• N = No

Journals_DB Returns the name of the CHAR X(30) Journals[X]


database in which a journal NOT NULL
table resides.

JournalUsed Returns one of the following CHAR X(1) Events[X]


codes to indicate which part
of the journal table was used:
• C = Current
• R = Restored
• S = Saved

Kind Returns a code that indicates CHAR X(1) Triggers


whether the trigger is
evaluated for:
• S = the statement (once)
• R = each row changed by
the triggering action

Teradata RDBMS Data Dictionary 2 – 47


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

LastAlterName Returns the name of the user CHAR X(30) Columns[X]


who last updated the object. NOT NULL Databases[X]
Indices[X]
Tables[X]
Triggers
Users

LastAlterTimeStamp Specifies the time the object TIMESTAMP yyyy-mm-dd Columns[X]


was last updated. hh:mm:ss Databases[X]
Indices[X]
Tables[X]
Triggers
Users

Line Returns the number that BYTEINT ZZ9 Software_Event_Log


corresponds to the line of text NOT NULL Hardware_Event_
for a multi-line error message. Log
For Database Query Manager,
the Line column identifies
sequential portions of the
error message that may be
spread over multiple lines.

LinkingEventNum Returns the terminating event INTEGER --,---,---,--9 Events[X]


number specified by the user
for a rollforward or
rollbackward event.

LockedCount Returns the number of BYTEINT ---9 Users


successive unsuccessful
attempts to logon to the user
with an erroneous password.
A null or 0 value indicates
there have been no attempts
since the last successful logon.

LockedDate Returns the Julian date on INTEGER YY/MM/DD Users


which the Dbase row was DATE
locked to logons due to
excessive erroneous
passwords. A null or 0 value
indicates the row was never
locked.

2 – 48 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

LockedTime Returns the time (number of INTEGER 99:99 Users


minutes after midnight) when
the Dbase row was locked to
logons due to excessive
erroneous passwords. Value
= 0 through 1439; a null or 0
value indicates the row was
never locked.

LockedUserExpire Returns the number of SMALLINT ---,--9 SecurityDefaults


minutes to elapse before a NOT NULL
locked user is unlocked. 0
indicates immediate unlock.

LockMode Returns a code to indicate the CHAR X(1) Events[X]


type of lock used by the event.
The codes are as follows:
• A = ACCESS or Group
READ
• R = full READ

LogDate Returns the date that the DATE YY/MM/DD AccessLog


access log entry was made. NOT NULL

Returns any calendar date DATE YY/MM/DD DeleteAccessLog[X]


that precedes the current date NOT NULL
by more than 30 days.

Returns the date that the DATE YY/MM/DD LogOnOff


event occurred. NOT NULL SecurityLog[X]

LogicalHostId Returns the ID of the client SMALLINT ZZZ9 AccessLog


system from which the session NOT NULL
logged on to the Teradata
RDBMS.

Returns the ID of the client SMALLINT ---,--9 DeleteOldInDoubt


system that had the in-doubt NOT NULL InDoubtLog
transaction.

Returns the identifier of the SMALLINT ZZZ9 HostsInfo


client system connection as NOT NULL
defined by the hardware
configuration data.

Returns the number of the SMALLINT ZZZ9 LogOnOff


client system through which NOT NULL
the user logged on to the
Teradata RDBMS.

Teradata RDBMS Data Dictionary 2 – 49


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

LogicalHostId Returns the client system SMALLINT ZZZ9 LogonRules


identifier, as defined by the NOT NULL
(continued)
hardware configuration data,
to which the rule applies.

Returns the identity of the SMALLINT ZZZ9 SessionInfo[X]


client system connector, based NOT NULL
on the hardware
configuration data, through
which the user logged on.

LogonDate Returns the date that the DATE YY/MM/DD AccessLog


session for which the log entry NOT NULL
was made was logged on to
the Teradata RDBMS.

Returns the date on which DATE YY/MM/DD LogOnOff


logon for the session occurred. NOT NULL

Returns the date of logon for DATE YY/MM/DD SessionInfo[X]


the session being reported. NOT NULL

LogonSequenceNo Returns the logon sequence BYTE X(8) SessionInfo[X]


number of the session.

2 – 50 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

LogonSource Returns the origin of the VARCHAR X(128) LogOnOff


session being reported, such SessionInfo[X]
as the userid or session CSPSessionInfo
number of the client system.
LogonSource may contain the
following names and
identifiers:

Channel-Attached LogonSource Values


Each of the following fields contains eight characters:
1 Operating System Name (using the string VM or MVS, followed by trailing blank
fill)
2 TDP Name (the TDP name, followed by trailing blank fill)
3 Virtual Machine Userid (VM) or MVS job name
4 Environment Name: Blank for VM; for MVS, either TSO, IMS, BATCH, or CICS)
5 Userid from Security Product (Blank if VM, or if no such product)
6 Group from Security Product (Blank if VM, or if no such product)
7 Program Name (MVS only)
8 Coordinator name (CICS or IMS only)
9 Transaction identifier (CICS or IMS only)
10 Terminal identifier (CICS only)
11 User/operator identifier (CICS only)
12 Job ID (MVS) or virtual machine name (VM)
13 A suffix tag showing that this is a new-style LogonSource type. Older client software
may not generate information for all the fields and will not contain the tag. The tag
‘1101 LSS’ means LSS version 01 with 11 preceding fields. The tag ‘0701 LSS’ means
LSS version 01 with seven preceding fields
Network-Attached LogonSource Values
Each of the following fields can contain a varying number of characters:
1 The string “(TCP/IP)”
2 Port number of the logon source machine
3 IP address of the logon source machine
4 PID of the process that establishes the connection
5 A suffix tag ‘01 LSS’ showing that this is a new-style LogonSource type. The tag ‘01
LSS’ means LSS version 01. Older client software may not generate information for
the PID field and will not contain the tag.
PDE Internal Session LogonSource Values
The following fields represent a session logged on by a PDE debug or dump
management application:
1 LIBDBSUTIL (the library that logged on the session)
2 PID of the application process running on the client
3 Application name
4 Node name (where the application logged on)

Teradata RDBMS Data Dictionary 2 – 51


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

LogonStatus Returns if the rule grants (G) CHAR X(1) LogonRules


or refuses (R) permission for NOT NULL
the named user to log on from
the identified client system.

LogonTime Returns the time on which FLOAT 99:99:99.99 LogOnOff


logon for the session occurred NOT NULL
(useful on logoff events).
Returns the time that the FLOAT 99:99:99 AccessLog
session for which the log entry NOT NULL
was made was logged on to
the Teradata RDBMS.

Returns the time of logon for FLOAT 99:99:99.99 SessionInfo[X]


the session being reported. NOT NULL

LogonUserName Returns the ID of the user VARCHAR X(30) DeleteOldInDoubt


who ran the in-doubt (30) InDoubtLog
transaction. NOT NULL

LogProcessor Returns the logical processor SMALLINT -(4)9 Events_


ID for an AMP not affected by Configuration[X]
the event. RCC_
Configuration[X]

LogTime Returns the time of day that FLOAT 99:99:99 AccessLog


the event occurred as NOT NULL
DeleteAccessLog[X]
HH:MM:SS.
SecurityLog[X]

Returns the time of day that FLOAT 99:99:99.99 LogOnOff


the event occurred as NOT NULL
HH:MM:SS.

LogType Returns the kind of statement BYTEINT ---,--9 SecurityLog[X]


for which the access log entry
was made.

MaxLogonAttempts Returns the number of BYTEINT ---9 SecurityDefaults


erroneous logons allowed, at NOT NULL
which time the user becomes
locked. For example, a 1
indicates that one erroneous
logon will lock the user. 0
indicates that a user is never
locked.

2 – 52 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

MaxPerm Returns an integer that FLOAT ---,---,---,---,--9 Allspace[X]


represents either the NOT NULL DiskSpace[X]
maximum permanent space,
in bytes, that is allocated to
the database on a specified
AMP (or on all AMPs if the
SUM aggregate is specified).

MaxSpool Returns an integer that FLOAT ---,---,---,---,--9 Allspace[X]


represents the maximum NOT NULL DiskSpace[X]
spool space, in bytes,
allocated to the database on a
specified AMP (or on all
AMPs if the SUM aggregate is
specified).

MaxTemp Returns the maximum FLOAT ---,---,---,---,--9 Allspace[X]


number of bytes available for NOT NULL DiskSpace[X]
temporary space per vproc.

Model Returns the PMA (Processor CHAR X(4) AMPUsage


Module Assembly) model NOT NULL
information for the Vproc for
which an event was logged.

Module_Type Returns the identity of the BYTEINT Z9 Hardware_Event_


type of module affected by the Log
hardware event. For example,
PMA, ACA, CMA, PDU,
SMA, etc.

NamedTblCheck Returns the count of named SMALLINT ---,--9 Tables[X]


Count table-level check constraint NOT NULL
for the table.

Nullable Returns a code to indicate CHAR NULL X(1) Columns[X]


whether or not a column may
have a null value. The
following codes are used:
• Y = Yes
• N = No

NullPassword Returns a code that specifies CHAR X(1) LogonRules


whether the rule allows this NOT NULL
user to log on without a
password from the specified
client system. The following
codes are used:
• T = True/yes
• F = False/no

Teradata RDBMS Data Dictionary 2 – 53


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ObjectType Returns a code to indicate the CHAR X(1) Events[X]


type of object associated with
the event. The following
codes are used:
• D = Database
• T = Table
• J = Journal Table

OperationInProcess Returns a code to indicate CHAR X(1) Events[X]


whether the event is still NOT NULL
processing. The following
codes are used:
• Y = Yes
• N = No

Options This field is assigned to NULL CHAR(1) X(1) InDoubtLog


initially. It is not used by the
system and users may update
this one-character column to
suit their needs.

OrderNumber Specifies when triggers SMALLINT ---,--9 Triggers


bearing the same action time
and event will execute.

Original_Comment Returns the original comment VARCHAR X(255) Association


String on the imported table.

Original_Creator Returns the original creator of CHAR X(30) Association


Name the imported table. NOT NULL

Original_Database Returns the name of the CHAR X(30) Association


Name original database in which the NOT NULL
object resided.

Original_Journal Returns a code to indicate the CHAR X(2) Association


Flag original journaling for the NOT NULL
imported object. The first
character indicates the
BEFORE-image status and the
second character indicates the
AFTER-image status. The
following codes are used:
• N = No journal
(default value)
• S = Single journal
• D = Dual journal
• L = Local AFTER journal
(not used for BEFORE)

2 – 54 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Original_Protection Returns the original CHAR X(1) Association


Type protection type of the UPPERCASE
imported object, using the NOT NULL
following codes:
• F = Fallback
• N = None

Original_TableKind Returns the original kind of CHAR X(1) Association


the imported object. Possible UPPERCASE
values are as follows: NOT NULL
• T = Data Table
• V = View
• M = Macro
• J = Journal Table
• I = Join Index Table
• P= Stored Procedure
• G = Trigger

Original_Table Returns the name of the CHAR X(30) Association


Name original object. UPPERCASE
NOT NULL

Original_Version Returns the original version of SMALLINT ---,--9 Association


the imported object. NOT NULL

OwnerName Returns the name of the VARCHAR X(30) AccessLog


owner of the objects targeted NOT NULL
by the view, stored procedure,
or macro referenced in the
request that generated this log
entry.

Returns the name of the CHAR X(30) Databases[X]


database owner. NOT NULL

Returns the name of the CHAR X(30) Users


owner of the user. NOT NULL

Parent Returns the name of a parent CHAR X(30) Children[X]


database or user. NOT NULL

ParentCount Returns the number of parent SMALLINT ---,--9 Tables[X]


tables for the table specified in NOT NULL Tables2
the TVM row.

ParentDb Returns the name of the CHAR X(30) All_RI_Children


referenced dababase. NOT NULL All_RI_Parents
RI_Distinct_
Children
RI_Distinct_
Parents

Teradata RDBMS Data Dictionary 2 – 55


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ParentDbId Returns the database ID of the BYTE X(8) RI_Child_Tables


referenced table. NOT NULL RI_Parent_Tables

ParentKeyColumn Returns the name of the CHAR X(30) All_RI_Children


column in a referenced key. NOT NULL All_RI_Parents

ParentKeyFID Returns the field ID of a SMALLINT ---,--9 RI_Child_Tables


column in the referenced key. NOT NULL RI_Parent_Tables

ParentTable Returns the name of the CHAR X(30) All_RI_Children


referenced table. NOT NULL All_RI_Parents
RI_Distinct_
Children
RI_Distinct_
Parents

ParentTID Returns the table ID of the BYTE X(12) RI_Child_Tables


referenced table. NOT NULL RI_Parent_Tables

Partition Returns the name of the CHAR X(20) SessionInfo[X]


Teradata RDBMS partition to
which the user is currently
attached. Possible values are
as follows:

• DBC/SQL = an SQL session


• FASTLOAD = a FASTLOAD session
• EXPORT = a FASTEXPORT session
• MLOAD = a MULTILOAD session
• MONITOR = sessions running in a performance monitoring application
• NONE = session is recognized but not yet assigned

Returns the number of the BYTEINT Z9 Software_Event_


Teradata RDBMS partition in
Log
which the task that resulted in
the logged event was running.

PasswordChgDate Returns the Julian date on DATE YY/MM/DD Users


which the current password
was assigned to the user. This
value is 0 for a new user.

PasswordDigits Returns a code to indicate if CHAR(1) X(1) SecurityDefaults


digits are to be allowed in the UPPERCASE
password. The following NOT NULL
codes are used:
• Y = allow digits in a
password
• N = do not allow digits

2 – 56 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

PasswordLastMod Returns the date that the user DATE YY/MM/DD Users
Date password was last modified.

PasswordLastMod Returns the time that the user INTEGER 99:99:99 Users
Time password was last modified.

PasswordMaxChar Returns the maximum BYTEINT --9 SecurityDefaults


number of characters in a BETWEEN
valid password string. 1 AND 30
PasswordMaxChar must be NOT NULL
equal to or greater than
PasswordMinChar.

PasswordMinChar Returns the minimum BYTEINT --9 SecurityDefaults


number of characters in a BETWEEN
valid password string. 1 AND 30
NOT NULL

PasswordReuse Returns the number of days to SMALLINT --9 SecurityDefaults


elapse before a password can NOT NULL
be reused. 0 indicates
immediate reuse.

PasswordSpecChar Returns a code to indicate if CHAR(1) X(1) SecurityDefaults


special characters are to be
allowed in the password. The
following codes are used:
• Y = allow special
characters in a password
• N = do not allow special
characters

PeakPerm Returns an integer that FLOAT ---,---,---,---,--9 AllSpace[X]


represents the maximum NOT NULL DiskSpace
permanent space, in bytes, TableSize[X]
that has been used at any one
time by the database or table.
Unless a specific AMP is
requested, this value includes
all AMPs.
The ClearPeakDisk macro
allows the Teradata RDBMS
administrator to clear this
field.

Teradata RDBMS Data Dictionary 2 – 57


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

PeakSpool Returns an integer that FLOAT ---,---,---,---,--9 AllSpace[X]


represents the maximum NOT NULL DiskSpace
spool space, in bytes, that was
used at any one time by the
database on a specified AMP
(or on all AMPs if the SUM
aggregate is specified).
Note: The ClearPeakDisk
macro allows the Teradata
RDBMS administrator to clear
this field.

PeakTemp Returns the peak number of FLOAT ---,---,---,---,--9 AllSpace[X]


bytes used at one time by a NOT NULL DiskSpace
temporary table per vproc.
Note: The ClearPeakDisk
macro allows the Teradata
RDBMS administrator to clear
this field.

PermSpace Returns an integer indicating FLOAT ZZZ,ZZZ,ZZ Databases[X]


the total space allocated to the NOT NULL Z,ZZZ,ZZ9
database on all AMPs.

Returns an integer that FLOAT ---,---,---,---,--9 Users


indicates the permanent space NOT NULL
allocated to the user.

PhyProcessor Returns the physical SMALLINT ZZ9-9 Events_


processor ID for an AMP not Configuration[X]
affected by the event. RCC_
Configuration[X]

PMA Identifies the Processor INTEGER ZZ9-9 Software_Event_Log


Module Assembly (PMA) on NOT NULL Hardware_Event_
which the event occurred. Log

Primary_Part_ Returns the board VARCHAR X(11) Hardware_Event_


Number information. Log

PrimaryKeyIndexId Returns information about the SMALLINT ---,--9 Tables[X]


identification of the table used NOT NULL
as the primary index.

ProcessorState Returns D (the event was for CHAR X(1) Events_


all AMPs and the processor NOT NULL Configuration[X]
was down) or U (the event RCC_
was for specific AMPs) Configuration[X]

2 – 58 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

ProtectionType Returns F (Fallback) or N CHAR X(1) Databases[X]


(None) to indicate whether NOT NULL Tables[X]
the tables in the database are Users
protected by the Fallback
option.

RequestText Returns the text of the most VARCHAR X(255) Tables[X]


recent data definition (12,500)
statement that was used to
change the table, view, join
index, trigger, or macro.

Returns the actual request text VARCHAR X(255) Triggers


that was used to create the (12,500)
trigger.

ResolvingUser Returns the identity of the VARCHAR X(30) DeleteOldIn


LogonName user who resolved the (30) DoubtInDoubt
in-doubt transaction. NOT NULL Log

RestartSeqNum Returns an integer (0 through SMALLINT ---,--9 Events[X]


n) to indicate the number of Events_
times that the Teradata Configuration[X]
RDBMS had to be restarted
during the event. 0 indicates
that no restarts took place.

Returns an integer (0 through SMALLINT ---,--9 RCC_


n) indicating the iteration of Configuration[X]
the event for which the
processor is defined. A 0
value indicates that a restart
did not take place. This
number matches the
RestartSeqNum value in a
row of the Events view.

Result Returns a code to indicate CHAR X(1) AccessLog


how the access request for NOT NULL
which this log entry was
made. Possible codes are as
follows:
• G = Granted
• D = Denied

Revision_Level Returns the revision level of VARCHAR X(2) Hardware_Event_


the part. Log

RunUnitId Returns the identity of the run VARBYTE X(60) DeleteOldIn


unit that had the in-doubt (30) DoubtInDoubt
transaction. NOT NULL Log

Teradata RDBMS Data Dictionary 2 – 59


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Secondary_Part_ Returns the secondary part VARCHAR X(11) Hardware_Event_


Number number assigned by Log
manufacturing.

SeqNumber Returns column sequence SMALLINT ---,--9 ColumnStats


numbers derived from the NOT NULL
field ID. The output is sorted
in the order of the sequence
numbers.

Serial_Number Returns the serial number VARCHAR X(10) Hardware_Event_


assigned by manufacturing. Log

SessionNo Returns the identifier INTEGER --,---,---,--9 AccessLog


assigned to the session by the NOT NULL LogOnOff
TDP or LAN interface. SessionInfo[X]
AllTempTables[X]
CSPSessionInfo

SessionNumber Returns the number of the INTEGER --,---,---,--9 DeleteOldIn


session that had the in-doubt NOT NULL Doubt
transaction. InDoubtLog

Severity The Severity option returns a SMALLINT ZZ9 Software_Event_


code identifying the severity Log
of a software event. Possible
values are as follows:

• 0 = Hardware and software are informational events (Occurrence)


• 10 = Software abnormality--informational (SW Abnormality)
• 20 = Hardware abnormality--informational (HW Abnormality)
• 30 = Recoverable user error (UserError Retry)
• 40 = Unrecoverable user error (UserError)
• 50 = Unrecoverable user error, no user restart (UserFatal)
• 60 = Unrecoverable Vproc error, Vproc restart required (VprocError)
• 70 = Unrecoverable Vproc error, no Vproc restart (VprocFatal)
• 80 = Recoverable PDE error (OSErrorRetry)
• 90 = Unrecoverable PDE error, restart required (OSError)
• 100 = Unrecoverable PDE error, restart not possible (OSFatal)
• 110 = Unrecoverable CPU hardware error, restart required (CPUError)
• 120 = Unrecoverable CPU hardware error, CPU stay down (CPUFatal)
• 130 = Unrecoverable PMA hardware error, PMA restart required (PMAError)
• 140 = Unrecoverable PMA hardware error, PMA stays down (PMAFatal)
• 200 = Unrecoverable system error, system restart required (SystemError)
• 210 = Unrecoverable system error, restart not possible (SystemFatal)

2 – 60 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Severity Returns a code identifying the CHAR X(1) Hardware_Event_


severity of the hardware Log
event. Possible values are:
C = Critical Event
F = Fatal - Subsystem down
D = Degraded
W = Warning
I = Information

Slot Returns the slot number BYTEINT Z9 Hardware_Event_


within the module assembly Log
at which the hardware event
is located.

Slot_Type Returns the identity of the FLOAT Hardware_Event_


type of the slot affected by the NOT NULL Log
hardware event. For example,
CMA_pwr, SMA_pwr.

SpoolSpace Returns an integer indicating FLOAT ZZZ,ZZZ,ZZ Databases[X]


the maximum spool space NOT NULL Z,ZZZ,ZZ9
allowed for the database.
SpoolSpace is 0 if
DatabaseName is PUBLIC.

Returns an integer that FLOAT ---,---,---,---, Users


indicates the spool space NOT NULL
--9
allocated to the user.

SPParameterType Returns the data type of a CHAR X(1) Columns[X]


stored procedure parameter. NOT NULL
Possible types are:

Type Description
I IN parameter
B INOUT parameter
O OUT parameter

Stacktrace Identifies the software calling VARBYTE X(640) Software_Event_Log


sequence to aid in debugging.

StartMBox Returns the client/server BYTE X(20) CSPSessionInfo


mailbox ID where the SQL
request is sent.

StartupString Returns the startup string VARCHAR X(255) Users


(macro or SQL statement)
specified for the user.

Teradata RDBMS Data Dictionary 2 – 61


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

StatementText Returns (if so defined in the VARCHAR X(8192) AccessLog


associated rule) the text of the
statement that caused the
privilege check for which this
log entry was made.

StatementType Returns the type of statement VARCHAR X(20) AccessLog


that caused the privilege NOT NULL
check for which this log entry
was made.

SubSlot Returns the number of the BYTEINT 9 Hardware_Event_


subslot affected by the event. Log

SubSlot_Type Returns the identity of the BYTEINT 9 Hardware_Event_


type of subslot affected by the Log
hardware event. For example,
Bynclk, MAPDP.

SW_Version Identifies the software version VARCHAR X(64) Software_Event_Log


running at the time the event
was logged.

TableKind Returns the table type as one CHAR X(1) Tables[X]


of the following: NOT NULL
• T = Table
• V = View
• M = Macro
• J = Journal Table
• I = Join Index Table
• P = Stored Procedure
• G = Trigger

2 – 62 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

TableName Returns the name of a table, CHAR X(30) AllRights


view, stored procedure, NOT NULL
trigger, or macro on which a
privilege was granted.

Returns the name of a table. CHAR X(30) AllSpace[X]


NOT NULL Indices[X]
Tables[X]
TableSize[X]

Returns the name of a table, CHAR X(30) Columns[X]


view, stored procedure, or NOT NULL UserGranted
macro. Rights
UserRights

Returns the imported object CHAR X(30) Association


name. NOT NULL

Returns the name of the table CHAR X(30) Events[X]


affected by the event. If the NOT NULL
object is a database, then the
value is set to NULL.

Returns the name of a data CHAR X(30) Journals[X]


table that has change images NOT NULL
recorded in a journal table.

Returns the name of the table, CHAR X(30) SecurityLog[X]


view, stored procedure, or NOT NULL
macro for this log entry.

Returns the name of a table CHAR X(30) SHOWCOL


having column-level check
NOT NULL CHECKS
constraints.

Returns the name of a table CHAR X(30) SHOWTBL


having table-level check NOT NULL CHECKS
constraints. Table_Level
Constraints

Returns the name of the table CHAR X(30) Triggers


the trigger is defined against. NOT NULL

Returns the name of the table CHAR X(30) ColumnStats


containing the column for NOT NULL IndexStats
which statistics are requested.

Tables_DB Returns the name of the CHAR X(30) Journals[X]


database in which a data table NOT NULL
resides that will have change
images written to a journal
table.

Teradata RDBMS Data Dictionary 2 – 63


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Task Returns the unique task SMALLINT ZZZZ9 Software_Event_Log


number assigned to each task
as it is created for execution.

TblCheck Returns the unresolved text VARCHAR X(255) SHOWTBLCHECKS


for the table-level check (8192)
condition.

Temperature Returns the temperature of DECIMAL -ZZ.99 Hardware_Event_


the power board in (4,1) Log
microdegrees Centigrade.

TempSpace Returns the maximum FLOAT NOT ---,---, ---,---, Databases[X]


temporary space allocated NULL --9
for a database or user in
bytes.
Returns an integer that FLOAT NOT ---,---, ---,---, Users
indicates the temporary space NULL --9
allocated to the user.

Text Returns the text associated VARCHAR X(8192) SecurityLog[X]


with the numbered event in
the error log.
For Database Query Manager,
the Text column returns error
messages that are broken into
sections that can fit within this
255-character field.

Returns the text associated VARCHAR X(255) Software_Event_Log


with the logged event. NOT NULL Hardware_Event_
Log

TheDate Returns the calendar date on DATE YY/MM/DD Software_Event_Log


which the event was logged. NOT NULL Hardware_Event_
Log

TheTime Returns the clock time at FLOAT 99:99:99.9999 Software_Event_Log


which the event was logged, NOT NULL 99 Hardware_Event_
based on a 24-hour clock Log
(hh:mm:ss).

TimeZoneHour Returns the format of the time BYTE ---9 Users


zone as signed integer values
from -12:59 to +13:00.

TimeZoneMinute Returns the format of the time BYTE ---9 Users


zone as signed integer values
from -12:59 to +13:00.

2 – 64 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

Transaction_Mode Returns one of the following CHAR X(1) SessionInfo[X]


codes to indicate the mode of
the session:
• T = TDBS
• A = ANSI

TriggerComment Returns the optional comment VARCHAR X(255) Triggers


for the trigger.

TriggerName Returns the name of the CHAR X(30) Triggers


trigger. NOT NULL
(I)
UPPERCASE

TVMId Returns the internal ID of the BYTE X(12) Tables2


table. NOT NULL

TVMName Returns the table, view, stored VARCHAR X(30) AccessLog


procedure, or macro name of
the object for which this log
entry was made.

Returns the table, view, stored CHAR X(30) AccLogRules


procedure, or macro to which NOT NULL
the access logging rule
applies.

Returns the name of the table. CHAR X(30) Tables2


NOT NULL

TwoPCMode Returns one of the following VARCHAR X(1) SessionInfo[X]


codes: (1)
• 2 = 2PC mode UPPERCASE
• N = non-2PC mode

UniqueFlag Returns a code to indicate CHAR X(1) Indices[X]


whether the index is unique. UPPERCASE
The following codes are used: NOT NULL
• Y = Yes; index is unique
• N = No; index is not
unique

UnnamedTblCheck Returns an indicator for CHAR X(1) Tables[X]


Exist whether the table has an NOT NULL
unnamed table-level check
constraint, as follows:
• Y = Yes, has
• N = No, does not have

Teradata RDBMS Data Dictionary 2 – 65


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

UnResolvedRICount Returns the total number of SMALLINT ’---,--9 Databases2


unresolved Referential Integrity NOT NULL
(RI) constraints in the database.

UpperCaseFlag Returns the case indicator flag CHAR X(1) Columns[X]


for the column, and whether
comparisons on the column
are case specific. The column
uses one of the following
codes:
• U = Uppercase, not
specific
• C = Not uppercase,
specific
• N = Not uppercase, not
specific
• B = Both
Note: Case flags U, C, and B
are valid only for CHAR,
VARCHAR, and LONG
VARCHAR columns.

UserLogonDate Returns the date that the DATE YY/MM/DD DeleteOldInDoubt


specified user logged on. NOT NULL InDoubtLog

UserLogonTime Returns the time that the FLOAT 99:99:99 DeleteOldInDoubt


specified user logged on. NOT NULL InDoubtLog

UserName Returns the name of the user VARCHAR X(30) AccessLog


for whom the log entry was NOT NULL SecurityLog[X]
made.

Returns the user to which the CHAR X(30) AccLogRules


access logging rule applies; NOT NULL
ALL may be specified.

Returns the name of a user. CHAR X(30) AccountInfo[X]


NOT NULL AMPUsage
Note: SYSTEMUSERID is a
Users
system user name that tracks
console utility activity such as
table rebuild, Diskcopy, or
Scandisk.

2 – 66 Teradata RDBMS Data Dictionary


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

UserName Returns the name of a user to CHAR X(30) AllRights


(Continued) whom the privilege was NOT NULL
granted.

Returns the username CHAR X(30) Events[X]


associated with the event. NOT NULL Events_
Configuration[X]
LogOnOff

Returns the name of the user CHAR X(30) LogonRules


to whom the rule applies; NOT NULL
DEFAULT may be specified.

Returns the Teradata RDBMS CHAR X(30) SessionInfo[X]


userid of the user who is NOT NULL
currently logged on.

Returns the name of a user CHAR X(30) User_Default_


space for which a default NOT NULL Journals
journal table has been
defined.

Returns the username CHAR X(30) Events_Media[X]


associated with the client NOT NULL
system utility dump or restore
event.

Returns the logon name of the CHAR X(30) AllTempTables[X]


user that materialized the NOT NULL
temporary table.

Vcc_Amps Returns the value of the main DECIMAL Z9.99 Hardware_Event_


supply current in microamps. (4,2) Log

Vcc_Margin Returns the value of the main CHAR X(1) Hardware_Event_


supply voltage margin.Values Log
inlcude: H = High, N =
Normal, and L = Low.

Vcc_Volts Returns the value of the main DECIMAL -9.99 Hardware_Event_


supply voltage in microvolts. (4,2) Log

Version Returns the version count, SMALLINT ZZZZ9 Tables[X]


which is incremented each NOT NULL
time the table is altered with a
data definition statement.

VolSequenceNum Returns the sequence number SMALLINT ---,--9 RCC_Media[X]


of the volume, which defines Events_Media[X]
the position of the volume in a
multi-volume set.

Teradata RDBMS Data Dictionary 2 – 67


Chapter 2: System Views
System View Columns Reference

View Column Name Description Data Type Format Associated Views

VolSerialId Returns the unique six CHAR X(6) Events_Media[X]


character volume serial NOT NULL RCC_Media[X]
assigned to a device.

Vproc Identifies the virtual processor SMALLINT -(4)9 Events_


for which an event was Configuration[X]
logged. RCC_
Configuration[X]
Software_Event_Log

Identifies the virtual processor SMALLINT -(4)9 AllSpace[X]


for which an event was NOT NULL AMPUsage
logged. DiskSpace[X]
TableSize[X]

Vproctype Returns the type of Vproc for CHAR X(4) AMPUsage


which an event was logged. NOT NULL

2 – 68 Teradata RDBMS Data Dictionary


Chapter 3:

System Views: Usage and Examples

This chapter explains the purpose of each of the DBC Data Dictionary system
views. The views are presented in alphabetical case-insensitive order by view
name and include the following information:
• View form (a view that has an X version is shown in the form
“ViewName[X]”)
• Columns that the view selects from the system table
• Corresponding system tables
• Usage notes about special information or uses of the view
• Examples, where available, of the results returned by a SELECT request on
the view. If applicable to the type or quantity of information being selected,
the example shows the X version of the view in the statement reference.
• Other Teradata RDBMS documents that can provide additional information
about this view

Note: The results shown in the examples are for illustration purposes only.
Utilities and tools, such as BTEQ, or other third-party products, may be used to
enter queries and will format the results differently.

Note: If a statement returns a “security violation” error, a reference to the


alternate version of the view name may yield results. If neither version is
available, use the HELP statement to inquire about individual objects. If this is
not adequate, the user should consult the Teradata database administrator.

Teradata RDBMS Data Dictionary 3–1


Chapter 3: System Views: Usage and Examples
AccessLog

AccessLog

Purpose
Returns logging entries generated by the application of access logging rules
(see “AccLogRules”).

View Name User Type Columns Selected

DBC.AccessLog Security LogDate


Administrators LogTime
LogonDate
LogonTime
LogicalHostId
IFPNo
SessionNo
UserName
AccountName
OwnerName
AccessType
Frequency
EventCount
Result
DatabaseName
TVMName
ColumnName
StatementType
StatementText

The corresponding system table is DBC.AccLogTbl.

Usage Notes
Each row AccessLog displays indicates the results of a privilege check.
Whether a privilege check is logged depends on the presence and the criteria of
an access logging rule (see “AccLogRules”).

Example
The following SELECT retrieves the name of the submitting user from the
AccessLog, the type of request, and the request text of each request that caused
a privilege check to be logged on a specific date. The response shows that one
request caused a privilege check to be logged on that date. (The statement text
column has been truncated in the results.)

3–2 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AccessLog

==> SELECT LogDate, UserName, AccessType, StatementText FROM


DBC.AccessLog WHERE LogDate = 890510;

LogDate UserName AccessType StatementText


89/05/10 Jones CT CREATE TABLE Jones.EmpDup (Em

Teradata RDBMS Data Dictionary 3–3


Chapter 3: System Views: Usage and Examples
AccLogRules

AccLogRules

The AccLogRules view provides information about logging rules that are
currently in effect on the system. The underlying table is populated as a result
of successfully processed BEGIN LOGGING statements.

View Name User Type Columns Selected

DBC.AccLogRules Security UserName


DatabaseName
Administrator
TVMName
AcrCheckpoint
AcrCreateDatabase
AcrCreateMacro
AcrCreateProcedure
AcrCreateTable
AcrCreateUser
AcrCreateView
AcrDelete
AcrDropDatabase
AcrDropMacro
AcrDropProcedure
AcrDropTable
AcrDropUser
AcrDropView
AcrDump
AcrExecute
AcrExecuteProcedure
AcrGrant
AcrIndex
AcrInsert
AcrReference
AcrRestore
AcrSelect
AcrUpdate
AcrCreateTrigger
AcrDropTrigger
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.AccLogRuleTbl
• DBC.DBase
• DBC.TVM

3–4 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AccLogRules

Usage Notes
The underlying table of this view is populated only if the security macro is
installed and the Teradata RDBMS or security administrator has executed one
or more BEGIN LOGGING statements.
Each row in the underlying table defines a rule controlling what privilege check
is to be logged when a specific user attempts to access a specific object.
When a request is submitted that involves any of the rule criteria, the details of
the involvement are recorded in the access log (see “AccessLog”).
In AccLogRules, each Access Rule (Acr...) column is named for a particular
privilege, which is also associated with an access action and a SQL statement.
In each column, each character position represents the frequency with which
checks performed on that privilege are to be logged, as follows:

1 Position 1 (every privilege check) indicates how often to log checks on this
privilege when performed against any requests (submitted by a specified
user) that attempt to access the specified object. Possible values that could
appear in each position are as follows:
• B Both FIRST and LAST occurrences are to be logged.
• E Each occurrence is to be logged.
• F FIRST occurrence is to be logged.
• L LAST occurrence is to be logged.
• blank No logging.

2 Position 2 indicates how often to log checks on this privilege when


performed against requests (submitted by a specified user) that are not
allowed to access the specified object (that is, check results are Denials).
• B Both FIRST and LAST occurrences are to be logged.
• E Each occurrence is to be logged.
• F FIRST occurrence is to be logged.
• L LAST occurrence is to be logged.
• blank No logging.

3 Position 3 (save text of request) indicates whether to record the text of the
requests that cause a check on this privilege.
• - Save text only for Denial entries.
• + Save text for all entries.
• = Save text for all entries (specified in multiple BEGIN LOGGING
statements).
• blank No WITH TEXT option specified.

Example
If the following statements are submitted, a SELECT statement retrieving the
AccLogRules entries for User1 returns the rows as shown:

Teradata RDBMS Data Dictionary 3–5


Chapter 3: System Views: Usage and Examples
AccLogRules

BEGIN LOGGING ON EACH CREATE TABLE BY Jones ON USER Jones ;


BEGIN LOGGING DENIALS WITH TEXT ON FIRST CREATE DATABASE
BY Jones ON DATABASE Personnel ;

==> SELECT * FROM DBC.AccLogRules WHERE UserName = ’Jones’ ;

UserName DatabaseName TVMName CPT CDB CMC CTB CUS

Jones Jones All E ...

Jones Personnel All F- ...

• In the first row, the UserName “Jones”, the DatabaseName “Jones”, and the
“E” in the first position of the CTB column indicate that a log entry is to be
made each time a check for the CREATE TABLE privilege is performed in
response to a request by Jones to create a table in his own space.
• In the second row, the UserName “Jones”, the DatabaseName “Personnel”,
and the “F” in the second position of the CDB column indicate that a log
entry is to be made the first time a check for a CREATE DATABASE
privilege that results in a denial is performed in response to a request by
Jones to create a database in the Personnel database. The “-” in the third
position of the CDB column indicates that the text of the denied statement
is to be saved in the log entry.

3–6 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AccountInfo[X]

AccountInfo[X]

The AccountInfo view provides information about valid accounts for the
specified user(s).

View Name User Type Columns Selected

DBC.AccountInfo[X] Supervisory UserName


AccountName

Corresponding system tables for this view include the following:


• DBC.Accounts
• DBC.DBase
• DBC.AccessRights
• DBC.DBase
• DBC.Owners
This view also references the DBC.userdb view.

Example
==> SELECT UserName, AccountName FROM DBC.AccountInfo
WHERE UserName IN (’Bob’,’G417’) ;

UserName AccountName
Bob 7654
Bob Temp Work Area
G417 137
G417 $HGAVE

Additional Information
See Teradata RDBMS Database Design for more information on controlling
access, space, and ownership.

Teradata RDBMS Data Dictionary 3–7


Chapter 3: System Views: Usage and Examples
AllRights

AllRights

The AllRights view provides information about all users who have been
explicitly or automatically granted privileges, and the objects on which the
privileges were granted including: databases, users, tables, views, stored
procedures, and macros.

View Name User Type Columns Selected

DBC.AllRights Administrator UserName


DatabaseName
TableName
ColumnName
AccessRight
GrantAuthority
GrantorName
AllnessFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.DBase
• DBC.TVM
• DBC.TVFields

Usage Notes
The AllRights view does not return information about implicit privileges for a
user, only explicit rights granted on the object. The explicit rights include the
following:
• AS = ABORT SESSION
• CD = CREATE DATABASE
• CG = CREATE TRIGGER
• CM = CREATE MACRO
• CP = CHECKPOINT
• CT = CREATE TABLE
• CU = CREATE USER
• CV = CREATE VIEW
• D = DELETE
• DD = DROP DATABASE

3–8 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AllRights

• DG = DROP TRIGGER
• DM = DROP MACRO
• DP = DUMP
• DT = DROP TABLE
• DU = DROP USER
• DV = DROP VIEW
• E = EXECUTE
• I = INSERT
• IX = INDEX
• MR = MONITOR RESOURCE
• MS = MONITOR SESSION
• PC = CREATE PROCEDURE
• PD = DROP PROCEDURE
• PE = EXECUTE PROCEDURE
• RO = REPLICATION OVERRIDE
• R = RETRIEVE/SELECT
• RF = REFERENCE
• RS = RESTORE
• SS = SET SESSION RATE
• SR = SET RESOURCE RATE
• U = UPDATE

Example
The following SELECT statement displays the privileges user Jones has on
tables.

==> SELECT Tablename, AccessRight, GrantorName


FROM DBC.AllRights WHERE UserName = ’Jones’;

TableName AccessRight GrantorName


project RS SYSTEMAD
project DP SYSTEMAD
project DT SYSTEMAD
project G SYSTEMAD
project D SYSTEMAD
project I SYSTEMAD
project U SYSTEMAD
project R SYSTEMAD
employee I SYSTEMAD
employee U SYSTEMAD

Teradata RDBMS Data Dictionary 3–9


Chapter 3: System Views: Usage and Examples
AllSpace[X]

AllSpace[X]

The AllSpace view provides AMP-by-AMP information about disk space usage
(including spool) for each database, data table, or journal table.

View Name User Type Columns Selected

DBC.AllSpace[X] Administrator Vproc


DatabaseName
AccountName
TableName
MaxPerm
MaxSpool
MaxTemp
CurrentPerm
CurrentSpool
CurrentTemp
PeakPerm
PeakSpool
PeakTemp

Corresponding system tables for this view include the following:


• DBC.DataBaseSpace
• DBC.DBase
• DBC.TVM
• DBC.AccessRights
• DBC.Owners

Usage Notes
When a database, user, or table is created, allocated disk space is divided
evenly among all AMPs. The AllSpace view returns one row of usage
information for each AMP in the Teradata RDBMS configuration (or for all
AMPs if the SUM aggregate is used).
When a database is created, a space row is added to each AMP, with the
processor field in each row initialized to 0. The first time the space row is
updated (such as when a table is created in the database, or when the system is
restarted), the processor field in each row is updated to indicate the actual
processor number.
When a query applies a SUM aggregate to either of those columns without a
WHERE clause, or with a WHERE clause that references only one tname or
dbname, the returned values will be double the desired result.

3 – 10 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AllSpace[X]

For example, the following query, which returns the correct amount of space
allocated to Peterson, also returns twice the amount of space currently being
used by Peterson (see DiskSpace and TableSize views).

SELECT SUM(MaxPerm), SUM(CurrentPerm)


FROM DBC.AllSpace
WHERE DatabaseName = ’Peterson’

Example
The following SELECT statement displays how the space currently used by the
data table named Department is distributed on each AMP.
==> SELECT DatabaseName,TableName,AMP,CurrentPerm FROM
DBC.AllSpace
WHERE TableName=’Department’ ORDER BY 1,2,3 ;

DatabaseName TableName AMP CurrentPerm

Test DEPARTMENT 1-0 1,024


Test DEPARTMENT 1-1 512
Test DEPARTMENT 1-2 1,024
Test DEPARTMENT 1-3 512
PERSONNEL department 1-0 2,048
PERSONNEL department 1-1 1,536
PERSONNEL department 1-2 1,536
PERSONNEL department 1-3 1,536
User1 department 1-0 2,048
User1 department 1-1 1,536
User1 department 1-2 1,536
User1 department 1-3 1,536

Teradata RDBMS Data Dictionary 3 – 11


Chapter 3: System Views: Usage and Examples
AllTempTables[X]

AllTempTables[X]

The AllTempTables view provides information about all global temporary


tables materialized in the system.
A global temporary table is created by explicitly stating the keywords GLOBAL
TEMPORARY in the CREATE TABLE statement. The temporary table defined
during the CREATE TABLE statement is referred to as the base temporary
table.
When referenced in an SQL session, a local temporary table is materialized
with the exact same definition as the base table. Once the temporary table is
materialized, subsequent DML statements referring to that table are mapped to
the materialized instance.
A materialized temporary table is automatically dropped at the end of a
session.

View Name User Type Columns Selected

DBC.AllTempTables Administrator HostNo


SessionNo
UserName
B_DatabaseName
B_TableName
E_TableId

Corresponding system tables for this view include the following:


• DBC.TempTables
• DBC.DBase
• DBC.TVM
• DBC.SessionTbl

Usage Notes
A materialized temporary table is different from a permanent table in the
following ways:
• It is always empty at the start of a session
• The contents of the materialized table cannot be shared by other
sessions.
• It can optionally be emptied at the end of each transaction.
• It is automatically dropped at the end of each session.

3 – 12 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
AllTempTables[X]

Example
After a global temporary table definition is created, you can use the INSERT
statement to create a local instance of the global temporary table for use during
the session.
The following statement shows all temporary tables materialized by the login
user in the system.
==> SELECT * FROM DBC.AllTempTablesX

HostNo SessionNo DatabaseName TableName TableId

52 3,409 TEST GTEMP1 00800A000000

Teradata RDBMS Data Dictionary 3 – 13


Chapter 3: System Views: Usage and Examples
All_RI_Children

All_RI_Children

The All_RI_Children view provides information about all tables in child-parent


order. It is similar to the RI_Child_Tables view but returns the names of
databases, tables, and columns instead of IDs.

View Name User Type Columns Selected

DBC.All_RI_Children All users IndexID


IndexName
ChildDB
ChildTable
ChildKeyColumn
ParentDB
ParentTable
ParentKeyColumn
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.ReferencingTbls
• DBC.DBase
• DBC.TVM
• DBC.TVFields

Usage Notes
The All_RI_Children view is designed for use in a SELECT statement with a
WHERE clause to narrow the selection criteria.
The All_RI_Children view is similar to the RI_Child_Tables view but returns
the database, table, and column names instead of the IDs for access control
purposes. The administrator can control who has access to internal ID numbers
by limiting the access to the RI_Child_Tables view while allowing more (or all)
users to access the names via the All_RI_Children view.

3 – 14 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
All_RI_Parents

All_RI_Parents

The All_RI_Parents view provides information about all tables in parent-child


order. It is similar to the RI_Parent_Tables view but returns the names of
databases, tables, and columns instead of IDs.

View Name User Type Columns Selected

DBC.All_RI_Parents All users IndexID


IndexName
ParentDB
ParentTable
ParentKeyColumn
ChildDB
ChildTable
ChildKeyColumn
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.ReferencingTbls
• DBC.DBase
• DBC.TVM
• DBC.TVFields

Usage Notes
The All_RI_Parents view is designed for use in a SELECT statement with a
WHERE clause to narrow the selection criteria.
The All_RI_Parents view is similar to the RI_Parent_Tables view but returns the
database, table, and column names instead of the IDs for access control
purposes. The administrator can control who has access to internal ID numbers
by limiting the access to the RI_Parent_Tables view while allowing more (or all)
users to access the names via the All_RI_Parents view.

Teradata RDBMS Data Dictionary 3 – 15


Chapter 3: System Views: Usage and Examples
AMPUsage

AMPUsage

The AMPUsage view provides information about the usage of each AMP for
each user and account.
AMPUsage monitors logical I/Os explicitly requested by the AMP database
software or file system that is running in the context of an AMP worker task for
the purpose of executing a step in the user query. I/Os done by UNIX for
swapping are not included in AMPUsage, nor are the I/Os caused by parsing
the user query.
A logical I/O is charged even if the requested segment is cached and no
physical I/O is done.

View Name User Type Columns Selected

DBC.AmpUsage Administrator AccountName


UserName
CPUTime
Vproc
VprocType
Model
DiskIO

The corresponding system table for this view is DBC.Acctg.

Example
The following SELECT statement is used to display, for a given account, total
CPU time and total DSU accesses for all AMPs.
==> SELECT AccountName,SUM(CPUTime),SUM(Diskio)
FROM DBC.AMPusage WHERE AccountName=’7654’

AccountName Sum(CPUTime) Sum(DiskIO)

7654 204,352.88 5,226,742

Additional Information
See Teradata RDBMS Database Design for more information on controlling
access, space, and ownership.

3 – 16 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Association

Association

The Association view allows the user to retrieve information about an object
that was imported from another Teradata RDBMS.

View Name User Type Columns Selected

DBC.Association End DatabaseName


TableName
EventNum
Original_DatabaseName
Original_TableName
Original_TableKind
Original_Version
Original_ProtectionType
Original_JournalFlag
Original_CreatorName
Original_CommentString

Corresponding system tables for this view include the following:


• DBC.Association
• DBC.DBase
• DBC.TVM

Usage Notes
The Association view contains information about entities that were restored
using the Archive and Recovery COPY utility. If a copied object is subsequently
dropped, then the information is deleted and is no longer available.

Example
The following SELECT statement selects information about tables copied into
the Personnel database.
==> SELECT Original_DatabaseName,Original_TableName,TableName
FROM DBC.Association WHERE DatabaseName = ’Personnel’;

Original_DatabaseName Original_TableName TableName

OldPersonnel Empl_Addr Emp_Address


Personnel2 Empl_Dept Empl_Dept

Teradata RDBMS Data Dictionary 3 – 17


Chapter 3: System Views: Usage and Examples
Association

Additional Information
The following references provide additional usage information on recovery
control.

Book Chapter Section

Teradata RDBMS Database Archiving and • Recovery Control Views


Administration Recovering Data

Teradata Archive/Recovery Archive/Recovery • All


Reference Control Language

3 – 18 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
CharSets

CharSets

The CharSets view returns the names assigned to user-defined character sets. If
the view does not exist, or if no rows are found, then no special character sets
are currently available.

View Name User Type Columns Selected

DBC.CharSets End CharSetName

The corresponding system table for this view is DBC.Translation.

Usage Notes
The Teradata RDBMS can support many user-defined character sets (see the
“CharTranslations”). A maximum of six character sets can be installed at any
given time. The CharSets view Returns the names of character sets that are
currently installed and thus can be specified at the session level. If the view
does not exist or no rows are found, then no user-defined character sets are
available.
Each name shown in CharSets can be used as the identifier in the BTEQ [.]SET
SESSION CHARSET <’name’> command or the CLIv2 call CHARSET <name>.
However, the specified character set should be compatible with the internal
code of the logon client system.
If a CharSetName is ambiguous as to its compatibility with the logon client
system of the viewer session, consult the Teradata RDBMS administrator.

Example
The following example shows that two user-defined character sets are available
for the requesting user.
==> SELECT * from DBC.CharSets ;

CharSetName

French_EBCDIC
Swedish_EBCDIC

Teradata RDBMS Data Dictionary 3 – 19


Chapter 3: System Views: Usage and Examples
CharTranslations

CharTranslations

The CharTranslations view shows hexadecimal codes inserted by the Teradata


RDBMS system administrator to form translation tables that enable the
Teradata RDBMS to store and manipulate non-English character sets. Such
translation tables usually define character sets for languages that use diacritical
characters.
If the view is empty or no rows are found, then no user-defined character sets
are available.

View Name User Type Columns Selected

DBC.CharTranslations End CharSetName


CharSetId
InstallFlag
E2I
E2IUp
I2E
I2EUp

The corresponding system table for this view is DBC.Translation.

Usage Notes
The underlying table of this view is populated by the Teradata RDBMS system
administrator or other responsible user. Each row in the table comprises a
translation table for one character set. The amount of character sets that can be
defined is limited only by the disk space available for the table. However, a
maximum of 12 sets can be installed as currently available at any one time.
The Teradata RDBMS must be reset to install the rows containing a Y in the
InstallFlag field. If the value of InstallFlag is Y in 12 rows or less, each Y row is
loaded. If InstallFlag is Y in more than 12 rows, then the CharSetName values
are sorted in ascending ASCII sequence, and rows are loaded in alphabetical
order until 12 sets are installed or the names are exhausted.
If client system connections are to use the defined character sets, the Teradata
RDBMS system administrator specifies which character set is assigned to which
client system (see DBC.HostsInfo view). Otherwise, the standard default is
used. Also, the user may specify a defined character set after a session is started
(see “CharSets”).
When specifying a character set for a session, the choice should be compatible
with the internal code of the logon client system; that is, an
EBCDIC-compatible character set for sessions initiated from an IBM
mainframe, ASCII-compatible sets for all others. It is suggested, therefore, that

3 – 20 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
CharTranslations

a convention be used for naming character sets which differentiates between


EBCDIC and ASCII compatibility (see example).

Example
The example below shows that the hexadecimal translation tables for 6
character sets have been defined, and that two of these are flagged for loading.
==> SELECT * FROM DBC.CharTranslations;

Char Install
CharSetName Set Id Flag E2I

German_EBCDIC 100 N 00010203A809A97FD1D2D3...


Italian_EBCDIC 105 N 00010203A809A97F2395EE...
Spanish_EBCDIC 103 N 00010203A809A97FD1D2D3...
French_EBCDIC 104 Y 00010203A809A97FD1D2D3...
Norwegian_EBCDIC 101 N 00010203A809A97FD1D2D3...
Swedish_EBCDIC 102 Y 00010203A809A97FD1D2D3...

Teradata RDBMS Data Dictionary 3 – 21


Chapter 3: System Views: Usage and Examples
Children[X]

Children[X]

The Children view lists the names of databases and users and their parents in
the hierarchy.

View Name User Type Columns Selected

DBC.Children[X] Administrator Child


Parent

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.DBase
• DBC.Owners
This view also references the userdb view.

Example
The following SELECT statement displays databases and users that are owned
by the Finance database.
==> SELECT Parent, Child FROM DBC.Children
WHERE Parent = ’Finance’;

Parent Child

Finance Personnel
Finance Jones
Finance Accounting

3 – 22 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Collations

Collations

The Collations view provides definitions for standard Swedish and Norwegian
collations as well as custom collation sequence definitions. The Collations view
provides a view on all columns of the DBC.CollationTbl.

View Name User Type Columns Selected

DBC.Collations End CollName


CollInstall
CollEqvClass
CollOrderCS
CollOrderUC

The corresponding system table for this view is DBC.CollationTbl.

Usage Notes
The DBC.Collation table initially contains two rows, SWEDISH_STANDARD
and NORWEGIAN_STANDARD. Database administration can redefine the
MULTINATIONAL collation sequence to meet other specific language collation
needs.
Using the MULTINATIONAL option, for example, in SET SESSION
COLLATION MULTINATIONAL, is the same. The final collation order,
however, is changed according to the defined collation sequence.
Database administration runs the CollInstallMulti macros to set the collation
sequence to MULTINATIONAL, SWEDISH_STANDARD, or
NORWEGIAN_STANDARD. The Teradata RDBMS must be reset (initialized)
before the new collation sequence can take effect.
When you define a new collation with a name other than ’MULTINATIONAL’,
you should set the CollInstall flag to N to avoid extra processing during
startup.

Example
The following statement returns the collation information for all collation
sequences defined in the collation table:
SELECT CollName
FROM DBC.Collation ;
The result is the following list:
CollName
SWEDISH_STANDARD
NORWEGIAN_STANDARD
MULTINATIONAL

Teradata RDBMS Data Dictionary 3 – 23


Chapter 3: System Views: Usage and Examples
Columns[X]

Columns[X]

The Columns view provides information from the DBC.TVFields table about
stored procedures, join indexes, the parameters of macros and stored
procedures, and the columns of any table or view that the user owns or has
SELECT privileges on.

View Name User Type Columns Selected

DBC.Columns[X] End DatabaseName


TableName
ColumnName
ColumnFormat
ColumnTitle
ColumnType
ColumnLength
DefaultValue
Nullable
CommentString
DecimalTotalDigits
DecimalFractionalDigits
ColumnId
UpperCaseFlag
Compressible
CompressValue
ColumnConstraint
ConstraintCount
CreatorName
CreateTimeStamp
LastAlterName
LastAlterTimeStamp
CharType
SPParameterType

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.TVFields
• DBC.TVM
• DBC.DBase
• DBC.Owners

Usage Notes
When querying DBC.Columns for a view, information on column attributes
(length, type, etc.) will be null. Because column attributes correspond to the
table for which they were defined, they are not stored in the dictionary and are

3 – 24 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Columns[X]

not accessible through this view. Information on the columns of views can be
obtained with the HELP COLUMN statement.

Example 1
This example shows a statement that selects from DBC.Columns the name,
format, null status, and data type of all columns in the Personnel.Employee
table:
==> SELECT ColumnName,ColumnFormat,Nullable,ColumnType
FROM DBC.Columns WHERE DatabaseName=’Personnel’
AND TableName = ’Employee’;

ColumnName ColumnFormat Nullable ColumnType

EmpNo 9(5) N I
Name X(12) N CV
DeptNo 999 Y I
JobTitle X(12) Y CV
Salary zzz,zz9.99 Y D
YrsExp z9 Y I
. . . .
. . . .
. . . .

Example 2
This example shows a statement that selects any available commentary about
columns in the Employee table:
==> SELECT ColumnName,CommentString FROM DBC.Columns
WHERE DatabaseName=’Personnel’ AND
TableName=’Employee’
ORDER BY Columnid;

ColumnName CommentString

EmpNo Employee serial number.


Name Employee name, last then first initial.
DeptNo
JobTitle
Salary
YrsExp

Teradata RDBMS Data Dictionary 3 – 25


Chapter 3: System Views: Usage and Examples
ColumnStats

ColumnStats

This view helps obtain statistical information on the columns of a table, for
which the statistics are available.
When statistics are collected on a column of a data table, the information is
saved into DBC.TVFields.FieldStatistics. The dictionary table TVFields is not
accessible to PUBLIC. Through this view, all users can access the column
statistics.

View Name User Type Columns Selected

DBC.ColumnStats All users DatabaseNameI


TVMNameI
FieldStatistics
FieldID

Corresponding system tables for this view are the following:


• DBC.DBase
• DBC.TVFields
• DBC.TVM

Usage Notes
This view is used by the client tools Teradata System Emulation Tool (TSET)
and Teradata Visual Explain, besides any client application that requires the
statistical information. TSET exports the statistical information for data tables
as part of Target Level Emulation.
The information returned includes the Field Statistics for each column, table
name and database name, and the sequence number of the column. The
SeqNumber is derived from the FieldID. The output is sorted in the order of the
SeqNumber.

Example
The following statement selects statistical information about the columns in the
table ‘Query’, provided that the statistics have been collected:
==> SELECT *
FROM DBC.ColumnStats
WHERE DatabaseName = 'QCD'
AND
TableName = 'Query'
ORDER BY SeqNumber;

3 – 26 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
ColumnStats

The output of this statement is:


FieldStatistics DatabaseName TableName SeqNumber
D10706130F271613
0100000000000000
0000000012000100
00000000000 QCD QUERY 1

Note: The FieldStatistics information appears in an internal format. The client


tools TSET or Teradata Visual Explain can interpret this information.

Teradata RDBMS Data Dictionary 3 – 27


Chapter 3: System Views: Usage and Examples
Databases[X]

Databases[X]

The Databases view provides information about both databases and users from
the DBC.DBase table.

View Name User Type Columns Selected

DBC.Databases[X] End DatabaseName


CreatorName
OwnerName
AccountName
ProtectionType
JournalFlag
PermSpace
SpoolSpace
TempSpace
CommentString
CreateTimeStamp
LastAlterName
LastAlterTimeStamp
DBKind

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.DBase
• DBC.Owners

Usage Notes
The indicators in the JournalFlag column depend on the following:
• the FALLBACK and JOURNAL settings for the database, which serve as the
default for all tables created in that database
• any FALLBACK and JOURNAL settings defined in the CREATE TABLE
and ALTER TABLE statements
Settings defined for an individual table override the database defaults.

Example
The statement shown in the following screen selects information about the
Personnel database.
==> SELECT AccountName,ProtectionType,PermSpace,SpoolSpace
FROM DBC.Databases WHERE DatabaseName = ’Personnel’;

AccountName ProtectionType PermSpace SpoolSpace


Teradata_Sample F 100,000 1,339,884,032

3 – 28 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Databases2

Databases2

The Databases2 view provides ID definition information about databases. It is


similar to the Databases view but returns the ID of the database and Referential
Integrity (RI) information instead of the other information (Creator Name,
Owner Name, etc.) provided by the Databases view.

View Name User Type Columns Selected

DBC.Databases2 All users DatabaseName


DatabaseId
UnResolvedRICount

The corresponding system table for this view is DBC.DBase.

Usage Notes
The Databases2 view is similar to the Databases view but, for access control
purposes, returns the ID of the database instead of the various names other
information associated with the database. See the columns of the Databases
view for comparison.
The administrator can control who has access to internal ID numbers by
limiting the access to the Databases2 view while allowing more (or all) users to
access the names via the Databases view.

Teradata RDBMS Data Dictionary 3 – 29


Chapter 3: System Views: Usage and Examples
Database_Default_Journals[X]

Database_Default_Journals[X]

The Database_Default_Journals view provides information on each database


that is defined as having a default journal table.

View Name User Type Columns Selected

DBC.Database_Default_Journals[X] End DatabaseName


Journal_DB
JournalName

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.TVM
• DBC.DBase
• DBC.Owners

Usage Notes
A journal table does not need to reside in the database which it serves.

Example
The following SELECT statement selects the information on each database
accessible by the requesting user for which a default journal table is defined.
==> SELECT * FROM DBC.Database_Default_JournalsX;

DatabaseName Journal_DB JournalName

DtBs1 DtBs1 DtBs1Jrnl


DtBs2 DtBs2 DtBs2Jrnl
DtBs3 DtBs1 DtBs1Jrnl

3 – 30 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
DBCInfo

DBCInfo

The DBCInfo view provides information about specific attributes of the


Teradata RDBMS, such as the current software version and release level. It is
updated during each system restart.

View Name User Type Columns Selected

DBC.DBCInfo Administrator InfoKey


InfoData

The corresponding system table for this view is DBC.InfoTbl.

Usage Notes
Two attributes are maintained in DBCInfo. They are:
• VERSION—Version of the software currently running on the Teradata
RDBMS
• RELEASE—Release level of the software currently running on the Teradata
RDBMS

Example
The following SELECT statement retrieves the version and release of the
current Teradata RDBMS software.

==> SELECT * FROM DBC.DBCInfo;

InfoKey InfoData

VERSION V2R.nn.nn.nn.nn
RELEASE nn.nnx.nn.nn

Teradata RDBMS Data Dictionary 3 – 31


Chapter 3: System Views: Usage and Examples
DeleteAccessLog[X]

DeleteAccessLog[X]

The DeleteAccessLog view is referenced in a DELETE statement to remove


from the access log all entries that are more than 30 days old.

View Name User Type Columns Selected

DBC.DeleteAccessLog[X] Security LogDate


Administrator LogTime

Corresponding system tables for this view include the following:


• DBC.AccLogTbl
• DBC.DBase
• DBC.Owners
This view also references the userdb view.

Usage Notes
The access log contains entries according to the application of the access
logging rules (see “AccessLog” and “AccLogRules”).
The DeleteAccessLog view purges entries from the log that are more than 30
days old.
The view also may be used to display information about records that are
eligible for deletion before the delete operation is performed.

Example
The following SELECT statement deletes entries logged against databases
owned by the requesting user that were entered more than 30 days before the
current calendar date.
==> DELETE FROM DBC.DeleteAccessLogX ALL;

DELETE COMPLETED. 79 RECORDS DELETED.

3 – 32 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
DeleteOldInDoubt

DeleteOldInDoubt

DeleteOldInDoubt view displays those rows in the DBC.InDoubtResLog table


that are more than 30 days old. The table contains a row for each transaction
that had been in-doubt, and that was subsequently manually resolved.

View Name User Type Columns Selected

DBC.DeleteOldInDoubt Administrator LogicalHostId


CoordTaskId
LogonUserName
CommitOrRollback
CompletionDate
UserLogonTime
SessionNumber
RunUnitId
ResolvingUserLogonName
UserLogonDate
CompletionTime
Options

The corresponding system table for this view is the InDoubtResLog.

Usage Notes
The DeleteOldInDoubt view purges entries from the in-doubt transaction log
that are more than 30 days old. Before a delete operation is performed the view
may also be used to display information about records eligible for deletion.

Example
The following statement deletes entries logged against in-doubt transactions
that were entered more than 30 days before the current calendar date.
==> DELETE FROM DBC.DeleteOldInDoubt ALL;

DELETE COMPLETED. 5 ROWS REMOVED.

Teradata RDBMS Data Dictionary 3 – 33


Chapter 3: System Views: Usage and Examples
DiskSpace[X]

DiskSpace[X]

The DiskSpace view provides AMP-by-AMP vproc information about disk


space usage (including spool) for any database or account.

View Name User Type Columns Selected

DBC.DiskSpace[X] Administrator Vproc


DatabaseName
AccountName
MaxPerm
MaxSpool
MaxTemp
CurrentPerm
CurrentSpool
CurrentTemp
PeakPerm
PeakSpool
PeakTemp

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.DataBaseSpace
• DBC.DBase
• DBC.Owners
The view also references the userdb view.

Usage Notes
When a database or user is created, allocated disk space is divided evenly
among all AMPs. The DiskSpace view returns one row of usage information for
each AMP in the Teradata RDBMS (or for all AMPs if the SUM aggregate is
used).
When a database is created, a space row is added on each AMP, with the
processor field in each row initialized to 0. The first time the space row is
updated, such as when a table is created in the database or the system is
restarted, the processor field in each row is updated to reflect the actual
processor number.
You can use the DiskSpace view to build and maintain a table of disk space
usage statistics for each username/accountname.
To create the history table, enter the following statement:
CREATE TABLE DiskSpaceHist ( DataBaseName VARCHAR(30),
AccountName VARCHAR(30),

3 – 34 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
DiskSpace[X]

MaxPerm FLOAT,
MaxSpool FLOAT,
CurrentPerm FLOAT,
PeakPerm FLOAT,
PeakSpool FLOAT,
CollectDate DATE,
CollectTime FLOAT )
PRIMARY INDEX (DataBaseName, AccountName);
Periodically, you can collect usage statistics using the following procedure:

Step Action

1 Select statistics from the DiskSpace view and insert them in the history table.

2 Reset DiskSpace counters to zero for the next collection period.

Note: The maximum and peak DiskSpace counters are reset to zero using the
ClearPeakDisk macro, which is provided on the release tape. Execute the
ClearPeakDisk macro provided in the Teradata RDBMS Data Dictionary, to
reset to zero the maximum and peak DiskSpace counters.

This procedure can be carried out using the following BTEQ script.
.LOGON username, password

INSERT INTO DiskSpaceHist


SELECT DataBaseName, AccountName,
SUM(MaxPerm),
SUM(MaxSpool),
SUM(CurrentPerm),
SUM(PeakPerm),
SUM(PeakSpool),
DATE, TIME
FROM DBC.DiskSpace
GROUP BY DataBaseName, AccountName, DATE, TIME;

EXECUTE DBC.ClearPeakDisk;

.QUIT

Example
The following SELECT statement displays the permanent disk space across all
AMPs.
==> SELECT DISTINCT AMP,DatabaseName,CurrentPerm,MaxPerm FROM
DBC.DiskSpace;

AMP DatabaseName CurrentPerm MaxPerm


. . . .

Teradata RDBMS Data Dictionary 3 – 35


Chapter 3: System Views: Usage and Examples
DiskSpace[X]

. . . .
0-0 stst14 0 125,000
0-0 ud12 0 125,000
1-0 atest 1,536 125,000
1-0 a1 0 247,500
1-0 btest 3,584 5,000
1-0 b2test 49,664 250,000
. . . .
. . . .
1-1 atest 1,536 125,000
1-1 a1 0 247,500
1-1 btest 3,584 5,000
1-1 b2test 50,688 250,000
. . . .
. . . .
1-2 atest 1,536 125,000

3 – 36 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Events[X]

Events[X]

The Events view provides information about the execution of checkpoint


statements and client system utility functions.

View Name User Type Columns Selected

DBC.Events[X] Operations CreateDate


Control CreateTime
EventNum
EventType
UserName
DatabaseName
ObjectType
AllAMPsFlag
RestartSeqNum
OperationInProcess
TableName
CheckpointName
LinkingEventNum
DataSetName
LockMode
JournalUsed
JournalSaved
IndexPresent
DupeDumpSet

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.RCEvent
• DBC.DBase
• DBC.Owners
This view also references the userdb view.

Usage Notes
The Events view returns a row for each archive or recovery activity. The types
of event rows are as follows:
• Checkpoint Event Row—A row is created for each journal checkpointed.
• Delete Event Row—A row is created for each journal deleted.
• Dump Event Row—A row is created for each database or table dumped.
• Restore Event Row—A row is created for each database or table restored.
• Rollback Event Row—A row is created for each database or table rolled
back.

Teradata RDBMS Data Dictionary 3 – 37


Chapter 3: System Views: Usage and Examples
Events[X]

• Rollforward Event Row—A row is created for each database or table rolled
forward.
The Events view contains the following standard and optional fields:

Standard fields Optional fields

EventNum DataSetName

CreateDate TableName,

CreateTime CheckpointName

UserName LinkingEventNum

EventType LockMode

DatabaseName JournalUsed

ObjectType JournalSaved

AllAMPsFlag IndexPresent

RestartSeqNum DupeDumpSet

OperationInProcess

The CreateDate and CreateTime fields are updated by the PE on which the
session is running; thus, all events for a given session are timestamp-ordered.
However, if multiple or concurrent sessions are running on different PEs, any
discrepancy in AMP clocks may be reflected in the timestamp sequence. This
may also occur if a Teradata RDBMS connects to more than one client system
and the client system clocks are not synchronized.

Example
The following SELECT statement selects information associated with the
requesting user from the DBC.EventsX view.
==> SELECT CreateDate, CreateTime, EventType, JournalUsed FROM
DBC.EventsX;

CreateDate CreateTime EventType JournalUsed

87/03/18 11:10:45 Rollforward R


87/03/18 11:18:20 Restore R
87/03/19 12:06:34 Rollforward R
87/02/12 14:13:38 Dump S

3 – 38 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Events_Configuration[X]

Events_Configuration[X]

The Events_Configuration view provides information about utility events that


did not affect all AMPs.

View Name User Type Columns Selected

DBC.Events_Configuration[X] Operations Vproc


Control CreateDate
CreateTime
EventNum
EventType
UserName
LogProcessor
PhyProcessor
ProcessorState
RestartSeqNum

Corresponding system tables for this view include the following:


• DBC.RCEvent
• DBC.RCConfiguration
• DBC.AccessRights
• DBC.DBase
• DBC.Owners
This view also reference the userdb view.

Usage Notes
The Events_Configuration view contains rows for each archive activity that
does not affect all AMPs in the Teradata RDBMS configuration.
If the activity is for all AMPs and there are AMPs off-line, a row is inserted for
each off-line AMP. If the activity is for specific AMPs, a row is inserted for each
AMP that is specified and on-line.
The CreateDate and CreateTime fields are updated by the PE on which the
session is running; thus, all events for a given session are timestamp-ordered.
However, if multiple or concurrent sessions are running on different PEs, any
discrepancy in AMP clocks may be reflected in the timestamp sequence. This
may also occur if a Teradata RDBMS is connected to more than one client
system and the client system clocks are not synchronized.

Teradata RDBMS Data Dictionary 3 – 39


Chapter 3: System Views: Usage and Examples
Events_Configuration[X]

Example
The statement on the following screen selects information concerning the
requesting user from the DBC.Events_ConfigurationX view.
==> SELECT CreateDate, CreateTime, EventNum, EventType
FROM DBC.Events_ConfigurationX;

CreateDate CreateTime EventNum EventType

87/03/18 08:53:48 30 Rollforward


87/03/18 08:57:49 44 Rollforward
87/03/18 08:54:42 33 Rollforward
87/03/20 11:26:26 98 Dump
87/03/18 09:00:05 52 Rollforward
87/03/18 09:30:59 55 Restore
87/03/18 08:57:02 41 Rollforward

3 – 40 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Events_Media[X]

Events_Media[X]

The Events_Media view provides information about the execution of a client


system utility dump or restore function that created or used removable media.

View Name User Type Columns Selected

DBC.Events_Media[X] Operations CreateDate


Control CreateTime
EventNum
EventType
UserName
DataSetName
VolSerialId
VolSequenceNum
DupeDumpSet

Corresponding system tables for this view include the following:


• DBC.RCEvent
• DBC.RCMedia
• DBC.AccessRights
• DBC.DBase
• DBC.Owners
This view also reference the userdb view.

Usage Notes
The CreateDate and CreateTime fields are updated by the PE on which the
session is running; therefore, all events for a given session will be
timestamp-ordered. However, if multiple or concurrent sessions are running on
different PEs, any discrepancy in AMP clocks may be reflected in the
timestamp sequence.
This may also occur if a Teradata RDBMS is connected to more than one client
system and the client system clocks are not synchronized.

Example
In this example, the requesting user is researching the Events_Media view for
events associated with the user named ’PAL’.
==> SELECT DataSetName,VolSerialId,DupeDumpSet
FROM DBC.Events_Media WHERE UserName = ’PAL’ ;

Teradata RDBMS Data Dictionary 3 – 41


Chapter 3: System Views: Usage and Examples
Events_Media[X]

DataSetName VolSerialId DupeDumpSet

BRM.DBC.TEXT1 000469 N
BRM.DBC.TEXT1 000469 N
BRM.DBC.TEXT2 000469 N
BRM.DBC.TEXT2 000469 N
BRM.DBC.TEXT1 BRM001 Y
BRM.DBC.TEXT1 BRM002 Y
BRM.DBC.TEXT2 BRM001 N
BRM.DBC.TEXT2 BRM002 N

3 – 42 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Hardware_Event_Log

Hardware_Event_Log

The Hardware_Event_Log view provides information about system failures,


error conditions and other events originating in the Parallel Data Extensions
(PDE) or the Teradata RDBMS.

View Name User Type Columns Selected

DBC.Hardware_Event_Log Operations TheDate


Control TheTime
Event_Tag
Category
Severity
Primary_Part_Number
Revision_Level
Secondary_Part_Number
Serial_Number
PMA
Module_Type
Slot
Slot_Type
SubSlot
SubSlot_Type
FW_Version
Vcc_Margin
Frequency_Margin
Vcc_Volts
Vcc_Amps
Temperature
Line
Text
Error_Data

The corresponding system table for this view is DBC.HW_Event_Log.

Usage Notes
Returned information from this view can help to diagnose where the failure
may originate for different types of events.

Teradata RDBMS Data Dictionary 3 – 43


Chapter 3: System Views: Usage and Examples
HostsInfo

HostsInfo

The HostsInfo view displays information about any user-defined character sets
assigned by the Teradata RDBMS system administrator as the default for the
client systems in the Teradata RDBMS configuration (also see the “CharSets”
and “CharTranslations”).

View Name User Type Columns Selected

DBC.HostsInfo End LogicalHostId


HostName
DefaultCharSet

The corresponding system table for this view is DBC.Hosts.

Usage Notes
If this view does not exist or no rows are found, the default character set of each
logon client system is in effect.

Example
The following SELECT statement selects any character sets assigned by the user
as the defaults for the client systems in the Teradata RDBMS configuration.
==> SELECT * FROM DBC.HostsInfo;

LogicalHostId HostName DefaultCharSet

136 VM Norwegian_EBCDIC
137 LAN ASCII

3 – 44 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Indices[X]

Indices[X]

The Indices view provides information about each indexed column from the
DBC.Indexes table.

View Name User Type Columns Selected

DBC.Indices[X] Supervisory DatabaseName


TableName
IndexNumber
IndexType
UniqueFlag
IndexName
ColumnName
ColumnPosition
CreatorName
CreateTimeStamp
LastAlterName
LastAlterTimeStamp

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.Indexes
• DBC.TVM
• DBC.TVFields
• DBC.DBase
• DBC.Owners

Usage Notes
One row is returned from the Indices view for each column in each index.
Therefore, a query on an index made up of multiple columns will return
multiple rows.

Example
The following SELECT statement displays index information for all the tables
in the Personnel database.
==> SELECT TableName,ColumnName,ColumnPosition,IndexType,
UniqueFlag FROM DBC.Indices
WHERE DatabaseName= ’Personnel’
ORDER BY TableName,ColumnPosition ;

Teradata RDBMS Data Dictionary 3 – 45


Chapter 3: System Views: Usage and Examples
Indices[X]

The results of this query are as follows:


TableName ColumnName ColumnPosition IndexType UniqueFlag

Charges Proj_id 1 S N
Charges EmpNo 1 P N
Charges Proj_id 2 P N
Department DeptNo 1 P Y
Employee EmpNo 1 P Y
Employee Name 1 S N
Project Proj_id 1 P Y

3 – 46 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
IndexStats

IndexStats

This view helps obtain statistical information on the indexes defined on a table,
for which the statistics are available.
When statistics are collected on the indexes of a data table, the information is
saved into DBC.Indexes.IndexStatistics. The dictioanry table Indexes is not
accessible to PUBLIC. Through this view, all users can access the index
statistics.

View Name User Type Columns Selected

DBC.IndexStats All users DatabaseName


TVMNameI
IndexStatistics
IndexNumber

Corresponding system tables for this view are the following:


• DBC.DBase
• DBC.Indexes
• DBC.TVM

Usage Notes
This view is used by the client tools Teradata System Emulation Tool (TSET)
and Teradata Visual Explain, besides any client application that requires the
statistical information.
The information returned includes the Index statistics, table name and database
name, and the index number. The output is sorted in the order of the index
number.

Example
The following statement selects statistical information about the indexes on the
table T1.
==> SELECT *
FROM DBC.IndexStats
WHERE DatabaseName = 'Test'
AND
TableName = 't1'
ORDER BY IndexNumber;

Teradata RDBMS Data Dictionary 3 – 47


Chapter 3: System Views: Usage and Examples
IndexStats

The output of this statement is:


IndexStatistics DatabaseName TableName IndexNumber

D10706130F271613
0100000000000000
0000000012000100
00000000000 TEST T1 4

Note: The IndexStatistics information appears in an internal format. The client


tools TSET or Teradata Visual Explain can interpret this information.

3 – 48 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
InDoubtLog

InDoubtLog

The InDoubtLog view displays the contents of the DBC.InDoubtResLog table.


The table contains a row for each transaction that had been in-doubt, and that
was subsequently manually resolved.

View Name User Type Columns Selected

DBC.InDoubtLog Administrator LogicalHostId


CoordTaskId
LogonUserName
UserLogonDate
CompletionDate
CommitOrRollBack
SessionNumber
RunUnitId
ResolvingUserLogonName
UserLogonTime
CompletionTime
Options

The corresponding system table for this view is InDoubtResLog.

Teradata RDBMS Data Dictionary 3 – 49


Chapter 3: System Views: Usage and Examples
Journals[X]

Journals[X]

The Journals view provides information about the journal table for each data
table that uses journal protection. The restricted version of the view displays
only those objects that the requesting user either owns or holds access rights to.

View Name User Type Columns Selected

DBC.Journals[X] End Tables_DB


TableName
Journals_DB
JournalName

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.TVM
• DBC.DBase
• DBC.Owners

Example
The statement on the following screen selects information from the Journals
view for the table named PriceA.
==> SELECT TableName,Tables_DB,Journals_DB,JournalName
FROM DBC.Journals WHERE Tablename = ’PriceA’ ;

TableName Tables_DB Journals_DB JournalName

PriceA Acctng Acctng JNLA


. . . .
. . . .
. . . .

3 – 50 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
LogOnOff

LogOnOff

The LogOnOff view supplies information about logon and logoff activity,
including attempted logons.

View Name User Type Columns Selected

DBC.LogOnOff Administrator LogDate


LogTime
UserName
AccountName
Event
LogicalHostId
IFPNo
SessionNo
LogonDate
LogonTime
LogonSource

The corresponding system table for this view is Eventlog.

Usage Notes
Event data is useful in determining why a logon attempt was not successful.
Information about logon and logoff activity is also maintained on the client
system.

LogonSource Example
The following example shows logons from both network-attached and channel-
attached clients:

Teradata RDBMS Data Dictionary 3 – 51


Chapter 3: System Views: Usage and Examples
LogOnOff

Figure 3-1 LogonSource Values

LogonSource Values
Logons from network- (TCP/IP) C079 153.64.69.48 756 01 LSS
attached clients (TCP/IP) A401 153.64.69.48

Logons from channel- VM TDP5 YT2 0701 LSS


attached clients MVS TDP5 SDML BATCH FASTMAINJOB075760701 LSS

Internal PDE session AGBCLI2J


information LIBDBSUTIL (673) APPL=CSPSLAVE HOST=BABBAGEB
LIBDBSUTIL (651) APPL=CSPSLAVE HOST=BABBAGE

MVS TDP5 SDME BATCH ++++++++* XPORT...........JOB053681101 LSS


MVS TDP5 YT2COP1 BATCH YT2 * ARCMAIN.......JOB076391101 LSS
Logons from MVS TDP5 AGBMLDB BATCH AGB * MLOAD...........JOB048661101 LSS
MVS TDP5 YT2BETQ BATCH ++++++++* BTQMAIN.......JOB004431101 LSS
channel-attached MVS TDP5 YT2FLD BATCH ++++++++* FASTLOAD....JOB076391101 LSS
clients MVS TDP5 AGBFAST1 BATCH AGB * FASTLOAD....JOB030551101 LSS
MVS TDP5 YT2TPMP BATCH ++++++++* TPUMP..........JOB050451101 LSS
MVS TDP5 YT2TO2 BATCH ++++++++* TRUMP..........JOB088881101 LSS
KY01A120

Example
The following SELECT statement displays information about the logon and
logoff activity of a specific user for a particular date:

==> SELECT LogDate,LogTime,Event,LogicalHostId,IFPNo


FROM DBC.LogOnOff WHERE LogDate=’87/09/29’
AND UserName=’Tester’ ORDER BY LogTime;

LogDate LogTime Event LogicalHostId IFPNo

87/09/29 12:35:54 Logon 116 1-4


87/09/29 12:35:60 Logon 116 1-4
87/09/29 13:30:37 Logoff 116 1-4
87/09/29 13:31:45 Logoff 116 1-4
87/09/29 13:52:52 Logon 116 1-4
87/09/29 13:56:03 Logoff 116 1-4
87/09/29 14:05:27 Logon 116 1-4
87/09/29 14:12:12 Logoff 116 1-4
87/09/29 14:14:04 Logon failed 116 1-4
. . . . .
. . . . .
. . . . .

Additional Information
See Teradata RDBMS Database Design for more information on controlling
access, space, and ownership.

3 – 52 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
LogonRules

LogonRules

The LogonRules view retrieves information about logon rules generated as a


result of successfully processed GRANT LOGON statements.

View Name User Type Columns Selected

DBC.LogonRules Administrator UserName


LogicalHostId
LogonStatus
NullPassword
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.LogonRuleTbl
• DBC.DBase

Usage Notes
The LOGON rules can be used to redefine the Teradata RDBMS defaults. See
"GRANT LOGON" documentation for more information.
The initial defaults are that all users can log on from all client systems and that
every logon string must contain a password.
In V2R4.1, Teradata RDBMS, running on Windows 2000, provides the
capability of integrating with the Windows logon, so that users only need to
identify themselves to Windows. Teradata RDBMS can then use this
information to log clients on. Single Sign On is enabled by granting permission
to log on "with null password" from the appropriate network, identified by host
ID.

Teradata RDBMS Data Dictionary 3 – 53


Chapter 3: System Views: Usage and Examples
RCC_Configuration[X]

RCC_Configuration[X]

The RCC_Configuration view is the product of a join on the Events table and
the Configuration table (see “Events[X]” and “Events_Configuration[X]”). It
provides information about checkpoint statements and client system utility
functions that did not affect all AMPs.

View Name User Type Columns Selected

DBC.RCC_Configuration[X] Operations Control EventNum


LogProcessor
PhyProcessor
ProcessorState
RestartSeqNum
Vproc

Corresponding system tables for this view include the following:


• DBC.RCConfiguration
• DBC.AccessRights
• DBC.DBase
• DBC.Owners
The view also references the userdb view.

Usage Notes
The RCC_Configuration view contains rows for each client system utility
function or CHECKPOINT statement that was executed on a subset of the AMP
processors.

Example
The following SELECT statement selects event and processor information from
the RCC_Configuration view.
==> SELECT EventNum, LogProcessor, PhyProcessor
FROM RCC_Configuration;

EventNum LogProcessor PhyProcessor


21 1 1-0
75 1 1-0
88 1 1-0
. . .
. . .
21 2 1-2
75 2 1-2
. . .
. . .

3 – 54 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
RCC_Media[X]

RCC_Media[X]

The RCC_Media view is produced by a join on the Events table and the Media
table. It provides information about a client system utility dump or restore
function that created or used removable media.

View Name User Type Columns Selected

DBC.RCC_Media[X] Operations Control EventNum


VolSerialId
VolSequenceNum
DupeDumpSet

Corresponding system tables for this view include the following:


• DBC.RCMedia
• DBC.AccessRights
• DBC.Owners
• DBC.DBase
This view also references the userdb view.

Example
The following SELECT statement selects all rows and all columns from the
RCC_Media view.
==> SELECT * FROM DBC.RCC_Media;

EventNum VolSerialID VolSequenceNum DupeDumpSet

21 KAZ002 1 N
76 RDB003 1 N
66 RDB007 1 N
19 KAZ002 1 N
66 RDB008 2 N
37 MET001 1 N
77 RDB003 1 N
. . . .
. . . .

Teradata RDBMS Data Dictionary 3 – 55


Chapter 3: System Views: Usage and Examples
RI_Child_Tables

RI_Child_Tables

The RI_Child_Tables view provides information about tables in child-parent


order. It is similar to the All_RI_Children view but returns the internal IDs of
databases, tables, and columns instead of names.

View Name User Type Columns Selected

DBC.RI_Child_Tables All users IndexID


IndexName
ChildDbID
ChildTID
ChildKeyFID
ParentDbID
ParentTID
ParentKeyFID
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding tables for this view include the following:


• DBC.ReferencingTbls
• DBC.Dbase

Usage Notes
The RI_Child_Tables view is similar to the All_RI_Children view but returns
the IDs of databases, tables, and columns instead of the names for access
control purposes. The administrator can control who has access to internal ID
numbers by limiting the access to the RI_Child_Tables view while allowing
more (or all) users to access the names via the All_RI_Children view.

3 – 56 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
RI_Distinct_Children

RI_Distinct_Children

The RI_Distinct_Children view provides information about tables in child-


parent order without the duplication that could result from multi-column
foreign keys.

View Name User Type Columns Selected

DBC.RI_Distinct_Children All users IndexID


IndexName
ChildDB
ChildTable
ParentDB
ParentTable
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.ReferencingTbls
• DBC.TVM
• DBC.DBase

Teradata RDBMS Data Dictionary 3 – 57


Chapter 3: System Views: Usage and Examples
RI_Distinct_Parents

RI_Distinct_Parents

The RI_Distinct_Parents provides information about tables in parent-child


order without the duplication that could result from multi-column foreign
keys.

View Name User Type Columns Selected

DBC.RI_Distinct_Parents All users IndexID


IndexName
ParentDB
ParentTable
ChildDB
ChildTable
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding tables for this view include the following:


• DBC.ReferencingTbls
• DBC.TVM
• DBC.Dbase

3 – 58 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
RI_Parent_Tables

RI_Parent_Tables

The RI_Parent_Tables view provides information about all tables in parent-


child order.

View Name User Type Columns Selected

DBC.RI_Parent_Tables All users IndexID


IndexName
ParentDbID
ParentTID
ParentKeyFID
ChildDbID
ChildTID
ChildKeyFID
InconsistencyFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.ReferencingTbls
• DBC.DBase

Usage Notes
The RI_Parent_Tables view is similar to the All_RI_Parents view but returns the
IDs of databases, tables, and columns instead of the names for access control
purposes.
The administrator can control who has access to internal ID numbers by
limiting the access to the RI_Parent_Tables view while allowing more (or all)
users to access the names via the All_RI_Parents view.

Teradata RDBMS Data Dictionary 3 – 59


Chapter 3: System Views: Usage and Examples
SecurityDefaults

SecurityDefaults

The SecurityDefaults view describes the password features selected for the site.

View Name User Type Columns Selected

DBC.SecurityDefaults Security ExpirePassword


Administrator PasswordMinChar
PasswordMaxChar
PasswordDigits
PasswordSpecChar
MaxLogonAttempts
LockedUserExpire
PasswordReuse

The corresponding system table for this view is SysSecDefaults.

Additional Information
For more information on controlling access, space, and ownership, see the
following manuals:
• Teradata RDBMS Database Design
• Teradata RDBMS Security Administration
• Teradata RDBMS Database Administration

3 – 60 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
SecurityLog[X]

SecurityLog[X]

The SecurityLog view provides a subset of the information available through


the AccessLog view. It is retained in this release to provide compatibility with
earlier releases.

View Name User Type Columns Selected

DBC.SecurityLog[X] Security LogDate


Administrator LogTime
LogType
UserName
AccountName
DatabaseName
TableName
Text

Note: Note that the column named DatabaseName was previously named
ObjectName.

Corresponding system tables for this view include the following:


• DBC.AccLogTbl
• DBC.DBase
• DBC.Owners
This view also references the userdb view.

Usage Notes
For an explanation of the BEGIN/END LOGGING statements, please refer to
Teradata RDBMS SQL Reference.

Teradata RDBMS Data Dictionary 3 – 61


Chapter 3: System Views: Usage and Examples
SessionInfo[X]

SessionInfo[X]

The SessionInfo view provides information about users who are currently
logged on.

View Name User Type Columns Selected

DBC.SessionInfo[X] Administrator UserName


AccountName
SessionNo
DefaultDatabase
Partition
LogicalHostId
HostNo
CurrentCollation
LogonDate
LogonTime
LogonSequenceNo
LogonSource
ExpiredPassword
TwoPCMode
Transaction_Mode

The corresponding system table for this view is SessionTbl.

Usage Notes
Information about current session pools, which are a collection of sessions that
are logged on to the Teradata RDBMS under the same logonid, may be accessed
by entering the DISPLAY POOL command.

Example
The following SELECT statement displays information on all current sessions.
==> SELECT UserName, SessionNo, DefaultDatabase, LogonSource
FROM DBC.SessionInfo;

UserName SessionNo DefaultDatabase LogonSource

BAS 1,020 BAS VM TDPM

SOFTDOC 1,016 Personnel MVS TDPG

UserTest 1,008 DBC

3 – 62 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
SessionInfo[X]

LogonSource Example
The following screen displays LogonSource information from the current
sessions:

select logonsource from dbc.sessioninfo;

*** Query completed. 3 rows found. One column returned.


*** Total elapsed time was 1 second.

LogonSource

(TCP/IP) 0438 153.64.115.59


(TCP/IP) 0448 153.64.115.59 251 01 LSS
(TCP/IP) 0491 141.206.19.180 893 01 LSS

0438 hex = 1080 decimal <---- winddi via ODBC from TD Manager
0448 hex = 1096 decimal <---- dmteq PID = 251 from PC
0491 hex = 1169 decimal <---- bteq PID = 893 from unix

root@napier# netstat -an


Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 141.206.19.180.1025 153.64.115.59.1096 ESTABLISHED
tcp 0 0 141.206.19.180.1025 153.64.115.59.1080 ESTABLISHED
tcp 0 2 141.206.19.180.23 153.64.115.59.1063 ESTABLISHED
tcp 0 0 141.206.19.180.23 153.64.115.59.1062 ESTABLISHED
tcp 0 0 141.206.19.180.1025 141.206.19.180.1169 ESTABLISHED
tcp 0 0 141.206.19.180.1169 141.206.19.180.1025 ESTABLISHED

Teradata RDBMS Data Dictionary 3 – 63


Chapter 3: System Views: Usage and Examples
ShowColChecks

ShowColChecks

The ShowColChecks view provides information about column constraints for a


table in a database.

View Name User Type Columns Selected

DBC.ShowColChecks All users DatabaseName


TableName
ColumnName
ColCheck
CreatorName
CreateTimeStamp

Corresponding system tables for this view include:


• DBC.TVFields
• DBC.TVM
• DBC.DBase

3 – 64 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
ShowTblChecks

ShowTblChecks

The ShowTblChecks view provides information about table constraints for a


database.

View Name User Type Columns Selected

DBC.ShowTblChecks All users DatabaseName


TableName
CheckName
TblCheck
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.TableContraints
• DBC.DBase
• DBC.TVM

Teradata RDBMS Data Dictionary 3 – 65


Chapter 3: System Views: Usage and Examples
Software_Event_Log

Software_Event_Log

The Software_Event_Log view provides information about logged software


events originating in the Parallel Data Extensions (PDE) or the Teradata
RDBMS.

View Name User Type Columns Selected

DBC.Software_Event_Log Operations TheDate


Control TheTime
Event_Tag
Category
Severity
PMA
Vproc
Partition
Task
Function
SW_Version
Line
Text
StackTrace
Error_Data

The corresponding system table for this view is SW_Event_Log.

Usage Notes
For Database Query Manager, the following fields are not used:
• Stacktrace
• Error_Data
• Category
• Severity
• PMA
• Vproc
• Partition
• Task
• Function
• SW_Version

3 – 66 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Software_Event_Log

Example
The following statement requests the software event log information for any
event with a severity level of 50 (unrecoverable user error, no user restart):
SELECT TheDate, TheTime, Category, Severity
FROM Software_Event_Log
Where Severity = ‘50’ ;
The result has the following form:
TheDate TheTime Category Severity
92/08/20 10:10:30 4 50

Teradata RDBMS Data Dictionary 3 – 67


Chapter 3: System Views: Usage and Examples
Table_LevelConstraints

Table_LevelConstraints

The Table_LevelConstraints view provides information about table constraints


for a database.

View Name User Type Columns Selected

DBC.Table_LevelConstraints All users DatabaseName


TableName
ConstraintName
ConstraintText
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.Table_Contraints
• DBC.DBase
• DBC.TVM

3 – 68 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Tables[X]

Tables[X]

The Tables view provides information about tables, views, stored procedures,
join indexes, and macros.

View Name User Type Columns Selected

DBC.Tables[X] All users DatabaseName


TableName
Version
TableKind
ProtectionType
JournalFlag
CreatorName
RequestText
CommentString
ParentCount
ChildCount
NamedTblCheckCount
UnnamedTblCheckExist
PrimaryKeyIndexId
CreateTimeStamp
LastAlterName
LastAlterTimeStamp

The DBC.TVM table contains one row for each table, view, or macro in the
database.
Corresponding system tables for this view include the following:
• DBC.AccessRights
• DBC.TVM
• DBC.DBase
• DBC.Owners

Usage Notes
The RequestText data reflects the definitions specified by the user. This may not
always match the data returned by the SHOW TABLE statement, which reflects
the reconstructed definitions as they exist in the Teradata RDBMS Data
Dictionary.
For example, when obsolete syntax that is still supported is converted
internally to current syntax, RequestText returns the submitted (obsolete)
syntax, while SHOW TABLE returns the converted (current) syntax.

Teradata RDBMS Data Dictionary 3 – 69


Chapter 3: System Views: Usage and Examples
Tables[X]

Example
The following SELECT statement displays information about tables, views, and
macros in the Personnel database.
==> SELECT TableName,CreatorName,TableKind,ProtectionType FROM
DBC.Tables WHERE DatabaseName = ’Personnel’ ;

TableName CreatorName TableKind ProtectionType

NewEmp GREENE M F
EmployeeInfo GREENE V F
Employee DBC T F
Department DBC T F
Project JONES T F
Charges JONES T F

3 – 70 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Tables2

Tables2

The Tables2 view provides ID definition information about tables. It is similar


to the Tables view but includes the ID of the table and database instead of the
other information (Version, TableKind, etc.) provided by the Tables view.

View Name User Type Columns Selected

DBC.Tables2 All users TVMName


TVMId
DatabaseId
ParentCount
ChildCount

The corresponding system table for this view is TVM.

Teradata RDBMS Data Dictionary 3 – 71


Chapter 3: System Views: Usage and Examples
TableSize[X]

TableSize[X]

The TableSize view provides AMP-by-AMP vproc information about disk


space usage (not including spool) for each database, table (including journal
tables), stored procedure, join index, or account.

View Name User Type Columns Selected

DBC.TableSize[X] Administrator Vproc


DatabaseName
AccountName
TableName
CurrentPerm
PeakPerm

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.DatabaseSpace
• DBC.TVM
• DBC.DBase
• DBC.Owners

Usage Notes
When a database or table is created, the allocated disk space is divided evenly
among all AMPs. The TableSize view returns one row of usage information for
each AMP in the Teradata RDBMS (or for all AMPs if the SUM aggregate is
used).

Example
The following SELECT statement is used to contrast the total disk space
currently being used by the Employee table with its peak usage figure.
==> SELECT SUM(PeakPerm), SUM(CurrentPerm)
FROM DBC.TableSize WHERE TableName=’Employee’ ;

Sum(PeakPerm) Sum(CurrentPerm)

260,608 260,608

3 – 72 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Triggers

Triggers

The Triggers view provides information about event-driven, specialized


procedures attached to a single table and stored in the database.

View Name User Type Columns Selected

DBC.Triggers Administrator DatabaseName


TableName
TriggerName
EnabledFlag
ActionTime
Event
Kind
OrderNumber
TriggerComment
RequestText
CreatorName
CreateTimeStamp
LastAlterName
LastAlterTimeStamp

Corresponding system tables for this view include the following:


• DBC.TriggersTbl
• DBC.TVM
• DBC.DBase

Usage Notes
A trigger is defined by a CREATE TRIGGER data modification statement. An
INSERT, UPDATE or DELETE statement on the specified table or view causes
the database to execute the trigger.
Triggers can be of two types: ROW or STATEMENT. When a triggered
statement fires a trigger, cascading ensues that can, in some instances, fire other
triggers and become triggering statements.
The REFERENCING clause must be used when referencing subject tables that
are qualified with old or new table values. In addition, all subject table columns
must use new or old correlation names.

Note: A positioned (updatable cursor) UPDATE or DELETE is not allowed to


fire a trigger and generates an error. In addition, the FastLoad and MultiLoad
utilities return an error if any triggers are enabled on the target table.

Teradata RDBMS Data Dictionary 3 – 73


Chapter 3: System Views: Usage and Examples
Triggers

Example 1
The following example defines two triggers on a parent table. These triggers
ensure that the changes made to the parent table are propagated to the child
table.
CREATE TABLE Parent_Tab (PrimKey int, Col2 int, Col3 int);
CREATE TABLE Child_Tab (PrimKey int, ForKey int, Col3 int);

CREATE TRIGGER UpdateForKey BEFORE UPDATE of (PrimKey) ON


Parent_Tab REFERENCING OLD AS OldRow NEW AS NewRow
FOR EACH ROW
(
UPDATE Child_Tab SET ForKey = NewRow.PrimKey WHERE
Child_Tab.ForKey = OldRow.PrimKey;
);

CREATE TRIGGER DelForKey = BEFORE DELETE ON Parent_Tab REFERENCING


OLD AS OldRow
FOR EACH ROW
(
UPDATE ChildTab SET ForKey = NULL WHERE ForKey =
OldRow.PrimKey;
);

3 – 74 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
UserGrantedRights

UserGrantedRights

The UserGrantedRights view provides information about objects on which the


current user has explicitly granted privileges to other users.

View Name User Type Columns Selected

DBC.UserGrantedRights End DatabaseName


TableName
ColumnName
Grantee
AccessRight
GrantAuthority
AllnessFlag
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.TVM
• DBC.TVFields
• DBC.DBase
This view also references the ownerdb view.

Example
The following SELECT statement displays all rights that the current user has
granted to other users.
==> SELECT DatabaseName,TableName,Grantee,AccessRight
FROM DBC.UserGrantedRights;

DatabaseName TableName Grantee AccessRight

Personnel Employee Greene R


Personnel Employee Greene U
Personnel Employee Greene I

Teradata RDBMS Data Dictionary 3 – 75


Chapter 3: System Views: Usage and Examples
UserRights

UserRights

The UserRights view provides information about objects on which the user has
explicitly or automatically been granted privileges including the following:
tables, views, join indexes, columns, stored procedures, or macros.

View Name User Type Columns Selected

DBC.UserRights End DatabaseName


TableName
ColumnName
AccessRight
GrantAuthority
GrantorName
CreatorName
CreateTimeStamp

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.TVM
• DBC.TVFields
• DBC.DBase
This view also references the userdb view.

Usage Notes
To display the privileges that the user has been granted on database D, the
SELECT statement must specify:
WHERE DatabaseName = ’D’ AND TableName = ’All’ ;
If privileges have been granted on the database, a row is returned for
each privilege.
The UserRights view does not return information about implicit privileges for a
user (for example, the GRANT privilege on each database owned by the user).

Example
The following SELECT statement displays information about all tables in the
Personnel database on which rights were granted to the requesting user.
==> SELECT * FROM DBC.UserRights
WHERE DatabaseName=’Personnel’
AND TableName = ’All’ ;

3 – 76 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
UserRights

DatabaseName TableName AccessRight GrantorName


Personnel Employee R DBC
Personnel Employee U DBC
Personnel Employee I DBC

Teradata RDBMS Data Dictionary 3 – 77


Chapter 3: System Views: Usage and Examples
Users

Users

The Users view provides information about username space that the requesting
user created or owns.

View Name User Type Columns Selected

DBC.Users Supervisory UserName


CreatorName
PasswordLastModDate
PasswordLastModTime
OwnerName
PermSpace
SpoolSpace
TempSpace
ProtectionType
JournalFlag
StartupString
DefaultAccount
DefaultDataBase
CommentString
DefaultCollation
PasswordChgDate
LockedDate
LockedTime
LockedCount
TimeZoneHour
TimeZoneMinute
DefaultDateForm
CreateTimeStamp
LastAlterName
LastAlterTimeStamp
DefaultCharType

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.Owners
• DBC.DBase
This view also references the userdb view.

Example
The following SELECT statement displays information about all users owned
or created by the current user, Jones.
==> SELECT UserName,CreatorName,PermSpace,SpoolSpace
FROM DBC.Users;

3 – 78 Teradata RDBMS Data Dictionary


Chapter 3: System Views: Usage and Examples
Users

UserName CreatorName PermSpace SpoolSpace

Jones sysadmin 1,000,000 1,000,000


Peterson Jones 100,000 1,000,000
Moffit Jones 100,000 1,000,000
Chin Jones 100,000 1,000,000
Greene Jones 100,000 1,000,000

Additional Information
See Teradata RDBMS Database Design for more information on controlling
access, space, and ownership.

Teradata RDBMS Data Dictionary 3 – 79


Chapter 3: System Views: Usage and Examples
User_Default_Journals[X]

User_Default_Journals[X]

The User_Default_Journals view provides information on user databases that


have a default journal specification.

View Name User Type Columns Selected

DBC.User_Default_Journals[X] End UserName


Journal_DB
JournalName

Corresponding system tables for this view include the following:


• DBC.AccessRights
• DBC.Owners
• DBC.DBase

Usage Notes
A journal table need not reside in the user space that it serves.

Example
The following SELECT statement selects information on each user database to
which the requesting user has access, and for which a default journal table is
defined.
==> SELECT * FROM DBC.User_Default_JournalsX;

UserName Journal_DB JournalName

Usr1 Usr1 Usr1Jrnl


Usr2 Usr2 Usr2Jrnl
Usr3 Usr3 Usr3Jrnl

3 – 80 Teradata RDBMS Data Dictionary


Chapter 4:

System Tables

The primary focus of this chapter is to provide a detailed listing of all the
fallback protected system tables of the Data Dictionary including: the columns
returned, the column data types, and the primary and secondary index
columns of each table.
In addition, this chapter explains the use of the DBC.ALL table, the TVM and
TVFields tables, describes the non-hashed non-fallback protected tables, stored
procedures, and briefly describes the ResUsage tables. For a detailed
description of the ResUsage tables, see Teradata RDBMS Resource Usage Macros
and Tables.

Teradata RDBMS Data Dictionary 4–1


Chapter 4: System Tables
Creating System Tables

Creating System Tables

The Data Dictionary System tables are generated during system initialization
(SysInit) and/or by the Table Initialization Program. They store information
about the DBC database that can be examined directly or through the system
views.

4–2 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Special Table Information

Special Table Information

DBC.ALL Table
The purpose of the DBC.ALL table is provide the user with a table name for a
zero table ID. This can occur when a GRANT is performed to give an access
right on a database without mention of a table. In this case, DBC.ALL will
appear as the table name.
It is necessary for the DBC.ALL table to exist to allow a join between the access
rights tables and the TVM table.

DBC.TVM Table
The DBC.TVM table contains one row for each table, view, trigger, stored
procedure, join index, or macro in the database.

DBC.TVFields Table
The DBC.TVFields table contains one row for each occurrence of the following
in every view and table in the database:
• Column, except when the view contains more than 51 columns
• Join index
• Macro
• Stored procedure

Stored Procedures
The information pertaining to a stored procedure object is stored in the
DBC.TVM, DBC.TVFields, DBC.AccessRights, and DBC.AccLogRulesTbl tables
of the DD.
The column, SPObjectCodeRows, in the DBC.TVM table references information
on the status of the stored procedure. The value of this column indicates the
following stored procedure creation-time attributes:
• Session mode
• Server platform
• Print option
• SPL text storage option
• Teradata Stored Procedure (TDSP) version number
The column SPParameterType in the DBC.TVFields table contains information
on the parameters of the stored procedure. Parameter types for this column
include IN, INOUT, or OUT.

Teradata RDBMS Data Dictionary 4–3


Chapter 4: System Tables
Special Table Information

The access rights of CREATE PROCEDURE, EXECUTE PROCEDURE, and


DROP PROCEDURE are stored in AccessRights. The corresponding logging
rules are stored in AccLogRuleTbl. These respective columns are called
AcrCreateProcedure, AcrExecuteProcedure, and AcrDropProcedure.
The Transient Journal (TJ) record holds the host request number for a stored
procedure, in addition to the DBS request number. This is required to return a
correct response to the “query status” for a request after DBS restarts.

ResUsage Tables
ResUsage tables store data that is gathered from specified data collection and
logging phases of Teradata RDBMS sub-systems. This data is then used by
ResUsage macros to provide resource usage statistics. User-written queries or
macros may also be used to generate reports from this data.
ResUsage tables, primarily of interest to NCR development, support, and field
engineers, are described in appendices of Teradata RDBMS Resource Usage
Macros and Tables.

4–4 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Non-Hashed Tables

Non-Hashed Tables

The following table lists and describes the non-hashed and NO FALLBACK
Data Dictionary Tables:

Non-Hashed, NO FALLBACK Tables Description

DBC.Acctg Resource usage by Acct/User

DBC.ChangedRowJournal Down -AMP recovery journal

DBC.DatabaseSpace Database and table space accounting

DBC.LocalSessionStatusTable Last request status by AMP

DBC.LocalTransactionStatusTable Last transaction consensus status

DBC.OrdSysChngTable AMP recovery journal

DBC.RecoveryLockTable Recovery session locks

DBC.RecoveryPJTable Permanent journal recovery

DBC.SavedTransactionStatus AMP recovery table

DBC.SysRcvStatJournal Recovery, reconfig, and startup info

DBC.TransientJournal Backout uncommitted transactions

DBC.UtilityLockJournalTable Host utility lock records

Only tables without suffixes are used by the RDBMS (for example,
DBC.AcccessRights; therefore, only tables without suffixes are covered in this
chapter.
Tables with suffixes (for example, DBC.AcccessRights_V2R2), are not used by
the RDBMS and are not covered in this chapter.

Teradata RDBMS Data Dictionary 4–5


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Data Dictionary FALLBACK Tables

The following table lists all of the FALLBACK protected tables of the system
DBC, except for the ResUsage tables that are explained in detail in the Teradata
RDBMS Resource Usage Macros and Tables book.
Unique Primary Indexes (UPIs), Non-Unique Primary Indexes (NUPIs),
Unique Secondary Indexes (USIs) and Non-Unique Secondary Indexes (NUSIs)
are indicated for each table.

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AccessRights UserId (NUPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Contains the DatabaseId (NUPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)
permissions for a TVM.DatabaseId
user.
TVMId (NUSI) TVM.TVMId BYTE(6), NOT NULL X(12)
TVFields.Tableid

FieldId TVFields.Fieldid SMALLINT, NOT ---,--9


NULL

AccessRight None CHAR (2), LATIN, X(2)


NOT NULL

WithGrant None CHAR (1), LATIN, X(1)


NOT NULL

GrantorId Dbase.Databaseid BYTE(4), NOT NULL X(8)

AllnessFlag None CHAR(1), LATIN, X(1)


NOT NULL

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

4–6 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AccLogRuleTbl UserId (UPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Controls the logging DatabaseId (UPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)
of access rights
checks for the TVMId (UPI) TVM.TVMId BYTE(6), NOT NULL X(12)
specified users or
ColumnId(UPI) TVFields.FieldId SMALLINT ---,--9
references to the
specified objects. AcrCheckPoint None CHAR(3), LATIN, X(3)
NOT CASE
SPECIFIC, NOT
NULL

AcrCreateDataBase None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateMacro None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateProcedure None CHAR(3), NULL X(3)

AcrCreateTable None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateUser None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateView None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDelete None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDropDatabase None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

Teradata RDBMS Data Dictionary 4–7


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AcclogRuleTbl AcrDropMacro None CHAR(3), LATIN, X(3)


(Continued) NOT CASE
SPECIFIC, NOT
NULL

AcrDropProcedure None CHAR(3), NULL X(3)

AcrDropTable None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDropUser None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDropView None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDump None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrExecute None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrExecuteProcedure None CHAR(3), NULL X(3)

AcrGrant None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrInsert None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrIndex None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrReference None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

4–8 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AccLogRuleTbl AcrRestore None CHAR(3), LATIN, X(3)


(Continued) NOT CASE
SPECIFIC, NOT
NULL

AcrSelect None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrUpdate None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateTrigger None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDropTrigger None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrCreateProcedure None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrDropProcedure None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

AcrExecuteProcedure None CHAR(3), LATIN, X(3)


NOT CASE
SPECIFIC, NOT
NULL

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

Teradata RDBMS Data Dictionary 4–9


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AccLogTbl LogonDate None DATE, NOT NULL YYYY/MM/


DD
Contains the result
of the logging LogonTime None FLOAT, NOT NULL 99:99:99
activity controlled
by the TheDate None DATE, NOT NULL YYYY/MM/
AccLogRuleTbl. DD

TheTime None FLOAT, NOT NULL 99:99:99

LogicalHostId None SMALLINT, NOT ZZZ9


NULL

IFPNo None SMALLINT, NOT -(5)9


NULL

SessionNo None INTEGER, NOT --,---,---,--9


NULL

UserId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

UserName Dbase.DatabaseName VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC, NOT
NULL

AccountName None VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC, NOT
NULL

Result None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL
SeqInHash None INTEGER, NOT --,---,---,--9
NULL

4 – 10 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.AccLogTbl AccessType None CHAR(2), LATIN, X(2)


(Continued) NOT CASESPECIFIC,
NOT NULL

Accesskind None BYTEINT, NOT --9


NULL

Frequency None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

EventCount None INTEGER --,---,---,--9

OwnerName Dbase.DatabaseName VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC,

DataBaseName Dbase.DatabaseName VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC, NOT
NULL

TVMName TVM.TVMName VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC,

ColumnName None VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC,

ObjectLevel None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

ObjectId Dbase.DatabaseId BYTE(4), NOT NULL X(8)


TVM.TVMId

ColumnId None SMALL INT ---,--9

StatementKind None SMALL INT ---,--9

StatementType None VARCHAR(20), X(20)


LATIN, NOT
CASESPECIFIC,

StatementText None VARCHAR(8192), X(8192)


UNICODE, NOT
CASE SPECIFIC

Teradata RDBMS Data Dictionary 4 – 11


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Acctg AccountName (UPI) None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
Contains a row for
NOT NULL
each account a user
owns on each AMP. UserName (UPI) Dbase.DatabaseName CHAR(30), LATIN, X(30)
NO FALLBACK NOT CASESPECIFIC,
NON-HASHED NOT NULL

CPU None FLOAT, NOT NULL ---,---,---,--9.99

IO None FLOAT, NOT NULL --,---,---,--9

Vproc None SMALLINT, NOT -(5)9


NULL

VprocType None CHAR(4), LATIN, X(4)


NOT CASESPECIFIC,
NOT NULL

Model None CHAR(4), LATIN, X(4)


NOT CASESPECIFIC,
NOT NULL

DBC.CollationTbl CollName (UPI) None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
Contains user-
NOT NULL
definable collation
definitions. CollInstall None CHAR(1), LATIN, X(1)
NOT CASESPECIFIC,
NOT NULL

CollEqvClass None BYTE(256), NOT X(512)


NULL

CollOrderCS None BYTE(256), NOT X(512)


NULL

CollOrderUC None BYTE(256), NOT X(512)


NULL

LastAccessTimeStamp None TIMESTAMP(0) yyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

4 – 12 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Constraint DatabaseId (NUPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Names
TableId (NUPI) TVM.TVMId BYTE(6), NOT NULL X(12)
Contains a row for
each named index or Name None CHAR(30), LATIN, X(30)
referential constraint NOT CASESPECIFIC,
defined on a table in NOT NULL
the system.
NameI None CHAR(30), LATIN, X(30)
UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

ConstraintType None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

IndexId None SMALLINT ---,--9

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.DatabaseSpace DatabaseId (UPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Does space
accounting for each
database and each
table in a database.
NO FALLBACK
NON-HASHED

Teradata RDBMS Data Dictionary 4 – 13


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Dbase DatabaseNameI (UPI) None CHAR(30), LATIN, X(30)


UPPERCASE, NOT
Contains a row for
CASESPECIFIC, NOT
each database in the
NULL
system.
DatabaseId (USI) Accounts.UserId BYTE(4), NOT NULL X(8)
Databasespace.
Databaseid
Accessrights.User
Id
Owners.ownerid
TVM.databaseId
ReferencingTbls.
ReferencingDbId
DBCAssociation.
DatabaseId
Owners.owneeid
ReferencedTbls.
ReferencedDbId
TableConstraints.
DbaseId
Triggerstbl.
DatabaseId

OwnerId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

PasswordString None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

ProtectionType None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

JournalFlag None CHAR(2), LATIN, X(2)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

PermSpace None FLOAT, NOT NULL ----,---,---,---,--9

SpoolSpace None FLOAT, NOT NULL ----,---,---,---,--9

StartupString None VARCHAR(255), X(255)


UNICODE, NOT
CASESPECIFIC

4 – 14 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Dbase CommentString None VARCHAR(255), X(255


(Continued) UNICODE, NOT
CASESPECIFIC

AccountName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

CreatorName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

DatabaseName RCEvent.Database CHAR(30), LATIN, X(30)


Name NOT CASESPECIFIC,
NOT NULL
AcclogTbl.User
Name

JournalId None BYTE(6) X(12)

Version None SMALLINT ---,--9

OwnerName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

NumFallBackTables None SMALLINT, NOT ---,--9


NULL

NumLogProtTables None SMALLINT, NOT ---,--9


NULL

DefaultDatabase Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

LogonRules None SMALLINT, NOT ---,--9


NULL

AccLogRules None SMALLINT, NOT ---,--9


NULL

AccLogUsrRules None SMALLINT, NOT ---,--9


NULL

DefaultCollation None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

RowType None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

PasswordChgDate None INTEGER --,---,---,--9

Teradata RDBMS Data Dictionary 4 – 15


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Dbase LockedDate None INTEGER --,---,---,--9


(Continued)
LockedTime None SMALLINT ---,--9

LockedCount None BYTEINT ---9

UnResolvedRICount None SMALLINT, NOT ---,--9


NULL

TimeZoneHour None BYTEINT ---9

TimeZoneMinute None BYTEINT ---9

DefaultDateForm None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) X(20)

LastAlterUID Dbase.DatabaseId BYTE(4) X(8)

LastAlterTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

TempSpace None FLOAT, NOT NULL ----,---,---,---,--9

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DefaultCharType None SMALLINT ---,--9

DBC.DBCAssociation TVMId (UPI) TVM.TVMId BYTE(6), NOT NULL X(12)


Contains the results DatabaseId Dbase.DatabaseId BYTE(4), NOT NULL X(8)
of the porting of a
data table between JournalId None BYTE(6) X(12)
DBCs by
EventNum None INTEGER, NOT --,---,---,--9
Archive/Recovery
NULL
software.
Original_Database None CHAR(30), LATIN, X(30)
Name NOT CASESPECIFIC,
NOT NULL

Original_DataBaseId None BYTE(4), NOT NULL X(12)

4 – 16 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.DBCAssociation Original_TVMNameI None CHAR(30), LATIN, X(30)


(Continued) UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Original_LogicalHost None SMALLINT ZZZ9


Id

Original_SessionNo None INTEGER --,---,---,--9

Original_TVMId None BYTE(6), NOT NULL X(12)

Original_TableKind None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Original_Protection None CHAR(1), LATIN, X(1)


Type UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Original_TempFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

Original_HashFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Original_NextIndexId None SMALLINT, NOT ---,--9


NULL

Original_NextFieldId None SMALLINT, NOT ---,--9


NULL

Original_Version None SMALLINT, NOT ---,--9


NULL

Original_RequestText None VARCHAR(12500), X(255)


UNICODE,
NOT CASESPECIFIC

Original_Comment None VARCHAR(255), X(255)


String UNICODE,
NOT CASESPECIFIC

Original_CreatorName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

Teradata RDBMS Data Dictionary 4 – 17


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.DBCAssociation Original_TVMName None CHAR(30), LATIN, X(30)


(Continued) NOT CASESPECIFIC,
NOT NULL

Original_JournalFlag None CHAR(2), LATIN, X(2)


NOT CASESPECIFIC,
NOT NULL

Original_JournalID None BYTE(6) X(12)

Original_UtilVersion None SMALLINT ---,--9

DBC.DBCInfoTbl InfoKey (UPI) None VARCHAR(30), X(30)


LATIN, NOT
Contains current
CASESPECIFIC, NOT
information such as,
NULL
the DBC version and
release. InfoData None VARCHAR(16384), X(16384)
LATIN, NOT
CASESPECIFIC

DBC.ErrorMsgs ErrorCode (UPI) None SMALLINT, NOT ---,--9


NULL
Stores all error
messages returned ErrorText None VARCHAR(255), X(255)
to the user. LATIN, NOT
CASESPECIFIC, NOT
NULL

4 – 18 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.EventLog DateFld (NUPI) None DATE, NOT NULL YYYY/MM/


DD
Contains a row for
every session event. TimeFld (NUPI) None FLOAT, NOT NULL 99:99:99.99

UserName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

AccountName Dbase.AccountName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

Event None CHAR(12), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

LogicalHostId None SMALLINT, NOT ZZZ9


NULL

IFPNo None SMALLINT, NOT -(5)9


NULL

SessionNo None INTEGER, NOT --,---,---,--9


NULL

LogonDate None DATE, NOT NULL YYYY/MM/


DD

LogonTime None FLOAT, NOT NULL 99:99:99.99

LogonSource None VARCHAR(128), X(128)


LATIN, NOT
CASESPECIFIC

DBC.Global Key (UPI) None CHAR(2), LATIN, X(2)


UPPERCASE, NOT
This table is only
CASESPECIFIC, NOT
used internally to
NULL
the DBC. It contains
information such as, Blob None VARBYTE(2048), X(4096)
whether logons to NOT NULL
the DBC are enabled
or disabled. This
table is used by
session control
during start up.

Teradata RDBMS Data Dictionary 4 – 19


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Hosts LogicalHostId (UPI) None SMALLINT, NOT ZZZ9


NULL
Contains one row
per host that defines HostName (USI) None CHAR(30), LATIN, X(30)
the default character NOT CASESPECIFIC,
set for that host. NOT NULL

DefaultCharSet None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

DBC.HW_Event_Log TheDate (NUPI) None DATE, NOT NULL YYYY/MM/


DD
This table contains
the information of TheTime (NUPI) None FLOAT 99:99:99.999999
system errors for
Teradata RDBMS Event_Tag None INTEGER, NOT Z99-99999-99
Field Engineers. NULL
Rows are inserted
Category None CHAR(1), LATIN, X(1)
by the system in
NOT CASESPECIFIC
response to
hardware error Severity None CHAR(1), LATIN, X(1)
conditions. NOT CASESPECIFIC

Primary_Part_Number None VARCHAR(11), X(11)


LATIN, NOT
CASESPECIFIC

Revision_Level None VARCHAR(2), X(2)


LATIN, NOT
CASESPECIFIC

Secondary_Part_Num None VARCHAR(11), X(1)


ber LATIN, NOT
CASESPECIFIC

Serial_Number None VARCHAR(10), X(10)


LATIN, NOT
CASESPECIFIC

PMA None INTEGER, NOT ZZ9-99


NULL

Module_Type None BYTEINT Z9

Slot None BYTEINT Z9

Slot_Type None BYTEINT Z9

Subslot None BYTEINT 9

Subslot_Type None BYTEINT 9

4 – 20 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.HW_Event_Log FW_Version None VARCHAR(11), X(11)


(Continued) LATIN, NOT
CASESPECIFIC

Vcc_Margin None VARCHAR(1), X(1)


LATIN, NOT
CASESPECIFIC

Frequency_Margin None VARCHAR(1), X(1)


LATIN, NOT
CASESPECIFIC

Vcc_Volts None DECIMAL(3,2) -9.99

Vcc_Amps None DECIMAL(4,2) -Z9.99

Temperature None DECIMAL(4,1) -ZZ9.9

Line None BYTEINT, NOT ZZ9


NULL

Text None VARCHAR(255) X(255)


LATIN, NOT
CASESPECIFIC

Error_Data None VARBYTE(128) X(256)

Teradata RDBMS Data Dictionary 4 – 21


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Indexes Table_Id (NUPI) TVM.TVMId BYTE(6), NOT NULL X(12)


Contains a row for Index_Type None CHAR(1), LATIN, X(1)
each column that is UPPERCASE,
an index.
NOT CASESPECIFIC,
NOT NULL

IndexNumber None SMALLINT, NOT ---,--9


NULL

UniqueFlag None CHAR(1), LATIN, X(1)


UPPERCASE,
NOT CASESPECIFIC,
NOT NULL

FieldId TVFields.FieldId SMALLINT, NOT ---,--9


NULL

FieldPosition None SMALLINT, NOT ---,--9


NULL

IndexMode None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC
For a unique index, the
value for IndexMode is
H (index is hashed).
For a nonunique index,
the value for
IndexMode is L (index
is local to the base
table - index rows are
on the same AMP as
the data they
reference).
For a primary index,
the value is NULL.

DatabaseId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

IndexStatistics None VARBYTE(16383) X(255)

4 – 22 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.Indexes Name None CHAR(30), LATIN, X(30)


(Continued) NOT CASESPECIFIC

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAlterUID Dbase.DatabaseId BYTE(4) X(8)

LastAlterTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.IndexName DatabaseId (UPI) None BYTE(4), NOT NULL X(8)


This table is unused. Name (UPI) None CHAR(30), LATIN, X(30)
NOT CASESPECIFIC,
NOT NULL

TableId None BYTE(6), NOT NULL X(12)

IndexNumber None SMALLINT, NOT ---,--9


NULL

DBC.InDoubtResLog LogicalHostId (NUPI) None SMALLINT, NOT ---,--9


NULL
Contains a row for
each transaction that SessionNumber None SMALLINT, NOT ---,--9
had been in doubt. (NUPI) NULL

CoordTaskId (NUPI) None VARBYTE(30), NOT X(60)


NULL

RunUnitId (NUPI) None VARBYTE(30), NOT X(60)


NULL

LogonUserName Dbase.DatabaseName VARCHAR(30), X(30)


LATIN, NOT
CASESPECIFIC, NOT
NULL

ResolvingUserLogon Dbase.DatabaseName VARCHAR(30), X(30)


Name LATIN, NOT
CASESPECIFIC, NOT
NULL

CommitOrRollback None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

Teradata RDBMS Data Dictionary 4 – 23


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.InDoubtResLog UserLogonDate None DATE, NOT NULL YYYY/MM/


(Continued) DD

UserLogonTime None FLOAT, NOT NULL 99:99:99

CompletionDate None DATE, NOT NULL YYYY/MM/


DD

CompletionTime None FLOAT, NOT NULL 99:99:99

Options None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

DBC.LogonRuleTbl UserId (UPI) Dbase.DatabaseId BYTE(4), NOT NULL X(12)


Indicates what users LogicalHostId (UPI) None SMALLINT, NOT ZZZ9
can legally logon NULL
from what host, and
whether a password LogonStatus None CHAR(1), LATIN, X(1)
is necessary. NOT CASESPECIFIC,
NOT NULL

NullPassWord None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.Migration Field1 (NUPI) None BYTEINT, NOT ---9


Internal table only. NULL

DBC.Next RowNum (UPI) None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
Contains the next
NOT NULL
internal identifiers
the DBC uses for DatabaseId None BYTE(4), NOT NULL X(8)
processing.
TableId None BYTE(4), NOT NULL X(8)

ProcsRowLoc None BYTE(4), NOT NULL X(8)

EventNum None BYTE(4), NOT NULL X(8)

LogonSequenceNo None BYTE(4), NOT NULL X(8)

TempTable None BYTE(4), NOT NULL X(8)

4 – 24 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.OldPasswords UserName (NUPI) Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
Contains a history of
NOT NULL
passwords used by a
user in the system. PasswordDate None INTEGER, NOT --,---,---,--9
NULL

PasswordSeed None BYTE(2), NOT NULL X(4)

PasswordString None BYTE(8), NOT NULL X(16)

DBC.Owners OwnerId (NUPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Shows information OwneeId Dbase.DatabaseId BYTE(4), NOT NULL X(8)
for each database in
the system. TVM.DatabaseId

DBC.Parents DbId Dbase.DatabaseId BYTE(4), NOT NULL X(8)


Represents the ParentId Dbase.DatabaseId BYTE(4), NOT NULL X(8)
parentage of for
each database in the
system. Is actually
the inverse of
Owners.

DBC.RCConfigu- EventNum (NUPI) RCEvent.EventNum INTEGER --,---,---,--9


ration
LogProcessor None SMALLINT -(5)9
Contains
information about PhyProcessor None SMALLINT ZZZZ9
the AMPs
ProcessorState None CHAR(1), LATIN, X(1)
configuration for an
NOT CASESPECIFIC,
event in the
NOT NULL
RCEvent table.
RestartSeqNum None SMALLINT ---,--9

Vproc None SMALLINT -(5)9

Teradata RDBMS Data Dictionary 4 – 25


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.RCEvent EventNum (NUPI) RCConfiguration. INTEGER, NOT --,---,---,--9


EventNum NULL
Contains a row for
each event executed RCMedia.Event
by the Host Utilities. Number

CreateDate None DATE, NOT NULL YYYY/MM/


DD

CreateTime None FLOAT, NOT NULL 99:99:99.99

EventType None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

UserName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

DatabaseName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

ObjectId None BYTE(4), NOT NULL X(8)

ObjectType None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

AllAmpsFlag None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

RestartSeqNum RCConfiguration. SMALLINT ---,--9


RestartSeqNum

TableName TVM.TVMName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

CheckPointName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

LinkingEventNum None INTEGER --,---,---,--9

OperationInProcess None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

DataSetName None CHAR(44), LATIN, X(44)


NOT CASESPECIFIC

LockMode None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

JournalUsed None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

4 – 26 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.RCEvent JournalSaved None CHAR(1), LATIN, X(1)


(Continued) NOT CASESPECIFIC

IndexPresent None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

DupeDumpSet RCMedia.Dupe CHAR(1), LATIN, X(1)


DumpSet NOT CASESPECIFIC

DBC.RCMedia EventNumber (NUPI) RCMediaEvent INTEGER, NOT --,---,---,--9


Number NULL
Contains
identification of VolSerialId None CHAR(6), LATIN, X(6)
storage media for NOT CASESPECIFIC,
events. NOT NULL

VolSequenceNum None SMALLINT ---,--9

DupeDumpSet None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

DBC.ReferencedTbls ReferencedDbID Dbase.DatabaseId BYTE(4), NOT NULL X(8)


(NUPI)
Contains
information about ReferencedTblID TVM.TVMId BYTE(6), NOT NULL X(12)
the parent table of a (NUPI)
referential TVFields.TableId
constraint. ReferenceIdx None SMALLINT, NOT ---,--9
NULL

ParentKeyFID TVFields.FieldId SMALLINT, NOT ---,--9


NULL

ReferencingDbID Dbase.DatabaseId BYTE(4), NOT NULL X(8)

ReferencingTblID TVM.TVMId BYTE(6), NOT NULL X(12)


TVFields.TableId

ForeignKeyFID TVFields.FieldId SMALLINT, NOT ---,--9


NULL

InconsistentFlag None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

ReferenceIdxName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

Teradata RDBMS Data Dictionary 4 – 27


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.ReferencedTbls LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


(Continued) hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.ReferencingTbls ReferencingDbID Dbase.DatabaseId BYTE(4), NOT NULL X(8)


(NUPI)
Contains
information about ReferencingTblID TVM.TVMId BYTE(6), NOT NULL X(12)
the child table of a (NUPI)
referential TVFields.TableId
constraint. ReferenceIdx None SMALLINT, NOT ---.--9
NULL

ForeignKeyFID TVFields.FieldId SMALLINT, NOT ---.--9


NULL

ReferencedDbID Dbase.DatabaseId BYTE(4), NOT NULL X(8)

ReferencedTblID TVM.TVMId BYTE(6), NOT NULL X(12)


TVMFields.TableId

ParentKeyFID TVfields.FieldId SMALLINT, NOT ---,--9


NULL

InconsistentFlag None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

ReferenceIdxName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.RepBatchStatus RSQualifier (UPI) None INTEGER, NOT --,---,---,--9


NULL
Internal table only.
BatchNum None BYTEINT, NOT --9
NULL

CompletionStatus None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

CommitSeqNumber None INTEGER --,---,---,--9

4 – 28 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.SessionTbl HostNo (UPI) TempTables.HostNo SMALLINT, NOT ---,--9


NULL
Contains current
user logon SessionNo (UPI) Temptables. INTEGER, NOT --,---,---,--9
information. SessionNo NULL

IFPNo None SMALLINT, NOT -(5)9


NULL

LogonDate None DATE, NOT NULL YYYY/MM/


DD

LogonTime None FLOAT, NOT NULL 99:99:99.99

LogonCollation None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

LogonDatabase Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

CurrentCollation None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

CurrentDatabase Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

UserName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

UserId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

AccountName Dbase.AccountName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

StartMBox None BYTE(10) X(20)

ContMBox None BYTE(10) X(20)

AbortMBox None BYTE(10) X(20)

Teradata RDBMS Data Dictionary 4 – 29


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.SessionTbl Partition None CHAR(16), LATIN, X(20)


(Continued) NOT CASESPECIFIC,

PartCode None BYTEINT --9

LogonSource None VARCHAR(128), X(128)


LATIN, NOT
CASESPECIFIC

LogonSequenceNo None BYTE(4) X(12)

LogicalHostId None SMALLINT, NOT ZZZ9


NULL

ConnectFunction None SMALLINT, NOT ---,--9


NULL

Options None CHAR(10), LATIN, X(10)


NOT CASESPECIFIC,
NOT NULL

ExpiredPassword None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

TimeZoneHour None BYTEINT ---9

TimeZoneMinute None BYTEINT ---9

CurrentDateForm None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

DefaultCharType None SMALLINT, NOT ---,--9


NULL

RepSesOverride None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

RFU None VARBYTE(1024) X(2056)

4 – 30 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.SW_Event_Log TheDate (NUPI) None DATE, NOT NULL YYYY/MM/


DD
This table contains
the information of TheTime (NUPI) None FLOAT, NOT NULL 99:99:99.999999
system errors for
Teradata RDBMS Event_Tag None INTEGER, NOT Z99-99999-99
Field Engineers. NULL
Rows are inserted
Category None BYTEINT Z9
by the system in
response to software Severity None SMALLINT ZZ9
error conditions.
PMA None INTEGER ZZ9-99

Vproc None INTEGER -(5)9

Partition None BYTEINT Z9

Task None SMALLINT ZZZZ9

Function None VARCHAR(32), X(32)


LATIN, NOT
CASESPECIFIC

SW_Version None VARCHAR(64), X(64)


LATIN, NOT
CASESPECIFIC

Line None BYTEINT, NOT ZZ9


NULL

Text None VARCHAR(255), X(255)


LATIN, NOT
CASESPECIFIC, NOT
NULL

Stacktrace None VARBYTE(320) X(640)

Error_Data None VARBYTE(256) X(512)

DBC.SysSecDefaults PrimeIndex (UPI) None BYTEINT, NOT --9


NULL
Provides system
default information. ExpirePassword None SMALLINT, NOT ---,--9
NULL

PasswordMinChar None BYTEINT, NOT --9


NULL

PasswordMaxChar None BYTEINT, NOT --9


NULL

Teradata RDBMS Data Dictionary 4 – 31


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.SysSecDefaults PasswordDigits None CHAR(1), LATIN, X(1)


(Continued) UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

PasswordSpecChar None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

MaxLogonAttempts None BYTEINT, NOT ---9


NULL

LockedUserExpire None SMALLINT, NOT ---,--9


NULL

PasswordReuse None SMALLINT, NOT ---,--9


NULL

DBC.TableConstraints TVMId (NUPI) TVM.TVMId BYTE(6), NOT NULL X(12)


Contains a row for Name None CHAR(30), LATIN, X(30)
each table-level NOT CASESPECIFIC
constraint defined in
the system. DBaseId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

TableCheck None VARCHAR(8192), X(255)


LATIN,
CASESPECIFIC

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

DBC.TempStatistics HostNo (NUPI) None SMALLINT, NOT ---,--9


NULL
Contains statistical
information SessionNo (NUPI) SessionTbl.SessionNo INTEGER, NOT --,---,---,--9
collected on a NULL
materialized
temporary table in BaseDbId Dbase.DatabaseId BYTE(4), NOT NULL X(8)
the system.
BaseTableId TVM.TVMId BYTE(6), NOT NULL X(12)

TableId TVM.TVMId BYTE(6), NOT NULL X(12)

StatId None SMALLINT, NOT ---,--9


NULL

StatInfo None VARBYTE(16383) X(255)

4 – 32 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TempTables HostNo (NUPI) SessionTbl.HostNo SMALLINT, NOT ---,--9


NULL
Contains a row for
each materialized SessionNo (NUPI) SessionTbl.SessionNo INTEGER, NOT --,---,---,--9
temporary table in NULL
the system.
TableId TVM.TVMId BYTE(6), NOT NULL X(12)

BaseDbId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

BaseTableId TVM.TVMId BYTE(6), NOT NULL X(12)

AccountDbId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

StatisticsCnt None SMALLINT, NOT ---,--9


NULL

DBC.TextTbl TextId (NUPI) None BYTE(6), NOT NULL X(12)


For internal use only
TextType (NUPI) None CHAR(1), LATIN, X(1)
NOT CASESPECIFIC,
NOT NULL

LineNo None SMALLINT, NOT ---,--9


NULL

TextString None VARCHAR(32000), X(255)


UNICODE, NOT
CASESPECIFIC, NOT
NULL

DBC.Translation TranslateName (UPI) None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
Contains
NOT NULL
information about
the character TranslateID (USI) None BYTEINT, NOT ZZ9
translation tables NULL
used.
Install None CHAR(1), LATIN, X(1)
UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

TranslateIn None BYTE(256), NOT X(512)


NULL

TranslateInUp None BYTE(256), NOT X(512)


NULL

TranslateOut None BYTE(256), NOT X(512)


NULL

TranslateOutUp None BYTE(256), NOT X(512)


NULL

Teradata RDBMS Data Dictionary 4 – 33


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TriggersTbl TableId (NUPI) TVM.TVMId BYTE(6), NOT NULL X(12)


Contains a row for TriggerId (NUSI) TVM.TVMId BYTE(6), NOT NULL X(12)
each trigger in the
system. DatabaseID Dbase.DatabaseId BYTE(4), NOT NULL X(8)

TriggerName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

TriggerEnabled None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

ActionTime None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

TriggerEvent None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Kind None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

TriggerOrder None SMALLINT ---,--9

CommentString None VARCHAR(255), X(255)


UNICODE, NOT
CASESPECIFIC

CreateText None VARCHAR(20480), X(255)


LATIN, NOT
CASESPECIFIC, NOT
NULL

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP (0) yyyy-mm-dd


hh:mm:ss

LastAlterUID Dbase.DatabaseId BYTE(4) X(8)

LastAlterTimeStamp None TIMESTAMP (0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP (0) yyyy-mm-dd


hh:mm:ss

4 – 34 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TriggersTbl AccessCount None INTEGER --,---,---,--9


(Continued)

DBC.TVFields TableId (NUPI) Accessrights.TVMId BYTE(6), NOT NULL X(12)


Contains a row for ReferencingTbls.
each column of ReferencingTblId
every table and
ReferencedTbls.
view, except when
ReferencedTblId
the view has more
than 51 columns. TVM.TVMId

FieldName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

FieldId (USI) Accessrights.FieldId SMALLINT, NOT ---,--9


NULL
ReferencingTbls.
ForeignKeyFID
ReferencedTbls.
ParentKeyFID
Indexes.FieldId

Nullable None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

FieldType None CHAR(2), LATIN, X(2)


UPPERCASE, NOT
CASESPECIFIC

MaxLength None INTEGER --,---,---,--9

DefaultValue None VARCHAR(1024), X(1024)


UNICODE, NOT
CASESPECIFIC

DefaultValueI None VARCHAR(1024) X(1024)

TotalDigits None SMALLINT ---,--9

ImpliedPoint None SMALLINT ---,--9

FieldFormat None CHAR(30), X(30)


UNICODE, NOT
CASESPECIFIC

FieldTitle None VARCHAR(60), X(60)


UNICODE, NOT
CASESPECIFIC

Teradata RDBMS Data Dictionary 4 – 35


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TVFields CommentString None VARCHAR(255), X(255)


(Continued) UNICODE, NOT
CASESPECIFIC

CollationFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

UpperCaseFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC

DatabaseId Dbase.DatabaseId BYTE(4), NOT NULL X(8)

Compressible None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC

CompressValue None VARCHAR(255), X(255)


UNICODE, NOT
CASESPECIFIC

FieldStatistics None VARBYTE(16383) X(55)

ColumnCheck None VARCHAR(8192), X(255)


LATIN, NOT
CASESPECIFIC

CheckCount None SMALLINT, NOT ---,--9


NULL

CreateUID Dbase.DatabaseId BYTE(4), NOT NULL X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAlterUID Dbase.DatabaseId BYTE(4) X(8)

LastAlterTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAccessTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

CharType None SMALLINT ---,--9

SPParameterType None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

4 – 36 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TVM DatabaseId (UPI) Accessrights. BYTE(4), NOT NULL X(8)


DatabaseId
Contains a row for
each table, view, Owners.owneeId
macro, trigger, join
Dbase.DatabaseId
index, hash index,
or procedure in the TVMNameI (UPI) None CHAR(30), LATIN, X(30)
system. UPPERCASE,
NOT CASESPECIFIC,
NOT NULL

Logical HostId None SMALLINT ZZZ9

SessionNo None INTEGER --,---,---,--9

TVMId (USI) AccLogRuleTbl. BYTE(6), NOT NULL X(12)


TVMId
DatabaseSpace.
tableId
Accessrights.TVMId
Temptables.Base
TableId
ReferencingTbls.
ReferencingTblId
ReferencedTbls.
ReferencedTblId
DBCAssociation.
TVMId
TVFields.TableId
Dbase.JournalId
Indexes.TableId
Tableconstraints.
TVMId

TableKind None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

ProtectionType None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Teradata RDBMS Data Dictionary 4 – 37


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TVM TempFlag None CHAR(1), LATIN, X(1)


(Continued) UPPERCASE, NOT
CASESPECIFIC

HashFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

NextIndexId None SMALLINT, NOT ---,--9


NULL

NextFieIdId None SMALLINT, NOT ---,--9


NULL

Version None SMALLINT, NOT ---,--9


NULL

RequestText None VARCHAR(12500), X(255)


UNICODE, NOT
CASESPECIFIC

CreateText None VARCHAR(26000), X(255)


UNICODE, NOT
CASESPECIFIC

CommentString None VARCHAR(255), X(255)


UNICODE, NOT
CASESPECIFIC

CreatorName Dbase.DatabaseName CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

TVMName (NUSI) None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC,
NOT NULL

JournalFlag None CHAR(2), LATIN, X(2)


NOT CASESPECIFIC,
NOT NULL
JournalId None BYTE(6) X(12)

UtilVersion None SMALLINT ---,--9

AccLogRules None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

ColumnAccRules None CHAR(1), LATIN, X(1)


NOT CASESPECIFIC,
NOT NULL

4 – 38 Teradata RDBMS Data Dictionary


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TVM CheckOpt None CHAR(1), LATIN, X(1)


(Continued) UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

ParentCount None SMALLINT, NOT ---,--9


NULL

ChildCount None SMALLINT, NOT ---,--9


NULL

NamedTblCheckCount None SMALLINT, NOT ---,--9


NULL

UnnamedTblCheckExist None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

PrimaryKeyIndexId None SMALLINT ---,--9

CreateUID Dbase.DatabaseId BYTE(4) X(8)

CreateTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

LastAlterUID Dbase.DatabaseId BYTE(4) X(8)

LastAlterTimeStamp None TIMESTAMP(0) yyyy-mm-dd


hh:mm:ss

AccessCount None INTEGER --,---,---,--9

SPObjectCodeRows None SMALLINT, NOT ---,--9


NULL

RSGroupID None SMALLINT ---,--9

DirtyFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

XactionFlag None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

TblRole None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

Teradata RDBMS Data Dictionary 4 – 39


Chapter 4: System Tables
Data Dictionary FALLBACK Tables

Table Name and


Columns Referenced Column(s) Data Type Default Format
Description

DBC.TVM TblStatus None CHAR(1), LATIN, X(1)


(Continued) UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

RequestTxtOverflow None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

CreateTextOverflow None CHAR(1), LATIN, X(1)


UPPERCASE, NOT
CASESPECIFIC, NOT
NULL

DBC.UnResolved DatabaseID (NUPI) Dbase.DatabaseId BYTE(4), NOT NULL X(8)


References
ParentTblName TVM.TVMNameI CHAR(30), LATIN, X(30)
Contains (NUPI) UPPERCASE, NOT
information about CASESPECIFIC, NOT
all the unresolved NULL
referential
constraints that UserID Dbase.DatabaseId BYTE(4), NOT NULL X(8)
currently exist in the
ReferenceIdx None SMALLINT, NOT ---,--9
system.
NULL

ChildTblID TVM.TVMId BYTE(6), NOT NULL X(12)

ForeignKeyFID None SMALLINT, NOT ---,--9


NULL

FKPosition None SMALLINT, NOT ---,--9


NULL

ParentKeyName None CHAR(30), LATIN, X(30)


UPPERCASE, NOT
CASESPECIFIC

ReferenceIdxName None CHAR(30), LATIN, X(30)


NOT CASESPECIFIC

4 – 40 Teradata RDBMS Data Dictionary


Chapter 5:

Macros

In order to load macros and other views, specific SQL scripts must be executed
using the DIP utility. Examples of these include the DIPSYSFE utility for SQL
scripts for System FE Macros and the DIPRUM utility for SQL scripts for
ResUsage macros.
In order to load all the views, tables, and macros, the DIPALL script must be
run.
This chapter contains information about the following system macros:
• TwoPCRule macro
• ResUsage macros
• DIPVIEW macros
The following macros are not covered in this manual:

For more information, see the


Macro(s) Purpose
publication entitled ...

SystemFE Track system health • Teradata RDBMS SystemFE


Macros

AccLogRule Enables access logging • Teradata RDBMS Database


Administration
• Teradata RDBMS Security
Administration

Query Capture Mostly used with • Teradata RDBMS Database


VEComp application Design

ECompare Mostly used with • Teradata RDBMS Database


VEComp application Design

Teradata RDBMS Data Dictionary 5–1


Chapter 5: Macros
TwoPCRule Macro

TwoPCRule Macro

The TwoPCRule is an empty macro. Its purpose is to determine the privilege


the user holds.

Creating the TwoPCRule Macro


You use the following CREATE statement for this macro:
CREATE MACRO DBC.TwoPCRule AS (;);

TwoPCRule and the Resolver Base Module


If the user has the EXECUTE privilege on this macro, the system allows him to
logon to the Resolver Base Module.
Without the privilege, the user cannot logon to the module.

Resolving Indoubt Transactions


You must have the EXECUTE privilege on this macro to use the Resolver Base
Module to resolve indoubt transactions.
To resolve indoubt transactions, the TDP must have access to
DBC.InDoubtResLog, and must be allowed to logon to the Resolver Base
Module. The following SQL statements define a TDP userid and attributes, and
establish the necessary privileges for the access and logon:
CREATE USER TDPUSER
AS PERM=0 PASSWORD=passwd ACCOUNT=’$H’;
GRANT LOGON ON ALL TO TDPUSER WITH NULL PASSWORD;
GRANT SELECT, DELETE ON DBC.InDoubtLog TO TDPUSER;
GRANT EXECUTE ON DBC.TwoPCRule TO TDPUSER;

Note: The TDP userid in the preceding CREATE and GRANT statements can
be changed with the INITIAL USER clause in the TDP parameter dataset.

Note: The CREATE USER statement for the TDP userid must include the
ACCOUNT=$H priority attribute.

5–2 Teradata RDBMS Data Dictionary


Chapter 5: Macros
ResUsage Macros

ResUsage Macros

Like other Teradata RDBMS macros, ResUsage macros consist of one or more
Teradata Structured Query Language (SQL) statements stored in the Teradata
RDBMS and executed by a single EXECUTE statement.

Usage Notes
ResUsage macros allow you to analyze key operational statistics, ResUsage
data, that you can use to evaluate the performance of your system. You must
have the EXECUTE privilege to use this macro.
In addition to the name of the macro, the EXECUTE statement for ResUsage
macros can include optional parameters to specify the following:
• Starting and ending dates and times
• Starting and ending nodes of a range of nodes
• A specific single node

Example
The following statement executes the ResCPUByAMP macro, producing a
report for the period beginning 8:00 a.m. on December 25, 1997, and ending
12:00 p.m., midnight, on December 31, 1997. It includes data for nodes 123-02
through 125-04.
EXECUTE ResCPUByAmp('1997-12-25', '1997-12-31', '08:00:00',
'24:00:00', '123-02', '125-04');
where:

Statement Element … Description

ResCPUByAmp Name of the ResUsage macro

‘1997-12-25’ Starting date of December 25, 1997

‘1997-12-31‘ Ending date of December 31, 1997

080000 Starting time of 8:00 a.m.

240000 Ending time of 12:00 midnight

'123-02' Starting node of a range of nodes

'125-04' Ending node of a range of nodes

For More Information


See Teradata RDBMS Resource Usage Macros and Tables for information on using
these macros.

Teradata RDBMS Data Dictionary 5–3


Chapter 5: Macros
DIPVIEW Macros

DIPVIEW Macros

The DIPVIEW script contains several macros, including the following:

Macro Name Function

ARC_NonEmpty_List Returns the names of the databases or users, owned by the


indicated database, that contain the specified objects.

ClearAccounting Resets the CPU and IO columns of the DBC.Acctg table.

ClearPeakDisk Resets the PEAKPERM, PEAKSPOOL, and PEAKTEMP


columns for the DISKSPACE information.

CollAddStandard Defines the standard collation sequences supplied with


the Teradata RDBMS and places them into the
DBC.CollationTbl.

CollInstallMulti Allows database administration to install an


NCR-supplied standard collation (Swedish or Norwegian)
or a user-defined collation from the DBC.CollationTbl
as the definition for Multinational collation.

DIPMarkNSIO Acts as a release marker to indicate a valid dictionary.

LogonRule Allows database administrator to determine who has


execute privileges for the GRANT/REVOKE LOGON
statements.

This section provides a brief description of each of the above macros including
any necessary parameters. If you need to see the macro itself, refer to the
DIPVIEW script.

ARC_NonEmpty_List Macro
This macro returns the names of the databases or users, owned by the indicated
database, that contain the specified objects.

5–4 Teradata RDBMS Data Dictionary


Chapter 5: Macros
DIPVIEW Macros

This macro uses the following parameter:

Parameter Description

ParentDb This parameter is the name of the database containing the objects
returned by this macro.
TKinds (VARCHAR(100), UPPERCASE) )
This parameter indicates the types of tables returned.
The possible values include the following:

Value Meaning

T Table

V View

M Macro

J Journal

I Join Index

P Stored Procedure

G Trigger

Usage Notes
Although this macro is designed for the person responsible for archiving data,
its access rights are PUBLIC.
The macro can return database names for which the executing user does not
have access rights.

Example
The following statement returns the names of the tables, journals, join indexes,
views, and macros in the NewEmp2 database:
EXEC DBC.ARC_NonEmpty_List (NewEmp2, ‘TJIVM’);

ClearAccounting Macro
This macro resets the CPU and IO columns of the DBC.Acctg table.

Usage Notes
This macro resets resource usage counters back to zero.

Teradata RDBMS Data Dictionary 5–5


Chapter 5: Macros
DIPVIEW Macros

Examples
The following example shows the definition of the ClearAccounting macro:
REPLACE MACRO DBC.ClearAccounting
AS ( UPDATE Acctg SET CPU = 0, IO = 0 ALL;
UPDATE Acctg SET CPU = 0, IO = 0 ALL; );
The following scenarios illustrate how the ClearAccounting macro can be used:

1 A systems administrator uses the CPU usage information in DBC.Acctg to


bill users every month. At the beginning of each month, the systems
administrator runs ClearAccounting to reset the resource usage counters
back to zero.

2 A person diagnosing system performance problems needs to look at


DBC.Acctg when certain jobs are run. He first runs ClearAccounting to
reset the resource usage counters.

ClearPeakDisk Macro
This macro resets to zero the following columns of the DISKSPACE
information:
• PEAKPERM
• PEAKSPOOL
• PEAKTEMP

Usage Notes
You are able to determine the maximum amount of permanent space, the
maximum amount of spool space, and the maximum amount of temporary
space used at any one time by the database for a specified AMP (or all AMPs if
the SUM aggregate is specified) since the last time the ClearPeakDisk macro
was run.

Example
To run the ClearPeakDisk macro, issue the following:
EXEC DBC.ClearPeakDisk();

CollAddStandard Macro
This macro defines the standard collation sequences supplied with the Teradata
RDBMS and places them into the DBC.CollationTbl.

Usage
If the existing standard collations in the DBC.TranslationTbl have been
corrupted or removed, this macro replaces them. Also, when we provide
additional standard collations, you can add them using this macro.

5–6 Teradata RDBMS Data Dictionary


Chapter 5: Macros
DIPVIEW Macros

Example
The following macro places the supplied collations into DBC.CollationTbl:
EXEC DBC.CollAddStandard();

CollInstallMulti Macro
This macro installs an NCR-supplied standard collation or a user-defined
collation from the DBC.CollationTbl as the definition for Multinational
collation.
This macro has the following parameter.

Parameter Description

CollationName The CollationName parameter identifies the


collation defined in the DBC.CollationTbl.
Data type is CHAR.
FORMAT is ‘X(30)’.

Usage Notes
The name assigned to the collation can be any valid name except
“MULTINATIONAL.”
To install the supplied standard collation, you must run the macro
DBC.CollAddStandard before you run the CollInstallMulti macro.

You must run this macro before any users have logged onto the system. The
redefinition of Multinational collation takes effect after a full Teradata RDBMS
restart.

Example
The following statement redefines the Multinational collation sequence as the
SWEDISH_STANDARD collation:
EXEC DBC.CollInstallMulti (‘SWEDISH_STANDARD’);
This next statement redefines the Multinational collation sequence as the
user-defined collation, “MULTINATIONAL_USER”:
EXEC CollInstallMulti (‘MULTINATIONAL_USER’);

DIPMarkNS10 Macro
The DIPMarkNS10 macro is an empty, parameterless macro in database DBC
which acts as a release marker to indicate a valid dictionary.
The Teradata RDBMS uses the presence or absence of this macro to determine
whether a conversion originates from an NCR System 3600 or DBC/1012 to the
Teradata RDBMS.

Teradata RDBMS Data Dictionary 5–7


Chapter 5: Macros
DIPVIEW Macros

Usage Notes
When you restore database DBC from an NCR System 3600 or DBC/1012 to the
Teradata RDBMS, the DIPMarkNS10 macro is deleted before the conversion
begins and is recreated at the end of the conversion process.
If the conversion was not successful, the macro is not created, and you see a
message instructing you to run the necessary conversion script.

LogonRule Macro
This macro determines who has execute privileges for the GRANT/REVOKE
LOGON statements.
When database administration grants the execute privilege on this macro to a
user, that user can then use the GRANT/REVOKE logon statements.
See Teradata RDBMS Security Administration for complete information on using
this macro.

5–8 Teradata RDBMS Data Dictionary


Chapter 5: Macros
DIPVIEW Macros

For More Information

Many additional macros exist for determining system efficiency. These resource
usage macros are described in Teradata RDBMS Resource Usage Macros and
Tables.

Teradata RDBMS Data Dictionary 5–9


Chapter 5: Macros
DIPVIEW Macros

5 – 10 Teradata RDBMS Data Dictionary


Index
AcrUpdate column 2–27
A
ActionTime column 2–27
ABORT SESSION command, PM Administrator views 1–10, 1–11
DBC.sw_event_log table 1–18 ALL
Access special database name in system views 1–14
auditing, DBC.AccLogRule macro 1–9 All_RI_Children view 2–6, 3–14
AccessLog view 2–4, 3–2 All_RI_Parents view 2–7, 3–15
AccessRight column 2–22 AllAMPsFlag column 2–27
AccessRights table 4–6 AllnessFlag column 2–27
AccLogRule table 4–7 AllRights view 2–6, 3–8
AccLogRules view 2–5, 3–4 AllSpace view 2–6, 3–10
AccLogTbl table 4–10, 4–11 AllTempTables view 2–6, 3–12
Account String Expansion AMP usage view 1–21
using to measure SQL 1–23 AmpUsage view 2–7, 3–16
AccountInfo view 2–5, 3–7 ARC_NonEmpty_List macro 5–4
Accounting Association view 2–7, 3–17
system views used for 1–21, 1–22
AccountName column 2–24
Acctg 4–5
Acctg table 4–5, 4–12 B
AcessLogRule table 4–9
AcrCheckPoint column 2–24 B_DatabaseName column 2–27
AcrCreate Trigger column 2–24 B_TableName column 2–27
AcrCreateDatabase column 2–24 BTEQ
AcrCreateMacro column 2–24 script
using to archive data 1–23
AcrCreateProcedure column 2–24
AcrCreateTable column 2–24
AcrCreateUser column 2–25
AcrCreateView column 2–25
C
AcrDelete column 2–25
AcrDropDatabase column 2–25 Category column 2–28
AcrDropMacro column 2–25 ChangedRowJournal table 4–5
AcrDropProcedure column 2–25 CharSetName column 2–28
AcrDropTable column 2–25 CharSets view 2–7, 3–19
AcrDropTrigger column 2–25 CharTranslations view 2–8, 3–20
AcrDropUser column 2–25 CharType column 2–28
AcrDropView column 2–26 CheckName column 2–29
AcrDump column 2–26 CheckpointName column 2–29
AcrExecute column 2–26 Child column 2–29
AcrExecute Procedure column 2–26 ChildCount column 2–29
AcrExecuteProcedure column 2–26 ChildDb column 2–29
AcrGrant column 2–26 ChildDbId column 2–29
AcrIndex column 2–26 ChildKeyColumn column 2–29
AcrInsert column 2–26 ChildKeyFID column 2–29
AcrReference column 2–26 Children view 2–8, 3–22
AcrRestore column 2–26 ChildTable column 2–29
AcrSelect column 2–26 ChildTID column 2–29

Teradata RDBMS Data Dictionary Index –1


Index

ClearAccounting macro 5–5


D
ClearPeakDisk macro 5–4, 5–6
ColCheck column 2–29 Data Dictionary
CollAddStandard macro 5–4, 5–6 columns. See alphabetical list and definitions,
Collations view 2–8, 3–23 Table 2-1
COMMENT statement 1–16
CollationTbl table 4–12
defined 1–2
CollEqvClass column 2–29
definition of 1–2
CollInstall column 2–30
generating tables for 4–2
CollInstallMulti macro 5–4, 5–7
HELP 1–16
CollName column 2–30
keywords 1–14
CollOrderCS column 2–30
organization of 1–5
CollOrderUC column 2–30 query, view 1–16
ColumnConstraint column 2–30 system use of 1–4
ColumnFormat column 2–30 system views, access to 1–14
ColumnId column 2–30 Teradata DBS and 1–4
ColumnLength column 2–30 update 1–3
ColumnName column 2–31 updating 1–3
ColumnPosition column 2–31 users, types of 2–2
Columns views
system views, table of 2–1 end user 1–12, 2–2
Columns view 2–9, 3–24 Field Engineer 1–8
ColumnStats view 2–9, 3–26 for resource usage 1–20
ColumnTitle column 2–31 operation and recovery control 1–11
operations control 2–2
ColumnType column 2–32
security administrator 1–9, 2–2
COMMENT Security Logging 1–8
query a Data Dictionary view 1–16 special users 1–8
COMMENT ON supervisory user 1–12, 2–2
system views 1–16 SYSADMIN 1–8
CommentString column 2–33 system administrator 2–2
CommitOrRollback column 2–33 SYSTEMFE 1–8
table distribution 1–20
CompletionDate column 2–33
Teradata administrator 1–10
CompletionTime column 2–33
X suffix, system views 1–7
Compressible column 2–33
Data Dictionary tables, affected by PM
CompressValue column 2–33
DBC.AccessRights 1–18
Constraint Names table 4–13
DBC.Dbase 1–18
ConstraintCount column 2–33
DBC.SessionTbl 1–18
ConstraintName column 2–33 DBC.sw_event_log 1–18
ConstraintText column 2–33 Data Dictionary views, affected by PM
CoordTaskId column 2–33 AllRights 1–18
CpuTime column 2–33 AllSpace(X) 1–18
CreateDate column 2–34 Databases(X) 1–18
CreateTime column 2–34 DiskSpace(X) 1–18
CreateTimeStamp column 2–34 LogOnOff 1–18
CreatorName column 2–35 SessionInfo 1–18
CSPSessionInfo view 2–9 Software_Event_Log 1–18
CurrentCollation column 2–35 UserGrantedRights 1–18
CurrentPerm column 2–35 UserRights 1–18
CurrentSpool column 2–35 Database Query Manager 2–42, 2–64, 3–66
CurrentTemp column 2–35 Database_ Default_Journals view 2–10
Database_Default_Journals view 3–30
DatabaseId column 2–36

Index –2 Teradata RDBMS Data Dictionary


Index

DatabaseName column 2–36


E
Databases view 2–10, 3–26, 3–28, 3–47
Databases2 view 2–10, 3–29 e 4–40
DataBaseSpace 4–5 E_TableId column 2–40
DatabaseSpace table 4–13 E2I column 2–40
DataSetName column 2–37 E2IUp column 2–40
Dbase table 4–14 EnabledFlag column 2–40
DBC.AccountInfo view 2–3 End user views 1–12
DBC.Acctg system table Error_Data column 2–40
impact of system restart 1–22 ErrorMsgs table 4–18
view for 1–21 Event column 2–41
DBC.ALL table Event_Tag column 2–42
purpose of 4–3 EventCount column 2–41
DBC.AMPUsage 1–21 EventLog table 4–19
DBC.Fields table EventNum column 2–41
use of 4–3 Events view 2–12, 3–37
DBC.SessionTbl table Events_Configuration view 2–12, 3–39
logging 1–18 Events_Media view 2–12, 3–41
DBC.sw_event_log table EventType column 2–42
logging system events ExpiredPassword column 2–43
ABORT SESSION 1–18 ExpirePassword column 2–43
SET RESOURCE 1–18
SET SESSION 1–18
DBC.TVM table
use of 4–3
F
DBCAssociation table 4–16, 4–17
DBCInfo view 2–11, 3–31 Fields. See Data Dictionary, columns
DBCInfoTbl table 4–18 Frequency column 2–43
DBKind column 2–37 Frequency_Margin column 2–43
DBQM 2–42, 2–48, 2–64, 3–66 Function column 2–43
DecimalFractionalDigits column 2–38 FW_Version column 2–43
DecimalTotalDigits column 2–38
DEFAULT
special database name in system views 1–14
DefaultAccount column 2–38 G
DefaultCharSet column 2–38
Global table 4–19
DefaultCharType column 2–38
GRANT privilege 1–6
DefaultCollation column 2–38
GrantAuthority column 2–44
DefaultDataBase column 2–39
Grantee column 2–44
DefaultDateForm column 2–39
GrantorName column 2–44
DefaultValue column 2–39
DeleteAccessLog view 2–11, 3–32
DeleteOldInDoubt view 2–11, 3–33
DIP utility 1–6, 5–1
H
DIPMarkNS10 macro 5–7
DIPMarkNSIO macro 5–4 Hardware_Event_Log view 2–13, 3–43
DiskIO column 2–39 Hash index 4–37
DiskSpace view 2–11, 3–34 HELP
DupeDumpSet column 2–39 system views 1–16
HELP statement 3–1
querying with 1–16
HostName column 2–44

Teradata RDBMS Data Dictionary Index –3


Index

Hosts table 4–20


L
HostsInfo view 2–13, 3–44
HW_Event_Log table 4–20 LastAlterName column 2–48
LastAlterTimeStamp column 2–48
Line column 2–48
LinkingEventNum column 2–48
I LocalSessionStatusTable 4–5
LocalTransactionStatusTable 4–5
I2E column 2–44
LockedCount column 2–48
I2EU column 2–44
LockedDate column 2–48
IFPNo column 2–44
LockedTime column 2–49
Indexes table 4–22
LockedUserExpire column 2–49
IndexId column 2–45
LockMode column 2–49
IndexName column 2–45
LogDate column 2–49
IndexName table 4–23
LogicalHostId column 2–49, 2–50
IndexNumber column 2–45
Logon rules
IndexPresent column 2–45
tracking 1–26
IndexStats view 2–13, 3–47
LogonDate column 2–50
IndexType column 2–46 LogOnOff view 2–14, 3–51
Indices view 2–14, 3–45 LogonRule macro 5–4, 5–8
Indoubt transactions LogonRules view 2–15, 3–53
resolving and TwoPCRule macro 5–2
LogonRuleTbl table 4–24
InDoubtLog view 2–14, 3–49
LogonSequenceNo column 2–50
InDoubtResLog table 4–23
LogonSource column 2–51
InfoData column 2–46
channel-attached values 2–51
InfoKey column 2–46 example with LogOnOff view 3–51
InstallFlag column 2–46 example with SessionInfo view 3–63
internal session values 2–51
network-attached values 2–51
LogonSource column, affected by PM
J DBC.SessionTbl table 1–18
Journal_DB column 2–46 DBC.sw_event_log table 1–18
JournalFlag column 2–47 LogonStatus column 2–52
JournalName column 2–47 LogonTime column 2–52
Journals view 2–14, 3–50 LogonUserName column 2–52
Journals_DB column 2–47 LogProcessor column 2–52
JournalSaved column 2–47 LogTime column 2–52
JournalUsed column 2–47 LogType column 2–52

K M

Keywords Macro
special Data Dictionary DBC.AccLogRule
ALL 1–14 auditing access 1–9
DEFAULT 1–14 Macros
PUBLIC 1–14 ARC_NonEmpty_List 5–4
Kind column 2–47 ClearAccounting 5–5
ClearPeakDisk 5–6
CollAddStandard 5–6
CollInstallMulti 5–7

Index –4 Teradata RDBMS Data Dictionary


Index

defined 5–3 ParentKeyColumn column 2–56


DIPMarkNS10 5–7 ParentKeyFID column 2–56
LogonRule 5–8 Parents table 4–25
TwoPCRule 5–2 ParentTable column 2–56
MaxLogonAttempts column 2–52 ParentTID column 2–56
MaxPerm column 2–53 Partition column 2–56
MaxSpool column 2–53 PasswordChgDate column 2–56
MaxTemp column 2–53 PasswordDigits column 2–56
Migration table 4–24 PasswordLastModDate column 2–57
Model column 2–53 PasswordLastModTime column 2–57
Module_Type column 2–53 PasswordMaxChar column 2–57
MONITOR option PasswordMinChar column 2–57
SELECT queries 1–19 PasswordReuse column 2–57
PasswordSpecChar column 2–57
PeakPerm column 2–57
PeakSpool column 2–58
N PeakTemp column 2–58
NamedTblCheckCount column 2–53 Performance Monitor
Next table 4–24 determining capacity with 1–24
Non-X query 1–15 purpose 1–18
Nullable column 2–53 PermSpace column 2–58
PhyProcessor column 2–58
NullPassword column 2–53
PM/API
queries, MONITOR-related 1–19
PMA column 2–58
Primary_Part_Number column 2–58
O
PrimaryKeyIndexId column 2–58
ObjectType column 2–54 Privileges
OldPasswords table 4–25 tracking 1–26
OperationInProcess column 2–54 ProcessorState column 2–58
Options column 2–54 ProtectionType column 2–59
OrderNumber column 2–54 PUBLIC
OrdSysChngTable 4–5 special database name in system views 1–14
Original_CommentString column 2–54
Original_CreatorName column 2–54
Original_Database column 2–54
Original_JournalFlag column 2–54 Q
Original_ProtectionType column 2–55
Query
Original_TableKind column 2–55
Data Dictionary 1–16
Original_TableName column 2–55
keywords, use of 1–14
Original_Version column 2–55
system monitor 1–19
OwnerName column 2–55
Owners table 4–25

P RCC_Configuration view 2–15, 3–54


RCC_Media view 2–15, 3–55
Parent column 2–55
RCConfiguration table 4–25
ParentCount column 2–55
RCEvent table 4–26
ParentDb column 2–55
RCMedia table 4–27
ParentDbId column 2–56

Teradata RDBMS Data Dictionary Index –5


Index

RecoveryLockTable 4–5 SHOWCOLCHECKS view 2–17, 3–64


RecoveryPJTable 4–5 SHOWTBLCHECKS view 2–17, 3–65
ReferencedTbls table 4–27, 4–28 Single Sign On 3–53
RepBatchStatus table 4–28 Slot column 2–61
RequestText column 2–59 Slot_Type column 2–61
ResNode macro Software_Event_Log view 2–18, 3–66
using to evaluate system capacity 1–24 SpoolSpace column 2–61
ResolvingUserLogonName column 2–59 Stacktrace column 2–61
Resource usage StartMBox column 2–61
AMP 1–21 StartupString column 2–61
AMPs 1–21 StatementText column 2–62
example 1–21 StatementType column 2–62
monitoring 1–20 Stored Procedure
system views 1–20 access rights 4–4
Resource utilization cross-platform incompatibility 1–17
tracking 1–20 Data Dictionary tables containing 1–17
RestartSeqNum column 2–59 definition 1–17
Result column 2–59 details in Data Dictionary 1–3
ResUsage macros how the system uses information about 1–4
executing, example 5–3 logging rules 4–4
Revision_Level column 2–59 request number 4–4
RI_Child_Tables view 2–15, 3–56 status 4–3
RI_Distinct_Children view 2–16, 3–57 Stored procedure
RI_Distinct_Parents view 2–16, 3–58 Data Dictionary information 4–3
RI_Parent_Tables view 2–16, 3–59 SubSlot column 2–62
Rights SubSlot_Type column 2–62
granting system 1–6 Supervisory views 1–12
RunUnitId column 2–59 SW_Event_Log table 4–31
SW_Version column 2–62
Sys_Calendar 1–27
SYSADMIN views 1–8
S SysRcvStatJournal 4–5
SysSecDefaults table 4–31, 4–32
SavedTransactionStatus 4–5
System events
Secondary_Part_Number column 2–60
tracking 1–26
Security
System logs
violation error 3–1
maintaining 1–28
Security Logging views 1–8
System monitor query 1–19
SecurityDefaults view 2–16, 3–60
System monitoring
SecurityLog view 2–17, 3–61
end user views, using 1–12
SELECT privelege 1–6
operation and recovery control views, using 1–11
SELECT privilege 1–16 security administrator view, using 1–9
SELECT statement supervisory user views, using 1–12
querying with 1–14 Teradata administrator views, using 1–10
Serial_Number column 2–60 System rights 1–6
SessionInfo view 2–17, 3–62 System table
SessionNo column 2–60 dropping
SessionNumber column 2–60 effect on Data Dictionary 1–13
SessionTbl table 4–29, 4–30 System tables
SET RESOURCE command, PM DBC.SessionTbl 1–18
DBC.sw_event_log table 1–18 DBC.sw_event_log 1–18
Severity column 2–60, 2–61 System user DBC 1–6

Index –6 Teradata RDBMS Data Dictionary


Index

SYSTEMFE views 1–8 User_Default_Journals view 2–21, 3–80


UserGrantedRights view 2–20, 3–75
UserLogonDate column 2–66
UserLogonTime column 2–66
T UserName column 2–66
UserRights view 2–20, 3–76
Table_LevelConstraints view 2–18, 3–68
Users view 2–21, 3–78
TableConstraints table 4–32
Users, types. See Data Dictionary, users
TableKind column 2–62
UtilityLockJournalTable 4–5
TableName column 2–63
Tables view 2–18, 3–69
Tables_DB column 2–63
Tables2 view 2–19, 3–71
V
TableSize view 2–19, 3–72
Task column 2–64 Vcc_Amps column 2–67
TblCheck column 2–64 Vcc_Margin column 2–67
Temperature column 2–64 Vcc_Volts column 2–67
TempSpace column 2–64 Version column 2–67
TempStatistics table 4–32 View privileges 1–6
TempTables table 4–33 Views
Text column 2–64 availability of 1–5
TextTbl table 4–33 definition of 1–5
The 1–19 how determined 1–6
TheDate column 2–64 Views. See also Data Dictionary
TheTime column 2–64 VolSerialId column 2–68
TimeZoneHour column 2–64 Vproc column 2–68
TimeZoneMinute column 2–64 Vproctype column 2–68
Transaction_Mode column 2–65
TransientJournal table 4–5
Translation table 4–33
TriggerComment column 2–65 W
TriggerName column 2–65 WHERE clause in sytem views 1–7
Triggers view 2–19, 3–73
TriggersTbl table 4–34
TVFields table 4–35, 4–36
TVM table 4–37
X
TVMId column 2–65
TVMName column 2–65 X query 1–14
TwoPCMode column 2–65
TwoPCRule macro 5–2

U
UniqueFlag column 2–65
UnnamedTblCheckExist column 2–65
UnResolvedReferences tabl 4–40
UnResolvedRICount column 2–66
UpperCaseFlag column 2–66
Usage statistics
compiling 1–22

Teradata RDBMS Data Dictionary Index –7


Index

Index –8 Teradata RDBMS Data Dictionary

Вам также может понравиться