You are on page 1of 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 users 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

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 AMP ANSI API ASCII AWS ASF2 BTEQ CICS CLI CPU DBA DBC DBQM DBS DD DDL DIP DML DSU EBCDIC HI HW ID I/O IMS JI Two-Phase Commit Access Module Process or Access Module Processor American National Standards Institute Application Programming Interface American Standard Code for Information Interchange Administration Workstation Archive Storage Facility 2 Basic Teradata Query Customer Information Control System (IBM) Call-Level Interface Central Processing Unit Database Administrator Name of database with Teradata RDBMS system tables Database Query Manager Database System or Database Software Data Dictionary Data Definition Language Database Initialization Program or DBC Initialization Procedure or DBC/1012 Initialization Program Data Manipulation Language Disk Storage Unit Extended Binary-Coded Decimal Interchange Code Hash Index Hardware Identifier/Identification Input/Output Information Management System Join Index

Teradata RDBMS Data Dictionary

Preface List of Acronyms KB LAN MVS NUPI NUSI ODBC OLCP OLAP OS PC PDE PE PI PJ PM/API PMA RCC RDBMS ResUsage RI SPL SQL SSO SW TDN TDP TP TOS TSO UPI USI Kilobytes Local Area Network Multiple Virtual Storage Non-unique Primary Index Non-unique Secondary Index Open Database Connectivity Online Complex Processing Online Analytical Processing Operating System Personal Computer Parallel Data Extension Parser Engine Primary Index (unique or non-unique) Permanent Journal Performance Monitor Application Programming Interface Processor Module Assembly Recovery Control Catalog Relational Database Management System Resource Usage Referential Integrity Stored Procedure Language Structured Query Language Single Sign-On Software Teradata Network Teradata Director Program Transaction Processor Teradata Operating System Time Sharing Option (IBM) Unique Primary Index Unique Secondary Index

vi

Teradata RDBMS Data Dictionary

Preface List of Acronyms VM VMS Virtual Machine 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?......................................................................................... 12 Data Dictionary Users.................................................................................................. 12 Accessing the Data Dictionary.................................................................................... 13 Updating the Data Dictionary .................................................................................... 13 How the System Uses Data Dictionary Information............................................... 14 Organization of the Data Dictionary ............................................................................ 15 What are System Views? ................................................................................................ 16 Granted Rights on System Views............................................................................... 16 Extending View Privileges .......................................................................................... 16 System View Versions Non-X and X ......................................................................... 17 Views for Special Users .................................................................................................. 18 Security Logging Views............................................................................................... 19 Administrator Views.................................................................................................. 110 Operations and Recovery Control Views ............................................................... 111 Supervisory User Views ............................................................................................ 112 End User Views .......................................................................................................... 112 Querying the Data Dictionary ..................................................................................... 114 Special Keywords ....................................................................................................... 114 Querying X Versus Non-X Views ............................................................................ 114 Example for Non-X View Query .............................................................................. 115 Example for X View Query ....................................................................................... 115 Dictionary Information Using HELP and COMMENT ........................................ 116 Stored Procedures ......................................................................................................... 117 What Is a Stored Procedure?..................................................................................... 117 Relationship with DD ................................................................................................ 117

Teradata RDBMS Data Dictionary

ix

Contents

PM/API Queries............................................................................................................ 118 MONITOR-Related Queries...................................................................................... 119 Monitoring Usage with Views..................................................................................... 120 AllSpace and TableSize Views.................................................................................. 120 AMPUsage View......................................................................................................... 121 Compiling AMPUsage Statistics .............................................................................. 122 Account String Expansion......................................................................................... 123 Additional Information ............................................................................................. 124 DIPVIEW Script ............................................................................................................. 125 Tracking Miscellaneous System Actions.................................................................... 126 Tracking System Events............................................................................................. 126 Tracking Logon Rules ................................................................................................ 126 Tracking Privileges..................................................................................................... 126 Sys_Calendar.................................................................................................................. 127 Maintaining System Logs............................................................................................. 128 Other System Objects .................................................................................................... 129 Columns with Hex Unicode Constants...................................................................... 130

Chapter 2: System Views Users of DD Views .......................................................................................................... 22 X Version Views............................................................................................................... 23 System Views Reference ................................................................................................. 24 System View Columns Reference ............................................................................... 222

Chapter 3: System Views: Usage and Examples AccessLog ......................................................................................................................... 32 AccLogRules..................................................................................................................... 34 AccountInfo[X]................................................................................................................. 37 AllRights ........................................................................................................................... 38 AllSpace[X] ..................................................................................................................... 310 AllTempTables[X] ......................................................................................................... 312 All_RI_Children............................................................................................................. 314 All_RI_Parents ............................................................................................................... 315 AMPUsage...................................................................................................................... 316 Association ..................................................................................................................... 317 CharSets .......................................................................................................................... 319 CharTranslations ........................................................................................................... 320 Children[X] ..................................................................................................................... 322 Collations ........................................................................................................................ 323

Teradata RDBMS Data Dictionary

Contents

Columns[X] .................................................................................................................... 324 ColumnStats ................................................................................................................... 326 Databases[X]................................................................................................................... 328 Databases2 ...................................................................................................................... 329 Database_Default_Journals[X] .................................................................................... 330 DBCInfo .......................................................................................................................... 331 DeleteAccessLog[X] ...................................................................................................... 332 DeleteOldInDoubt ......................................................................................................... 333 DiskSpace[X] .................................................................................................................. 334 Events[X]......................................................................................................................... 337 Events_Configuration[X].............................................................................................. 339 Events_Media[X] ........................................................................................................... 341 Hardware_Event_Log................................................................................................... 343 HostsInfo ........................................................................................................................ 344 Indices[X]........................................................................................................................ 345 IndexStats ....................................................................................................................... 347 InDoubtLog .................................................................................................................... 349 Journals[X]...................................................................................................................... 350 LogOnOff........................................................................................................................ 351 LogonRules..................................................................................................................... 353 RCC_Configuration[X] ................................................................................................. 354 RCC_Media[X] ............................................................................................................... 355 RI_Child_Tables ............................................................................................................ 356 RI_Distinct_Children .................................................................................................... 357 RI_Distinct_Parents....................................................................................................... 358 RI_Parent_Tables........................................................................................................... 359 SecurityDefaults ............................................................................................................ 360 SecurityLog[X] ............................................................................................................... 361 SessionInfo[X] ................................................................................................................ 362 ShowColChecks ............................................................................................................. 364 ShowTblChecks ............................................................................................................. 365 Software_Event_Log ..................................................................................................... 366 Table_LevelConstraints ................................................................................................ 368 Tables[X] ......................................................................................................................... 369 Tables2 ............................................................................................................................ 371 TableSize[X].................................................................................................................... 372 Triggers .......................................................................................................................... 373 UserGrantedRights........................................................................................................ 375 UserRights ...................................................................................................................... 376 Users ................................................................................................................................ 378 User_Default_Journals[X] ............................................................................................ 380

Teradata RDBMS Data Dictionary

xi

Contents

Chapter 4: System Tables Creating System Tables .................................................................................................. 42 Special Table Information .............................................................................................. 43 DBC.ALL Table ............................................................................................................. 43 DBC.TVM Table............................................................................................................ 43 DBC.TVFields Table ..................................................................................................... 43 Stored Procedures......................................................................................................... 43 ResUsage Tables ........................................................................................................... 44 Non-Hashed Tables......................................................................................................... 45 Data Dictionary FALLBACK Tables............................................................................. 46

Chapter 5: Macros TwoPCRule Macro .......................................................................................................... 52 Creating the TwoPCRule Macro ................................................................................ 52 TwoPCRule and the Resolver Base Module ............................................................. 52 ResUsage Macros............................................................................................................. 53 DIPVIEW Macros ............................................................................................................ 54 ARC_NonEmpty_List Macro...................................................................................... 54 ClearAccounting Macro............................................................................................... 55 ClearPeakDisk Macro................................................................................................... 56 CollAddStandard Macro ............................................................................................. 56 CollInstallMulti Macro................................................................................................. 57 DIPMarkNS10 Macro ................................................................................................... 57 LogonRule Macro ......................................................................................................... 58

Index.......................................................................................................................... Index1

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

11

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 systems 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.

12

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

13

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 approved query approved request that references a macro name approved request that references a view name approved request that references a stored procedure name

checks the DD to ensure that the requestor has the appropriate access privileges. uses the DD information, along with all other available statistics, to devise the best method of accessing the data. executes the macro according to the definition stored in the DD. assembles the view according to the definition stored in the Data Dictionary, and returns data rows retrieved from the underlying tables or views to the user. obtains the stored procedure creation-time attributes from the DD and validates the usage of the submitted request.

14

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 Columnsare 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

15

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.

16

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

17

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. 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.

SYSTEMFE

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

18

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] SecurityLog[X] LogonRules

Used to remove AccessLog records that are more than 30 days old. Provides a subset of the information in the AccessLog view. What logon rules have been generated for username/hostid pairs as a result of successfully executed GRANT LOGON and REVOKE LOGON statements? 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?

SecurityDefaults

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

19

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? 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? What demands on Teradata RDBMS resources (AMP usage, I/Os) are generated by a given user/account string? The names of any user-defined character sets that are installed and can be used in a session. 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.

AllSpace[X]

AMPUsage CharSets CharTranslations

Children[X] ColumnStats DBCInfo

What databases and users are owned by other databases and users? Returns statistical information on the columns in a table for which statistics have been collected. What Teradata RDBMS software version and release are running? What version and release are indicated after a restart? How much disk storage space or spool space is being used by a given database/user or account on all AMPs? On specific AMPs? What character sets have been assigned to what client systems? Returns statistical information on the indexes defined on a table for which statistics have been collected.

DiskSpace[X]

HostsInfo IndexStats

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? What logon rules have been generated for username/hostid pairs as a result of successfully executed GRANT LOGON and REVOKE LOGON statements? 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? What user name, account, default database, collation, logon hostid, logon sequence number, and logon source are associated with each current Teradata RDBMS session? 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? 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?

LogonRules

SecurityDefaults

SessionInfo[X]

Software_Event_Log

TableSize[X]

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] Events_Configuration[X] Events_Media[X] RCC_Configuration[X] RCC_Media[X] Software_Event_Log Hardware_Event_Log Association

All archive and restore activity. Archive and restore activity that did not affect all AMPs. Archive and restore events that involved removable media. Utility events that did not affect all AMPs. Utility events that involved removable media. Software events and error logging information. Software events and error logging information. 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] Users

What accounts are available to a given user? 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. 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.

CharSets

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? 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? What are the characteristics of the databases you own or on which you have privileges?

Columns[X]

Databases[X]

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? 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.

HostsInfo

Indices[X] Journals[X] Tables[X]

What kinds of indexes have been defined for a table? What data tables use what journal tables, and in what database does each table reside? What data tables, triggers, stored procedures, views, join indexes, and macros have been created in a database on which you have privileges? What is the AMP-by-AMP disk usage for each database, table, or account? What event-driven specialized procedures are attached to a single table? What user spaces are defined as having a default journal table, and what are the journal table names? What privileges have you granted to other users? What privileges have you been granted to databases, tables, triggers, stored procedures, views, join indexes, and macros?

TableSize{X] Triggers User_Default_Journals[X]

UserGrantedRights UserRights

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 pers Accounting2 SQLDBA abc123 PERSONNEL Accounting1 Test1 Jane . . . CreatorName SYSADMIN Jacobs DBC SYSADMIN SYSADMIN Hillstein SYSADMIN Jane . . . OwnerName SYSADMIN Vettes SYSADMIN SYSADMIN SYSADMIN Vettes Test1 Test1 . . . PermSpace 500,000 250,000 150,000 1,460,000 1,500,000 500,000 1,000,000 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 SQLDBA Jane PERSONNEL Test1 . . . CreatorName DBC Jane SYSADMIN SYSADMIN . . . OwnerName SYSADMIN Test1 SYSADMIN Test1 . . . PermSpace 150,000 500,000 1,500,000 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 2

Select statistics from the AMPUsage view and insert them in the history table. 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 PM/API Reference Teradata RDBMS Resource Usage Macros and Tables

Other Performance Monitoring Tools Resource Usage Macros

AMPUsage View

ResUsage Macro Names ResUsage Macro Functions 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. Teradata RDBMS SystemFE Macros Teradata RDBMS Resource Usage Macros and Tables Teradata RDBMS SQL Reference, Volume 3.

SystemFE database Resource Usage tables Sys_Calendar database

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 systems 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 DBC DBC DBC

TableConstraints TriggersTbl TVFields TVM

TableCheck CreateText ColumnCheck 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

21

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 system administrator

Performance Status and statistics Errors Accounting

Teradata RDBMS security administrator Operations control

Access logging rules generated by the execution of BEGIN LOGGING statements Results of access checking events, logged as determined by the access logging rules Archive and recovery activities.

22

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] Provides information about the accounts the user can control, that is, accounts the user owns or can modify.

Accounts Dbase [X]AccessRights [X]Userdb [X]Owners

Supervisory

UserName AccountName

Teradata RDBMS Data Dictionary

23

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.
View Name and Description Referenced Tables and Views User Type Columns Selected Referenced column(s)

DBC.AccessLog Displays, by row, the results of a privilege check performed in response to a request.

AccLogTbl

Security Administrator

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

None None None None None None None Dbase.DatabaseName None Dbase.DatabaseName None None None None Dbase.DatabaseName TVM.TVMName None None None

24

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.AccLogRules Provides information about logging rules that are currently in effect on the system.

AccLogRuleTbl Dbase TVM

Security Administrator

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

Dbase.DatabaseName AcclogTbl.UserName Dbase.DatabaseName AcclogTbl.UserName TVM.TVMName None None None None None None None None None None None None None None None None None None None None None None None None None None Dbase.DatabaseName AcclogTbl.UserName None Dbase.DatabaseName AcclogTbl.UserName None

DBC.AccountInfo[X] Gives the accounts the user can control, that is, accounts the user owns or can modify.

Accounts Dbase [X]AccessRights [X]Userdb [X]Owners

Supervisory

UserName AccountName

Teradata RDBMS Data Dictionary

25

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.AllRights Gives every explicit right for the privileges on databases, users, tables, views, stored procedures, and macros that have been granted for every user on the system. DBC.AllSpace[X] Gives both database and table space utilization.

AccessRights Dbase TVM TVFields

Administrator

UserName DatabaseName TableName ColumnName AccessRight GrantAuthority GrantorName AllnessFlag CreatorName CreateTimeStamp

Dbase.DatabaseName AcclogTbl.UserName Dbase.DatabaseName AcclogTbl.UserName TVM.TVMName None None None None None Dbase.DatabaseName None None Dbase.DatabaseName None None None None None None None None None None None SessionTbl.HostNo SessionTbl.SessionNo Dbase.DatabaseName None None TVM.TVMId None None Dbase.DatabaseName None None Dbase.DatabaseName None None None Dbase.DatabaseName None

DatabaseSpace Dbase TVM [X]AccessRights [X]Owners

Administrator

Vproc DatabaseName AccountName TableName MaxPerm MaxSpool MaxTemp CurrentPerm CurrentSpool CurrentTemp PeakPerm PeakSpool PeakTemp HostNo SessionNo UserName B_DatabaseName B_TableName E_TableId IndexID IndexName ChildDB ChildTable ChildKeyColumn ParentDB ParentTable ParentKeyColumn InconsistencyFlag CreatorName CreateTimeStamp

DBC.AllTempTables[X] Gives the local temporary table materialized with the exact same definition as the base table. DBC.All_RI_Children 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

TempTables Dbase TVM SessionTbl

Administrator

ReferencingTbls Dbase TVM TVFields

All users

26

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.All_RI_Parents 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. DBC.AmpUsage Gives CPU and I/O accounting information saved by the DBC. DBC.Association Retrieves information about tables that have been ported using the Dump/Restore facility.

ReferencedTbls Dbase TVM TVFields

All users

IndexID IndexName ParentDB ParentTable ParentKeyColumn ChildDB ChildTable ChildKeyColumn InconsistencyFlag CreatorName CreateTimeStamp AccountName UserName CPUTime Vproc VprocType Model DiskIO DatabaseName TableName EventNum Original_DatabaseName Original_TableName Original_TableKind Original_Version Original_ProtectionType Original_JournalFlag Original_CreatorName Original_CommentString

None None Dbase.DatabaseName None None Dbase.DatabaseName None None None Dbase.DatabaseName None None Dbase.DatabaseName None None None None None RCEvent.DatabaseName Dbase.DatabaseName None None None None None None None None None None None

Acctg

Administrator

DBCAssociation Dbase TVM

Operations Control

DBC.CharSets Returns the names assigned to user-defined character sets currently installed on the RDBMS.

Translation

End

CharSetName

Teradata RDBMS Data Dictionary

27

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.CharTranslations 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. DBC.Children[X] Provides the names of all the databases under a user. DBC.Collations Provides definitions for standard Swedish and Norwegian collations as well as custom collation sequence definitions.

Translation

End

CharSetName CharSetId InstallFlag E2I E2IUp I2E I2EUp

None None None None None None None

Owners Dbase [X]AccessRights [X]Userdb CollationTbl

Administrator

Child Parent

Dbase.DatabaseName Dbase.DatabaseName

End

CollName CollInstall CollEqvClass CollOrderCS CollOrderUC

None None None None None

28

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Columns[X] Provides information about the columns of tables or views, or the parameters of stored procedures and macros that the user can access.

TVFields Dbase TVM [X]AccessRights [X]Owners

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 DBC.ColumnStats Displays statistics for the columns in a table for which statistics have been collected. DBC.CSPSessionInfo (Reserved for internal use.) Returns information on crashdumps. TVFields Dbase TVM All users DatabaseNameI FieldID FieldStatistics TVMNameI

RCEvent.DatabaseName AcclogTbl.UserName None None None None None None None None None None None Accessrights.FieldId ReferencingTbls. ForeignKeyFID ReferencedTbls. ParentKeyFID Indexes.FieldId None None None None None Dbase.DatabaseName None None None None None None None None None

SessionTbl

Operations Control

SessionNo, HostNo, StartMBox, LogonSource

Teradata RDBMS Data Dictionary

29

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Databases[X] Provides information about the databases that the user can access.

Dbase [X]AccessRights [X]Userdb [X]Owners

End

DatabaseName CreatorName OwnerName AccountName ProtectionType JournalFlag PermSpace SpoolSpace TempSpace CommentString CreateTimeStamp LastAlterName LastAlterTimeStamp DBKind

RCEvent.DatabaseName AcclogTbl.UserName Dbase.DatabaseName Dbase.DatabaseName None None None None None None None None Dbase.DatabaseName None None None Accounts.UserId Databasespace. DatabaseId Accessrights.UserId Owners.OwnerId TVM.DatabaseId ReferencingTbls.Referencing.DbId DBCAssociation. DatabaseId Owners.OwneeId ReferencedTbls. ReferencedDbId TableConstraints. DbaseId Triggertbl.DatabaseId None Dbase.DatabaseName Dbase.DatabaseName None

DBC.Databases2 Provides ID definition information about databases.

Dbase

All users

DatabaseName DatabaseId

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

2 10

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.DBCInfo Provides information on the current version and release of the DBC. It is updated during each system restart. DBC.DeleteAccess Log[X] Provides a means of controlling deletion of the DBC. AccLogTbl. Only rows older than 30 days from the current date can be deleted. DBC.DeleteOld InDoubt Displays those rows in the DBC.InDoubtResLog table that are more than 30 days old.

DBCInfoTbl

Administrator

InfoKey InfoData

None None

AccLogTbl [X]Dbase [X]Owners [X]Userdb

Security Administrator

LogDate LogTime

None None

InDoubtResLog

Administrator

LogicalHostId CoordTaskId LogonUserName CommitOrRollback CompletionDate UserLogonTime SessionNumber RunUnitId ResolvingUserLogon Name UserLogonDate CompletionTime Options Vproc DatabaseName AccountName MaxPerm MaxSpool MaxTemp CurrentPerm CurrentSpool CurrentTemp PeakPerm PeakSpool PeakTemp

None None Dbase.DatabaseName None None None None None Dbase.DatabaseName None None None None Dbase.DatabaseName None None None None None None None None None None

DBC.DiskSpace[X] Provides AMP-byAMP information about disk space usage, including spool, for each database or account that the use can access.

DatabaseSpace Dbase [X]AccessRights [X]Userdb [X]Owners

Administrator

Teradata RDBMS Data Dictionary

2 11

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Events[X] Provides a row for each execution of a Host Utility function or of a DBC/SQL checkpoint statement.

RCEvent [X]Dbase [X]AccessRights [X]Userdb [X]Owners

Operations Control

CreateDate CreateTime EventNum

EventType UserName DatabaseName ObjectType AllAMPsFlag RestartSeqNum OperationInProcess TableName CheckpointName LinkingEventNum DataSetName LockMode JournalUsed JournalSaved IndexPresent DupeDumpSet

None None RCConfiguration. EventNum RCMedia.EventNumber None Dbase.DatabaseName Dbase.DatabaseName None None RCConfiguration. RestartSeqNum None TVM.TVMName None None None None None None None RCMedia.Dupe DumpSet None None None RCConfiguration. EventNum RCMedia.EventNumber None Dbase.DatabaseName None None None None None None RCConfiguration. EventNum RCMedia.EventNumber None Dbase.DatabaseName None None None None

DBC.Events_Configuration[X] Provides a row for each execution of a Host Utility function or of a DBC/SQL checkpoint statement, which was executed on a subset of the AMP processors. DBC.Events_Media[ X] Provides a row for each execution of a Host Utility dump or restore function, which created or used removable media.

RCEvent RCConfiguration [X]Dbase [X]AccessRights [X]Userdb [X]Owners

Operations Control

Vproc CreateDate CreateTime EventNum

EventType UserName LogProcessor PhyProcessor ProcessorState RestartSeqNum Operations Control CreateDate CreateTime EventNum

RCEvent RCMedia [X]Dbase [X]AccessRights [X]Userdb [X]Owners

EventType UserName DataSetName VolSerialId VolSequenceNum DupeDumpSet

2 12

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Hardware_ Event_Log Provides information about system failures, error conditions and other events originating in the Parallel Data Extensions (PDE) or the Teradata RDBMS.

HW_Event_Log

Operations Control

TheDate 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 LogicalHostId HostName DefaultCharSet

None None None None None None None None None None None None None None None None None None None None None None None None None None None

DBC.HostsInfo Provides 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. DBC.IndexStats Displays statistics on the indexes defined on a table for which statistics have been collected.

Hosts

End

Indexes Dbase TVM

All users

DatabaseNameI IndexNumber IndexStatistics TVMNameI

None None None None

Teradata RDBMS Data Dictionary

2 13

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Indices[X] Describes each of the indexes on each table that the user can access.

Indexes Dbase TVM TVFields [X]AccessRights [X]Owners

End

DatabaseName TableName IndexNumber IndexType UniqueFlag IndexName ColumnName ColumnPosition CreatorName CreateTimeStamp LastAlterName LastAlterTimeStamp LogicalHostId CoordTaskId LogonUserName UserLogonDate CompletionDate CommitOrRollBack SessionNumber RunUnitId ResolvingUserLogon Name UserLogonTime CompletionTime Options Tables_DB TableName Journals_DB JournalName

Dbase.DatabaseName TVM.TVMName None None None None None None Dbase.DatabaseName None Dbase.DatabaseName None None None Dbase.DatabaseName None None None None None Dbase.DatabaseName None None None Dbase.DatabaseName None RCEvent.DatabaseName Dbase.DatabaseName None

DBC.InDoubtLog Displays the contents of the DBC.InDoubtResLog table.

InDoubtResLog

Administrator

DBC.Journals[X] Provides specific information about journal to table mapping for each data table the user can access. DBC.LogOnOff Gives the DBA access to the session event table that records logon, logoffs, and attempted logons.

Dbase TVM [X]AccessRights [X]Owners

End

EventLog

Security Administrator

LogDate LogTime UserName AccountName Event LogicalHostId IFPNo SessionNo LogonDate LogonTime LogonSource

None None Dbase.DatabaseName Dbase.AccountName None None None None None None None

2 14

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.LogonRules Retrieves information about logon rules generated as a result of successfully processed GRANT/REVOKE LOGON statements. DBC.RCC_Configuration[X] Provides a row for each execution of a Host Utility function or of a Teradata SQL checkpoint statement, which was executed on a subset of the AMP processors. DBC.RCC_Media[X] Provides a row for each execution of a Host Utility dump or restore function that created or used removable media. DBC.RI_Child_Tables The RI_Child_Tables view provides information about tables in child-parent order. It is similar to the DBC.All_RI_Childre n view but returns the internal IDs of databases, tables, and columns instead of names.

LogonRuleTbl Dbase

Security Administrator

UserName LogicalHostId LogonStatus NullPassword CreatorName CreateTimeStamp

Dbase.DatabaseName AcclogTbl.UserName None None None Dbase.DatabaseName None

RCConfiguration [X]Dbase [X]AccessRights [X]Userdb [X]Owners

Operations Control

EventNum LogProcessor PhyProcessor ProcessorState RestartSeqNum Vproc

RCEvent.EventNum None None None None None

RCMedia [X]Dbase [X]AccessRights [X]Userdb [X]Owners

Operations Control

EventNum VolSerialId VolSequenceNum DupeDumpSet

RCMediaEventNumber None None None

ReferencingTbls Dbase

All users

IndexID IndexName ChildDbID ChildTID ChildKeyFID ParentDbID ParentTID ParentKeyFID InconsistencyFlag CreatorName CreateTimeStamp

None None Dbase.DatabaseId TVM.TVMId TVFields.TableId TVFields.FieldId Dbase.DatabaseId TVM.TVMId TVFields.TableId TVFields.FieldId None Dbase.DatabaseName None

Teradata RDBMS Data Dictionary

2 15

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.RI_Distinct_ Children Provides information about tables in childparent order without the duplication that could result from multi-column foreign keys. DBC.RI_Distinct_ Parents Provides information about tables in parent-child order without the duplication that could result from multi-column foreign keys. DBC.RI_Parent_Tables Provides information about all tables in parent-child order.

ReferencingTbls Dbase TVM

All users

IndexID IndexName ChildDB ChildTable ParentDB ParentTable InconsistencyFlag CreatorName CreateTimeStamp IndexID IndexName ParentDB ParentTable ChildDB ChildTable InconsistencyFlag CreatorName CreateTimeStamp

None None Dbase.DatabaseName None Dbase.DatabaseName None None Dbase.DatabaseName None None None Dbase.DatabaseName None Dbase.DatabaseName None None Dbase.DatabaseName None

ReferencingTbls Dbase TVM

All users

ReferencingTbls Dbase

All users

IndexID IndexName ParentDbID ParentTID ParentKeyFID ChildDbID ChildTID ChildKeyFID InconsistencyFlag CreatorName CreateTimeStamp

None None Dbase.DatabaseId TVM.TVMId TVFields.TableId TVFields.FieldId Dbase.DatabaseId TVM.TVMId TVFields.TableId TVFields.FieldId None Dbase.DatabaseName None None None None None None None None None

DBC.SecurityDefaults Describes the password features selected on the site.

SysSecDefaults

Security Administrator

ExpirePassword PasswordMinChar PasswordMaxChar PasswordDigits PasswordSpecChar MaxLogonAttempts LockedUserExpire PasswordReuse

2 16

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.SecurityLog[X] Provides access to the DBC.AccLogTbl. Rows are logged as directed by BEGIN/END LOGGING. DBC.SessionInfo[X] Gives one row for each time the user is logged on; used as a review of accounts set by user.

AccLogTbl [X]Dbase [X]Owners [X]Userdb

Security Administrator

LogDate LogTime LogType UserName AccountName DatabaseName TableName Text UserName AccountName SessionNo DefaultDataBase IFPNo Partition LogicalHostId HostNo CurrentCollation LogonDate LogonTime LogonSequenceNo LogonSource ExpiredPassword TwoPCMode Transaction_Mode DatabaseName TableName ColumnName ColCheck CreatorName CreateTimeStamp DatabaseName TableName CheckName TblCheck CreatorName CreateTimeStamp

None None None Dbase.DatabaseName None Dbase.DatabaseName TVM.TVMName None Dbase.DatabaseName Dbase.AccountName Temptables.SessionNo Dbase.DatabaseName None None None TempTables.HostNo None None None None None None None None Dbase.DatabaseName TVM.TVMName None None Dbase.DatabaseName None Dbase.DatabaseName TVM.TVMName None None Dbase.DatabaseName None

SessionTbl

Administrator

DBC.SHOWCOL CHECKS Provides information about column constraints for a table in a database. DBC.SHOWTBL CHECKS Provides information about table constraints for a database.

TVFields Dbase TVM

All users

TableConstraints Dbase TVM

All users

Teradata RDBMS Data Dictionary

2 17

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Software_Event _Log Provides information about logged software events originating in the Parallel Data Extensions (PDE) or the Teradata RDBMS.

SW_Event_Log

Operations Control

TheDate TheTime Event_Tag Category Severity PMA Vproc Partition Task Function SW_Version Line Text Stacktrace Error_Data DatabaseName TableName ConstraintName ConstraintText CreatorName CreateTimeStamp DatabaseName TableName Version TableKind ProtectionType JournalFlag CreatorName RequestText CommentString ParentCount ChildCount NamedTblCheckCount UnnamedTblCheckExist PrimaryKeyIndexId CreateTimeStamp LastAlterName LastAlterTimeStamp

None None None None None None None None None None None None None None None Dbase.DatabaseName TVM.TVMName None None Dbase.DatabaseName None Dbase.DatabaseName TVM.TVMName None None None None Dbase.DatabaseName None None None None None None None None Dbase.DatabaseName None

DBC.Table_Level Constraints Provides information about table constraints for a database. DBC.Tables[X] Provides information about the tables, views, stored procedures, join indexes, or macros that the user can access.

TableConstraints Dbase TVM

All users

TVM Dbase [X]AccessRights [X]Owners

All users

2 18

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Tables2 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.

TVM

All users

TVMName TVMId

DatabaseId

ParentCount ChildCount DBC.TableSize[X] Provides AMP-by AMP information about disk space usage, excluding spool, for any database, data table, journal table, or account the user can access. DBC.Triggers Provides information about event-driven, specialized procedures attached to a single table and stored in the database. DataBaseSpace Dbase TVM [X]AccessRights [X]Owners End Vproc DatabaseName AccountName TableName CurrentPerm PeakPerm

TVM.TVMName AcclogRuleTbl.TVMId DatabaseSpace.tableId Accessrights.TVMId Temptables.BaseTableId ReferencingTbls.ReferencingTblId ReferencedTbls.ReferencedTblId DBCAssociation.TVMId TVFields.TableId Dbase.JournalId Indexes.TableId Tableconstraints.TVMId Accessrights.DatabaseId Owners.owneeId Dbase.DatabaseId None None None Dbase.DatabaseName None TVM.TVMName None None

TriggersTbl Dbase TVM

End

DatabaseName TableName TriggerName EnabledFlag ActionTime Event Kind OrderNumber TriggerComment RequestText CreatorName CreateTimeStamp LastAlterName LastAlterTimeStamp

Dbase.DatabaseName TVM.TVMName None None None None None None None None Dbase.DatabaseName None Dbase.DatabaseName None

Teradata RDBMS Data Dictionary

2 19

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.UserGranted Rights Describes the explicit rights that the user has granted to other users.

AccessRights Dbase TVM TVFields Ownerdb

End

DatabaseName TableName ColumnName Grantee GrantAuthority AccessRight AllnessFlag CreatorName CreateTimeStamp DatabaseName TableName ColumnName AccessRight GrantAuthority GrantorName CreatorName CreateTimeStamp

Dbase.DatabaseName None None None None None None Dbase.DatabaseName None Dbase.DatabaseName TVM.TVMName None None None None Dbase.DatabaseName None

DBC.UserRights Describes the explicit rights of each user for access to tables, views, join indexes, stored procedures or macros.

AccessRights Dbase TVM TVFields Userdb

End

2 20

Teradata RDBMS Data Dictionary

Chapter 2: System Views System Views Reference


Referenced Tables and Views

View Name and Description

User Type

Columns Selected

Referenced column(s)

DBC.Users Describes in detail all information about users that you control, including passwords.

Dbase AccessRights Userdb Owners

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

RCEvent.DatabaseName AcclogTbl.UserName DbaseDatabaseName None None Dbase.DatabaseName None None None None None None None Dbase.DatabaseName None None None None None None None None None None RCEvent.DatabaseName AcclogTbl.UserName None None RCEvent.DatabaseName AcclogTbl.UserName RCEvent.DatabaseName AcclogTbl.UserName None

DBC.User_Default_ Journals[X] Describes the users that have default journal tables, including the name and database for each journal table.

Dbase TVM AccessRights Owners

End

UserName Journal_DB JournalName

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 a privilege granted on the object. Possible values for privilege type are as follows: 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 DG = DROP TRIGGER DM = DROP MACRO DP = DUMP DT = DROP TABLE DU = DROP USER

CHAR NOT NULL

X(2)

AllRights UserGrantedRights UserRights

DV = DROP VIEW E I = EXECUTE (MACRO) = INSERT

IX = INDEX MR = MONITOR RESOURCE MS = MONITOR SESSION PC = CREATE PROCEDURE PD = DROP PROCEDURE PE = EXECUTE PROCEDURE R = RETRIEVE/SELECT RF = REFERENCE RS = RESTORE SS = SET SESSION RATE SR = SET RESOURCE RATE 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 (for Acr-type columns)

Returns the type of privilege for which the check that generated this log entry was performed. AN=ANY PRIVILEGE * (Indicates a HELP or SHOW statement for which at least one privilege, but no specific privilege, is required.) 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 DG = DROP TRIGGER DM = DROP MACRO DP = DUMP DT = DROP TABLE DU = DROP USER DV = DROP VIEW

CHAR NOT NULL

X(2)

AccessLog

E G I

= EXECUTE = GRANT = INSERT

IX = INDEX

HR = HUT RELEASE LOCK * (Indicates that a client system utility lock is involved, which could require a check for one or more of the privileges associated with DUMP and RESTORE.) MR = MONITOR RESOURCE MS = MONITOR SESSION PC = CREATE PROCEDURE PD = DROP PROCEDURE PE = EXECUTE PROCEDURE = RETRIEVE/SELECT

RF = REFERENCE RS = RESTORE SS = SET SESSION RATE SR = SET RESOURCE RATE U = UPDATE WL = WRITE LOCK * (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 when the request that generated this log entry was submitted. Note: The system account name SYSTEMACCOUNTNO tracks console utility activity such as table rebuild, Diskcopy, or Scandisk.

VARCHAR NOT NULL

X(30)

AccessLog SecurityLog[X]

CHAR NOT NULL

X(30)

AccountInfo[X] AllSpace[X] AMPUsage Databases[X] DiskSpace[X] LogOnOff SessionInfo[X] TableSize[X] AccLogRules

AcrCheckPoint

Returns the logging in effect for the CHECKPOINT privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE DATABASE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE MACRO privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE PROCEDURE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE TABLE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE TRIGGER privilege on the objects or users (or both) to which the rule applies.

CHAR NOT NULL

X(3) Title: CPT

AcrCreateDatabase

CHAR NOT NULL

X(3) Title: CDB

AccLogRules

AcrCreateMacro

CHAR NOT NULL

X(3) Title: CMC

AccLogRules

AcrCreateProcedure

CHAR NOT NULL

X(3) Title: CSP

AccLogRules

AcrCreateTable

CHAR NOT NULL

X(3) Title: CTB

AccLogRules

AcrCreateTrigger

CHAR NOT NULL

X(3) Title: CTG

AccLogRules

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 for the CREATE USER privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE VIEW privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DELETE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP DATABASE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP MACRO privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP PROCEDURE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP TABLE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP TRIGGER privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DROP USER privilege on the objects or users (or both) to which the rule applies.

CHAR NOT NULL

X(3) Title: CUS

AccLogRules

AcrCreateView

CHAR NOT NULL

X(3) Title: CVW

AccLogRules

AcrDelete

CHAR NOT NULL

X(3) Title: DEL

AccLogRules

AcrDropDatabase

CHAR NOT NULL

X(3) Title: DDB

AccLogRules

AcrDropMacro

CHAR NOT NULL

X(3) Title: DMC

AccLogRules

AcrDropProcedure

CHAR NOT NULL

X(3) Title: DSP

AccLogRules

AcrDropTable

CHAR NOT NULL

X(3) Title: DTB

AccLogRules

AcrDropTrigger

CHAR NOT NULL

X(3) Title: DTG

AccLogRules

AcrDropUser

CHAR NOT NULL

X(3) Title: DUS

AccLogRules

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 for the DROP VIEW privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the DUMP privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the EXECUTE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the EXECUTE PROCEDURE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the GRANT privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the CREATE/DROP INDEX privilege on the object(s) or users (or both) to which the rule applies. Returns the logging in effect for the INSERT privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the Reference privilege on the object(s) or users (or both) to which the rule applies. Returns the logging in effect for the RESTORE privilege on the objects or users (or both) to which the rule applies. Returns the logging in effect for the SELECT privilege on the objects or users (or both) to which the rule applies.

CHAR NOT NULL

X(3) Title: DVW

AccLogRules

AcrDump

CHAR NOT NULL

X(3) Title: DMP

AccLogRules

AcrExecute

CHAR NOT NULL

X(3) Title: EXE

AccLogRules

AcrExecute Procedure

CHAR NOT NULL

X(3) Title: ESP

AccLogRules

AcrGrant

CHAR NOT NULL

X(3) Title: GRT

AccLogRules

AcrIndex

CHAR NOT NULL

X(3) Title: IDX

AccLogRules

AcrInsert

CHAR NOT NULL

X(3) Title: INS

AccLogRules

AcrReference

CHAR NOT NULL

X(3) Title: REF

AccLogRules

AcrRestore

CHAR NOT NULL

X(3) Title: RST

AccLogRules

AcrSelect

CHAR NOT NULL

X(3) Title: SEL

AccLogRules

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 for the UPDATE privilege on the objects or users (or both) to which the rule applies. Returns a code to signify when, in relation to the SQL statement, the trigger is fired: B = Before A = After I = Instead of the statement

CHAR NOT NULL

X(3) Title: UPD

AccLogRules

ActionTime

CHAR UPPERCASE NOT NULL

X(1)

Triggers

AllAMPsFlag

Returns a code that indicates whether the event was executed on all AMPs, clusters, or processors. The codes are as follows: A = all AMPs used C = all Clusters P = all Processors

CHAR NOT NULL

X(1)

Events[X]

AllnessFlag

Returns Y (yes) or N (no) to indicate whether or not the privilege was granted to all subordinate users, or to all users who are owned by the grantee. Returns the name of the database in which the temporary table resides Returns the name of the base temporary table.

CHAR UPPERCASE NOT NULL

X(1)

AllRights UserGrantedRights

B_DatabaseName

CHAR(30) NOT NULL CHAR(30) NOT NULL

X(30)

AllTempTables[X]

B_TableName

X(30)

AllTempTables[X]

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 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

BYTEINT

Z9

Software_Event_Log

Returns the category code assigned to a hardware event. Possible values are: P = Permanent events T = Transient events CharSetId Returns the number assigned to the character set defined by this row. Returns the name of a user-defined character set that is installed and available for the current session, or the name assigned to the character set defined by this row. Returns the type of the 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.

CHAR

X(1)

Hardware_Event_ Log

BYTEINT NOT NULL CHAR UPPERCASE NOT NULL

ZZ9

CharTranslations

CharSetName

X(30)

CharSets CharTranslations

CharType

SMALLINT

---,--9

Columns[X]

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 tablelevel check. This field is NULL if this is an unnamed table check. Returns the checkpoint name as specified by the user in the CHECKPOINT statement. Returns the name of a referencing database or user. Returns the count of the referencing tables for the table. Returns the name of the referencing database.

CHAR

X(30)

SHOWTBLCHECKS

CheckpointName

VARCHAR

X(30)

Events[X]

Child ChildCountC

CHAR NOT NULL SMALLINT NOT NULL CHAR NOT NULL

X(30) ---,--9

Children[X] Tables[X] Tables2 All_RI_Children All_RI_Parents RI_Distinct_ Children RI_Distinct_Parents RI_Child_Tables RI_Parent_Tables All_RI_Children All_RI_Parents RI_Child_Tables RI_Parent_Tables All_RI_Children All_RI_Parents RI_Distinct_ Children RI_Distinct_Parents RI_Child_Tables RI_Parent_Tables SHOWCOLCHECKS

ChildDb

X(30)

ChildDbId ChildKeyColumn ChildKeyFID ChildTable

Returns the database ID of the referencing table. Returns the name of a column in the referencing key. Returns the field ID of a column in the referencing key. Returns the name of the referencing table.

BYTE NOT NULL CHAR NOT NULL SMALLINT NOT NULL CHAR NOT NULL

X(8) X(30) ---,--9 X(30)

ChildTID ColCheck

Returns the table ID of the referencing table. Returns the unresolved text for the column-level check condition. Returns the value of the equivalence class assigned to each character. Equivalence also is the first level of comparison in determining the collation sequence.

BYTE NOT NULL VARCHAR (8192) BYTE NOT NULL

X(12) X(255)

CollEqvClass

X(512)

Collations

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 collation. The option returns 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. Returns the name of the collation sequence. Only the collation sequence with name MULTINATIONAL and the collInstall flag set to Y is installed on the Teradata RDBMS. Returns the value assigned to each character to determine the relative order of the characters within the same class for second level, case-specific comparison. Returns the value assigned to each character to determine the relative order of the characters within the same class for second level, uppercase comparison. Returns the condition text for column-level check. Returns the format of a column or parameter. Returns a two-byte value specifying the internal identifier for this column. Returns the length of a column as the maximum number of bytes used to physically store a column value in the row of a table.

CHAR NOT NULL

X(1)

Collations

CollName

CHAR NOT NULL

X(30)

Collations

CollOrderCS

BYTE NOT NULL

X(512)

Collations

CollOrderUC

BYTE NOT NULL

X(512)

Collations

ColumnConstraint ColumnFormat ColumnId

VARCHAR (8192) CHAR SMALLINT NOT NULL SMALLINT

X(255) X(30) ---,--9

Columns[X] Columns[X] Columns[X]

ColumnLength

ZZ,ZZ9

Columns[X]

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 was entered on the access log. Returns the column name or parameter. Returns the column name to which a privilege has been granted. Returns the column name having column-level checks.

VARCHAR CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL SMALLINT NOT NULL

X(30) X(30) X(30)

AccessLog Columns[X] Indices[X] AllRights UserGrantedRights UserRights SHOWCOLCHECKS Indices[X]

X(30) Z9

ColumnPosition

Returns the position of the column in the index. For a composite index, this indicates the order of the columns making up the index. Returns any column heading.

ColumnTitle

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 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

CHAR

X(2)

Columns[X]

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 commentary on the column, database, table, view, macro, stored procedure, or the user. Returns a code to indicate whether the transaction was committed or rolled back. C = Committed R = Rolled Back

VARCHAR

X(255)

Columns[X] Databases[X] Tables[X] Users DeleteOldInDoubt InDoubtLog

CommitOrRollback

CHAR (1) NOT NULL

X(1)

CompletionDate CompletionTime Compressible

Returns the date the in-doubt transaction was resolved. Returns the time the in-doubt transaction was resolved. Returns a C (Compress) if the COMPRESS phrase is defined for the column. Returns the constant value specified for compression in the COMPRESS phrase. If the constant value is not defined, a null value is returned. Returns the count of table level constraints referencing this column. Returns the name of the tablelevel check. This field is NULL if this is an unnamed table check. Returns the unresolved text for the table-level check condition. Returns the coordinator that had the in-doubt transaction. Returns total CPU time in seconds (with resolution of .01 second) used on an AMP (or on all AMPs if SUM aggregate is specified).

DATE NOT NULL FLOAT NOT NULL CHAR

YY/MM/DD 99:99:99 X(1)

DeleteOldInDoubt InDoubtLog DeleteOldInDoubt InDoubtLog Columns[X]

CompressValue

VARCHAR

X(255)

Columns[X]

ConstraintCount

SMALLINT NOT NULL CHAR

---,--9

Columns[X]

ConstraintName

X(30)

Table_ LevelConstraints

ConstraintText

VARCHAR (8192) VARBYTE (30) NOT NULL FLOAT NOT NULL

X(255)

Table_ LevelConstraints DeleteOldInDoubt InDoubtLog AMPUsage

CoordTaskId

X(60)

CpuTime

---,---,---,--9.99

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 event took place.

DATE NOT NULL

YY/MM/DD

Events[X] Events_ Configuration[X] Events_Media[X] Events[X] Events_ Configuration[X] Events_Media[X] AccLogRules 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

CreateTime

Returns the time that the event took place.

FLOAT NOT NULL

99:99:99.99

CreateTimeStamp

Specifies the time the object was created.

TIMESTAMP

yyyy-mm-dd hh:mm:ss

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 who created the database, table, or the name of the users creator.

CHAR NOT NULL

X(30)

AccLogRules 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 SessionInfo[X]

CurrentCollation

Returns the current collation of the session with the following values: A E H = ASCII = EBCDIC = Host

CHAR UPPERCASE NOT NULL

X(1)

M = Multinational FLOAT NOT NULL ---,---,---,---,--9 AllSpace[X} DiskSpace[X] TableSize[X]

CurrentPerm

Returns an integer that represents the permanent space, in bytes, that is currently being used by the database or table. Unless a specific AMP is requested, this value includes all AMPs. Returns an integer that represents the spool space, in bytes, that is currently being used by the database on a specified AMP (or on all AMPs if the SUM aggregate is specified). Returns the number of bytes currently used by a temporary table per vproc.

CurrentSpool

FLOAT NOT NULL

---,---,---,---,--9

AllSpace[X} DiskSpace[X]

CurrentTemp

FLOAT NOT NULL

---,---,---,---,--9

AllSpace[X} DiskSpace[X]

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 with the indicated count of unresolved references. Returns the ID of the database which contains both the Child and Parent tables. Returns the ID of the database where the trigger resides.

BYTE NOT NULL BYTE NOT NULL BYTE NOT NULL VARCHAR NOT NULL CHAR NOT NULL

X(8)

Databases2

X(8)

Tables2

X(4) X(30)

Triggers AccessLog SecurityLog[X] AccLogRules

DatabaseName

Returns the database or user name of the object for which this log entry was made. Returns the database to which the access logging rule applies; the special system keyword ALL may be specified. Returns the name of the database on which a privilege was granted; either of the following special system keywords may be specified: ALL PUBLIC (indicates performance monitoring rights)

X(30)

CHAR NOT NULL

X(30)

AllRights

Returns the name of a database or one of the following special system keywords: ALL 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.

CHAR NOT NULL

X(30)

AllSpace[X] Databases[X] DiskSpace[X] UserGrantedRights UserRights

2 36

Teradata RDBMS Data Dictionary

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

DatabaseName (continued)

Returns the name of the database or user space in which the imported object now resides. Returns the name of a database. Returns the name of a database for which a default journal table has been defined. Returns the name of a database with the indicated count of unresolved references. Returns the name of the database that was affected by the event. Returns the name of a database containing a table with a column-level check. Returns the name of a database containing a table with a table-level check. Returns the name of the database that contains the table. Returns the name of the database where the trigger resides. Returns the databasename of the table, for which the column or index statistics are requested.

CHAR NOT NULL

X(30)

Association

CHAR NOT NULL CHAR NOT NULL

X(30)

Columns[X] Indices[X] TableSize[X] Database_Default_ Journals[X]

X(30)

CHAR NOT NULL

X(30)

Databases2

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(30)

Events[X]

X(30)

SHOWCOL CHECKS SHOWTBLCHECKS Table_ LevelConstraints Tables[X]

X(30)

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(30)

X(30)

Triggers

X(30)

ColumnStats IndexStats

DataSetName

Returns the client system data set name for a dump or restore event. Returns information that indicates whether the row information represents a database (D) or a user (U).

VARCHAR

X(44)

Events[X] Events_Media[X]

DBKind

CHAR NOT NULL

X(1)

Databases[X]

Teradata RDBMS Data Dictionary

2 37

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

DecimalFractional Digits

Returns an integer indicating the total number of fractional digits (if the column is defined as decimal). Returns an integer indicating the total number of decimal digits (if the column is defined as a decimal) Returns the name of any default account. Returns the name of the character set to be used as the 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.

SMALLINT

Z9

Columns[X]

DecimalTotalDigits

SMALLINT

Z9

Columns[X]

DefaultAccount DefaultCharSet

CHAR NOT NULL CHAR NOT NULL

X(30) X(30)

Users HostsInfo

DefaultCharType

Returns the type of the user default character type as follows: 1 - Latin 2 - Unicode 3 - KanjiSJIS 4 - Graphic 5 - Kanji1

SMALLINT

---,--9

Users

DefaultCollation

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

CHAR NOT NULL

X(1)

Users

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 current default database for the user. Returns the name of the 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.

CHAR NOT NULL CHAR

X(30)

SessionInfo[X]

X(30)

Users

DefaultDateForm

Returns either an INTEGERDATE or ANSIDATE that is set for a USER with the CREATE or MODIFY statement. Returns any default value assigned to the column or parameter. Returns the total number of reads and writes to DSU by each AMP in the system (or the total for all AMPs if the sum aggregate is specified). Returns a code to indicate 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

CHAR UPPERCASE

X(1)

Users

DefaultValue

VARCHAR

X(1024)

Columns[X]

DiskIO

FLOAT NOT NULL

---,---,---,--9

AMPUsage

DupeDumpSet

CHAR

X(1)

Events[X]

Returns a code to indicate 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

CHAR NOT NULL

X(1)

Events_Media[X] RCC_Media[X]

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 (external) to Teradata RDBMS (internal) Hex translation codes. Returns the client system (external) to Teradata RDBMS (internal) and uppercase Hex translation codes. Returns a code that indicates whether the trigger is enabled or disabled: Y = Yes (default) N = No

BYTE NOT NULL

X(512)

CharTranslations

E2IUp

BYTE NOT NULL

X(512)

CharTranslations

EnabledFlag

CHAR UPPERCASE NOT NULL

X(1)

Triggers

Error_Data

Returns event-specific data supplied by the diagnostic subsystem. This data can be extracted for further analysis. Returns event-specific data supplied by the diagnostic subsystem. This data can be extracted for further analysis.

VARBYTE

X(512)

Software_Event_Log

VARBYTE

X(128)

Hardware_Event_ Log

E_TableId

Returns the identifier for the materialized (effective) temporary table.

CHAR(30) NOT NULL

X(30)

AllTempTables[X]

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 type of action, using the 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)

CHAR NOT NULL

X(12)

LogOnOff

Returns a code to signify which of the following SQL statements fires the trigger: EventCount U = UPDATE I = INSERT D = DELETE

CHAR UPPERCASE NOT NULL

X(1)

Triggers

Returns the number of duplicate rows (that is, same occurrences) that preceded a LAST-occurrence- only row. Returns the client system event number of the restore operation. Returns the value assigned by the Teradata RDBMS to each user archive or recovery command processed. Returns the value assigned by the Teradata RDBMS to each utility function performed or CHECKPOINT statement processed.

INTEGER

--,---,---,--9

AccessLog

EventNum

INTEGER NOT NULL INTEGER NOT NULL

--,---,---,--9

Association

--,---,---,--9

Events[X] RCC_Media[X] Events_ Configuration[X] Events_Media[X] RCC_ Configuration[X]

INTEGER NOT NULL

--,---,---,--9

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 made up of the subsystem ID, 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 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

INTEGER NOT NULL

Z99-99999-99

Software_Event_Log

DECIMAL

rbbeeeeehh

Hardware_Event_ Log

EventType

Returns the type of event that occurred, using the following: CHECKPOINT RESTORE DELETE ROLLBACK DUMP ROLLFORWARD

CHAR NOT NULL

X(30)

Events[X] Events_ Configuration[X] Events_Media[X]

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 whether or not the defined 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

CHAR (1) UPPERCASE

X(1)

SessionInfo[X]

ExpirePassword

Returns the number of days to elapse before the password expires. 0 indicates passwords do not expire. Returns the statistics for each column in a table. Returns the version number of the firmware running at the time the event was logged. Returns the specified logging frequency, which is 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

SMALLINT NOT NULL

---,--9

SecurityDefaults

FieldStatistics FW_Version

VARBYTE (16383) CHAR

X(55) X(11)

ColumnStats Hardware_Event_ Log AccessLog

Frequency

CHAR NOT NULL

X(1)

Frequency_Margin

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

CHAR

X(1)

Hardware_Event_ Log

Function

Returns the identification string for the entity reporting a software event.

VARCHAR

X(32)

Software_Event_Log

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 OPTION attribute of the access right held by the user. Returns the name of a user who was granted a privilege; ALL can be specified. Returns the name of the user who granted the privilege. Returns the unique name defined for this client system. Returns the number of the client system through which the user logged on to the Teradata RDBMS. Returns the Teradata RDBMS (internal) to client system (external) Hex translation codes. Returns the Teradata RDBMS (internal) to client system (external) and uppercase Hex translation codes. Returns the PE Vproc number of the PE through which the session was connected. Returns the PE Vproc number of the PE to which the session was assigned.

CHAR NOT NULL

X(1)

AllRights UserGranted Rights UserRights UserGranted Rights AllRights UserRights HostsInfo SessionInfo[X] CSPSessionInfo AllTempTables[X] CharTranslations

Grantee

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL SMALLINT NOT NULL

X(30)

GrantorName HostName HostNo

X(30) X(30) ---,--9

I2E

BYTE NOT NULL

X(512)

I2EUp

BYTE NOT NULL

X(512)

CharTranslations

IFPNo

SMALLINT NOT NULL SMALLINT NOT NULL

-(4)9

AccessLog

-(4)9

LogOnOff SessionInfo[X]

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 inconsistencies may exist between the definitions of the related parent-child objects after being restored (using ARC), as follows: Y = Yes, the definitions could be inconsistent N = No, the definitions are consistent

CHAR UPPERCASE NOT NULL

X(1)

All_RI_Children All_RI_Parents RI_Child_Tables RI_Distinct_ Children RI_Distinct_ Parents RI_Parent_Tables

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 number. SMALLINT NOT NULL ---,--9 All_RI_Children All_RI_Parents RI_Child_Tables RI_Distinct_Children RI_Distinct_ Parents RI_Parent_Tables All_RI_Children All_RI_Parents Indices[X] RI_Child_Tables RI_Distinct_ Children RI_Distinct_ Parents RI_Parent_Tables Indices[X] IndexStats Events[X]

IndexName

Returns the name of the reference index.

CHAR NOT NULL

X(30)

IndexNumber

Returns an internal index number. Returns the internal number assigned to the index.

SMALLINT NOT NULL SMALLINT NOT NULL CHAR

ZZ9 ---,--9 X(1)

IndexPresent

Returns Y (yes) or N (no) to indicate whether or not the INDEX option was used in a dump event. Returns the statistics relating to the indexes on a table. The output is sorted in the order of the index numbers.

IndexStatistics

VARBYTE (16383)

X(255)

IndexStats

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 as: P (Primary) 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)

CHAR UPPERCASE NOT NULL

X(1)

Indices[X]

InfoData

Returns the attribute identified by the contents of the InfoKey field. Returns the attribute described by the contents of the InfoData field. Returns a code to indicate whether this character set is to be installed as currently 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

VARCHAR

X(16384)

DBCInfo

InfoKey

VARCHAR NOT NULL CHAR UPPERCASE NOT NULL

X(30)

DBCInfo

InstallFlag

X(1)

CharTranslations

Journal_DB

Returns the name of the database or user space in which the default journal table for DatabaseName resides.

CHAR NOT NULL

X(30)

Database_Default_ Journals[X] User_Default_ Journals[X]

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 journaling in effect for the table, or the journal default for 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)

CHAR NOT NULL

X(2)

Databases[X] Tables[X] Users

JournalName

Returns the name of the journal table defined as the default for UserName.

CHAR NOT NULL

X(30)

Database_Default_ Journals[X] Journals[X] User_Default_ Journals[X] Events[X]

JournalSaved

Returns one of the following codes to indicate whether or not the SAVE option was used in the event: Y = Yes N = No

CHAR

X(1)

Journals_DB

Returns the name of the database in which a journal table resides. Returns one of the following codes to indicate which part of the journal table was used: C = Current R = Restored S = Saved

CHAR NOT NULL CHAR

X(30)

Journals[X]

JournalUsed

X(1)

Events[X]

Kind

Returns a code that indicates whether the trigger is evaluated for: S = the statement (once) R = each row changed by the triggering action

CHAR

X(1)

Triggers

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 who last updated the object.

CHAR NOT NULL

X(30)

Columns[X] Databases[X] Indices[X] Tables[X] Triggers Users Columns[X] Databases[X] Indices[X] Tables[X] Triggers Users Software_Event_Log Hardware_Event_ Log

LastAlterTimeStamp

Specifies the time the object was last updated.

TIMESTAMP

yyyy-mm-dd hh:mm:ss

Line

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

BYTEINT NOT NULL

ZZ9

LinkingEventNum

Returns the terminating event number specified by the user for a rollforward or rollbackward event. Returns the number of 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. Returns the Julian date on which the Dbase row was locked to logons due to excessive erroneous passwords. A null or 0 value indicates the row was never locked.

INTEGER

--,---,---,--9

Events[X]

LockedCount

BYTEINT

---9

Users

LockedDate

INTEGER DATE

YY/MM/DD

Users

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 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. Returns the number of minutes to elapse before a locked user is unlocked. 0 indicates immediate unlock. Returns a code to indicate the type of lock used by the event. The codes are as follows: A = ACCESS or Group READ R = full READ

INTEGER

99:99

Users

LockedUserExpire

SMALLINT NOT NULL

---,--9

SecurityDefaults

LockMode

CHAR

X(1)

Events[X]

LogDate

Returns the date that the access log entry was made. Returns any calendar date that precedes the current date by more than 30 days. Returns the date that the event occurred.

DATE NOT NULL DATE NOT NULL DATE NOT NULL SMALLINT NOT NULL

YY/MM/DD YY/MM/DD

AccessLog DeleteAccessLog[X]

YY/MM/DD ZZZ9

LogOnOff SecurityLog[X] AccessLog

LogicalHostId

Returns the ID of the client system from which the session logged on to the Teradata RDBMS. Returns the ID of the client system that had the in-doubt transaction. Returns the identifier of the client system connection as defined by the hardware configuration data. Returns the number of the client system through which the user logged on to the Teradata RDBMS.

SMALLINT NOT NULL SMALLINT NOT NULL

---,--9

DeleteOldInDoubt InDoubtLog HostsInfo

ZZZ9

SMALLINT NOT NULL

ZZZ9

LogOnOff

Teradata RDBMS Data Dictionary

2 49

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

LogicalHostId (continued)

Returns the client system identifier, as defined by the hardware configuration data, to which the rule applies. Returns the identity of the client system connector, based on the hardware configuration data, through which the user logged on.

SMALLINT NOT NULL

ZZZ9

LogonRules

SMALLINT NOT NULL

ZZZ9

SessionInfo[X]

LogonDate

Returns the date that the session for which the log entry was made was logged on to the Teradata RDBMS. Returns the date on which logon for the session occurred. Returns the date of logon for the session being reported.

DATE NOT NULL

YY/MM/DD

AccessLog

DATE NOT NULL DATE NOT NULL BYTE

YY/MM/DD YY/MM/DD X(8)

LogOnOff SessionInfo[X] SessionInfo[X]

LogonSequenceNo

Returns the logon sequence 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 session being reported, such as the userid or session number of the client system. LogonSource may contain the following names and identifiers:

VARCHAR

X(128)

LogOnOff SessionInfo[X] CSPSessionInfo

Channel-Attached LogonSource Values Each of the following fields contains eight characters:

1 2 3 4 5 6 7 8 9 10 11 12 13

Operating System Name (using the string VM or MVS, followed by trailing blank fill) TDP Name (the TDP name, followed by trailing blank fill) Virtual Machine Userid (VM) or MVS job name Environment Name: Blank for VM; for MVS, either TSO, IMS, BATCH, or CICS) Userid from Security Product (Blank if VM, or if no such product) Group from Security Product (Blank if VM, or if no such product) Program Name (MVS only) Coordinator name (CICS or IMS only) Transaction identifier (CICS or IMS only) Terminal identifier (CICS only) User/operator identifier (CICS only) Job ID (MVS) or virtual machine name (VM) 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 2 3 4 5

The string (TCP/IP) Port number of the logon source machine IP address of the logon source machine PID of the process that establishes the connection 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 2 3 4

LIBDBSUTIL (the library that logged on the session) PID of the application process running on the client Application name 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) or refuses (R) permission for the named user to log on from the identified client system. Returns the time on which logon for the session occurred (useful on logoff events). Returns the time that the session for which the log entry was made was logged on to the Teradata RDBMS. Returns the time of logon for the session being reported.

CHAR NOT NULL

X(1)

LogonRules

LogonTime

FLOAT NOT NULL FLOAT NOT NULL

99:99:99.99

LogOnOff

99:99:99

AccessLog

FLOAT NOT NULL VARCHAR (30) NOT NULL SMALLINT

99:99:99.99 X(30)

SessionInfo[X] DeleteOldInDoubt InDoubtLog Events_ Configuration[X] RCC_ Configuration[X] AccessLog DeleteAccessLog[X] SecurityLog[X]

LogonUserName

Returns the ID of the user who ran the in-doubt transaction. Returns the logical processor ID for an AMP not affected by the event. Returns the time of day that the event occurred as HH:MM:SS. Returns the time of day that the event occurred as HH:MM:SS.

LogProcessor

-(4)9

LogTime

FLOAT NOT NULL

99:99:99

FLOAT NOT NULL BYTEINT

99:99:99.99

LogOnOff

LogType

Returns the kind of statement for which the access log entry was made. Returns the number of erroneous logons allowed, at 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.

---,--9

SecurityLog[X]

MaxLogonAttempts

BYTEINT NOT NULL

---9

SecurityDefaults

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 represents either the 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). Returns an integer that represents the maximum spool space, in bytes, allocated to the database on a specified AMP (or on all AMPs if the SUM aggregate is specified). Returns the maximum number of bytes available for temporary space per vproc. Returns the PMA (Processor Module Assembly) model information for the Vproc for which an event was logged. Returns the identity of the type of module affected by the hardware event. For example, PMA, ACA, CMA, PDU, SMA, etc. Returns the count of named table-level check constraint for the table. Returns a code to indicate whether or not a column may have a null value. The following codes are used: Y = Yes N = No

FLOAT NOT NULL

---,---,---,---,--9

Allspace[X] DiskSpace[X]

MaxSpool

FLOAT NOT NULL

---,---,---,---,--9

Allspace[X] DiskSpace[X]

MaxTemp

FLOAT NOT NULL CHAR NOT NULL

---,---,---,---,--9

Allspace[X] DiskSpace[X] AMPUsage

Model

X(4)

Module_Type

BYTEINT

Z9

Hardware_Event_ Log

NamedTblCheck Count Nullable

SMALLINT NOT NULL CHAR NULL

---,--9

Tables[X]

X(1)

Columns[X]

NullPassword

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

CHAR NOT NULL

X(1)

LogonRules

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 type of object associated with the event. The following codes are used: D = Database T J = Table = Journal Table

CHAR

X(1)

Events[X]

OperationInProcess

Returns a code to indicate whether the event is still processing. The following codes are used: Y = Yes N = No

CHAR NOT NULL

X(1)

Events[X]

Options

This field is assigned to NULL initially. It is not used by the system and users may update this one-character column to suit their needs. Specifies when triggers bearing the same action time and event will execute. Returns the original comment on the imported table. Returns the original creator of the imported table. Returns the name of the original database in which the object resided. Returns a code to indicate the original journaling for the 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)

CHAR(1)

X(1)

InDoubtLog

OrderNumber

SMALLINT

---,--9

Triggers

Original_Comment String Original_Creator Name Original_Database Name Original_Journal Flag

VARCHAR CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(255) X(30) X(30)

Association Association Association

X(2)

Association

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 Type

Returns the original protection type of the imported object, using the following codes: F = Fallback N = None

CHAR UPPERCASE NOT NULL

X(1)

Association

Original_TableKind

Returns the original kind of the imported object. Possible values are as follows: T = Data Table V = View M = Macro J = Journal Table I = Join Index Table P= Stored Procedure G = Trigger

CHAR UPPERCASE NOT NULL

X(1)

Association

Original_Table Name Original_Version OwnerName

Returns the name of the original object. Returns the original version of the imported object. Returns the name of the owner of the objects targeted by the view, stored procedure, or macro referenced in the request that generated this log entry. Returns the name of the database owner. Returns the name of the owner of the user.

CHAR UPPERCASE NOT NULL SMALLINT NOT NULL VARCHAR NOT NULL

X(30)

Association

---,--9 X(30)

Association AccessLog

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL SMALLINT NOT NULL CHAR NOT NULL

X(30) X(30) X(30) ---,--9

Databases[X] Users Children[X] Tables[X] Tables2 All_RI_Children All_RI_Parents RI_Distinct_ Children RI_Distinct_ Parents

Parent ParentCount

Returns the name of a parent database or user. Returns the number of parent tables for the table specified in the TVM row. Returns the name of the referenced dababase.

ParentDb

X(30)

Teradata RDBMS Data Dictionary

2 55

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

ParentDbId ParentKeyColumn ParentKeyFID ParentTable

Returns the database ID of the referenced table. Returns the name of the column in a referenced key. Returns the field ID of a column in the referenced key. Returns the name of the referenced table.

BYTE NOT NULL CHAR NOT NULL SMALLINT NOT NULL CHAR NOT NULL

X(8) X(30) ---,--9 X(30)

RI_Child_Tables RI_Parent_Tables All_RI_Children All_RI_Parents RI_Child_Tables RI_Parent_Tables All_RI_Children All_RI_Parents RI_Distinct_ Children RI_Distinct_ Parents RI_Child_Tables RI_Parent_Tables SessionInfo[X]

ParentTID Partition

Returns the table ID of the referenced table. Returns the name of the Teradata RDBMS partition to which the user is currently attached. Possible values are as follows: DBC/SQL FASTLOAD EXPORT MLOAD MONITOR NONE

BYTE NOT NULL CHAR

X(12) X(20)

= an SQL session = a FASTLOAD session = a FASTEXPORT session = a MULTILOAD session = sessions running in a performance monitoring application = session is recognized but not yet assigned BYTEINT Z9 Software_Event_ Log

Returns the number of the Teradata RDBMS partition in which the task that resulted in the logged event was running. PasswordChgDate Returns the Julian date on which the current password was assigned to the user. This value is 0 for a new user. Returns a code to indicate if digits are to be allowed in the password. The following codes are used: Y = allow digits in a password N = do not allow digits

DATE

YY/MM/DD

Users

PasswordDigits

CHAR(1) UPPERCASE NOT NULL

X(1)

SecurityDefaults

2 56

Teradata RDBMS Data Dictionary

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

PasswordLastMod Date PasswordLastMod Time PasswordMaxChar

Returns the date that the user password was last modified. Returns the time that the user password was last modified. Returns the maximum number of characters in a valid password string. PasswordMaxChar must be equal to or greater than PasswordMinChar. Returns the minimum number of characters in a valid password string. Returns the number of days to elapse before a password can be reused. 0 indicates immediate reuse. Returns a code to indicate if 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

DATE INTEGER BYTEINT BETWEEN 1 AND 30 NOT NULL

YY/MM/DD 99:99:99 --9

Users Users SecurityDefaults

PasswordMinChar

BYTEINT BETWEEN 1 AND 30 NOT NULL SMALLINT NOT NULL

--9

SecurityDefaults

PasswordReuse

--9

SecurityDefaults

PasswordSpecChar

CHAR(1)

X(1)

SecurityDefaults

PeakPerm

Returns an integer that represents the maximum permanent space, in bytes, 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.

FLOAT NOT NULL

---,---,---,---,--9

AllSpace[X] DiskSpace TableSize[X]

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 represents the maximum 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.

FLOAT NOT NULL

---,---,---,---,--9

AllSpace[X] DiskSpace

PeakTemp

Returns the peak number of bytes used at one time by a temporary table per vproc. Note: The ClearPeakDisk macro allows the Teradata RDBMS administrator to clear this field.

FLOAT NOT NULL

---,---,---,---,--9

AllSpace[X] DiskSpace

PermSpace

Returns an integer indicating the total space allocated to the database on all AMPs. Returns an integer that indicates the permanent space allocated to the user.

FLOAT NOT NULL FLOAT NOT NULL SMALLINT

ZZZ,ZZZ,ZZ Z,ZZZ,ZZ9 ---,---,---,---,--9

Databases[X]

Users

PhyProcessor

Returns the physical processor ID for an AMP not affected by the event. Identifies the Processor Module Assembly (PMA) on which the event occurred. Returns the board information. Returns information about the identification of the table used as the primary index. Returns D (the event was for all AMPs and the processor was down) or U (the event was for specific AMPs)

ZZ9-9

Events_ Configuration[X] RCC_ Configuration[X] Software_Event_Log Hardware_Event_ Log Hardware_Event_ Log Tables[X]

PMA

INTEGER NOT NULL VARCHAR SMALLINT NOT NULL CHAR NOT NULL

ZZ9-9

Primary_Part_ Number PrimaryKeyIndexId

X(11) ---,--9

ProcessorState

X(1)

Events_ Configuration[X] RCC_ 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 (None) to indicate whether the tables in the database are protected by the Fallback option. Returns the text of the most recent data definition statement that was used to change the table, view, join index, trigger, or macro. Returns the actual request text that was used to create the trigger.

CHAR NOT NULL

X(1)

Databases[X] Tables[X] Users

RequestText

VARCHAR (12,500)

X(255)

Tables[X]

VARCHAR (12,500) VARCHAR (30) NOT NULL SMALLINT

X(255)

Triggers

ResolvingUser LogonName RestartSeqNum

Returns the identity of the user who resolved the in-doubt transaction. Returns an integer (0 through n) to indicate the number of times that the Teradata RDBMS had to be restarted during the event. 0 indicates that no restarts took place. Returns an integer (0 through n) indicating the iteration of 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.

X(30)

DeleteOldIn DoubtInDoubt Log Events[X] Events_ Configuration[X]

---,--9

SMALLINT

---,--9

RCC_ Configuration[X]

Result

Returns a code to indicate how the access request for which this log entry was made. Possible codes are as follows: G = Granted D = Denied

CHAR NOT NULL

X(1)

AccessLog

Revision_Level RunUnitId

Returns the revision level of the part. Returns the identity of the run unit that had the in-doubt transaction.

VARCHAR VARBYTE (30) NOT NULL

X(2) X(60)

Hardware_Event_ Log DeleteOldIn DoubtInDoubt 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_ Number SeqNumber

Returns the secondary part number assigned by manufacturing. Returns column sequence numbers derived from the field ID. The output is sorted in the order of the sequence numbers. Returns the serial number assigned by manufacturing. Returns the identifier assigned to the session by the TDP or LAN interface.

VARCHAR

X(11)

Hardware_Event_ Log ColumnStats

SMALLINT NOT NULL

---,--9

Serial_Number SessionNo

VARCHAR INTEGER NOT NULL

X(10) --,---,---,--9

Hardware_Event_ Log AccessLog LogOnOff SessionInfo[X] AllTempTables[X] CSPSessionInfo DeleteOldIn Doubt InDoubtLog Software_Event_ Log

SessionNumber

Returns the number of the session that had the in-doubt transaction. The Severity option returns a code identifying the severity of a software event. Possible values are as follows: 0

INTEGER NOT NULL SMALLINT

--,---,---,--9

Severity

ZZ9

= 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 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 200 = Unrecoverable system error, system restart required (PMAError) 140 = Unrecoverable PMA hardware error, PMA stays down (PMAFatal) (SystemError) 210 = Unrecoverable system error, restart not possible (SystemFatal) (VprocFatal)

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 severity of the hardware event. Possible values are: C = Critical Event F = Fatal - Subsystem down D = Degraded W = Warning I = Information

CHAR

X(1)

Hardware_Event_ Log

Slot

Returns the slot number within the module assembly at which the hardware event is located. Returns the identity of the type of the slot affected by the hardware event. For example, CMA_pwr, SMA_pwr. Returns an integer indicating the maximum spool space allowed for the database. SpoolSpace is 0 if DatabaseName is PUBLIC. Returns an integer that indicates the spool space allocated to the user.

BYTEINT

Z9

Hardware_Event_ Log

Slot_Type

FLOAT NOT NULL

Hardware_Event_ Log

SpoolSpace

FLOAT NOT NULL

ZZZ,ZZZ,ZZ Z,ZZZ,ZZ9

Databases[X]

FLOAT NOT NULL CHAR NOT NULL

---,---,---,---, --9 X(1)

Users

SPParameterType

Returns the data type of a stored procedure parameter. Possible types are:
Type I B O Description IN parameter INOUT parameter OUT parameter

Columns[X]

Stacktrace StartMBox

Identifies the software calling sequence to aid in debugging. Returns the client/server mailbox ID where the SQL request is sent. Returns the startup string (macro or SQL statement) specified for the user.

VARBYTE BYTE

X(640) X(20)

Software_Event_Log CSPSessionInfo

StartupString

VARCHAR

X(255)

Users

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 associated rule) the text of the statement that caused the privilege check for which this log entry was made. Returns the type of statement that caused the privilege check for which this log entry was made. Returns the number of the subslot affected by the event. Returns the identity of the type of subslot affected by the hardware event. For example, Bynclk, MAPDP. Identifies the software version running at the time the event was logged. Returns the table type as one of the following: T = Table V = View M = Macro J = Journal Table I = Join Index Table P = Stored Procedure G = Trigger

VARCHAR

X(8192)

AccessLog

StatementType

VARCHAR NOT NULL

X(20)

AccessLog

SubSlot SubSlot_Type

BYTEINT BYTEINT

9 9

Hardware_Event_ Log Hardware_Event_ Log

SW_Version

VARCHAR

X(64)

Software_Event_Log

TableKind

CHAR NOT NULL

X(1)

Tables[X]

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, view, stored procedure, trigger, or macro on which a privilege was granted. Returns the name of a table.

CHAR NOT NULL

X(30)

AllRights

CHAR NOT NULL

X(30)

AllSpace[X] Indices[X] Tables[X] TableSize[X] Columns[X] UserGranted Rights UserRights Association Events[X]

Returns the name of a table, view, stored procedure, or macro. Returns the imported object name. Returns the name of the table affected by the event. If the object is a database, then the value is set to NULL. Returns the name of a data table that has change images recorded in a journal table. Returns the name of the table, view, stored procedure, or macro for this log entry. Returns the name of a table having column-level check constraints. Returns the name of a table having table-level check constraints. Returns the name of the table the trigger is defined against. Returns the name of the table containing the column for which statistics are requested. Tables_DB Returns the name of the database in which a data table resides that will have change images written to a journal table.

CHAR NOT NULL

X(30)

CHAR NOT NULL CHAR NOT NULL

X(30) X(30)

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(30)

Journals[X]

X(30)

SecurityLog[X]

X(30)

SHOWCOL CHECKS

X(30)

SHOWTBL CHECKS Table_Level Constraints Triggers ColumnStats IndexStats Journals[X]

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(30) X(30)

X(30)

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 number assigned to each task as it is created for execution. Returns the unresolved text for the table-level check condition. Returns the temperature of the power board in microdegrees Centigrade.

SMALLINT

ZZZZ9

Software_Event_Log

TblCheck

VARCHAR (8192) DECIMAL (4,1) FLOAT NOT NULL

X(255)

SHOWTBLCHECKS

Temperature

-ZZ.99

Hardware_Event_ Log Databases[X]

TempSpace

Returns the maximum temporary space allocated for a database or user in bytes.
Returns an integer that indicates the temporary space allocated to the user.

---,---, ---,---, --9

FLOAT NOT NULL VARCHAR

---,---, ---,---, --9 X(8192)

Users

Text

Returns the text associated 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 with the logged event.

SecurityLog[X]

VARCHAR NOT NULL DATE NOT NULL FLOAT NOT NULL

X(255)

Software_Event_Log Hardware_Event_ Log Software_Event_Log Hardware_Event_ Log Software_Event_Log Hardware_Event_ Log Users

TheDate

Returns the calendar date on which the event was logged. Returns the clock time at which the event was logged, based on a 24-hour clock (hh:mm:ss). Returns the format of the time zone as signed integer values from -12:59 to +13:00. Returns the format of the time zone as signed integer values from -12:59 to +13:00.

YY/MM/DD

TheTime

99:99:99.9999 99

TimeZoneHour

BYTE

---9

TimeZoneMinute

BYTE

---9

Users

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 codes to indicate the mode of the session: T = TDBS A = ANSI

CHAR

X(1)

SessionInfo[X]

TriggerComment TriggerName

Returns the optional comment for the trigger. Returns the name of the trigger.

VARCHAR CHAR NOT NULL (I) UPPERCASE BYTE NOT NULL VARCHAR

X(255) X(30)

Triggers Triggers

TVMId TVMName

Returns the internal ID of the table. Returns the table, view, stored procedure, or macro name of the object for which this log entry was made. Returns the table, view, stored procedure, or macro to which the access logging rule applies. Returns the name of the table.

X(12) X(30)

Tables2 AccessLog

CHAR NOT NULL

X(30)

AccLogRules

CHAR NOT NULL VARCHAR (1) UPPERCASE

X(30) X(1)

Tables2 SessionInfo[X]

TwoPCMode

Returns one of the following codes: 2 = 2PC mode N = non-2PC mode

UniqueFlag

Returns a code to indicate whether the index is unique. The following codes are used: Y = Yes; index is unique N = No; index is not unique

CHAR UPPERCASE NOT NULL

X(1)

Indices[X]

UnnamedTblCheck Exist

Returns an indicator for whether the table has an unnamed table-level check constraint, as follows: Y = Yes, has N = No, does not have

CHAR NOT NULL

X(1)

Tables[X]

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 unresolved Referential Integrity (RI) constraints in the database. Returns the case indicator flag 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

SMALLINT NOT NULL CHAR

---,--9

Databases2

UpperCaseFlag

X(1)

Columns[X]

Note: Case flags U, C, and B are valid only for CHAR, VARCHAR, and LONG VARCHAR columns. UserLogonDate UserLogonTime UserName Returns the date that the specified user logged on. Returns the time that the specified user logged on. Returns the name of the user for whom the log entry was made. Returns the user to which the access logging rule applies; ALL may be specified. Returns the name of a user. Note: SYSTEMUSERID is a system user name that tracks console utility activity such as table rebuild, Diskcopy, or Scandisk. DATE NOT NULL FLOAT NOT NULL VARCHAR NOT NULL CHAR NOT NULL CHAR NOT NULL YY/MM/DD 99:99:99 X(30) DeleteOldInDoubt InDoubtLog DeleteOldInDoubt InDoubtLog AccessLog SecurityLog[X] AccLogRules

X(30)

X(30)

AccountInfo[X] AMPUsage Users

2 66

Teradata RDBMS Data Dictionary

Chapter 2: System Views System View Columns Reference


View Column Name Description Data Type Format Associated Views

UserName (Continued)

Returns the name of a user to whom the privilege was granted. Returns the username associated with the event.

CHAR NOT NULL CHAR NOT NULL

X(30)

AllRights

X(30)

Events[X] Events_ Configuration[X] LogOnOff LogonRules

Returns the name of the user to whom the rule applies; DEFAULT may be specified. Returns the Teradata RDBMS userid of the user who is currently logged on. Returns the name of a user space for which a default journal table has been defined. Returns the username associated with the client system utility dump or restore event. Returns the logon name of the user that materialized the temporary table. Vcc_Amps Vcc_Margin Returns the value of the main supply current in microamps. Returns the value of the main supply voltage margin.Values inlcude: H = High, N = Normal, and L = Low. Returns the value of the main supply voltage in microvolts. Returns the version count, which is incremented each time the table is altered with a data definition statement. Returns the sequence number of the volume, which defines the position of the volume in a multi-volume set.

CHAR NOT NULL CHAR NOT NULL CHAR NOT NULL

X(30)

X(30)

SessionInfo[X]

X(30)

User_Default_ Journals

CHAR NOT NULL

X(30)

Events_Media[X]

CHAR NOT NULL DECIMAL (4,2) CHAR

X(30)

AllTempTables[X]

Z9.99 X(1)

Hardware_Event_ Log Hardware_Event_ Log

Vcc_Volts Version

DECIMAL (4,2) SMALLINT NOT NULL

-9.99 ZZZZ9

Hardware_Event_ Log Tables[X]

VolSequenceNum

SMALLINT

---,--9

RCC_Media[X] Events_Media[X]

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 character volume serial assigned to a device. Identifies the virtual processor for which an event was logged.

CHAR NOT NULL SMALLINT

X(6)

Events_Media[X] RCC_Media[X] Events_ Configuration[X] RCC_ Configuration[X] Software_Event_Log AllSpace[X] AMPUsage DiskSpace[X] TableSize[X] AMPUsage

Vproc

-(4)9

Identifies the virtual processor for which an event was logged. Vproctype Returns the type of Vproc for which an event was logged.

SMALLINT NOT NULL

-(4)9

CHAR NOT NULL

X(4)

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

31

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 Administrators

LogDate 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.)

32

Teradata RDBMS Data Dictionary

Chapter 3: System Views: Usage and Examples AccessLog ==> SELECT LogDate, UserName, AccessType, StatementText FROM DBC.AccessLog WHERE LogDate = 890510; LogDate 89/05/10 UserName Jones AccessType CT StatementText CREATE TABLE Jones.EmpDup (Em

Teradata RDBMS Data Dictionary

33

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 Administrator

UserName DatabaseName 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

34

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. 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. 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

35

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

Jones Personnel

All 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.

36

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 Bob Bob G417 G417 AccountName 7654 Temp Work Area 137 $HGAVE

Additional Information
See Teradata RDBMS Database Design for more information on controlling access, space, and ownership.

Teradata RDBMS Data Dictionary

37

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 CD CG CM CP CT CU CV D DD = = = = = = = = = = ABORT SESSION CREATE DATABASE CREATE TRIGGER CREATE MACRO CHECKPOINT CREATE TABLE CREATE USER CREATE VIEW DELETE DROP DATABASE

38

Teradata RDBMS Data Dictionary

Chapter 3: System Views: Usage and Examples AllRights DG DM DP DT DU DV E I IX MR MS PC PD PE RO R RF RS SS SR U = = = = = = = = = = = = = = = = = = = = = DROP TRIGGER DROP MACRO DUMP DROP TABLE DROP USER DROP VIEW EXECUTE INSERT INDEX MONITOR RESOURCE MONITOR SESSION CREATE PROCEDURE DROP PROCEDURE EXECUTE PROCEDURE REPLICATION OVERRIDE RETRIEVE/SELECT REFERENCE RESTORE SET SESSION RATE SET RESOURCE RATE 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 project project project project project project project project employee employee AccessRight RS DP DT G D I U R I U GrantorName SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD

Teradata RDBMS Data Dictionary

39

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 Test Test Test Test PERSONNEL PERSONNEL PERSONNEL PERSONNEL User1 User1 User1 User1 TableName DEPARTMENT DEPARTMENT DEPARTMENT DEPARTMENT department department department department department department department department AMP 1-0 1-1 1-2 1-3 1-0 1-1 1-2 1-3 1-0 1-1 1-2 1-3 CurrentPerm 1,024 512 1,024 512 2,048 1,536 1,536 1,536 2,048 1,536 1,536 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 52 SessionNo 3,409 DatabaseName TEST TableName GTEMP1 TableId 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 7654 Sum(CPUTime) 204,352.88 Sum(DiskIO) 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 OldPersonnel Personnel2 Original_TableName Empl_Addr Empl_Dept TableName Emp_Address 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 Administration Teradata Archive/Recovery Reference

Archiving and Recovering Data Archive/Recovery Control Language

Recovery Control Views All

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 Set Id 100 105 103 104 101 102 Install E2I 00010203A809A97FD1D2D3... 00010203A809A97F2395EE... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3...

CharSetName German_EBCDIC Italian_EBCDIC Spanish_EBCDIC French_EBCDIC Norwegian_EBCDIC Swedish_EBCDIC

Flag N N N Y N Y

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 Finance Finance Finance Child Personnel Jones 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 EmpNo Name DeptNo JobTitle Salary YrsExp . . . ColumnFormat 9(5) X(12) 999 X(12) zzz,zz9.99 z9 . . . Nullable N N Y Y Y Y . . . ColumnType I CV I CV D 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 EmpNo Name DeptNo JobTitle Salary YrsExp CommentString Employee serial number. Employee name, last then first initial.

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 D10706130F271613 0100000000000000 0000000012000100 00000000000 DatabaseName TableName SeqNumber

QCD

QUERY

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 Teradata_Sample ProtectionType F PermSpace 100,000 SpoolSpace 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 DtBs1 DtBs2 DtBs3 Journal_DB DtBs1 DtBs2 DtBs1 JournalName DtBs1Jrnl DtBs2Jrnl 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: VERSIONVersion of the software currently running on the Teradata RDBMS RELEASERelease 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 VERSION RELEASE InfoData V2R.nn.nn.nn.nn 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 Administrator

LogDate 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 2

Select statistics from the DiskSpace view and insert them in the history table. 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 0-0 1-0 1-0 1-0 1-0 . . 1-1 1-1 1-1 1-1 . . 1-2 . stst14 ud12 atest a1 btest b2test . . atest a1 btest b2test . . atest . 0 0 1,536 0 3,584 49,664 . . 1,536 0 3,584 50,688 . . 1,536 . 125,000 125,000 125,000 247,500 5,000 250,000 . . 125,000 247,500 5,000 250,000 . . 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 Control

CreateDate 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 RowA row is created for each journal checkpointed. Delete Event RowA row is created for each journal deleted. Dump Event RowA row is created for each database or table dumped. Restore Event RowA row is created for each database or table restored. Rollback Event RowA 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 RowA 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 CreateDate CreateTime UserName EventType DatabaseName ObjectType AllAMPsFlag RestartSeqNum OperationInProcess

DataSetName TableName, CheckpointName LinkingEventNum LockMode JournalUsed JournalSaved IndexPresent DupeDumpSet

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 87/03/18 87/03/18 87/03/19 87/02/12 CreateTime 11:10:45 11:18:20 12:06:34 14:13:38 EventType Rollforward Restore Rollforward Dump JournalUsed R R R 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 Control

Vproc 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 87/03/18 87/03/18 87/03/18 87/03/20 87/03/18 87/03/18 87/03/18 CreateTime 08:53:48 08:57:49 08:54:42 11:26:26 09:00:05 09:30:59 08:57:02 EventNum 30 44 33 98 52 55 41 EventType Rollforward Rollforward Rollforward Dump Rollforward Restore 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 Control

CreateDate 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 BRM.DBC.TEXT1 BRM.DBC.TEXT1 BRM.DBC.TEXT2 BRM.DBC.TEXT2 BRM.DBC.TEXT1 BRM.DBC.TEXT1 BRM.DBC.TEXT2 BRM.DBC.TEXT2 VolSerialId 000469 000469 000469 000469 BRM001 BRM002 BRM001 BRM002 DupeDumpSet N N N N Y Y N 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 Control

TheDate 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 136 137 HostName VM LAN DefaultCharSet Norwegian_EBCDIC 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 Charges Charges Charges Department Employee Employee Project ColumnName Proj_id EmpNo Proj_id DeptNo EmpNo Name Proj_id ColumnPosition 1 1 2 1 1 1 1 IndexType S P P P P S P UniqueFlag N N N Y Y N 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 D10706130F271613 0100000000000000 0000000012000100 00000000000 DatabaseName TableName IndexNumber

TEST

T1

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 PriceA . . . Tables_DB Acctng . . . Journals_DB Acctng . . . JournalName 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 channelattached clients:

Teradata RDBMS Data Dictionary

3 51

Chapter 3: System Views: Usage and Examples LogOnOff Figure 3-1 LogonSource Values

LogonSource Values
Logons from networkattached clients Logons from channelattached clients Internal PDE session information
(TCP/IP) C079 153.64.69.48 (TCP/IP) A401 153.64.69.48 VM MVS TDP5 TDP5 YT2 SDML 756 01 LSS

BATCH

0701 LSS FASTMAINJOB075760701 LSS

AGBCLI2J LIBDBSUTIL (673) APPL=CSPSLAVE HOST=BABBAGEB LIBDBSUTIL (651) APPL=CSPSLAVE HOST=BABBAGE MVS MVS MVS MVS MVS MVS MVS MVS TDP5 TDP5 TDP5 TDP5 TDP5 TDP5 TDP5 TDP5 SDME YT2COP1 AGBMLDB YT2BETQ YT2FLD AGBFAST1 YT2TPMP YT2TO2 BATCH BATCH BATCH BATCH BATCH BATCH BATCH BATCH ++++++++* YT2 * AGB * ++++++++* ++++++++* AGB * ++++++++* ++++++++* XPORT...........JOB053681101 ARCMAIN.......JOB076391101 MLOAD...........JOB048661101 BTQMAIN.......JOB004431101 FASTLOAD....JOB076391101 FASTLOAD....JOB030551101 TPUMP..........JOB050451101 TRUMP..........JOB088881101 LSS LSS LSS LSS LSS LSS LSS LSS

Logons from channel-attached clients

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 87/09/29 87/09/29 87/09/29 87/09/29 87/09/29 87/09/29 87/09/29 87/09/29 87/09/29 . . . LogTime 12:35:54 12:35:60 13:30:37 13:31:45 13:52:52 13:56:03 14:05:27 14:12:12 14:14:04 . . . Event LogicalHostId 116 116 116 116 116 116 116 116 116 . . . IFPNo 1-4 1-4 1-4 1-4 1-4 1-4 1-4 1-4 1-4 . . .

Logon Logon Logoff Logoff Logon Logoff Logon Logoff Logon failed . . .

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 21 75 88 . . 21 75 . . . . LogProcessor 1 1 1 . . . . 2 2 . . PhyProcessor 1-0 1-0 1-0

1-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 21 76 66 19 66 37 77 . . VolSerialID KAZ002 RDB003 RDB007 KAZ002 RDB008 MET001 RDB003 . . VolSequenceNum 1 1 1 1 2 1 1 . . DupeDumpSet N N N N N N 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 childparent 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 parentchild 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 Administrator

ExpirePassword 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 Administrator

LogDate 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 BAS SOFTDOC UserTest SessionNo 1,020 1,016 1,008 DefaultDatabase BAS Personnel DBC LogonSource VM MVS TDPM TDPG

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 (TCP/IP) 0491 141.206.19.180 0438 hex = 1080 decimal 0448 hex = 1096 decimal 0491 hex = 1169 decimal

251 893

01 LSS 01 LSS

<---- winddi via ODBC from TD Manager <---- dmteq PID = 251 from PC <---- bteq PID = 893 from unix

root@napier# netstat -an Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address tcp 0 0 141.206.19.180.1025 153.64.115.59.1096 tcp 0 0 141.206.19.180.1025 153.64.115.59.1080 tcp 0 2 141.206.19.180.23 153.64.115.59.1063 tcp 0 0 141.206.19.180.23 153.64.115.59.1062 tcp 0 0 141.206.19.180.1025 141.206.19.180.1169 tcp 0 0 141.206.19.180.1169 141.206.19.180.1025

(state) ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED 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 Control

TheDate 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 92/08/20 TheTime 10:10:30 Category 4 Severity 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 NewEmp EmployeeInfo Employee Department Project Charges CreatorName GREENE GREENE DBC DBC JONES JONES TableKind M V T T T T ProtectionType F F F F F 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) 260,608 Sum(CurrentPerm) 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 Personnel Personnel Personnel TableName Employee Employee Employee Grantee Greene Greene Greene AccessRight R U 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 Personnel Personnel Personnel TableName Employee Employee Employee AccessRight R U I GrantorName DBC DBC 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 Jones Peterson Moffit Chin Greene

CreatorName sysadmin Jones Jones Jones Jones

PermSpace 1,000,000 100,000 100,000 100,000 100,000

SpoolSpace 1,000,000 1,000,000 1,000,000 1,000,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 Usr1 Usr2 Usr3 Journal_DB Usr1 Usr2 Usr3 JournalName Usr1Jrnl Usr2Jrnl 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

41

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.

42

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

43

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.

44

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 DBC.ChangedRowJournal DBC.DatabaseSpace DBC.LocalSessionStatusTable DBC.LocalTransactionStatusTable DBC.OrdSysChngTable DBC.RecoveryLockTable DBC.RecoveryPJTable DBC.SavedTransactionStatus DBC.SysRcvStatJournal DBC.TransientJournal DBC.UtilityLockJournalTable

Resource usage by Acct/User Down -AMP recovery journal Database and table space accounting Last request status by AMP Last transaction consensus status AMP recovery journal Recovery session locks Permanent journal recovery AMP recovery table Recovery, reconfig, and startup info Backout uncommitted transactions 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

45

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 Description Columns Referenced Column(s) Data Type Default Format

DBC.AccessRights Contains the permissions for a user.

UserId (NUPI) DatabaseId (NUPI) TVMId (NUSI) FieldId AccessRight WithGrant GrantorId AllnessFlag CreateUID CreateTimeStamp LastAccessTimeStamp AccessCount

Dbase.DatabaseId Dbase.DatabaseId TVM.DatabaseId TVM.TVMId TVFields.Tableid TVFields.Fieldid None None Dbase.Databaseid None Dbase.DatabaseId None None None

BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL SMALLINT, NOT NULL CHAR (2), LATIN, NOT NULL CHAR (1), LATIN, NOT NULL BYTE(4), NOT NULL CHAR(1), LATIN, NOT NULL BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER

X(8) X(8) X(12) ---,--9 X(2) X(1) X(8) X(1) X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9

46

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.AccLogRuleTbl Controls the logging of access rights checks for the specified users or references to the specified objects.

UserId (UPI) DatabaseId (UPI) TVMId (UPI) ColumnId(UPI) AcrCheckPoint

Dbase.DatabaseId Dbase.DatabaseId TVM.TVMId TVFields.FieldId None

BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL SMALLINT CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL

X(8) X(8) X(12) ---,--9 X(3)

AcrCreateDataBase

None

X(3)

AcrCreateMacro

None

X(3)

AcrCreateProcedure AcrCreateTable

None None

X(3) X(3)

AcrCreateUser

None

X(3)

AcrCreateView

None

X(3)

AcrDelete

None

X(3)

AcrDropDatabase

None

X(3)

Teradata RDBMS Data Dictionary

47

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.AcclogRuleTbl (Continued)

AcrDropMacro

None

CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL

X(3)

AcrDropProcedure AcrDropTable

None None

X(3) X(3)

AcrDropUser

None

X(3)

AcrDropView

None

X(3)

AcrDump

None

X(3)

AcrExecute

None

X(3)

AcrExecuteProcedure AcrGrant

None None

X(3) X(3)

AcrInsert

None

X(3)

AcrIndex

None

X(3)

AcrReference

None

X(3)

48

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.AccLogRuleTbl (Continued)

AcrRestore

None

CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL CHAR(3), LATIN, NOT CASE SPECIFIC, NOT NULL BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER

X(3)

AcrSelect

None

X(3)

AcrUpdate

None

X(3)

AcrCreateTrigger

None

X(3)

AcrDropTrigger

None

X(3)

AcrCreateProcedure

None

X(3)

AcrDropProcedure

None

X(3)

AcrExecuteProcedure

None

X(3)

CreateUID CreateTimeStamp LastAccessTimeStamp AccessCount

Dbase.DatabaseId None None None

X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9

Teradata RDBMS Data Dictionary

49

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.AccLogTbl Contains the result of the logging activity controlled by the AccLogRuleTbl.

LogonDate LogonTime TheDate TheTime LogicalHostId IFPNo SessionNo UserId UserName

None None None None None None None Dbase.DatabaseId Dbase.DatabaseName

DATE, NOT NULL FLOAT, NOT NULL DATE, NOT NULL FLOAT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL INTEGER, NOT NULL BYTE(4), NOT NULL VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL INTEGER, NOT NULL

YYYY/MM/ DD 99:99:99 YYYY/MM/ DD 99:99:99 ZZZ9 -(5)9 --,---,---,--9 X(8) X(30)

AccountName

None

X(30)

Result

None

X(1)

SeqInHash

None

--,---,---,--9

4 10

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.AccLogTbl (Continued)

AccessType

None

CHAR(2), LATIN, NOT CASESPECIFIC, NOT NULL BYTEINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL INTEGER VARCHAR(30), LATIN, NOT CASESPECIFIC, VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL VARCHAR(30), LATIN, NOT CASESPECIFIC, VARCHAR(30), LATIN, NOT CASESPECIFIC, CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL SMALL INT SMALL INT VARCHAR(20), LATIN, NOT CASESPECIFIC, VARCHAR(8192), UNICODE, NOT CASE SPECIFIC

X(2)

Accesskind Frequency

None None

--9 X(1)

EventCount OwnerName

None Dbase.DatabaseName

--,---,---,--9 X(30)

DataBaseName

Dbase.DatabaseName

X(30)

TVMName

TVM.TVMName

X(30)

ColumnName

None

X(30)

ObjectLevel

None

X(1)

ObjectId ColumnId StatementKind StatementType

Dbase.DatabaseId TVM.TVMId None None None

X(8) ---,--9 ---,--9 X(20)

StatementText

None

X(8192)

Teradata RDBMS Data Dictionary

4 11

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Acctg Contains a row for each account a user owns on each AMP. NO FALLBACK NON-HASHED

AccountName (UPI)

None

CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL FLOAT, NOT NULL FLOAT, NOT NULL SMALLINT, NOT NULL CHAR(4), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(4), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(256), NOT NULL BYTE(256), NOT NULL BYTE(256), NOT NULL TIMESTAMP(0) INTEGER

X(30)

UserName (UPI)

Dbase.DatabaseName

X(30)

CPU IO Vproc VprocType

None None None None

---,---,---,--9.99 --,---,---,--9 -(5)9 X(4)

Model

None

X(4)

DBC.CollationTbl Contains userdefinable collation definitions.

CollName (UPI)

None

X(30)

CollInstall

None

X(1)

CollEqvClass CollOrderCS CollOrderUC LastAccessTimeStamp AccessCount

None None None None None

X(512) X(512) X(512) yyy-mm-dd hh:mm:ss --,---,---,--9

4 12

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Constraint Names Contains a row for each named index or referential constraint defined on a table in the system.

DatabaseId (NUPI) TableId (NUPI) Name

Dbase.DatabaseId TVM.TVMId None

BYTE(4), NOT NULL BYTE(6), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER BYTE(4), NOT NULL

X(8) X(12) X(30)

NameI

None

X(30)

ConstraintType

None

X(1)

IndexId CreateUID CreateTimeStamp LastAccessTimeStamp AccessCount DBC.DatabaseSpace Does space accounting for each database and each table in a database. NO FALLBACK NON-HASHED DatabaseId (UPI)

None Dbase.DatabaseId None None None Dbase.DatabaseId

---,--9 X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9 X(8)

Teradata RDBMS Data Dictionary

4 13

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Dbase Contains a row for each database in the system.

DatabaseNameI (UPI)

None

CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL

X(30)

DatabaseId (USI)

Accounts.UserId Databasespace. Databaseid Accessrights.User Id Owners.ownerid TVM.databaseId ReferencingTbls. ReferencingDbId DBCAssociation. DatabaseId Owners.owneeid ReferencedTbls. ReferencedDbId TableConstraints. DbaseId Triggerstbl. DatabaseId

X(8)

OwnerId PasswordString

Dbase.DatabaseId None

BYTE(4), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(2), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL FLOAT, NOT NULL FLOAT, NOT NULL VARCHAR(255), UNICODE, NOT CASESPECIFIC

X(8) X(30)

ProtectionType

None

X(1)

JournalFlag

None

X(2)

PermSpace SpoolSpace StartupString

None None None

----,---,---,---,--9 ----,---,---,---,--9 X(255)

4 14

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Dbase (Continued)

CommentString

None

VARCHAR(255), UNICODE, NOT CASESPECIFIC CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL

X(255

AccountName

None

X(30)

CreatorName

Dbase.DatabaseName

X(30)

DatabaseName

RCEvent.Database Name AcclogTbl.User Name

X(30)

JournalId Version OwnerName

None None Dbase.DatabaseName

BYTE(6) SMALLINT CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC SMALLINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL INTEGER

X(12) ---,--9 X(30)

NumFallBackTables NumLogProtTables DefaultDatabase LogonRules AccLogRules AccLogUsrRules DefaultCollation

None None Dbase.DatabaseName None None None None

---,--9 ---,--9 X(30) ---,--9 ---,--9 ---,--9 X(1)

RowType

None

X(1)

PasswordChgDate

None

--,---,---,--9

Teradata RDBMS Data Dictionary

4 15

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Dbase (Continued)

LockedDate LockedTime LockedCount UnResolvedRICount TimeZoneHour TimeZoneMinute DefaultDateForm

None None None None None None None

INTEGER SMALLINT BYTEINT SMALLINT, NOT NULL BYTEINT BYTEINT CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC BYTE(4) TIMESTAMP(0) BYTE(4) TIMESTAMP(0) FLOAT, NOT NULL TIMESTAMP(0) INTEGER SMALLINT BYTE(6), NOT NULL BYTE(4), NOT NULL BYTE(6) INTEGER, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL

--,---,---,--9 ---,--9 ---9 ---,--9 ---9 ---9 X(1)

CreateUID CreateTimeStamp LastAlterUID LastAlterTimeStamp TempSpace LastAccessTimeStamp AccessCount DefaultCharType DBC.DBCAssociation Contains the results of the porting of a data table between DBCs by Archive/Recovery software. TVMId (UPI) DatabaseId JournalId EventNum Original_Database Name Original_DataBaseId

Dbase.DatabaseId None Dbase.DatabaseId None None None None None TVM.TVMId Dbase.DatabaseId None None None

X(8) X(20) X(8) yyyy-mm-dd hh:mm:ss ----,---,---,---,--9 yyyy-mm-dd hh:mm:ss --,---,---,--9 ---,--9 X(12) X(8) X(12) --,---,---,--9 X(30)

None

X(12)

4 16

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.DBCAssociation (Continued)

Original_TVMNameI

None

CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT INTEGER BYTE(6), NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL VARCHAR(12500), UNICODE, NOT CASESPECIFIC

X(30)

Original_LogicalHost Id Original_SessionNo Original_TVMId Original_TableKind

None None None None

ZZZ9 --,---,---,--9 X(12) X(1)

Original_Protection Type

None

X(1)

Original_TempFlag

None

X(1)

Original_HashFlag

None

X(1)

Original_NextIndexId Original_NextFieldId Original_Version Original_RequestText

None None None None

---,--9 ---,--9 ---,--9 X(255)

Original_Comment String

None

VARCHAR(255), UNICODE, NOT CASESPECIFIC

X(255)

Original_CreatorName

None

CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL

X(30)

Teradata RDBMS Data Dictionary

4 17

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.DBCAssociation (Continued)

Original_TVMName

None

CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(2), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(6) SMALLINT VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL VARCHAR(16384), LATIN, NOT CASESPECIFIC SMALLINT, NOT NULL VARCHAR(255), LATIN, NOT CASESPECIFIC, NOT NULL

X(30)

Original_JournalFlag

None

X(2)

Original_JournalID Original_UtilVersion DBC.DBCInfoTbl Contains current information such as, the DBC version and release. InfoKey (UPI)

None None None

X(12) ---,--9 X(30)

InfoData

None

X(16384)

DBC.ErrorMsgs Stores all error messages returned to the user.

ErrorCode (UPI) ErrorText

None None

---,--9 X(255)

4 18

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.EventLog Contains a row for every session event.

DateFld (NUPI) TimeFld (NUPI) UserName

None None Dbase.DatabaseName

DATE, NOT NULL FLOAT, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(12), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL INTEGER, NOT NULL DATE, NOT NULL FLOAT, NOT NULL VARCHAR(128), LATIN, NOT CASESPECIFIC CHAR(2), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL VARBYTE(2048), NOT NULL

YYYY/MM/ DD 99:99:99.99 X(30)

AccountName

Dbase.AccountName

X(30)

Event

None

X(30)

LogicalHostId IFPNo SessionNo LogonDate LogonTime LogonSource

None None None None None None

ZZZ9 -(5)9 --,---,---,--9 YYYY/MM/ DD 99:99:99.99 X(128)

DBC.Global This table is only used internally to the DBC. It contains information such as, whether logons to the DBC are enabled or disabled. This table is used by session control during start up.

Key (UPI)

None

X(2)

Blob

None

X(4096)

Teradata RDBMS Data Dictionary

4 19

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Hosts Contains one row per host that defines the default character set for that host.

LogicalHostId (UPI) HostName (USI)

None None

SMALLINT, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL DATE, NOT NULL FLOAT INTEGER, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC VARCHAR(11), LATIN, NOT CASESPECIFIC VARCHAR(2), LATIN, NOT CASESPECIFIC VARCHAR(11), LATIN, NOT CASESPECIFIC VARCHAR(10), LATIN, NOT CASESPECIFIC INTEGER, NOT NULL BYTEINT BYTEINT BYTEINT BYTEINT BYTEINT

ZZZ9 X(30)

DefaultCharSet

None

X(30)

DBC.HW_Event_Log This table contains the information of system errors for Teradata RDBMS Field Engineers. Rows are inserted by the system in response to hardware error conditions.

TheDate (NUPI) TheTime (NUPI) Event_Tag Category Severity Primary_Part_Number

None None None None None None

YYYY/MM/ DD 99:99:99.999999 Z99-99999-99 X(1) X(1) X(11)

Revision_Level

None

X(2)

Secondary_Part_Num ber Serial_Number

None

X(1)

None

X(10)

PMA Module_Type Slot Slot_Type Subslot Subslot_Type

None None None None None None

ZZ9-99 Z9 Z9 Z9 9 9

4 20

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.HW_Event_Log (Continued)

FW_Version

None

VARCHAR(11), LATIN, NOT CASESPECIFIC VARCHAR(1), LATIN, NOT CASESPECIFIC VARCHAR(1), LATIN, NOT CASESPECIFIC DECIMAL(3,2) DECIMAL(4,2) DECIMAL(4,1) BYTEINT, NOT NULL VARCHAR(255) LATIN, NOT CASESPECIFIC VARBYTE(128)

X(11)

Vcc_Margin

None

X(1)

Frequency_Margin

None

X(1)

Vcc_Volts Vcc_Amps Temperature Line Text

None None None None None

-9.99 -Z9.99 -ZZ9.9 ZZ9 X(255)

Error_Data

None

X(256)

Teradata RDBMS Data Dictionary

4 21

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Indexes Contains a row for each column that is an index.

Table_Id (NUPI) Index_Type

TVM.TVMId None

BYTE(6), NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL

X(12) X(1)

IndexNumber UniqueFlag

None None

SMALLINT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL

---,--9 X(1)

FieldId FieldPosition IndexMode 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 IndexStatistics

TVFields.FieldId None None

SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC

---,--9 ---,--9 X(1)

Dbase.DatabaseId None

BYTE(4), NOT NULL VARBYTE(16383)

X(8) X(255)

4 22

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.Indexes (Continued)

Name CreateUID CreateTimeStamp LastAlterUID LastAlterTimeStamp LastAccessTimeStamp AccessCount

None Dbase.DatabaseId None Dbase.DatabaseId None None None None None

CHAR(30), LATIN, NOT CASESPECIFIC BYTE(4) TIMESTAMP(0) BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER BYTE(4), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(6), NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL VARBYTE(30), NOT NULL VARBYTE(30), NOT NULL VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL VARCHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL

X(30) X(8) yyyy-mm-dd hh:mm:ss X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9 X(8) X(30)

DBC.IndexName This table is unused.

DatabaseId (UPI) Name (UPI)

TableId IndexNumber DBC.InDoubtResLog Contains a row for each transaction that had been in doubt. LogicalHostId (NUPI) SessionNumber (NUPI) CoordTaskId (NUPI) RunUnitId (NUPI) LogonUserName

None None None None None None Dbase.DatabaseName

X(12) ---,--9 ---,--9 ---,--9 X(60) X(60) X(30)

ResolvingUserLogon Name

Dbase.DatabaseName

X(30)

CommitOrRollback

None

X(1)

Teradata RDBMS Data Dictionary

4 23

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.InDoubtResLog (Continued)

UserLogonDate UserLogonTime CompletionDate CompletionTime Options

None None None None None Dbase.DatabaseId None None

DATE, NOT NULL FLOAT, NOT NULL DATE, NOT NULL FLOAT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC BYTE(4), NOT NULL SMALLINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER BYTEINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL

YYYY/MM/ DD 99:99:99 YYYY/MM/ DD 99:99:99 X(1) X(12) ZZZ9 X(1)

DBC.LogonRuleTbl Indicates what users can legally logon from what host, and whether a password is necessary.

UserId (UPI) LogicalHostId (UPI) LogonStatus

NullPassWord

None

X(1)

CreateUID CreateTimeStamp LastAccessTimeStamp AccessCount DBC.Migration Internal table only. DBC.Next Contains the next internal identifiers the DBC uses for processing. Field1 (NUPI) RowNum (UPI)

Dbase.DatabaseId None None None None None

X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9 ---9 X(1)

DatabaseId TableId ProcsRowLoc EventNum LogonSequenceNo TempTable

None None None None None None

X(8) X(8) X(8) X(8) X(8) X(8)

4 24

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.OldPasswords Contains a history of passwords used by a user in the system.

UserName (NUPI)

Dbase.DatabaseName

CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL INTEGER, NOT NULL BYTE(2), NOT NULL BYTE(8), NOT NULL BYTE(4), NOT NULL BYTE(4), NOT NULL

X(30)

PasswordDate PasswordSeed PasswordString

None None None Dbase.DatabaseId Dbase.DatabaseId TVM.DatabaseId

--,---,---,--9 X(4) X(16) X(8) X(8)

DBC.Owners Shows information for each database in the system. DBC.Parents Represents the parentage of for each database in the system. Is actually the inverse of Owners. DBC.RCConfiguration Contains information about the AMPs configuration for an event in the RCEvent table.

OwnerId (NUPI) OwneeId

DbId ParentId

Dbase.DatabaseId Dbase.DatabaseId

BYTE(4), NOT NULL BYTE(4), NOT NULL

X(8) X(8)

EventNum (NUPI) LogProcessor PhyProcessor ProcessorState

RCEvent.EventNum None None None

INTEGER SMALLINT SMALLINT CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT SMALLINT

--,---,---,--9 -(5)9 ZZZZ9 X(1)

RestartSeqNum Vproc

None None

---,--9 -(5)9

Teradata RDBMS Data Dictionary

4 25

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.RCEvent Contains a row for each event executed by the Host Utilities.

EventNum (NUPI)

RCConfiguration. EventNum RCMedia.Event Number

INTEGER, NOT NULL

--,---,---,--9

CreateDate CreateTime EventType

None None None

DATE, NOT NULL FLOAT, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT CHAR(30), LATIN, NOT CASESPECIFIC CHAR(30), LATIN, NOT CASESPECIFIC INTEGER CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(44), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC

YYYY/MM/ DD 99:99:99.99 X(30)

UserName

Dbase.DatabaseName

X(30)

DatabaseName

Dbase.DatabaseName

X(30)

ObjectId ObjectType AllAmpsFlag

None None None

X(8) X(1) X(1)

RestartSeqNum TableName CheckPointName LinkingEventNum OperationInProcess

RCConfiguration. RestartSeqNum TVM.TVMName None None None

---,--9 X(30) X(30) --,---,---,--9 X(1)

DataSetName LockMode JournalUsed

None None None

X(44) X(1) X(1)

4 26

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.RCEvent (Continued)

JournalSaved IndexPresent DupeDumpSet

None None RCMedia.Dupe DumpSet RCMediaEvent Number None

CHAR(1), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC CHAR(1), LATIN, NOT CASESPECIFIC INTEGER, NOT NULL CHAR(6), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL

X(1) X(1) X(1) --,---,---,--9 X(6)

DBC.RCMedia Contains identification of storage media for events.

EventNumber (NUPI) VolSerialId

VolSequenceNum DupeDumpSet

None None

---,--9 X(1)

DBC.ReferencedTbls Contains information about the parent table of a referential constraint.

ReferencedDbID (NUPI) ReferencedTblID (NUPI) ReferenceIdx ParentKeyFID ReferencingDbID ReferencingTblID

Dbase.DatabaseId TVM.TVMId TVFields.TableId None TVFields.FieldId Dbase.DatabaseId TVM.TVMId TVFields.TableId

X(8) X(12)

SMALLINT, NOT NULL SMALLINT, NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL

---,--9 ---,--9 X(8) X(12)

ForeignKeyFID InconsistentFlag

TVFields.FieldId None

SMALLINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC BYTE(4) TIMESTAMP(0)

---,--9 X(1)

ReferenceIdxName CreateUID CreateTimeStamp

None Dbase.DatabaseId None

X(30) X(8) yyyy-mm-dd hh:mm:ss

Teradata RDBMS Data Dictionary

4 27

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.ReferencedTbls (Continued)

LastAccessTimeStamp AccessCount

None None Dbase.DatabaseId TVM.TVMId TVFields.TableId None TVFields.FieldId Dbase.DatabaseId TVM.TVMId TVMFields.TableId

TIMESTAMP(0) INTEGER BYTE(4), NOT NULL BYTE(6), NOT NULL

yyyy-mm-dd hh:mm:ss --,---,---,--9 X(8) X(12)

DBC.ReferencingTbls Contains information about the child table of a referential constraint.

ReferencingDbID (NUPI) ReferencingTblID (NUPI) ReferenceIdx ForeignKeyFID ReferencedDbID ReferencedTblID

SMALLINT, NOT NULL SMALLINT, NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL

---.--9 ---.--9 X(8) X(12)

ParentKeyFID InconsistentFlag

TVfields.FieldId None

SMALLINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER INTEGER, NOT NULL BYTEINT, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC INTEGER

---,--9 X(1)

ReferenceIdxName CreateUID CreateTimeStamp LastAccessTimeStamp AccessCount DBC.RepBatchStatus Internal table only. RSQualifier (UPI) BatchNum CompletionStatus CommitSeqNumber

None Dbase.DatabaseId None None None None None None None

X(30) X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9 --,---,---,--9 --9 X(1) --,---,---,--9

4 28

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.SessionTbl Contains current user logon information.

HostNo (UPI) SessionNo (UPI) IFPNo LogonDate LogonTime LogonCollation

TempTables.HostNo Temptables. SessionNo None None None None

SMALLINT, NOT NULL INTEGER, NOT NULL SMALLINT, NOT NULL DATE, NOT NULL FLOAT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(10) BYTE(10) BYTE(10)

---,--9 --,---,---,--9 -(5)9 YYYY/MM/ DD 99:99:99.99 X(1)

LogonDatabase

Dbase.DatabaseName

X(30)

CurrentCollation

None

X(1)

CurrentDatabase

Dbase.DatabaseName

X(30)

UserName

Dbase.DatabaseName

X(30)

UserId AccountName

Dbase.DatabaseId Dbase.AccountName

X(8) X(30)

StartMBox ContMBox AbortMBox

None None None

X(20) X(20) X(20)

Teradata RDBMS Data Dictionary

4 29

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.SessionTbl (Continued)

Partition PartCode LogonSource

None None None

CHAR(16), LATIN, NOT CASESPECIFIC, BYTEINT VARCHAR(128), LATIN, NOT CASESPECIFIC BYTE(4) SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(10), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC BYTEINT BYTEINT CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC SMALLINT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL VARBYTE(1024)

X(20) --9 X(128)

LogonSequenceNo LogicalHostId ConnectFunction Options

None None None None

X(12) ZZZ9 ---,--9 X(10)

ExpiredPassword

None

X(1)

TimeZoneHour TimeZoneMinute CurrentDateForm

None None None

---9 ---9 X(1)

DefaultCharType RepSesOverride

None None

---,--9 X(1)

RFU

None

X(2056)

4 30

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.SW_Event_Log This table contains the information of system errors for Teradata RDBMS Field Engineers. Rows are inserted by the system in response to software error conditions.

TheDate (NUPI) TheTime (NUPI) Event_Tag Category Severity PMA Vproc Partition Task Function

None None None None None None None None None None

DATE, NOT NULL FLOAT, NOT NULL INTEGER, NOT NULL BYTEINT SMALLINT INTEGER INTEGER BYTEINT SMALLINT VARCHAR(32), LATIN, NOT CASESPECIFIC VARCHAR(64), LATIN, NOT CASESPECIFIC BYTEINT, NOT NULL VARCHAR(255), LATIN, NOT CASESPECIFIC, NOT NULL VARBYTE(320) VARBYTE(256) BYTEINT, NOT NULL SMALLINT, NOT NULL BYTEINT, NOT NULL BYTEINT, NOT NULL

YYYY/MM/ DD 99:99:99.999999 Z99-99999-99 Z9 ZZ9 ZZ9-99 -(5)9 Z9 ZZZZ9 X(32)

SW_Version

None

X(64)

Line Text

None None

ZZ9 X(255)

Stacktrace Error_Data DBC.SysSecDefaults Provides system default information. PrimeIndex (UPI) ExpirePassword PasswordMinChar PasswordMaxChar

None None None None None None

X(640) X(512) --9 ---,--9 --9 --9

Teradata RDBMS Data Dictionary

4 31

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.SysSecDefaults (Continued)

PasswordDigits

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL BYTEINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL BYTE(6), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC BYTE(4), NOT NULL VARCHAR(8192), LATIN, CASESPECIFIC BYTE(4) TIMESTAMP(0) INTEGER SMALLINT, NOT NULL INTEGER, NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL BYTE(6), NOT NULL SMALLINT, NOT NULL VARBYTE(16383)

X(1)

PasswordSpecChar

None

X(1)

MaxLogonAttempts LockedUserExpire PasswordReuse DBC.TableConstraints Contains a row for each table-level constraint defined in the system. TVMId (NUPI) Name DBaseId TableCheck

None None None TVM.TVMId None Dbase.DatabaseId None

---9 ---,--9 ---,--9 X(12) X(30) X(8) X(255)

CreateUID CreateTimeStamp AccessCount DBC.TempStatistics Contains statistical information collected on a materialized temporary table in the system. HostNo (NUPI) SessionNo (NUPI) BaseDbId BaseTableId TableId StatId StatInfo

Dbase.DatabaseId None None None SessionTbl.SessionNo Dbase.DatabaseId TVM.TVMId TVM.TVMId None None

X(8) yyyy-mm-dd hh:mm:ss --,---,---,--9 ---,--9 --,---,---,--9 X(8) X(12) X(12) ---,--9 X(255)

4 32

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TempTables Contains a row for each materialized temporary table in the system.

HostNo (NUPI) SessionNo (NUPI) TableId BaseDbId BaseTableId AccountDbId StatisticsCnt

SessionTbl.HostNo SessionTbl.SessionNo TVM.TVMId Dbase.DatabaseId TVM.TVMId Dbase.DatabaseId None None None

SMALLINT, NOT NULL INTEGER, NOT NULL BYTE(6), NOT NULL BYTE(4), NOT NULL BYTE(6), NOT NULL BYTE(4), NOT NULL SMALLINT, NOT NULL BYTE(6), NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL VARCHAR(32000), UNICODE, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL BYTEINT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL BYTE(256), NOT NULL BYTE(256), NOT NULL BYTE(256), NOT NULL BYTE(256), NOT NULL

---,--9 --,---,---,--9 X(12) X(8) X(12) X(8) ---,--9 X(12) X(1)

DBC.TextTbl For internal use only

TextId (NUPI) TextType (NUPI)

LineNo TextString

None None

---,--9 X(255)

DBC.Translation Contains information about the character translation tables used.

TranslateName (UPI)

None

X(30)

TranslateID (USI) Install

None None

ZZ9 X(1)

TranslateIn TranslateInUp TranslateOut TranslateOutUp

None None None None

X(512) X(512) X(512) X(512)

Teradata RDBMS Data Dictionary

4 33

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TriggersTbl Contains a row for each trigger in the system.

TableId (NUPI) TriggerId (NUSI) DatabaseID TriggerName

TVM.TVMId TVM.TVMId Dbase.DatabaseId None

BYTE(6), NOT NULL BYTE(6), NOT NULL BYTE(4), NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT VARCHAR(255), UNICODE, NOT CASESPECIFIC VARCHAR(20480), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(4) TIMESTAMP (0) BYTE(4) TIMESTAMP (0) TIMESTAMP (0)

X(12) X(12) X(8) X(30)

TriggerEnabled

None

X(1)

ActionTime

None

X(1)

TriggerEvent

None

X(1)

Kind

None

X(1)

TriggerOrder CommentString

None None

---,--9 X(255)

CreateText

None

X(255)

CreateUID CreateTimeStamp LastAlterUID LastAlterTimeStamp LastAccessTimeStamp

Dbase.DatabaseId None Dbase.DatabaseId None None

X(8) yyyy-mm-dd hh:mm:ss X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss

4 34

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TriggersTbl (Continued) DBC.TVFields Contains a row for each column of every table and view, except when the view has more than 51 columns.

AccessCount TableId (NUPI)

None Accessrights.TVMId ReferencingTbls. ReferencingTblId ReferencedTbls. ReferencedTblId TVM.TVMId

INTEGER BYTE(6), NOT NULL

--,---,---,--9 X(12)

FieldName

None

CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL

X(30)

FieldId (USI)

Accessrights.FieldId ReferencingTbls. ForeignKeyFID ReferencedTbls. ParentKeyFID Indexes.FieldId

---,--9

Nullable

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC CHAR(2), LATIN, UPPERCASE, NOT CASESPECIFIC INTEGER VARCHAR(1024), UNICODE, NOT CASESPECIFIC VARCHAR(1024) SMALLINT SMALLINT CHAR(30), UNICODE, NOT CASESPECIFIC VARCHAR(60), UNICODE, NOT CASESPECIFIC

X(1)

FieldType

None

X(2)

MaxLength DefaultValue

None None

--,---,---,--9 X(1024)

DefaultValueI TotalDigits ImpliedPoint FieldFormat

None None None None

X(1024) ---,--9 ---,--9 X(30)

FieldTitle

None

X(60)

Teradata RDBMS Data Dictionary

4 35

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TVFields (Continued)

CommentString

None

VARCHAR(255), UNICODE, NOT CASESPECIFIC

X(255)

CollationFlag

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC BYTE(4), NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC VARCHAR(255), UNICODE, NOT CASESPECIFIC VARBYTE(16383) VARCHAR(8192), LATIN, NOT CASESPECIFIC SMALLINT, NOT NULL BYTE(4), NOT NULL TIMESTAMP(0) BYTE(4) TIMESTAMP(0) TIMESTAMP(0) INTEGER SMALLINT CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL

X(1)

UpperCaseFlag

None

X(1)

DatabaseId Compressible CompressValue

Dbase.DatabaseId None None

X(8) X(1) X(255)

FieldStatistics ColumnCheck

None None

X(55) X(255)

CheckCount CreateUID CreateTimeStamp LastAlterUID LastAlterTimeStamp LastAccessTimeStamp AccessCount CharType SPParameterType

None Dbase.DatabaseId None Dbase.DatabaseId None None None None None

---,--9 X(8) yyyy-mm-dd hh:mm:ss X(8) yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss --,---,---,--9 ---,--9 X(1)

4 36

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TVM Contains a row for each table, view, macro, trigger, join index, hash index, or procedure in the system.

DatabaseId (UPI)

Accessrights. DatabaseId Owners.owneeId Dbase.DatabaseId

BYTE(4), NOT NULL

X(8)

TVMNameI (UPI)

None

CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT INTEGER BYTE(6), NOT NULL

X(30)

Logical HostId SessionNo TVMId (USI)

None None AccLogRuleTbl. TVMId DatabaseSpace. tableId Accessrights.TVMId Temptables.Base TableId ReferencingTbls. ReferencingTblId ReferencedTbls. ReferencedTblId DBCAssociation. TVMId TVFields.TableId Dbase.JournalId Indexes.TableId Tableconstraints. TVMId

ZZZ9 --,---,---,--9 X(12)

TableKind

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL

X(1)

ProtectionType

None

X(1)

Teradata RDBMS Data Dictionary

4 37

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TVM (Continued)

TempFlag

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL VARCHAR(12500), UNICODE, NOT CASESPECIFIC VARCHAR(26000), UNICODE, NOT CASESPECIFIC VARCHAR(255), UNICODE, NOT CASESPECIFIC CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(30), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(2), LATIN, NOT CASESPECIFIC, NOT NULL BYTE(6) SMALLINT CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, NOT CASESPECIFIC, NOT NULL

X(1)

HashFlag

None

X(1)

NextIndexId NextFieIdId Version RequestText

None None None None

---,--9 ---,--9 ---,--9 X(255)

CreateText

None

X(255)

CommentString

None

X(255)

CreatorName

Dbase.DatabaseName

X(30)

TVMName (NUSI)

None

X(30)

JournalFlag

None

X(2)

JournalId UtilVersion AccLogRules

None None None

X(12) ---,--9 X(1)

ColumnAccRules

None

X(1)

4 38

Teradata RDBMS Data Dictionary

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TVM (Continued)

CheckOpt

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL SMALLINT BYTE(4) TIMESTAMP(0) BYTE(4) TIMESTAMP(0) INTEGER SMALLINT, NOT NULL SMALLINT CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL

X(1)

ParentCount ChildCount NamedTblCheckCount UnnamedTblCheckExist

None None None None

---,--9 ---,--9 ---,--9 X(1)

PrimaryKeyIndexId CreateUID CreateTimeStamp LastAlterUID LastAlterTimeStamp AccessCount SPObjectCodeRows RSGroupID DirtyFlag

None Dbase.DatabaseId None Dbase.DatabaseId None None None None None

---,--9 X(8) yyyy-mm-dd hh:mm:ss X(8) yyyy-mm-dd hh:mm:ss --,---,---,--9 ---,--9 ---,--9 X(1)

XactionFlag

None

X(1)

TblRole

None

X(1)

Teradata RDBMS Data Dictionary

4 39

Chapter 4: System Tables Data Dictionary FALLBACK Tables


Table Name and Description

Columns

Referenced Column(s)

Data Type

Default Format

DBC.TVM (Continued)

TblStatus

None

CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL CHAR(1), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC, NOT NULL BYTE(4), NOT NULL SMALLINT, NOT NULL BYTE(6), NOT NULL SMALLINT, NOT NULL SMALLINT, NOT NULL CHAR(30), LATIN, UPPERCASE, NOT CASESPECIFIC CHAR(30), LATIN, NOT CASESPECIFIC

X(1)

RequestTxtOverflow

None

X(1)

CreateTextOverflow

None

X(1)

DBC.UnResolved References Contains information about all the unresolved referential constraints that currently exist in the system.

DatabaseID (NUPI) ParentTblName (NUPI)

Dbase.DatabaseId TVM.TVMNameI

X(8) X(30)

UserID ReferenceIdx ChildTblID ForeignKeyFID FKPosition ParentKeyName

Dbase.DatabaseId None TVM.TVMId None None None

X(8) ---,--9 X(12) ---,--9 ---,--9 X(30)

ReferenceIdxName

None

X(30)

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:


Macro(s) Purpose For more information, see the publication entitled ...

SystemFE AccLogRule

Track system health Enables access logging

Teradata RDBMS SystemFE Macros Teradata RDBMS Database Administration Teradata RDBMS Security Administration Teradata RDBMS Database Design Teradata RDBMS Database Design

Query Capture ECompare

Mostly used with VEComp application Mostly used with VEComp application

Teradata RDBMS Data Dictionary

51

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.

52

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 1997-12-25 1997-12-31 080000 240000 '123-02' '125-04'

Name of the ResUsage macro Starting date of December 25, 1997 Ending date of December 31, 1997 Starting time of 8:00 a.m. Ending time of 12:00 midnight Starting node of a range of nodes 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

53

Chapter 5: Macros DIPVIEW Macros

DIPVIEW Macros
The DIPVIEW script contains several macros, including the following:
Macro Name Function

ARC_NonEmpty_List ClearAccounting ClearPeakDisk CollAddStandard

Returns the names of the databases or users, owned by the indicated database, that contain the specified objects. Resets the CPU and IO columns of the DBC.Acctg table. Resets the PEAKPERM, PEAKSPOOL, and PEAKTEMP columns for the DISKSPACE information. Defines the standard collation sequences supplied with the Teradata RDBMS and places them into the DBC.CollationTbl. 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. Acts as a release marker to indicate a valid dictionary. Allows database administrator to determine who has execute privileges for the GRANT/REVOKE LOGON statements.

CollInstallMulti

DIPMarkNSIO LogonRule

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.

54

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 V M J I P G

Table View Macro Journal Join Index Stored Procedure 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

55

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. 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.

56

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

57

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.

58

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

59

Chapter 5: Macros DIPVIEW Macros

5 10

Teradata RDBMS Data Dictionary

Index
A ABORT SESSION command, PM DBC.sw_event_log table 118 Access auditing, DBC.AccLogRule macro 19 AccessLog view 24, 32 AccessRight column 222 AccessRights table 46 AccLogRule table 47 AccLogRules view 25, 34 AccLogTbl table 410, 411 Account String Expansion using to measure SQL 123 AccountInfo view 25, 37 Accounting system views used for 121, 122 AccountName column 224 Acctg 45 Acctg table 45, 412 AcessLogRule table 49 AcrCheckPoint column 224 AcrCreate Trigger column 224 AcrCreateDatabase column 224 AcrCreateMacro column 224 AcrCreateProcedure column 224 AcrCreateTable column 224 AcrCreateUser column 225 AcrCreateView column 225 AcrDelete column 225 AcrDropDatabase column 225 AcrDropMacro column 225 AcrDropProcedure column 225 AcrDropTable column 225 AcrDropTrigger column 225 AcrDropUser column 225 AcrDropView column 226 AcrDump column 226 AcrExecute column 226 AcrExecute Procedure column 226 AcrExecuteProcedure column 226 AcrGrant column 226 AcrIndex column 226 AcrInsert column 226 AcrReference column 226 AcrRestore column 226 AcrSelect column 226 AcrUpdate column 227 ActionTime column 227 Administrator views 110, 111 ALL special database name in system views 114 All_RI_Children view 26, 314 All_RI_Parents view 27, 315 AllAMPsFlag column 227 AllnessFlag column 227 AllRights view 26, 38 AllSpace view 26, 310 AllTempTables view 26, 312 AMP usage view 121 AmpUsage view 27, 316 ARC_NonEmpty_List macro 54 Association view 27, 317

B B_DatabaseName column 227 B_TableName column 227 BTEQ script using to archive data 123

C Category column 228 ChangedRowJournal table 45 CharSetName column 228 CharSets view 27, 319 CharTranslations view 28, 320 CharType column 228 CheckName column 229 CheckpointName column 229 Child column 229 ChildCount column 229 ChildDb column 229 ChildDbId column 229 ChildKeyColumn column 229 ChildKeyFID column 229 Children view 28, 322 ChildTable column 229 ChildTID column 229

Teradata RDBMS Data Dictionary

Index 1

Index

ClearAccounting macro 55 ClearPeakDisk macro 54, 56 ColCheck column 229 CollAddStandard macro 54, 56 Collations view 28, 323 CollationTbl table 412 CollEqvClass column 229 CollInstall column 230 CollInstallMulti macro 54, 57 CollName column 230 CollOrderCS column 230 CollOrderUC column 230 ColumnConstraint column 230 ColumnFormat column 230 ColumnId column 230 ColumnLength column 230 ColumnName column 231 ColumnPosition column 231 Columns system views, table of 21 Columns view 29, 324 ColumnStats view 29, 326 ColumnTitle column 231 ColumnType column 232 COMMENT query a Data Dictionary view 116 COMMENT ON system views 116 CommentString column 233 CommitOrRollback column 233 CompletionDate column 233 CompletionTime column 233 Compressible column 233 CompressValue column 233 Constraint Names table 413 ConstraintCount column 233 ConstraintName column 233 ConstraintText column 233 CoordTaskId column 233 CpuTime column 233 CreateDate column 234 CreateTime column 234 CreateTimeStamp column 234 CreatorName column 235 CSPSessionInfo view 29 CurrentCollation column 235 CurrentPerm column 235 CurrentSpool column 235 CurrentTemp column 235

D Data Dictionary columns. See alphabetical list and definitions, Table 2-1 COMMENT statement 116 defined 12 definition of 12 generating tables for 42 HELP 116 keywords 114 organization of 15 query, view 116 system use of 14 system views, access to 114 Teradata DBS and 14 update 13 updating 13 users, types of 22 views end user 112, 22 Field Engineer 18 for resource usage 120 operation and recovery control 111 operations control 22 security administrator 19, 22 Security Logging 18 special users 18 supervisory user 112, 22 SYSADMIN 18 system administrator 22 SYSTEMFE 18 table distribution 120 Teradata administrator 110 X suffix, system views 17 Data Dictionary tables, affected by PM DBC.AccessRights 118 DBC.Dbase 118 DBC.SessionTbl 118 DBC.sw_event_log 118 Data Dictionary views, affected by PM AllRights 118 AllSpace(X) 118 Databases(X) 118 DiskSpace(X) 118 LogOnOff 118 SessionInfo 118 Software_Event_Log 118 UserGrantedRights 118 UserRights 118 Database Query Manager 242, 264, 366 Database_ Default_Journals view 210 Database_Default_Journals view 330 DatabaseId column 236

Index 2

Teradata RDBMS Data Dictionary

Index

DatabaseName column 236 Databases view 210, 326, 328, 347 Databases2 view 210, 329 DataBaseSpace 45 DatabaseSpace table 413 DataSetName column 237 Dbase table 414 DBC.AccountInfo view 23 DBC.Acctg system table impact of system restart 122 view for 121 DBC.ALL table purpose of 43 DBC.AMPUsage 121 DBC.Fields table use of 43 DBC.SessionTbl table logging 118 DBC.sw_event_log table logging system events ABORT SESSION 118 SET RESOURCE 118 SET SESSION 118 DBC.TVM table use of 43 DBCAssociation table 416, 417 DBCInfo view 211, 331 DBCInfoTbl table 418 DBKind column 237 DBQM 242, 248, 264, 366 DecimalFractionalDigits column 238 DecimalTotalDigits column 238 DEFAULT special database name in system views 114 DefaultAccount column 238 DefaultCharSet column 238 DefaultCharType column 238 DefaultCollation column 238 DefaultDataBase column 239 DefaultDateForm column 239 DefaultValue column 239 DeleteAccessLog view 211, 332 DeleteOldInDoubt view 211, 333 DIP utility 16, 51 DIPMarkNS10 macro 57 DIPMarkNSIO macro 54 DiskIO column 239 DiskSpace view 211, 334 DupeDumpSet column 239

E e 440 E_TableId column 240 E2I column 240 E2IUp column 240 EnabledFlag column 240 End user views 112 Error_Data column 240 ErrorMsgs table 418 Event column 241 Event_Tag column 242 EventCount column 241 EventLog table 419 EventNum column 241 Events view 212, 337 Events_Configuration view 212, 339 Events_Media view 212, 341 EventType column 242 ExpiredPassword column 243 ExpirePassword column 243

F Fields. See Data Dictionary, columns Frequency column 243 Frequency_Margin column 243 Function column 243 FW_Version column 243

G Global table 419 GRANT privilege 16 GrantAuthority column 244 Grantee column 244 GrantorName column 244

H Hardware_Event_Log view 213, 343 Hash index 437 HELP system views 116 HELP statement 31 querying with 116 HostName column 244

Teradata RDBMS Data Dictionary

Index 3

Index

Hosts table 420 HostsInfo view 213, 344 HW_Event_Log table 420

L LastAlterName column 248 LastAlterTimeStamp column 248 Line column 248 LinkingEventNum column 248 LocalSessionStatusTable 45 LocalTransactionStatusTable 45 LockedCount column 248 LockedDate column 248 LockedTime column 249 LockedUserExpire column 249 LockMode column 249 LogDate column 249 LogicalHostId column 249, 250 Logon rules tracking 126 LogonDate column 250 LogOnOff view 214, 351 LogonRule macro 54, 58 LogonRules view 215, 353 LogonRuleTbl table 424 LogonSequenceNo column 250 LogonSource column 251 channel-attached values 251 example with LogOnOff view 351 example with SessionInfo view 363 internal session values 251 network-attached values 251 LogonSource column, affected by PM DBC.SessionTbl table 118 DBC.sw_event_log table 118 LogonStatus column 252 LogonTime column 252 LogonUserName column 252 LogProcessor column 252 LogTime column 252 LogType column 252

I I2E column 244 I2EU column 244 IFPNo column 244 Indexes table 422 IndexId column 245 IndexName column 245 IndexName table 423 IndexNumber column 245 IndexPresent column 245 IndexStats view 213, 347 IndexType column 246 Indices view 214, 345 Indoubt transactions resolving and TwoPCRule macro 52 InDoubtLog view 214, 349 InDoubtResLog table 423 InfoData column 246 InfoKey column 246 InstallFlag column 246

J Journal_DB column 246 JournalFlag column 247 JournalName column 247 Journals view 214, 350 Journals_DB column 247 JournalSaved column 247 JournalUsed column 247

K Keywords special Data Dictionary ALL 114 DEFAULT 114 PUBLIC 114 Kind column 247

M Macro DBC.AccLogRule auditing access 19 Macros ARC_NonEmpty_List 54 ClearAccounting 55 ClearPeakDisk 56 CollAddStandard 56 CollInstallMulti 57

Index 4

Teradata RDBMS Data Dictionary

Index

defined 53 DIPMarkNS10 57 LogonRule 58 TwoPCRule 52 MaxLogonAttempts column 252 MaxPerm column 253 MaxSpool column 253 MaxTemp column 253 Migration table 424 Model column 253 Module_Type column 253 MONITOR option SELECT queries 119

N NamedTblCheckCount column 253 Next table 424 Non-X query 115 Nullable column 253 NullPassword column 253

O ObjectType column 254 OldPasswords table 425 OperationInProcess column 254 Options column 254 OrderNumber column 254 OrdSysChngTable 45 Original_CommentString column 254 Original_CreatorName column 254 Original_Database column 254 Original_JournalFlag column 254 Original_ProtectionType column 255 Original_TableKind column 255 Original_TableName column 255 Original_Version column 255 OwnerName column 255 Owners table 425

ParentKeyColumn column 256 ParentKeyFID column 256 Parents table 425 ParentTable column 256 ParentTID column 256 Partition column 256 PasswordChgDate column 256 PasswordDigits column 256 PasswordLastModDate column 257 PasswordLastModTime column 257 PasswordMaxChar column 257 PasswordMinChar column 257 PasswordReuse column 257 PasswordSpecChar column 257 PeakPerm column 257 PeakSpool column 258 PeakTemp column 258 Performance Monitor determining capacity with 124 purpose 118 PermSpace column 258 PhyProcessor column 258 PM/API queries, MONITOR-related 119 PMA column 258 Primary_Part_Number column 258 PrimaryKeyIndexId column 258 Privileges tracking 126 ProcessorState column 258 ProtectionType column 259 PUBLIC special database name in system views 114

Q Query Data Dictionary 116 keywords, use of 114 system monitor 119

R P Parent column 255 ParentCount column 255 ParentDb column 255 ParentDbId column 256 RCC_Configuration view 215, 354 RCC_Media view 215, 355 RCConfiguration table 425 RCEvent table 426 RCMedia table 427

Teradata RDBMS Data Dictionary

Index 5

Index

RecoveryLockTable 45 RecoveryPJTable 45 ReferencedTbls table 427, 428 RepBatchStatus table 428 RequestText column 259 ResNode macro using to evaluate system capacity 124 ResolvingUserLogonName column 259 Resource usage AMP 121 AMPs 121 example 121 monitoring 120 system views 120 Resource utilization tracking 120 RestartSeqNum column 259 Result column 259 ResUsage macros executing, example 53 Revision_Level column 259 RI_Child_Tables view 215, 356 RI_Distinct_Children view 216, 357 RI_Distinct_Parents view 216, 358 RI_Parent_Tables view 216, 359 Rights granting system 16 RunUnitId column 259

S SavedTransactionStatus 45 Secondary_Part_Number column 260 Security violation error 31 Security Logging views 18 SecurityDefaults view 216, 360 SecurityLog view 217, 361 SELECT privelege 16 SELECT privilege 116 SELECT statement querying with 114 Serial_Number column 260 SessionInfo view 217, 362 SessionNo column 260 SessionNumber column 260 SessionTbl table 429, 430 SET RESOURCE command, PM DBC.sw_event_log table 118 Severity column 260, 261

SHOWCOLCHECKS view 217, 364 SHOWTBLCHECKS view 217, 365 Single Sign On 353 Slot column 261 Slot_Type column 261 Software_Event_Log view 218, 366 SpoolSpace column 261 Stacktrace column 261 StartMBox column 261 StartupString column 261 StatementText column 262 StatementType column 262 Stored Procedure access rights 44 cross-platform incompatibility 117 Data Dictionary tables containing 117 definition 117 details in Data Dictionary 13 how the system uses information about 14 logging rules 44 request number 44 status 43 Stored procedure Data Dictionary information 43 SubSlot column 262 SubSlot_Type column 262 Supervisory views 112 SW_Event_Log table 431 SW_Version column 262 Sys_Calendar 127 SYSADMIN views 18 SysRcvStatJournal 45 SysSecDefaults table 431, 432 System events tracking 126 System logs maintaining 128 System monitor query 119 System monitoring end user views, using 112 operation and recovery control views, using 111 security administrator view, using 19 supervisory user views, using 112 Teradata administrator views, using 110 System rights 16 System table dropping effect on Data Dictionary 113 System tables DBC.SessionTbl 118 DBC.sw_event_log 118 System user DBC 16

Index 6

Teradata RDBMS Data Dictionary

Index

SYSTEMFE views 18

T Table_LevelConstraints view 218, 368 TableConstraints table 432 TableKind column 262 TableName column 263 Tables view 218, 369 Tables_DB column 263 Tables2 view 219, 371 TableSize view 219, 372 Task column 264 TblCheck column 264 Temperature column 264 TempSpace column 264 TempStatistics table 432 TempTables table 433 Text column 264 TextTbl table 433 The 119 TheDate column 264 TheTime column 264 TimeZoneHour column 264 TimeZoneMinute column 264 Transaction_Mode column 265 TransientJournal table 45 Translation table 433 TriggerComment column 265 TriggerName column 265 Triggers view 219, 373 TriggersTbl table 434 TVFields table 435, 436 TVM table 437 TVMId column 265 TVMName column 265 TwoPCMode column 265 TwoPCRule macro 52

User_Default_Journals view 221, 380 UserGrantedRights view 220, 375 UserLogonDate column 266 UserLogonTime column 266 UserName column 266 UserRights view 220, 376 Users view 221, 378 Users, types. See Data Dictionary, users UtilityLockJournalTable 45

V Vcc_Amps column 267 Vcc_Margin column 267 Vcc_Volts column 267 Version column 267 View privileges 16 Views availability of 15 definition of 15 how determined 16 Views. See also Data Dictionary VolSerialId column 268 Vproc column 268 Vproctype column 268

W WHERE clause in sytem views 17

X X query 114

U UniqueFlag column 265 UnnamedTblCheckExist column 265 UnResolvedReferences tabl 440 UnResolvedRICount column 266 UpperCaseFlag column 266 Usage statistics compiling 122

Teradata RDBMS Data Dictionary

Index 7

Index

Index 8

Teradata RDBMS Data Dictionary

You might also like