Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Teradata Database Data Dictionary Release 15.0 B035-1092-015K January 2016 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, Active Data Warehousing, Active Enterprise Intelligence, Applications-Within, Aprimo Marketing Studio, Aster, BYNET, Claraview, DecisionCast, Gridscale, MyCommerce, QueryGrid, SQL-MapReduce, Teradata Decision Experts, "Teradata Labs" logo, Teradata ServiceConnect, Teradata Source Experts, WebAnalyst, and Xkoto are trademarks or registered trademarks of Teradata Corporation or its affiliates in the United States and other countries. Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc. AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc. Apache, Apache Avro, Apache Hadoop, Apache Hive, Hadoop, and the yellow elephant logo are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Apple, Mac, and OS X all are registered trademarks of Apple Inc. Axeda is a registered trademark of Axeda Corporation. Axeda Agents, Axeda Applications, Axeda Policy Manager, Axeda Enterprise, Axeda Access, Axeda Software Management, Axeda Service, Axeda ServiceLink, and Firewall-Friendly are trademarks and Maximum Results and Maximum Support are servicemarks of Axeda Corporation. Data Domain, EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation. GoldenGate is a trademark of Oracle. Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company. Hortonworks, the Hortonworks logo and other Hortonworks trademarks are trademarks of Hortonworks Inc. in the United States and other countries. Intel, Pentium, and XEON are registered trademarks of Intel Corporation. IBM, CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines Corporation. Linux is a registered trademark of Linus Torvalds. LSI is a registered trademark of LSI Corporation. Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States and other countries. NetVault is a trademark or registered trademark of Dell Inc. in the United States and/or other countries. Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries. Oracle, Java, and Solaris are registered trademarks of Oracle and/or its affiliates. QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation. Quantum and the Quantum logo are trademarks of Quantum Corporation, registered in the U.S.A. and other countries. Red Hat is a trademark of Red Hat, Inc., registered in the U.S. and other countries. Used under license. SAP is the trademark or registered trademark of SAP AG in Germany and in several other countries. SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc. SPARC is a registered trademark of SPARC International, Inc. Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and other countries. Unicode is a registered trademark of Unicode, Inc. in the United States and other countries. UNIX is a registered trademark of The Open Group in the United States and other countries. Other product and company names mentioned herein may be the trademarks of their respective owners. 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 TERADATA CORPORATION 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 Teradata Corporation intends to announce such features, functions, products, or services in your country. Please consult your local Teradata Corporation 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. Teradata Corporation 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 email: [email protected]. Any comments or materials (collectively referred to as "Feedback") sent to Teradata Corporation will be deemed non-confidential. Teradata Corporation 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, Teradata Corporation 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 © 2000-2016 by Teradata. All Rights Reserved. Preface Purpose This book contains information about Data Dictionary system views. You can use Teradata Studio and Teradata Studio Express to view Data Dictionary system views. Download the tools from here: http://downloads.teradata.com/download. Data Dictionary tables only change in major Teradata releases, but Data Dictionary views can change in minor releases. See DBS Tech Alert 2288 for information about changes to Data Dictionary views in maintenance or efix releases (available from Teradata@Your Service: http:/ /tays.teradata.com/). Audience This book provides information for the following types of users: • Teradata Database administrators • Teradata Database security administrators Supported Software Releases and Operating Systems This book supports Teradata® Database 15.0. Teradata Database 15.0 is supported on: • SUSE Linux Enterprise Server 10 SP3 • SUSE Linux Enterprise Server 11 SP1 Teradata Database client applications support other operating systems. Prerequisites You should be familiar with relational databases in general and the Teradata Database in particular. Data Dictionary 3 Preface Changes to This Book Changes to This Book Release Description Teradata Database 15.0 • Added values for AuthorizationType in AuthorizationsV[X], added ServerByteCount usage notes to QryLogStepsV, and added TotalServerByteCount usage notes to QryLogV. Added ServerV[X], ServerInfoV[X], TblSrvV[X], and TblSrvInfoV[X] views. • Added StatsSkipCount column to ColumnStatsV[X], StatsV, and TableStatsV views January 2016 Teradata Database 15.0 September 2015 • Removed references to 30-character limits for object names. Teradata Database supports object names up to 128 characters long in most cases. For more information on object naming see SQL Fundamentals. • Updated a value in the ExceptionAction table. See QryLogExceptionsV. • Added QryLogParamJSON. • QueryStatUseCountV[X] is unused. Teradata Database 15.0 Added the following: June 2014 • • • • Teradata Database 15.0 Updated the “Manually Deleting Old Log Data” topic. Teradata QueryGrid introduction QryLogV TotalServerByteCount column is no longer reserved. QryLogStepsV ServerByteCount column is no longer reserved. Appendix A AccessRight table includes CREATE SERVER and DROP SERVER for the foreign server connector, such as Teradata QueryGrid: Teradata Database-to-Hadoop. April 2014 4 Teradata Database 15.0 Added the following: March 2014 • The ParamFlag, UtilityInfoFlag, LockDelay, and DetailDiag columns; modified some of the referenced table columns, and updated the example output to the DBQLRulesV view. • A reserved for future use column to the IndicesV[X] view. • The EstRowCountSkew, EstRowCountSkewMatch, LockDelay, SSRReceiverCount, and a couple of reserved for future use columns; modified some referenced table columns, modified the data type for the CollectTimeStamp column, and updated the example output for the QryLogStepsV view. • The ThrottleBypassed column, modified the data types for the CollectTimeStamp and StartColTime columns; and updated the example output to the QryLogTDWMSumV view. • The TxnUniq, LockLevel, UtilityByteCount, UtilityRowCount, TDWMEstMemUsage, LockDelay, UtilityInfoAvailable, ThrottleBypassed, IterationCount, TTGranularity, MaxStepMemory, and some reserved for future use columns; modified the data type for the CollectTimeStamp, FirstStepTime, FirstRespTime, and LastRespTime columns; and updated the example output for the QryLogV view. • The TTGranularity and reserved for future use columns to the SessionInfoV[X] view. • Added some reserved for future use columns to the TablesV[X] view. • Added reserved for future use views: LoadTablesInfoV[X], ZoneGuestsV[X], and ZonesV[X]. • Updated possible values for the Compressible column in the ColumnsV[X] view. Data Dictionary Preface Additional Information Release Description Teradata Database 15.0 • Added a description for the CompressValueList column in the ColumnsV[X] view. • Removed the WDDelayTime column from QryLogTDWMV. • Updated the data types for the following: • The CollectTimeStamp column in the QryLockLogXMLV view. • The CollectTimeStamp and EntryTS columns in the QryLogEventHisV view. • The CollectTimeStamp and EventTime columns in the QryLogEventsV view. • The CollectTimeStamp, ClassificationTime, and ExceptionTime columns to the QryLogExceptionsV view. • The CollectTimeStamp column in the QryLogExplainV view. • The CollectTimeStamp column in the QryLogObjectsV view. • The CollectTimeStamp column in the QryLogSQLV view. • The CollectTimeStamp column in the QryLogSummaryV view. • The CollectTimeStamp column in the QryLogTDWMV view. • The CollectTimeStamp column in the QryLogXMLV view. • Added the following views: • PeriodsV[X] • QryLogParamV • QryLogUtilityV • UIF_V (System View) March 2014 continued Additional Information URL Description www.info.teradata.com/ Use the Teradata Information Products Publishing Library site to: • View or download a manual: 1 Under Online Publications, select General Search. 2 Enter your search criteria and click Search. • Download a documentation CD-ROM: 1 Under Online Publications, select General Search. 2 In the Title or Keyword field, enter CD-ROM, and click Search. www.teradata.com The Teradata home page provides links to numerous sources of information about Teradata. Links include: • Executive reports, white papers, case studies of customer experiences with Teradata, and thought leadership • Technical information, solutions, and expert advice • Press releases, mentions and media resources Data Dictionary 5 Preface Product Safety Information URL Description www.teradata.com/t/TEN/ Teradata Customer Education delivers training that builds skills and capabilities for our customers, enabling them to maximize their Teradata investment. https://tays.teradata.com/ Use Teradata @ Your Service to access Orange Books, technical alerts, and knowledge repositories, view and join forums, and download software patches. developer.teradata.com/ Teradata Developer Exchange provides articles on using Teradata products, technical discussion forums, and code downloads. 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 email [email protected]. Product Safety Information This document might contain several types of product safety statements: Safety Information Type Description Notice Indicates a situation which, if not avoided, could result in damage to property, such as to equipment or data, but not related to personal injury. Caution Indicates a hazardous situation which, if not avoided, could result in minor or moderate personal injury. WARNING Indicates a hazardous situation which, if not avoided, could result in death or serious personal injury. Examples: Notice: Improper use of the Reconfiguration utility can result in data loss. Caution: A drive tray chassis weighs approximately 28.6 kg (63 lb). Do not attempt to remove or install the chassis until all the drives and modules have been removed. WARNING: Risk of electrical shock! Always remove power to the power supply/fan module before servicing it. Teradata Database Optional Features This book may include descriptions of the following optional Teradata Database features and products: • 6 Teradata Columnar Data Dictionary Preface Teradata Database Optional Features • Teradata Row Level Security • Teradata Temporal • Teradata Virtual Storage (VS) You may not use these features without the appropriate licenses. The fact that these features may be included in product media or downloads, or described in documentation that you receive, does not authorize you to use them without the appropriate licenses. Contact your Teradata sales representative to purchase and enable optional features. Data Dictionary 7 Preface Teradata Database Optional Features 8 Data Dictionary Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Supported Software Releases and Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Changes to This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 Product Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Teradata Database Optional Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 Chapter 1: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Installing Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 What the Data Dictionary Stores. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Other System Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Teradata QueryGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 2: Data Dictionary Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 About Data Dictionary Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Types of Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modern Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Compatibility Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Non-X Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 19 20 21 23 Access to Data Dictionary Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Default PUBLIC Privileges for Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Views for Which PUBLIC Privileges Are not Granted by Default . . . . . . . . . . . . . . . . . . Compatibility View Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 23 23 24 Querying Data Dictionary Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 How to See All Columns of a View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Querying X Versus Non-X Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Data Dictionary 9 Table of Contents Using HELP and COMMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Tracking Resource Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 AllSpace and TableSize Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 AMPUsage View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Compiling AMPUsage Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Tracking User Activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Tracking Logon Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Tracking Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Accessing PM/API-Related Data in the Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Using System Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 System Calendar View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 SQLJ System Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 User Installed Files View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 Using Modern Views to Update Object Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 Chapter 3: Views Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 AccessLogV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 AccLogRulesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 AccountInfoV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 All_RI_ChildrenV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 All_RI_ParentsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 AllRightsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 AllRoleRightsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 AllSpaceV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 AllTempTablesV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 AMPUsageV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 ArchiveLoggingObjsV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 AssociationV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 AuthorizationsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 BusinessCalendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 BusinessCalendarExceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 BusinessCalendarPatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 CharSetsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 CharTranslationsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 ChildrenV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 CollationsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 ColumnStatsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 10 Data Dictionary Table of Contents ColumnsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 ColumnUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 ConnectRulesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 ConstraintFunctionsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 ConstraintValuesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 CostProfiles_V. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 CostProfileTypes_V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 CostProfileValues_V. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Database_Default_JournalsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Databases2V[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 DatabasesV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 DatabaseUseCountV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 DBCInfoV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 DBQLRulesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 DeleteAccessLogV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 DeleteOldInDoubtV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 DeleteUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 DiskSpaceV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 ErrorTblsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Events_ConfigurationV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Events_MediaV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 EventsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 ExportWidthV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 ExpStatsV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 ExternalSPsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 FunctionsV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 HostsInfoV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 IndexConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 IndexStatsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 IndexUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 IndicesV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 InDoubtLogV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 InsertUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 JoinIndicesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 JournalsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 LoadTablesInfoV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 LogOnOffV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 LogonRulesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Data Dictionary 11 Table of Contents MultiColumnStatsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177 MultiExpStatsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .180 ObjectUseCountV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .183 PartitioningConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184 PeriodsV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .188 ProfileAsgdSecConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190 ProfileInfoV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191 QryLockLogXMLV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193 QryLogEventHisV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196 QryLogEventsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199 QryLogExceptionsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .200 QryLogExplainV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 QryLogObjectsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205 QryLogParamJSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209 QryLogParamV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .211 QryLogSQLV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213 QryLogStepsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .214 QryLogSummaryV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220 QryLogTDWMSumV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .222 QryLogTDWMV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .226 QryLogUtilityV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230 QryLogV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238 QryLogXMLV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .250 RCC_ConfigurationV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .252 RCC_MediaV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .254 ReconfigDeleteOrderV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .254 ReconfigInfoV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256 ReconfigRedistOrderV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .260 ReconfigTableStatsV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261 RepCaptureRulesV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 RepTablesV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 ResolvedDTSV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 RestrictedWordsV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269 RI_Child_TablesV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269 RI_Distinct_ChildrenV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .272 RI_Distinct_ParentsV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .274 RI_Parent_TablesV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275 RoleInfoV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279 12 Data Dictionary Table of Contents RoleMembersV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 SecConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 SecurityDefaultsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 SecurityLogV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 ServerInfoV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 ServerV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 SessionInfoV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 ShowColChecksV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 ShowTblChecksV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 Software_Event_LogV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 StatsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 StatUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 Table_LevelConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 Tables2V[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 Tables3V[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 TableSizeV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 TableStatsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 TablesV[X]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 TableTextV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 TblSrvInfoV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 TblSrvV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 TempTableStatsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 TriggersV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 UDTInfoV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 UpdateUseCountV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 User_Default_JournalsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 UserGrantedRightsV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 UserRightsV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 UserRoleRightsV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 UsersV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 UsrAsgdSecConstraintsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 ZoneGuestsV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 ZonesV[X] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Chapter 4: Data Dictionary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 How Tables Are Created . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 Data Dictionary 13 Table of Contents Accessing Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349 Non-Hashed Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349 DBCExtension Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350 Updating Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Character Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Object Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Text Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Other Character Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Maintaining System Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 Data Dictionary Logs that Require Manual Purging . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 Manually Deleting Old Log Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .353 Appendix A: View Column Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355 AccessRight Column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355 ConstraintType Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357 ExceptionValue Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 IndexType Column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 JournalFlag Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359 NoSQLDataAccess Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359 ProcessOffline Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359 RoutineKind Column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360 StatsSource Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360 TableKind Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360 TimeDimension Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362 VTCheckType Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362 Appendix B: LogonSource Column Fields and Examples . . . . .363 LogonSource Column. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363 Mainframe-Attached Systems Using the CLIv2 API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363 Workstation-Attached Systems Using CLIv2 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365 JDBC Driver API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368 ODBC Driver API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372 .NET Data Provider for Teradata API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .374 PDE Internal Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .381 Data Types for Unicode Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .381 14 Data Dictionary Table of Contents Appendix C: Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 External Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 JARs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 Java External Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 Java UDFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Corresponding Tables and Logging Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 UDFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 UDMs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 UDTs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Views or Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 Data Dictionary 15 Table of Contents 16 Data Dictionary CHAPTER 1 Overview The Teradata Data Dictionary is composed of tables and views primarily in database DBC but also in a number of system databases (for example, Sys_Calendar, TD_SYSFNLIB, SYSUDTLIB, SystemFE, and SYSUIF) that users can retrieve. Tables are reserved for system use and contain metadata about system objects, privileges, events, and usage. Users can retrieve frequently-used data from tables via pre-defined views. The Teradata database administrator determines the set of views available to a user. Installing Data Dictionary The system databases, tables and associated views and macros are created at system initialization (sysinit) time and by executing a set of Dictionary Initialization Program (DIP) scripts. The DIPALL option executes all of the DIP scripts that are installed on every system. Optional DIP scripts include: • DIPACC (supports database access logging) • DIPPDCR (supports infrastructure used by Teradata Professional Services when analyzing system performance issues) Related Topics For information about ... See ... the DIP utility and its executable SQL scripts (such as DIPPDCR, DIPACC, DIPSYSUIF, DIPVIEWS, and DIPALL) Utilities. the macros that are created by the DIPVIEWS script Database Administration. using the DIPACC script to create the DBC.ACCLogRule macro, which is required for setting up database access logging, Security Administration. What the Data Dictionary Stores Information about each database object is stored in the system tables. Data Dictionary 17 Chapter 1: Overview Teradata QueryGrid System tables cannot be directly modified and are used by the system to manage and maintain the integrity of the database. Information in the system tables is used to create, access, modify and execute objects and user data stored in the Teradata Database. The primary system tables include: • Dbase: This table contains information about every database installed on the system. Database information includes names associated with this database (for example, database name, owner name, and account name), timestamps, passwords, and so on. • DataBaseSpace: This table contains space allocation for each database. • TVM and TVFields: This table contains information about every table, view, macro and other objects that are stored in the databases. • Accessrights: This table contains all of the information about user permissions for each type object stored in the database. Teradata database supports the following database objects: • Stored procedures written in SQL and external stored procedures written in C/C++ and Java. • User-defined types (UDTs), user-defined functions (UDFs), and user-defined methods (UDMs). These functions and methods provide you with the toolset to perform whatever type of processing and manipulation of data is required. For detailed descriptions of these objects, see Appendix C: “Database Objects.” Other System Objects For details about system objects not covered in this manual, see Appendix C: “Database Objects.” For information about ... See ... SystemFE database SystemFE Macros. Resource Usage tables Resource Usage Macros and Tables. Sys_Calendar database and DBQL tables Database Administration. Teradata QueryGrid Teradata QueryGrid: Teradata Database-to-Hadoop (also referred to as the Teradata-toHadoop connector) provides a SQL interface for transferring data between Teradata Database and remote Hadoop hosts. For information about related views and tables, see Teradata QueryGrid: Teradata Database-to-Hadoop. 18 Data Dictionary CHAPTER 2 Data Dictionary Views Data Dictionary tables only change in major Teradata releases, but Data Dictionary views can change in minor releases. See DBS Tech Alert 2288 for information about changes to Data Dictionary views in maintenance or efix releases (available from Teradata@Your Service: http:/ /tays.teradata.com/). About Data Dictionary Views During initial system setup, the Database Initialization Program (DIP) creates pre-defined Data Dictionary views, which allow convenient access to data stored in Data Dictionary base tables. For more information about DIP, see Utilities. The DIP script run as part of system setup creates several types of Data Dictionary views with varying purposes. For more information about the Data Dictionary views, see “Types of Views” on page 19. Many Data Dictionary views are accessible by all users by default, but some are restricted. For information about the privileges for Data Dictionary views, see “Access to Data Dictionary Views” on page 23. You can query views using SQL requests. For details, see “Querying Data Dictionary Views” on page 24. Data Dictionary views are used by administrators and by administrative tools, such as Teradata Viewpoint. For more about how Data Dictionary views are used, see “Tracking Resource Usage” on page 26. Types of Views During system installation, the database administrator can load the following views into the DBC user space. Modern Views Because data dictionary tables can change, views provide greater stability. In modern views, object names are returned in the session character set. The substitution character for the session character set will be returned for any characters in the object name that do not exist in the session character set. Modern view names use the following formats: Data Dictionary 19 Chapter 2: Data Dictionary Views Types of Views • view_nameV • view_nameVX For example, All_RI_ChildrenV or All_RI_ChildrenVX, where the “X” denotes a partial view that omits certain restricted data, such as security-related information. Related Topics For more information about ... See ... modern views that end with a suffix “VX” “X Views” on page 21. modern views that end with a suffix “V” “Non-X Views” on page 23. standard language support systems or Japanese language support systems International Character Set Support. the types of privileges “Access to Data Dictionary Views” on page 23. Compatibility Views Compatibility views convert the native variable length Unicode object names into 30 bytes of either Latin or Kanji1.This can cause loss of information by truncation or inability to convert object names longer than 30 characters into Latin or Kanji1. Characters that can not be converted are replaced by the substitution character, which is 0x1A for both Latin and Kanji1. As with all character data, when object names are returned to the user they are converted to the session character set. This conversion can produce loss of information if the characters in the object name cannot be converted to the session character set or exceed the export width for the character data. Compatibility view names use the format: • view_name • view_nameX For example, All_RI_Children or All_RI_ChildrenX, where the X denotes a partial view that omits restricted data, such as security-related information. A modern view exists for every compatibility view in database DBC. The information available in compatibility views is available from the corresponding modern view, and compatibility views should no longer be used to obtain the required information. Note: Teradata strongly encourages you to switch over to modern views. The following compatibility views are deprecated and will be eliminated in a future release. 20 Data Dictionary Chapter 2: Data Dictionary Views Types of Views • • • • • • • • • • • • • • • • • • • • • • • • • • • • DBC.AccessLog[X] DBC.AccLogRules[X] DBC.AccountInfo[X] DBC.AllRights[X] DBC.AllRoleRights[X] DBC.AllSpace[X] DBC.AllTempTables[X] DBC.All_RI_Children[X] DBC.All_RI_Parents[X] DBC.AMPUsage[X] DBC.Association[X] DBC.Authorizations[X] DBC.CharSets[X] DBC.CharTranslations[X] DBC.Children[X] DBC.Collations[X] DBC.Columns[X] DBC.ConnectRules[X] DBC.Databases[X] DBC.Databases2[X] DBC.Database_Default_ Journals[X] DBC.DBCInfo[X] DBC.DBQLRules[X] DBC.DeleteAccessLog[X] DBC.DeleteOldInDoubt[X] DBC.DiskSpace[X] DBC.Events[X] DBC.Events_ Configuration[X] • • • • • • • • • • • • • • • • • • • • • • • • • • • • • DBC.Events_Media[X] • DBC.ExternalSPs[X] DBC.Functions[X] • DBC.HostsInfo[X] DBC.IndexConstraints[X] • • DBC.IndexStats[X] • DBC.Indices[X] • DBC.InDoubtLog[X] • DBC.Journals[X] • DBC.LogOnOff[X] • DBC.LogonRules[X] DBC.MultiColumnStats[X] • • DBC.ProfileInfo[X] • DBC.QryLog[X] DBC.QryLogEventHis[X] • DBC.QryLogEvents[X] • DBC.QryLogExceptions[X] • DBC.QryLogExplain[X] • DBC.QryLogObjects[X] • DBC.QryLogSQL[X] • DBC.QryLogSteps[X] DBC.QryLogSummary[X] • DBC.QryLogTDWM[X] • DBC.QryLogTDWM • Sum[X] • DBC.RCC_Configuration[X] DBC.RCC_Media[X] DBC.RepTables[X] DBC.RestrictedWords[X] DBC.RI_Child_Tables[X] DBC.RI_Distinct_ Children[X] DBC.RI_Distinct_Parents[X] DBC.RI_Parent_Tables[X] DBC.RoleInfo[X] DBC.RoleMembers[X] DBC.SecurityDefaults[X] DBC.SecurityLog[X] DBC.SessionInfo[X] DBC.ShowColChecks[X] DBC.ShowTblChecks[X] DBC.Software_Event_Log[X] DBC.Table_Level Constraints[X] DBC.Tables[X] DBC.Tables2[X] DBC.TableSize[X] DBC.TableText[X] DBC.Triggers[X] DBC.UserGranted Rights[X] DBC.UserRights[X] DBC.UserRoleRights[X] DBC.Users[X] DBC.User_Default_ Journals[X] X Views The modern X views and compatibility X views contain security constraints in their definition to limit the result set to only the rows associated with the requesting user, such as: • Databases • Users • Objects owned or created by the user • Objects on which the user has been granted privileges The following modern X views and compatibility X views also return rows associated with the current role of the user and any nested roles of that current role. Data Dictionary 21 Chapter 2: Data Dictionary Views Types of Views • • • • • • • • • • • • • • • • • • • • • • • DBC.All_RI_ChildrenVX DBC.All_RI_ParentsVX DBC.AssociationVX DBC.ColumnsVX DBC.DatabasesVX DBC.Databases2VX DBC.All_RI_ChildrenVX DBC.All_RI_ParentsVX DBC.AllRightsVX DBC.AssociationVX DBC.ColumnsVX DBC.DatabasesVX DBC.Databases2VX DBC.Database_Default_JournalsVX DBC.DiskSpaceVX DBC.EventsVX DBC.Events_MediaVX DBC.Events_ConfigurationVX DBC.FunctionsVX DBC.IndexConstraintsVX DBC.EventsVX DBC.Events_MediaVX DBC.Events_ConfigurationVX • • • • • • • • • • • • • • • • • • • • • • • DBC.FunctionsVX DBC.IndexConstraintsVX DBC.IndicesVX DBC.JournalsVX DBC.PeriodsVX DBC.RCC_MediaVX DBC.RCC_ConfigurationVX DBC.RepTablesVX DBC.RI_Child_TablesVX DBC.RI_Distinct_ChildrenVX DBC.RI_Distinct_ParentsVX DBC.RI_Parent_TablesVX DBC.ShowColChecksVX DBC.ShowTblChecksVX DBC.Table_LevelConstraintsVX DBC.TablesVX DBC.Tables2VX DBC.Tables3VX DBC.TableSizeVX DBC.TableTextVX DBC.TriggersVX DBC.User_Default_JournalsVX DBC.UIF_V For example, the DBC.TablesVX and DBC.TablesX views provide the following information for each table to which the role of the user has access: • If the role has privilege on all in TVMs • If the role has privilege on this specific TVM It also depends on the current session role of the user to determine what roles are used to verify privileges. If the current role is. . . Then . . . not NULL or ALL the current role and its nested role are used for security checks. ALL all the role(s) directly granted to the user and all their nested role(s) are used for security checks. The modern X views and compatibility X views run slower than their corresponding non-X versions because the modern X views and compatibility X views have security checks. Compatibility X views are named the same as their corresponding non-X views followed by the character X. 22 Data Dictionary Chapter 2: Data Dictionary Views Access to Data Dictionary Views Modern X views are named the same as their corresponding non-X view followed by the letter V. Non-X Views A non-X view ends with the letter V (for example, DBC_RCC_MediaV). Views that end with the letter V will return every row of every column defined on the underlying table. Access to Data Dictionary Views Default PUBLIC Privileges for Views The system grants the SELECT privilege to PUBLIC on most Data Dictionary views by default. All Teradata Database users have PUBLIC privileges by default. For security and data integrity reasons, the system does not grant INSERT, UPDATE, and DELETE privileges to PUBLIC on Data Dictionary views. You can separately grant these privileges to administrative users if needed. For information on accessing views, see “Querying Data Dictionary Views” on page 24. Views for Which PUBLIC Privileges Are not Granted by Default The system grants default access privileges on some views only to user DBC. These views contain security information or other data that is not for general use, so they are not included when the system grants default PUBLIC privileges on other views. You must GRANT privileges to the following restricted views for any users or roles that need access to them. Data Dictionary • DBC.AccessLog • DBC.AccLogRules • DBC.CSPSessionInfo • DBC.DBQLRules • DBC.DeleteAccessLog • DBC.DeleteOldInDoubt • DBC.InDoubtLog • DBC.LogonRules • DBC.QryLog • DBC.QryLogExceptions • DBC.QryLogExplain • DBC.QryLogEvents • DBC.QryLogObjects • DBC.QryLogSQL • DBC.QryLogSteps 23 Chapter 2: Data Dictionary Views Querying Data Dictionary Views • DBC.QryLogSummary • DBC.QryLogTDWM • DBC.QryLogTDWMSum • DBC.SecurityLog • DBC.Software_Event_Log Compatibility View Privileges Privileges for the compatibility views have been changed to read only and INSERT, UPDATE, DELETE, and SELECT privileges are granted under the following modern views: • CollationsV • CharTranslationsV • HostsInfoV Querying Data Dictionary Views You can submit an SQL request to access the data in a system view and display or print the results. For example: SELECT * FROM DBC.AccLogRules WHERE UserName = ’ALL’; Note: If an SQL request 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, consult with the Teradata Database administrator. The following sections show various methods for retrieving directory information. For a description of several common administrative uses of the information in Data Dictionary views, see the topics starting with “Tracking Resource Usage” on page 26. How to See All Columns of a View The output of some views extends beyond a standard 80-character width display. To see all the columns, you can either: • Cast the name columns to shorter lengths • Use the SET FOLDLINE and SET SIDETITLES options in BTEQ Querying X Versus Non-X Views The amount of information that can be retrieved from system views at a particular site depends on: • 24 Whether an X version is available for a particular view Data Dictionary Chapter 2: Data Dictionary Views Querying Data Dictionary Views • The privilege granted, if any, on each available view • Whether the statement references “view_name” or “view_nameX” 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 view name, as follows: A view specified as … Returns information about … DBC.viewname all objects for which entries exist in the underlying table. Note: Unconditional SELECTs on non-X views may cause the result to e xhaust the available spool space of the user. DBC.viewnameX only those objects that the requesting user: • • • • owns created has been granted privileges on has access to via current role and the current nested roles of the role Example 1 - Non-X View Query User Test1 queries the Databases view: SELECT DatabaseName, CreatorName, OwnerName, PermSpace FROM DBC.Databases ; As a result, all the databases in the Teradata Database are listed: 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 2 - X View Query User Test1 queries the X version of the Databases view: SELECT DatabaseName, CreatorName, OwnerName, PermSpace FROM DBC.DatabasesX ; In contrast to the results of the previous example, only those databases that Test1 owns or has access to are listed: DatabaseName Jane Test1 . . Data Dictionary CreatorName Jane SYSADMIN . . OwnerName Test1 Test1 . . PermSpace 500,000 1,000,000 . . 25 Chapter 2: Data Dictionary Views Tracking Resource Usage Using HELP and COMMENT If the SELECT privilege on one or more system views is revoked or not granted to PUBLIC, you can use the HELP and COMMENT statements to obtain directory information about a particular object for which you have access. 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 privileges that t he current user has granted to other users. The column names are: Databa seName, TableName, ColumnName, AccessRight, Grantee, Grant Authority, an d Allnessflag. Tracking Resource Usage Information on the usage of the Teradata Database is collected by user and by account number. Control is determined by the definition of each CREATE USER statement. An account is associated with a group of users whose usage charges are maintained by the Teradata Database. Account IDs 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 ID of the immediate owner of the user. If the owner has multiple account IDs, then the first account ID is taken for the user as the default. The following sections describe the accounting information available for any Teradata Database session. You can monitor usage with the following Data Dictionary views: • AccountInfo • AllSpace • AMPUsage • DiskSpace • LogOnOff • TableSize The AllSpace, DiskSpace, TableSize, and AMPUsage views are useful in tracking Teradata Database resources for accounting purposes, and in determining how effectively resources are being utilized by accounts and users. 26 Data Dictionary Chapter 2: Data Dictionary Views Tracking Resource Usage 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 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 because the table was created. AMPUsage View The AMPUsage view supplies information about AMP CPU time consumed, and the number of AMP to disk 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 To obtain a list (in order of the amount of space used) of those databases currently using more than 80% of their permanent space allocation, enter: 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. Compiling AMPUsage Statistics You can use the AMPUsage view to build and maintain a history table of CPU time and disk I/O statistics for each username/accountname. To create the history table, enter: CREATE TABLE AMPUseHist ( AccountName VARCHAR(30), UserName VARCHAR(30), CPUtime INTEGER, DiskIO INTEGER, Data Dictionary 27 Chapter 2: Data Dictionary Views Tracking Resource Usage Date DATE,Time FLOAT ) PRIMARY INDEX (UserName, AccountName); Periodically, collect usage statistics using this procedure: 1 Select statistics from the AMPUsage view and insert them in the history table. 2 Reset AMPUsage counters to zero for the next collection period. This procedure can be carried out using the 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.AMPUsageV SET CPUTime = 0, DiskIO = 0 ALL; .QUIT 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 determine how you can use the DiskSpace view to build and maintain a table of disk space usage. After a collection period, you may select AMPUsageV and DiskSpace statistics from the history tables to query the data or to archive the data on a client system. You can use the selected data in sequential data sets on the host computer for subsequent analysis. For example, you can use a BTEQ script to: • Create a client-resident file • Use the BTEQ .EXPORT command to save the data being selected into that file • Select 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 Date,Time; .QUIT ## After it is selected and stored, historical data can be used for analysis, as follows: 28 Data Dictionary Chapter 2: Data Dictionary Views Tracking User Activity • Client-resident software packages such as SAS can be used to perform analysis and other statistical manipulation on the data. • Graphic software packages can be used to display the data. Related Topics For more information on ... See ... PM/API requests Application Programming Reference. resource usage Resource Usage Macros and Tables. Tracking User Activity The Software_Event_Log view displays, by date and time, any events that have affected processing, such as a memory parity error, a disabling of logons, a Teradata Database restart, or execution of a PM/API SET 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 Database. 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 contains information about the privileges that have been granted to any user. See the description of the GRANT statement in SQL Data Control Language, 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 Security Administration. Data Dictionary 29 Chapter 2: Data Dictionary Views Tracking User Activity Accessing PM/API-Related Data in the Data Dictionary Several Data Dictionary tables log Performance Monitor/Application Programming Interface (PM/API)-related values for some columns. You can use the PM/API information to track the use of MONITOR partition functions. The following DBC tables contain PM/API information: • DBC.AccessRights • DBC.SessionTbl • DBC.SW_Event_Log Note: Execution of the PM/API SET RESOURCE, SET SESSION, and ABORT SESSION requests are considered major system events and are logged to the DBC.SW_Event_Log table. • DBC.Dbase • DBC.TVM The following Data Dictionary views, which are built on those tables, are also carry PM/API-related data: • AllRights • AllSpace[X] • Databases[X] • DiskSpace[X] • Software_Event_Log • LogOnOff • SessionInfo • UserGrantedRights • UserRights The following example queries return information about PM/API-related activities. Example 1 To determine who is using the monitor, enter the following: SELECT UserName, IFPNo FROM DBC.SessionInfo WHERE Partition = ’MONITOR’ ; Example 2 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. 30 Data Dictionary Chapter 2: Data Dictionary Views Using System Views Example 3 To find out what users have been forced off the system (using PM/API ABORT SESSION) in the past two days, enter the following: SELECT DISTINCT UserName FROM DBC.LogOnOff WHERE Event = ’Forced Off’ AND LogDate > DATE - 3 ; Using System Views System Calendar View The Sys_Calendar.Calendar system view helps to extend the properties of a DATE data type column by means of a join. The columns of the view contain data only for the active calendar for the session. The calendar dates range from 1900 to 2100 and are stored in a table in the Sys_Calendar database. The administrator must run DIPCAL SQL and DIPSYSFNC scripts from the DIP utility to create the Sys_Calendar database and the two versions of the Calendar view. There are two versions of the Sys_Calendar.Calendar view. One for the current release, and the version that was provided in the Teradata Database 13.10 release, which is named Sys_Calendar.Calendar_TD1310. The current version (named Sys_Calendar.Calendar_TD_ISO_COMPATIBLE), is an internal view and can only be accessed by user DBC. Release 13.10 Version Note: The Release 13.10 version can only be used for the Teradata system-defined calendar. If you try to use it when the session calendar is ISO or COMPATIBLE, the returned values will not be valid because they will always be from the Teradata calendar. The current version uses embedded services system functions to compute some column values. The Release 13.10 version computes all column values using arithmetic, which generally takes less time than computing values using UDFs. To begin using Release 13.10 version, follow these steps: 1 Use this statement to view the definition of the Release 13.10 version: SHOW VIEW Sys_Calendar.Calendar_TD1310; 2 Use REPLACE to replace the definition of the current version with the definition of the Release 13.10 version. After you redefine the current version, it no longer uses embedded services system functions to compute column values for the following columns: Data Dictionary • day_of_month • weekday_of_month 31 Chapter 2: Data Dictionary Views Using System Views • month_of_quarter • month_of_year • quarter_of_year • year_of_calendar To Revert the View to the Current Version If the view was redefined to the Release 13.10 version and you want to use the current version, you need to redefine it so that is has the definition of the current version. The current version (named Sys_Calendar.Calendar_TD_ISO_COMPATIBLE), is an internal view and has restricted access. Note: The current version can be used with the Teradata, ISO, and COMPATIBLE session calendars. To redefine the Release 13.10 version, follow these steps: 1 Use this statement to view the definition of the Release 13.10 version: SHOW VIEW Sys_Calendar.Calendar_TD_ISO_COMPATIBLE; 2 Use REPLACE to replace the definition of the Release 13.10 version with the definition of the current version. After you redefine the Release 13.10 version, the current version uses Embedded Services functions to compute column values for the following columns: • day_of_month • weekday_of_month • month_of_quarter • month_of_year • quarter_of_year • year_of_calendar Privilege By default, the system grants the SELECT privilege on Sys_Calendar.Calendar to PUBLIC. View Definition This table lists and describes the columns of the view. 32 View Column Name Description Data Type Format calendar_date The default date format. DATE YY/MM/DD day_of_week The day of the week (1-7) where Sunday = 1 and Saturday = 7. INTEGER -(10)9 day_of_month The day of the month (1-31). INTEGER -(10)9 day_of_year The day of the year (1-366). INTEGER -(10)9 Data Dictionary Chapter 2: Data Dictionary Views Using System Views View Column Name Description Data Type Format day_of_calendar The number of days since and including 01/01/1900. INTEGER -(10)9 weekday_of_month The nth occurrence of the weekday in the month (1-5). INTEGER -(10)9 week_of_month The nth full week of the month, first partial week is 0 (0-5). INTEGER -(10)9 week_of_year The nth full week of the year, first partial week is 0 (0-53). INTEGER -(10)9 week_of_calendar The nth full week of the calendar, the first partial week is 0. INTEGER -(10)9 month_of_quarter The month of the quarter (1-3). INTEGER -(10)9 month_of_year The month of the year (1-12). INTEGER -(10)9 month_of_calendar The number of the months since and including 01/01/1900. INTEGER -(10)9 quarter_of_year The quarter of the year. 1 (Jan/Feb/Mar) 4 (Oct/Nov/Dec). INTEGER -(10)9 quarter_of_calendar The number of quarters since and including Q1/1900. INTEGER -(10)9 year_of_calendar The number of calendar years in 4 digit format. INTEGER -(10)9 Example You are encouraged to define views on the Calendar system view because of its convenience. A useful view to define on Calendar is Today: CREATE VIEW Today AS ( SELECT * FROM Sys_Calendar.Calendar WHERE Sys_Calendar.Calendar.calendar_date = DATE ); The Calendar system view permits easy specification of arithmetic expressions and aggregation. This is particularly useful in online analytical processing environments where requests commonly aggregate values by weeks, months, year-to-date, years, and so on. The following is an example. What are the dollar sales for this week, last week, and the same weeks last year for all items in the sportswear department for women? SELECT a2.week_of_calendar, SUM(a1.price) FROM Sales a1, CALENDAR a2, Item a3, Department a4, Today a5 WHERE a1.calendar_date=a2.calendar_date AND (a2.week_of_calendar=a5.week_of_calendar OR a2.week_of_calendar=a5.week_of_calendar - 1 OR a2.week_of_calendar=a5.week_of_calendar - 52 OR a2.week_of_calendar=a5.week_of_calendar - 53 Data Dictionary 33 Chapter 2: Data Dictionary Views Using System Views ) AND a1.itemID=a3.itemID AND a3.classID=a4.classID AND a4.classDesc='Women’s Sportswear' GROUP BY a2.week_of_calendar ORDER BY a2.week_of_calendar; SQLJ System Views The SQLJ database and its views are used by the system to manage JAR files that implement Java external stored procedures. The SQLJ database and its components are created via a DIP script called DIPSQLJ. The DIPSQLJ script is run as part of DIPALL and follows the pattern set by the DBC Data Dictionary initialization process. The DIPSQLJ script revokes all privileges, which could result in modification of SQLJ database views and external stored procedures. The SQLJ database requires sufficient space for all required components to be defined within it, and the initial space allocation for this database is determined based upon that fact. The best practice is to avoid the placement of additional items into this database, as the SQLJ database could be considered an extension to the Teradata Data Dictionary defined in the DBC database. The SQLJ system database contains the views: • JAR_JAR_USAGE • JARS • ROUTINE_JAR_USAGE JAR_JAR_USAGE The JAR_JAR_USAGE view identifies each JAR owned by a given user or database on which other JARs defined on the system are dependent. View Column Name Description Data Type Format DatabaseId The identifier of the database or user in which the JAR identified by JarName is defined. BYTE(4) NOT NULL X(8) JarName The name designator for a JAR that depends on code from another JAR. VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL X(128) 34 Data Dictionary Chapter 2: Data Dictionary Views Using System Views View Column Name Description Data Type Format PathJarName The name designator for a JAR, which is in the SQL-Java path of the JAR identified by JarName. VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL X(128) The SQL-Java path is the search path defined for a particular JAR. With a SQL-Java path defined, a method defined in a particular JAR (JAR A) may invoke a method which is defined in another JAR (JAR B), if JAR B (and all its classes) is contained in the SQL-Java path of JAR A. A SQL-Java path for a JAR can only be created, altered, or dropped via a call to SQLJ.Alter_Java_Path. Corresponding System Tables The corresponding system tables for SQLJ.JAR_JAR_USAGE are: • DBC.JAR_JAR_USAGE • DBC.DBase • DBC.TVM Example The following SELECT statement retrieves information about each JAR owned by a given user or database on which other JARs are dependent. ==> SELECT * FROM sqlj.jar_jar_usage; Result: DatabaseId ---------0000B905 0000B905 JarName ------JAR1 JAR2 PathJarName ----------JAR4 JAR3 JARS The JARS view identifies the installed JARs defined on the system that are accessible to the current user or database. View Column Name Description Data Type Format DatabaseId The identifier of the database or user in which the JAR identified by JarName is defined. BYTE(4) NOT NULL X(8) JarName The name designator for an installed JAR. VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL X(128) JarId The unique identifier for the JAR identified by JarName. BYTE(6) NOT NULL X(12) Data Dictionary 35 Chapter 2: Data Dictionary Views Using System Views Corresponding System Tables The corresponding system tables for SQLJ.JARS are: • DBC.DBase • DBC.JARS Example The following SELECT statement retrieves information about all JAR objects that are accessible to the current user or database. ==> SELECT * FROM sqlj.jars; Result: DatabaseId ---------0000B905 0000B905 0000B905 JarName ------JAR1 JAR2 JAR3 JarId -----------000061280000 000062280000 000063280000 ROUTINE_JAR_USAGE The ROUTINE_JAR_USAGE view identifies the JARs owned by a given user or database on which external Java routines defined on the system are dependent. View Column Name Description Data Type Format DatabaseId The identifier of the database or user in which the JAR identified by JarName is defined. BYTE(4) NOT NULL X(8) RoutineName The name designator for a Java external stored procedure that depends on the JAR identified by JarName. VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL X(128) JarName The name designator for a JAR that contains code that the RoutineName external stored procedure depends on. VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL X(128) Signature The signature defined for Java external stored procedure identified by RoutineName. VARCHAR(6400) LATIN CASESPECIFIC X(255) Corresponding System Tables The corresponding system tables for SQLJ.ROUTINE_JAR_USAGE are: 36 • DBC.ROUTINE_JAR_USAGE • DBC.DBase • DBC.TVM Data Dictionary Chapter 2: Data Dictionary Views Using System Views Example The following SELECT statement retrieves information about all of the JARs owned by a given user or database on which dependent external Java routines are defined. Information about these routines is also returned. ==> SELECT * FROM sqlj.routine_jar_usage; Result: DatabaseId JarName RoutineName Signature DatabaseId JarName RoutineName Signature DatabaseId JarName RoutineName Signature 0000B905 JAR1 MYINT (I[I)V 0000B905 JAR2 MYDEC (Ljava/math/BigDecimal;[Ljava/math/BigDecimal;)V 0000B905 JAR3 MYVARBYTE ([B[Ljava/lang/String;)V User Installed Files View The user installed files (UIF_V) view is created by the SYSUIF database and is populated by the DBC.UIF_INFO table. This view identifies the user installed files (UIFs) defined on the system that are accessible to the current user or database. View Definition This table lists and describes the columns of the view. View Column Data Type Format Referenced Table.Column DatabaseId BYTE(4) X(8) Dbase.DatabaseId X(128) TVM.NameI X(12) UIF_INFO.UIFID NOT NULL TVMNameI VARCHAR(128) NOT NULL UIFID BYTE(6) NOT NULL Example The following SELECT statement displays the UIFs that are accessible by database or user ID 00000104. SELECT * from sysuif.uif_v; Result: DatabaseId 00000104 UIFFileName r2.r TVMNameI R2 Data Dictionary 37 Chapter 2: Data Dictionary Views Using Modern Views to Update Object Names UIFId DatabaseId UIFFileName TVMNameI UIFId 0000060A0000 00000104 p1.py P1 0000070A0000 Using Modern Views to Update Object Names Based on the language support mode, a compatibility view casts the object name to 30 fixed characters in the Latin or Kanji server character set. Whenever data is not accessed via direct reference, the view cannot be used to update the underlying table. Therefore, you cannot use compatibility views to update object names in the underlying tables. Instead, you must use modern views. Processes that ran on Release 12.0 or earlier may attempt to make updates through the DBC.Collations, DBC.CharTranslations or DBC.HostsInfo views. These views are deprecated and have not been supported since Release 12.0. Teradata strongly recommends that you update such processes to reference the corresponding modern views (for example, CollationsV, CharTranslationsV, and HostsInfoV) instead of the compatibility views. 38 Data Dictionary CHAPTER 3 Views Reference You can use Teradata Studio or Teradata Studio Express to view the Data Dictionary. For information about these tools and to download them, go to: http://developer.teradata.com The following topics describe all the Data Dictionary views in alphabetical order. The columns of each view are listed in the order they appear in the client applications’ Show Definition. DBC.UserDB and DBC.OwnerDB system views are not covered in this manual 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). Data Dictionary tables only change in major Teradata releases, but Data Dictionary views can change in minor releases. See DBS Tech Alert 2288 for information about changes to Data Dictionary views in maintenance or efix releases (available from Teradata@Your Service: http:/ /tays.teradata.com/). Data Dictionary views fall into the following categories: Type Information Stored Operations Internal database operations Database Database instance and owner Schema Database schema (tables, columns, and so on) Integrity Data integrity (constraints and so on) Security Data security (roles, grants, access, and so on) Query Database Query Log Accounting Database usage (accounts, space, and so on) Optimizer Statistics Statistics collected on indexed, non-indexed columns (including row and column PARTITION statistics) and expressions on permanent tables, base and materialized global temporary tables (for the current session) and join and hash indexes. Data Dictionary views consist of one or more columns. Many of the Data Dictionary view columns have referenced table columns. That is, the value in the view column selected corresponds to a value in the column referenced in the table. It would be meaningful to join the view and the referenced table based on the selected column and the referenced column. Data Dictionary 39 Chapter 3: Views Reference AccessLogV Note: The results shown in the examples are for illustration purposes only. You can use utilities and tools, such as BTEQ or other third-party products, to enter queries and format the results differently. Some column formats are explicit, while others are not. "Explicit" means that the format string is specified by the Table Initializer program. When "explicit" is not specified, the format is taken from the default format for the data type for the column. AccessLogV Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogDate DATE YY/MM/DD (explicit) AccLogTbl.TheDate 99:99:99 (explicit) AccLogTbl.TheTime YY/MM/DD (explicit) AccLogTbl.LogonDate (NUPI) 99:99:99 (explicit AccLogTbl.LogonTime (NUPI) ZZZ9 (explicit) AccLogTbl.LogicalHostId -(5)9 AccLogTbl.IFPNo --,---,---,--9 (explicit) AccLogTbl.SessionNo X(128) AccLogTbl.UserName NOT NULL LogTime TIME NOT NULL LogonDate DATE NOT NULL LogonTime TIME NOT NULL LogicalHostId SMALLINT NOT NULL IFPNo SMALLINT NOT NULL SessionNo INTEGER NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 40 Data Dictionary Chapter 3: Views Reference AccessLogV View Column Data Type Format Referenced Table.Column AccountName VARCHAR(128) X(128) AccLogTbl.AccountName X(128) AccLogTbl.OwnerName X(2) AccLogTbl.AccessType X(1) AccLogTbl.Frequency UNICODE NOT CASESPECIFIC NOT NULL OwnerName VARCHAR(128) UNICODE NOT CASESPECIFIC AccessType CHAR(2) LATIN NOT CASESPECIFIC NOT NULL Frequency CHAR(1) LATIN NOT CASESPECIFIC NOT NULL EventCount INTEGER --,---,---,--9 (explicit) AccLogTbl.EventCount AccLogResult CHAR(1) LATIN X(1) AccLogTbl.AccLogResult X(128) AccLogTbl.DatabaseName X(128) AccLogTbl.TVMName X(128) AccLogTbl.ColumnName X(20) AccLogTbl.StatementType X(8192) AccLogTbl.StatementText NOT CASESPECIFIC NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TVMName VARCHAR(128) UNICODE NOT CASESPECIFIC ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC StatementType VARCHAR(20) LATIN NOT CASESPECIFIC NOT NULL StatementText VARCHAR(8192) UNICODE NOT CASESPECIFIC Data Dictionary 41 Chapter 3: Views Reference AccessLogV View Column Data Type Format Referenced Table.Column QueryBand VARCHAR(6160) X(6160) AccLogTbl.Queryband X(128) AccLogTbl.ProxyUser X(8) AcclogTbl.ConstraintId UNICODE NOT CASESPECIFIC ProxyUser VARCHAR(128) UNICODE NOT CASESPECIFIC ConstraintId BYTE(4) Usage Notes Each row displays 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 “AccLogRulesV” on page 44). Possible Values for the AccessType Column 42 Value Description AE ALTER EXTERNAL PROCEDURE AF ALTER FUNCTION AN ANY PRIVILEGE * h (*indicates a HELP or SHOW statement for which at least one privilege, but no specific privilege, is required) AP ALTER PROCEDURE AS ABORT SESSION CA CREATE AUTHORIZATION CD CREATE DATABASE CE CREATE EXTERNAL PROCEDURE CF CREATE FUNCTION CG CREATE TRIGGER CM CREATE MACRO CO CREATE PROFILE CP CHECKPOINT CR CREATE ROLE CT CREATE TABLE CU CREATE USER CV CREATE VIEW Data Dictionary Chapter 3: Views Reference AccessLogV Data Dictionary Value Description D DELETE DA DROP AUTHORIZATION DD DROP DATABASE DF DROP FUNCTION DG DROP TRIGGER DM DROP MACRO DO DROP PROFILE DP DUMP DR DROP ROLE DT DROP TABLE DU DROP USER DV DROP VIEW E EXECUTE EF EXECUTE FUNCTION GC CREATE GLOP GD DROP GLOP GM GLOP MEMBER HR HUT RELEASE LOCK * (*indicates a client system utility lock is involved, which could require a check for one or more privileges associated with DUMP and RESTORE.) I INSERT IX INDEX MR MONITOR RESOURCE MS MONITOR SESSION OP CREATE OWNER PROCEDURE PC CREATE PROCEDURE PD DROP PROCEDURE PE EXECUTE PROCEDURE RF REFERENCES RS RESTORE S RETRIEVE/SELECT 43 Chapter 3: Views Reference AccLogRulesV Value Description SR SET RESOURCE RATE SS SET SESSION RATE ST STATISTICS U UPDATE UM UDT METHOD UT UDT TYPE UU UDT USAGE WL WRITE LOCK * (*indicates a locking object name FOR WRITE is involved, which may require checks for INSERT, UPDATE, and/or DELETE privileges.) Possible Values for the AccLogResult Column Value Description G GRANTED D DENIED UserName Column The user name column is the name or profile of a user. 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.) ==> SELECT LogDate, UserName, AccessType, StatementText FROM DBC.AccessL og WHERE LogDate = 890510; Result: LogDate -------89/05/10 UserName -------Jones AccessType ---------CT StatementText -----------------------------CREATE TABLE Jones.EmpDup (Em AccLogRulesV Category Security 44 Data Dictionary Chapter 3: Views Reference AccLogRulesV Database DBC View Columns and Referenced Tables.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) SecConstraints.ConstraintName X(3) AccLogRuleTbl.AcrAlterFunction X(3) AccLogRuleTbl.AcrCheckpoint X(3) AccLogRuleTbl.AcrCreateDataBase X(3) AccLogRuleTbl.AcrCreateFunction X(3) AccLogRuleTbl.AcrCreateMacro UNICODE NOT CASESPECIFIC NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TVMName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ConstraintName VARCHAR(128) UNICODE NOT NULL AcrAlterFunction CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCheckPoint CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateDataBase CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateFunction CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateMacro CHAR(3) LATIN NOT CASESPECIFIC NOT NULL Data Dictionary 45 Chapter 3: Views Reference AccLogRulesV View Column Data Type Format Referenced Table.Column AcrCreateTable CHAR(3) LATIN X(3) AccLogRuleTbl.AcrCreateTable X(3) AccLogRuleTbl.AcrCreateUser X(3) AccLogRuleTbl.AcrCreateView X(3) AccLogRuleTbl.AcrCreateProcedure X(3) AccLogRuleTbl.AcrCreExtProcedure X(3) AccLogRuleTbl.AcrDelete X(3) AccLogRuleTbl.AcrDropDatabase X(3) AccLogRuleTbl.AcrDropFunction X(3) AccLogRuleTbl.AcrDropMacro X(3) AccLogRuleTbl.AcrDropTable X(3) AccLogRuleTbl.AcrDropUser NOT CASESPECIFIC NOT NULL AcrCreateUser CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateView CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreExtProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDelete CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropDatabase CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropFunction CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropMacro CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropTable CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropUser CHAR(3) LATIN NOT CASESPECIFIC NOT NULL 46 Data Dictionary Chapter 3: Views Reference AccLogRulesV View Column Data Type Format Referenced Table.Column AcrDropView CHAR(3) LATIN X(3) AccLogRuleTbl.AcrDropView X(3) AccLogRuleTbl.AcrDropProcedure X(3) AccLogRuleTbl.AcrDump X(3) AccLogRuleTbl.AcrExecute X(3) AccLogRuleTbl.AcrExecuteFunction X(3) AccLogRuleTbl.AcrExecuteProcedure X(3) AccLogRuleTbl.AcrGrant X(3) AccLogRuleTbl.AcrIndex X(3) AccLogRuleTbl.AcrInsert X(3) AccLogRuleTbl.AcrReference X(3) AccLogRuleTbl.AcrRestore NOT CASESPECIFIC NOT NULL AcrDropProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDump CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrExecute CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrExecuteFunction CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrExecuteProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrGrant CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrIndex CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrInsert CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrReference CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrRestore CHAR(3) LATIN NOT CASESPECIFIC NOT NULL Data Dictionary 47 Chapter 3: Views Reference AccLogRulesV View Column Data Type Format Referenced Table.Column AcrSelect CHAR(3) LATIN X(3) AccLogRuleTbl.AcrSelect X(3) AccLogRuleTbl.AcrUpdate X(3) AccLogRuleTbl.AcrCreateTrigger X(3) AccLogRuleTbl.AcrDropTrigger X(3) AccLogRuleTbl.AcrCreateRole X(3) AccLogRuleTbl.AcrDropRole X(3) AccLogRuleTbl.AcrCreateProfile X(3) AccLogRuleTbl.AcrDropProfile X(3) AccLogRuleTbl.AcrAlterProcedure X(3) AccLogRuleTbl.AcrRepControl X(3) AccLogRuleTbl.AcrAlterExtProcedure NOT CASESPECIFIC NOT NULL AcrUpdate CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateTrigger CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropTrigger CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateRole CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropRole CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreateProfile CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropProfile CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrAlterProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrRepControl CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrAlterExtProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL 48 Data Dictionary Chapter 3: Views Reference AccLogRulesV View Column Data Type Format Referenced Table.Column AcrUDTUsage CHAR(3) LATIN X(3) AccLogRuleTbl.AcrUDTUsage X(3) AccLogRuleTbl.AcrUDTType X(3) AccLogRuleTbl.AcrUDTMethod X(3) AccLogRuleTbl.AcrCreAuthorization X(3) AccLogRuleTbl.AcrDropAuthorization X(3) AccLogRuleTbl.AcrStatistics X(3) AccLogRuleTbl.AcrShow X(3) AccLogRuleTbl.AcrCreOwnerProcedure X(3) AccLogRuleTbl.AcrConnectThrough X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS AccLogRuleTbl.CreateTimeStamp NOT CASESPECIFIC NOT NULL AcrUDTType CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrUDTMethod CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreAuthorization CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrDropAuthorization CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrStatistics CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrShow CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrCreOwnerProcedure CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrConnectThrough CHAR(3) LATIN NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp Data Dictionary TIMESTAMP(0) 49 Chapter 3: Views Reference AccLogRulesV View Column Data Type Format Referenced Table.Column AcrCreateGLOP CHAR(3) LATIN X(3) AccLogRuleTbl.AcrCreateGLOP X(128) AccLogRuleTbl.AcrDropGLOP X(128) AccLogRuleTbl.AcrGLOPMember NOT CASESPECIFIC NOT NULL AcrDropGLOP CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrGLOPMember CHAR(3) LATIN NOT CASESPECIFIC NOT NULL AcrConstrDef CHAR(3)LATIN X(3) AccLogRuleTbl.AcrConstrDef AcrConstrAsgn CHAR(3) LATIN X(3) AccLogRuleTbl.AcrConstrAsgn X(3) AccLogRuleTbl.AcrOverrideIns X(3) AccLogRuleTbl.AcrOverrideSel X(3) AccLogRuleTbl AcrOverrideUpd X(3) AccLogRuleTbl.AcrOverrideDel X(3) AccLogRuleTbl.AcrOverrideDump X(3) AccLogRuleTbl.AcrOverrideRestore NOT NULL AcrOverrideIns CHAR(3) LATIN NOT NULL AcrOverrideSel CHAR(3) LATIN NOT NULL AcrOverrideUpd CHAR(3) LATIN NOT NULL AcrOverrideDel CHAR(3) LATIN NOT NULL AcrOverrideDump CHAR(3)LATIN NOT NULL AcrOverrideRestore CHAR(3) LATIN NOT NULL Usage Notes The underlying table of this view is populated only if the DBC.AccLogRule security macro is installed and the Teradata Database or security administrator has executed one or more BEGIN LOGGING statements. For more information about this security macro, see Security Administration. To install the DBC.AccLogRule security macro, you must manually run the DIP script, DIPACC. For more information about the DIPACC script, see Utilities. 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. 50 Data Dictionary Chapter 3: Views Reference AccLogRulesV When a request is submitted that involves any of the rule criteria, the details of the involvement are recorded in the access log. 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 2 3 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: a B = Both FIRST and LAST occurrences are to be logged. b E = Each occurrence is to be logged. c F = FIRST occurrence is to be logged. d L = LAST occurrence is to be logged. e 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). a B = Both FIRST and LAST occurrences are to be logged. b E = Each occurrence is to be logged. c F = FIRST occurrence is to be logged. d L= LAST occurrence is to be logged. e 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. a - = Save text only for Denial entries. b + = Save text for all entries. c = Save text for all entries (specified in multiple BEGIN LOGGING statements). d 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: 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’ ; Result: Data Dictionary 51 Chapter 3: Views Reference AccountInfoV[X] UserName DatabaseName TVMName Jones Jones All Jones Personnel All CPT CDB CMC CTB CUS E ... 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. AccountInfoV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Accounts.AccountName X(7) None UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL UserOrProfile CHAR(7) UNICODE NOT NULL 52 Data Dictionary Chapter 3: Views Reference All_RI_ChildrenV[X] Usage Notes You can use this view to query the accounts the user can control. Example The following SELECT statement returns the accounts the user controls: ==> SELECT * FROM DBC.AccountInfo; Result: Name ------------DBC CONSOLE SystemFe Crashdumps TDPUSER SysAdmin Sys_Calendar V2R5IN AccountName ------------DBC DBC SystemFe Crashdumps $H SysAdmin Sys_Calendar DBC UserOrProfile -------------User User User User User User User User Related Topics For information about ... See ... controlling access, space, and ownership Database Design. the current account name (unexpanded) in effect for a session “SessionInfoV[X]” on page 288. the default account name for a user or database “DatabasesV[X]” on page 108 or “UsersV” on page 341. the default account name if set by profile for a user or database “ProfileInfoV[X]” on page 191. All_RI_ChildrenV[X] Category Database Database DBC Data Dictionary 53 Chapter 3: Views Reference All_RI_ChildrenV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 (explicit) ReferencingTbls.ReferenceIdx X(128) ReferencingTbls.ReferenceIdxName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(128) Dbase.DatabaseNameI X(128) TVM.TVMName X(128) TVFields.FieldName X(1) ReferencingTbls.InconsistentFlag X(128) Dbase.CreatorName NOT NULL IndexName VARCHAR(128) UNICODE NOT CASESPECIFIC ChildDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildKeyColumn VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentDB VARCHAR(128) UNICODE UPPERCASE NOT NULL ParentTable VARCHAR(128) UNICODE NOT NULL ParentKeyColumn VARCHAR(128) UNICODE NOT NULL InconsistencyFlag CHAR(1) LATIN NOT NULL CreatorName VARCHAR(128) UNICODE NOT NULL 54 Data Dictionary Chapter 3: Views Reference All_RI_ParentsV[X] View Column Data Type Format Referenced Table.Column CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReferencingTbls.CreateTimeStamp The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.Roles • DBC.RoleGrants 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 contains 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. InconsistencyFlag Column If the value in the InconsistencyFlag column is Y, it may be possible to validate the reference indexes that have been marked as inconsistent. All_RI_ParentsV[X] Category Database Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 (explicit) ReferencedTbls.ReferenceIdx NOT NULL Data Dictionary 55 Chapter 3: Views Reference All_RI_ParentsV[X] View Column Data Type Format Referenced Table.Column IndexName VARCHAR(128) X(128) ReferencedTbls.ReferenceIdxName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(1) ReferencedTbls.InconsistentFlag X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC ParentDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentKeyColumn VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildKeyColumn VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL InconsistencyFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 56 Data Dictionary Chapter 3: Views Reference AllRightsV[X] View Column Data Type Format Referenced Table.Column CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReferencedTbls.CreateTimeStamp The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.Roles • DBC.RoleGrants Usage Notes The All_RI_Parents view is designed for use in a SELECT statement with a WHERE clause to narrow the selection criteria. This view is similar to the RI_Parent_Tables view, but contains 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. InconsistencyFlag Column If the value in the InconsistencyFlag column is Y, it may be possible to validate the reference indexes that have been marked as inconsistent. AllRightsV[X] Category Accounting Database DBC View Columns and Referenced Tables.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 57 Chapter 3: Views Reference AllRightsV[X] View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(2) AccessRights.AccessRight X(1) AccessRights.WithGrant X(128) Dbase.DataBaseNameI (UPI) X(1) AccessRights.AllnessFlag X(128) Dbase.DataBaseName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccessRight CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL GrantAuthority CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL GrantorName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL AllnessFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 58 Data Dictionary Chapter 3: Views Reference AllRoleRightsV View Column Data Type Format Referenced Table.Column CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS AccessRights.CreateTimeStamp The X view references these additional tables: • DBC.Owners • DBC.Roles • DBC.RoleGrants Usage Notes The AllRights view does not contain information about implicit privileges for a user, only explicit privileges granted on the object. For information about the types of explicit privileges, see “AccessRight Column” in Appendix A: “View Column Values.” Example The following SELECT statement displays the privileges user Jones has on tables: ==> SELECT Tablename, AccessRight, GrantorName FROM DBC.AllRights WHERE UserName = ’Jones’; Result: TableName ---------project project project project project project project employee employee AccessRight ----------RS DP DT D I U R I U GrantorName ------------SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD SYSTEMAD AllRoleRightsV Category Security Database DBC Data Dictionary 59 Chapter 3: Views Reference AllRoleRightsV View Columns and Referenced Tables.Columns View Column Data Type Format Referenced Table.Column RoleName VARCHAR(128) X(128) Roles.RoleName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(2) AccessRights.AccessRight X(128) Dbase.DataBaseName YYYY-MMDDBHH:MI:SS AccessRights.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccessRight CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL GrantorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) The AllRollRightsV view also references the DBC.Owners table. Usage Notes The AllRoleRights view is similar to the AllRights view except that it does not include the following columns: • AllnessFlag • CreatorName column For information about the possible values for the AccessRight column, see Appendix A: “View Column Values.” 60 Data Dictionary Chapter 3: Views Reference AllSpaceV[X] Example The following SELECT statement returns all the privileges granted to each role: ==> SELECT CAST(RoleName as CHAR(16)) as RoleName, CAST(DatabaseName as CHAR(15)) as Databases, CAST(TableName as CHAR(15)) as TVMs --,CAST(ColumnName as CHAR(10)) as Columns, CAST(AccessRight as CHAR(5)) as AccRights CAST(GrantorName as CHAR(15)) as Grantor FROM DBC.AllRoleRights WHERE RoleName like 'roles017%' ORDER BY 1,2,3,5; Result: RoleName ---------------roles017_dbc_r1b roles017_r1a roles017_r1c roles017_r1f roles017_r2d roles017_r2e Databases --------------roles017_3_db roles017_3_db roles017_3_db roles017_3_db roles017_3_db roles017_3_db TVMs --------------roles017_3_m3 roles017_3_t1 roles017_3_t4 roles017_3_v2 roles017_3_v2 roles017_3_t5 AccRights --------E R R R R R Grantor --------------roles017_3 roles017_3 monthly roles017_3 roles017_3 monthly AllSpaceV[X] Category Accounting Database DBC View Columns and Referenced Tables.Columns View Column Data Type Format Referenced Table.Column Vproc SMALLINT -(5)9 DataBaseSpace.Vproc X(128) Dbase.DatabaseName X(128) Dbase.AccountName NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 61 Chapter 3: Views Reference AllSpaceV[X] View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName ----,---,---,---,--9 (explicit) DataBaseSpace.MaxPermSpace ----,---,---,---,--9 (explicit) DataBaseSpace.MaxSpoolSpace ----,---,---,---,--9 (explicit) DataBaseSpace.MaxTempSpace ----,---,---,---,--9 (explicit) DataBaseSpace.CurrentPermSpace ----,---,---,---,--9 (explicit) DataBaseSpace.CurrentSpoolSpace ----,---,---,---,--9 DataBaseSpace.CurrentPersistent SpoolSpace ----,---,---,---,--9 (explicit) DataBaseSpace.CurrentTempSpace ----,---,---,---,--9 (explicit) DataBaseSpace.PeakPermSpace ----,---,---,---,--9 (explicit) DataBaseSpace.PeakSpoolSpace ----,---,---,---,--9 DataBaseSpace.PeakPersistentSpool Space ----,---,---,---,--9 (explicit) DataBaseSpace.PeakTempSpace UNICODE NOT CASESPECIFIC NOT NULL MaxPerm FLOAT NOT NULL MaxSpool FLOAT NOT NULL MaxTemp FLOAT NOT NULL CurrentPerm FLOAT NOT NULL CurrentSpool FLOAT NOT NULL CurrentPersistentSpool FLOAT NOT NULL CurrentTemp FLOAT NOT NULL PeakPerm FLOAT NOT NULL PeakSpool FLOAT NOT NULL PeakPersistentSpool FLOAT NOT NULL PeakTemp FLOAT NOT NULL MaxProfileSpool FLOAT ----,---,---,---,--9 (explicit) DataBaseSpace.MaxProfileSpoolSpace MaxProfileTemp FLOAT ----,---,---,---,--9 (explicit) DataBaseSpace.MaxProfileTempSpace The X view references these additional tables: 62 • DBC.AccessRights • DBC.Owners • DBC.Roles • DBC.RoleGrants Data Dictionary Chapter 3: Views Reference AllSpaceV[X] 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 Database 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 the MaxPerm or CurrentPerm column without a WHERE clause, or with a WHERE clause that references only one TableName or DatabaseName, the returned values are double the desired result. 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 “DiskSpaceV[X]” on page 122 and “TableSizeV[X]” on page 311). SELECT SUM(MaxPerm), SUM(CurrentPerm) FROM DBC.AllSpace WHERE DatabaseName = ’Peterson’; AccountName Column The AccountName column is the unexpanded default account name for the user or database. A database can only have one account. A user may have a default account plus other accounts. If there is a profile for the user, and it specifies a default account, that account superseded this account name. CurrentPerm Column The CurrentPerm column value includes all AMPs unless a specific AMP is requested. CurrentPersistentSpool Column This column returns the persistent spool space (in bytes) currently used by the database on a specified AMP or on all AMPs if the SUM aggregate is specified. PeakPerm, PeakSpool, PeakPersistentSpool, and PeakTemp Columns You can use the DBC.ClearPeakDisk macro to reset the PeakPerm, PeakSpool, PeakPersistentSpool, and PeakTemp columns. PeakPersistentSpool Column This column returns the integer that represents the maximum persistent 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. Example The following SELECT statement displays how the space currently used by the data table named Department is distributed on each AMP: Data Dictionary 63 Chapter 3: Views Reference AllTempTablesV[X] ==> SELECT DatabaseName,TableName,AMP,CurrentPerm FROM DBC.AllSpace WHERE TableName=’Department’ ORDER BY 1,2,3 ; Result: 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 AllTempTablesV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column HostNo SMALLINT ---,--9 (explicit) TempTables.HostNo (Composite NUPI) --,---,---,--9 (explicit) TempTables.SessionNo (Composite NUPI) X(128) SessionTbl.UserName X(128) Dbase.DatabaseNameI (UPI) NOT NULL SessionNo INTEGER NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL B_DatabaseName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL 64 Data Dictionary Chapter 3: Views Reference AMPUsageV[X] View Column Data Type Format Referenced Table.Column B_TableName VARCHAR(128) X(128) TVM.TVMNameI (Composite UPI) X(12) TempTables.TableId UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL E_TableId BYTE(6) NOT NULL 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; Result: HostNo SessionNo DatabaseName TableName TableId 52 3,409 TEST GTEMP1 00800A000000 AMPUsageV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column AccountName VARCHAR(128) X(128) Acctg.AccountName (Composite UPI) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 65 Chapter 3: Views Reference AMPUsageV[X] View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Acctg.UserName (Composite UPI) ---,---,---,--9.99 (explicit) Acctg.CPU --,---,---,--9 (explicit) Acctg.IO ---,---,---,--9.99 (explicit) Acctg.CpuNorm -(5)9 Acctg.Vproc X(4) Acctg.VprocType X(4) Acctg.Model UNICODE NOT CASESPECIFIC NOT NULL CpuTime FLOAT NOT NULL DiskIO FLOAT NOT NULL CpuTimeNorm FLOAT NOT NULL Vproc SMALLINT NOT NULL VprocType CHAR(4) LATIN NOT CASESPECIFIC NOT NULL Model CHAR(4) LATIN NOT CASESPECIFIC NOT NULL Usage Notes CPUTimeNorm Column The CpuNorm column contains the normalized CPU value and is calculated: CPU x scaling factor UserName Column For this column, the SYSTEMUSERID is a system user name that tracks console utility activity such as table rebuild, Diskcopy, or Scandisk. Example The following SELECT statement displays, for a given account, total CPU time and total disk accesses for all AMPs: ==> SELECT AccountName,SUM(CPUTime),SUM(Diskio) FROM DBC.AMPusage WHERE AccountName=’7654’ GROUP BY AccountName; Result: 66 Data Dictionary Chapter 3: Views Reference ArchiveLoggingObjsV[X] AccountName ----------7654 Sum(CPUTime) -----------204,352.88 Sum(DiskIO) ------------5,226,742 Related Topics For more information about how to control access, space, and ownership, see Database Design. ArchiveLoggingObjsV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(1) ArchiveLoggingObjsTbl.LogLevel X(128) TVM.CreatorName YYYY-MMDDBHH:MI:SS ArchiveLoggingObjsTbl.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL TVMName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL LogLevel CHAR(1) LATIN NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) NOT NULL Data Dictionary 67 Chapter 3: Views Reference AssociationV[X] Example The following SELECT statement displays information about the tables that have online archive active logs and their online archive logging levels. In this example, the logging levels are either T or D (O is also a possible value). • T = Online Archive Logging was activated on the table level. • D = Online Archive Logging was activated on the database level. • O = Nontable objects. ==> SELECT databasename, tvmname, loglevel FROM dbc.archiveloggingobjsv; Result: DatabaseName --------------oarc_otop005db1 oarc_oth007db1 oarc_oth007db1 oarc_otop010db1 oarc_oth007db1 oarc_otop010db1 oarc_otop016db1 oarc_oth008db1 oarc_otop010db1 oarc_otop001db1 oarc_otop018db1 oarc_comb002db1 TVMName ------Tab_nfb Tab_nfb tab_fb Tab_nfb tab_ppi tab_nusi Tab_nfb Tab_queue tab_bigcol Tab_nfb Tab_nfb tab_fb LogLevel -------T D D D D D T T D T T T AssociationV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL 68 Data Dictionary Chapter 3: Views Reference AssociationV[X] View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName --,---,---,--9 (explicit) DBCAssociation.EventNum X(128) DBCAssociation.Original_DatabaseName X(128) DBCAssociation.Original_TVMName X(1) DBCAssociation.Original_TableKind ---,--9 (explicit) DBCAssociation.Original_Version X(1) DBCAssociation.Original_ProtectionType X(2) DBCAssociation.Original_JournalFlag X(128) DBCAssociation.Original_CreatorName X(255) DBCAssociation.Original_CommentString UNICODE NOT CASESPECIFIC NOT NULL EventNum INTEGER NOT NULL Original_DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Original_TableName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL Original_TableKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Original_Version SMALLINT NOT NULL Original_ProtectionType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Original_JournalFlag CHAR(2) LATIN NOT CASESPECIFIC NOT NULL Original_CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Original_CommentString VARCHAR(255) UNICODE NOT CASESPECIFIC Data Dictionary 69 Chapter 3: Views Reference AssociationV[X] The X view references these additional tables: • DBC.AccessRights • DBC.Owner • DBC.RoleGrants • DBC.Roles 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, the information is deleted and is no longer available. Possible Values for the Original_JournalFlag Column Value Description N No Journal S Single Journal D Dual Journal L Local AFTER journal (non used for BEFORE) Possible Values for the Original_TableKind Column 70 Value Description T Data Table V View M Macro J Journal Table I Join Index Table P Stored Procedure G Trigger F Scalar UDF A Aggregate UDF N Hash Index Table U User-defined Data Type H Instance or Constructor Method E External Stored Procedure Data Dictionary Chapter 3: Views Reference AuthorizationsV[X] Value Description R Table Function X Authorization 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’; Result: Original_DatabaseName --------------------OldPersonnel Personnel2 Original_TableName -----------------Empl_Addr Empl_Dept TableName ----------Emp_Address Empl_Dept Related Topics For more information on recovery control, see the following: • Database Administration • Teradata Archive/Recovery Utility Reference AuthorizationsV[X] Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 71 Chapter 3: Views Reference AuthorizationsV[X] View Column Data Type Format Referenced Table.Column AuthorizationName VARCHAR(128) X(128) TVM.TVMName X(12) TVM.TVMId X(1) TVM.TableKind ---,--9 (explicit) TVM.Version X(1) TVM.AuthorizationType X(1) TVM.AuthorizationSubType X(256) TVM.OSDomainName X(256) TVM.OSUserName UNICODE NOT CASESPECIFIC NOT NULL AuthorizationId BYTE(6) NOT NULL TableKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Version SMALLINT NOT NULL AuthorizationType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC AuthorizationSubType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC OSDomainName VARCHAR(256) LATIN CASESPECIFIC OSUserName VARCHAR(256) LATIN CASESPECIFIC The X view references these additional tables: • DBC.AccessRights • DBC.Owner Usage Notes For information about the possible values for the TableKind column, see Appendix A: “View Column Values.” Possible Values for the AuthorizationName Column If AuthorizationType is I, two entries appear for the same database name: one where AuthorizationName is the same as the name specified in the CREATE AUTHORIZATION statement and one where AuthorizationName is a default name. 72 Data Dictionary Chapter 3: Views Reference BusinessCalendar Possible Values for the AuthorizationSubType Column Value Description D Default N Non-default Possible Values for the AuthorizationType Column Value Description D Definer I Invoker T Invoker Trusted S Definer Trusted Example The following SELECT statement returns details about the database DBA. ==> SELECT * FROM Authorizations WHERE databasename = 'dba'; Result: DatabaseName dba AuthorizationName INVOKER_DEFAULT AuthorizationId 00001F0A0000 TableKind X Version 1 AuthorizationType I AuthorizationSubType D OSDomainName OSUserName gdUsrGrp DatabaseName dba AuthorizationName myinvoker AuthorizationId 00001E0A0000 TableKind X Version 1 AuthorizationType I AuthorizationSubType D OSDomainName OSUserName gdUsrGrp BusinessCalendar Category Operations Data Dictionary 73 Chapter 3: Views Reference BusinessCalendar Database Sys_Calendar View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column calendar_date DATE YY/MM/DD none day_of_week INTEGER -(10)9 none day_of_month INTEGER -(10)9 none day_of_year INTEGER -(10)9 none day_of_calendar INTEGER -(10)9 none weekday_of_month INTEGER -(10)9 none week_of_month INTEGER -(10)9 none week_of_quarter INTEGER -(10)9 none week_of_year INTEGER -(10)9 none week_of_calendar INTEGER -(10)9 none month_of_quarter INTEGER -(10)9 none month_of_year INTEGER -(10)9 none month_of_calendar INTEGER -(10)9 none quarter_of_year INTEGER -(10)9 none quarter_of_calendar INTEGER -(10)9 none year_of_calendar INTEGER -(10)9 none WeekBegin DATE YY/MM/DD none WeekEnd DATE YY/MM/DD none MonthBegin DATE YY/MM/DD none MonthEnd DATE YY/MM/DD none QuarterBegin DATE YY/MM/DD none QuarterEnd DATE YY/MM/DD none YearBegin DATE YY/MM/DD none YearEnd DATE YY/MM/DD none IsBusinessDay BYTEINT -(3)9 none BusinessWeekBegin DATE YY/MM/DD none BusinessWeekEnd DATE YY/MM/DD none 74 Data Dictionary Chapter 3: Views Reference BusinessCalendar View Column Data Type Format Referenced Table.Column BusinessMonthBegin DATE YY/MM/DD none BusinessMonthEnd DATE YY/MM/DD none BusinessQuarterBegin DATE YY/MM/DD none BusinessQuarterEnd DATE YY/MM/DD none BusinessYearBegin DATE YY/MM/DD none BusinessYearEnd DATE YY/MM/DD none Usage Notes Week_of_quarter Column The week_of_quarter column can contain a range of possible values from 0 through 14. Corresponding Tables The corresponding tables for this view are: • DBC.BusinessCalendarPattern • DBC.BusinessCalendarException Examples of Queries of Calendar Data These examples show simple queries that you can use to determine the day of the week (day_of_week) and the date at the beginning of the week (weekBegin). The session calendars are the ISO and COMPATIBLE system-defined calendars. • Examples 1 and 2 provide queries that return the day of the week (for example, day 1, 2, or 7) for a particular date. • Examples 3 and 4 provide queries that return the date of the first day of a week (day 1) for the week to which a particular date belongs. Example 1: Day of the Week (ISO Calendar) Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01'; day_of_week ----------6 Example 2: Day of the Week (COMPATIBLE Calendar) Sel day_of_week from Sys_Calendar.Calendar where calendar_date = date '2011-01-01'; day_of_week ----------1 Data Dictionary 75 Chapter 3: Views Reference BusinessCalendarExceptions Example 3: Beginning of the Week (ISO Calendar) Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01'; WeekBegin ----------10/12/27 Example 4: Beginning of the Week (COMPATIBLE Calendar) Sel weekBegin from Sys_Calendar.BusinessCalendar where calendar_date = date '2011-01-01'; WeekBegin ----------11/01/01 Related Topics For more information about the following topics, see SQL Functions, Operators, Expressions, and Predicates: • Teradata, ISO, and COMPATIBLE system-defined business calendars • How the basic units (weeks, months, quarter, and year) of the ISO system-defined calendar are defined • Business calendar functions BusinessCalendarExceptions Category Operations Database Sys_Calendar View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CalendarName VARCHAR(128) X(128) BusinessCalendarException.CalendarName X(3) BusinessCalendarException.ExceptionIndicator UNICODE NOT CASESPECIFIC NOT NULL ExceptionIndicator VARCHAR(3) UNICODE 76 Data Dictionary Chapter 3: Views Reference BusinessCalendarPatterns View Column Data Type Format Referenced Table.Column ExceptionDate DATE YY/MM/DD BusinessCalendarException.ExceptionDate X(1024) BusinessCalendarException.ExceptionReason X(128) BusinessCalendarException.CreatorName YYYY-MMDDBHH:MI: SS BusinessCalendarException.CreationTime NOT NULL ExceptionReason VARCHAR(1024) UNICODE CreatorName VARCHAR(128) UNICODE NOT NULL CreationTime TIMESTAMP(0) NOT NULL Usage Notes ExceptionData Column The date specified in the ExceptionData column must be within the calendar period (that is, the value specified in the BusinessCalendar view YearEnd column). ExceptionReason Column The value of the ExceptionReason column can be NULL. BusinessCalendarPatterns Category Operations Database Sys_Calendar View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CalendarName VARCHAR(128) X(128) BusinessCalendarPattern.CalendarName X(9) BusinessCalendarPattern.DayNumber UNICODE NOT CASESPECIFIC NOT NULL DayName VARCHAR(9) UNICODE Data Dictionary 77 Chapter 3: Views Reference CharSetsV View Column Data Type Format Referenced Table.Column Pattern VARCHAR(3) X(3) BusinessCalendarPattern.Pattern X(1024) BusinessCalendarPattern.PatternComment X(128) BusinessCalendarPattern.CreatorName YYYY-MMDDBHH:MI: SS BusinessCalendarPattern.LastModified UNICODE PatternComment VARCHAR(1024) UNICODE CreatorName VARCHAR(128) UNICODE NOT NULL LastModified TIMESTAMP(0) NOT NULL Usage Notes CreatorName Column A CreatorName column value of DBC indicates a system-defined business calendar. CharSetsV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CharSetName VARCHAR(128) X(128) Translation.TranslateName (UPI) UNICODE NOT CASESPECIFIC NOT NULL Usage Notes The Teradata Database can support many user-defined character sets (see “CharTranslationsV” on page 79). You can install a maximum of 12 character sets at any given time. The CharSets view contains the names of character sets that are currently installed and 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. 78 Data Dictionary Chapter 3: Views Reference CharTranslationsV CharSetName Column 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 Database administrator. Example The following example shows that two user-defined character sets are available for the requesting user: ==> SELECT * FROM DBC.CharSets ; Result: CharSetName French_EBCDIC Swedish_EBCDIC CharTranslationsV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CharSetName VARCHAR(128) X(128) Translation.TranslateName (UPI) ZZ9 (explicit) Translation.TranslateId X(1) Translation.Install UNICODE NOT CASESPECIFIC NOT NULL CharSetId BYTEINT NOT NULL InstallFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Data Dictionary 79 Chapter 3: Views Reference CharTranslationsV View Column Data Type Format Referenced Table.Column E2I BYTE(256) X(512) Translation.TranslateIn X(512) Translation.TranslateInUp X(512) Translation.TranslateOut X(512) Translation.TranslateOutUp NOT NULL E2IUp BYTE(256) NOT NULL I2E BYTE(256) NOT NULL I2EUp BYTE(256) NOT NULL Usage Notes If client system connections are to use the defined character sets, the Teradata Database system administrator specifies which character set is assigned to which client system (see “HostsInfoV” on page 149). Otherwise, the standard default is used. Also, the user may specify a defined character set after a session is started (see “CharSetsV” on page 78). 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 a convention be used for naming character sets which differentiates between EBCDIC and ASCII compatibility (see the example below). CharSetId Column If the character set is user-defined, the ID should also exist in DBC.CharTranslations.CharSetID. For constraints not involving comparison of character data or not using CHARSET_COLL for evaluation, the value is NULL. InstallFlag Column The Teradata Database 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 fewer, 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. 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; Result: 80 Data Dictionary Chapter 3: Views Reference ChildrenV[X] CharSetName ---------------German_EBCDIC Italian_EBCDIC Spanish_EBCDIC French_EBCDIC Norwegian_EBCDIC Swedish_EBCDIC Set Id -----100 105 103 104 101 102 Flag ----N N N Y N Y E2I -------------------------00010203A809A97FD1D2D3... 00010203A809A97F2395EE... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3... 00010203A809A97FD1D2D3... ChildrenV[X] Category Database Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column Child VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL Parent VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL The V view also references the DBC.Owners table. The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.Roles • DBC.RoleGrants Usage Notes You can use this view to show all the databases under a user. Data Dictionary 81 Chapter 3: Views Reference CollationsV 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’; Result: Parent -------Finance Finance Finance Child ---------Personnel Jones Accounting CollationsV Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CollName VARCHAR(128) X(128) CollationTbl.CollName (UPI) X(1) CollationTbl.CollInstall X(512) CollationTbl.CollEqvClass X(512) CollationTbl.CollOrderCS X(512) CollationTbl.CollOrderUC UNICODE NOT CASESPECIFIC NOT NULL CollInstall CHAR(1) LATIN NOT CASESPECIFIC NOT NULL CollEqvClass BYTE(256) NOT NULL CollOrderCS BYTE(256) NOT NULL CollOrderUC BYTE(256) NOT NULL 82 Data Dictionary Chapter 3: Views Reference ColumnStatsV[X] Usage Notes The DBC.Collations view initially contains five rows: • KANJI5026_STANDARD • KANJIKATA_STANDARD • KANJI5035_STANDARD • NORWEGIAN_STANDARD • SWEDISH_STANDARD Database administrators can run the CollInstallMulti macro to specify which row in the DBC.Collations view to use as the collation sequence when the user or session COLLATION option is set to MULTINATIONAL. You must reset (initialize) the Teradata Database before the new collation sequence can take effect. When you define a new collation with a name other than ‘MULTINATIONAL,’ 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 Collations view: SELECT CollName FROM DBC.Collations; The result is the following list: CollName --------------------------KANJI5026_STANDARD KANJIKATA_STANDARD KANJI5035_STANDARD NORWEGIAN_STANDARD SWEDISH_STANDARD Related Topics For more information about the MULTINATIONAL collation sequence, see International Character Set Support. ColumnStatsV[X] Category Optimizer Statistics Database DBC Data Dictionary 83 Chapter 3: Views Reference ColumnStatsV[X] View Columns and Referenced Table.Columns Note: There is no compatibility version of this view. You must have the most current release of Teradata Database to use it. View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(255) TVFields.FieldName X(255) StatsTbl.StatsName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(10000) UNICODE NOT CASESPECIFIC NOT NULL StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5,2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature NOT CASESPECIFIC MaxIntervals SMALLINT ---,--9 StatsTbl.MaxIntervals MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCoun 84 Data Dictionary Chapter 3: Views Reference ColumnStatsV[X] View Column Data Type Format Referenced Table.Column HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq StatsSkipCount INTEGER --,---,---,--9 StatsTbl.Reserved1 CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS.S(F) StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS.S(F) StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” ColumnName Column • If more than one column or expression is specified, each column or expression is separated by a comma. • The maximum number of columns is 64. • If expressions are in the list, the maximum number of columns can be reduced past the limit of 64, depending on the combined total size of the text in the expressions. • If the combined total size of the expression text causes the maximum column limit to be less than the actual number of columns in the list, an error occurs. IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. Data Dictionary 85 Chapter 3: Views Reference ColumnsV[X] To Get Information Not Contained in This View This view does not contain: • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Example This example assumes the following statistics have been collected: STATISTICS COLUMN o_orderkey ON Orders; STATISTICS COLUMN o_orderdatetime ON Orders; This query can be used to retrieve the statistics: ==> SELECT * FROM dbc.ColumnStatsV WHERE Databasename = ‘sales’ AND TableName = ‘Orders’ Related Topics For information about statistics collected on ... See ... groups of non-indexed columns “MultiColumnStatsV[X]” on page 177. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. tables “StatsV” on page 303 and “TableStatsV” on page 312. materialized temporary tables “TempTableStatsV” on page 325. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. ColumnsV[X] Category Schema 86 Data Dictionary Chapter 3: Views Reference ColumnsV[X] Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(128) TVFields.FieldFormat X(256) TVFields.FieldTitle X(1) TVFields.SPParameterType X(2) TVFields.FieldType X(128) TVFields.UDTName Z,ZZZ,ZZZ,ZZ9 TVFields.MaxLength UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnFormat VARCHAR(128) UNICODE NOT CASESPECIFIC ColumnTitle VARCHAR(256) UNICODE NOT CASESPECIFIC SPParameterType CHAR(1) LATIN NOT CASESPECIFIC NOT NULL ColumnType CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC ColumnUDTName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC ColumnLength Data Dictionary INTEGER 87 Chapter 3: Views Reference ColumnsV[X] View Column Data Type Format Referenced Table.Column DefaultValue VARCHAR(1024) X(1024) (explicit) TVFields.DefaultValue X(1) TVFields.Nullable X(255) TVFields.CommentString UNICODE NOT CASESPECIFIC Nullable CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC CommentString VARCHAR(255) UNICODE NOT CASESPECIFIC DecimalTotalDigits SMALLINT -ZZ9 TVFields.TotalDigits DecimalFractionalDigits SMALLINT -ZZ9 TVFields.ImpliedPoint ColumnId SMALLINT ---,--9 (explicit) TVFields.FieldId X(1) TVFields.UpperCaseFlag X(1) TVFields.Compressible -(10)9 TVFields.CompressValue X(255) (explicit) TVFields.ColumnCheck ---,--9 (explicit) TVFields.CheckCount X(128) Dbase.DatabaseName NOT NULL UpperCaseFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC Compressible CHAR(1) LATIN NOT CASESPECIFIC CompressValue INTEGER NOT CASESPECIFIC ColumnConstraint VARCHAR(8192) UNICODE NOT CASESPECIFIC ConstraintCount SMALLINT NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVFields.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL 88 Data Dictionary Chapter 3: Views Reference ColumnsV[X] View Column Data Type Format Referenced Table.Column LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVFields.LastAlterTimeStamp CharType SMALLINT ---,--9 (explicit) TVFields.CharType IdColType CHAR(2) LATIN X(2) TVFields.IdColType UPPERCASE NOT CASESPECIFIC AccessCount BIGINT --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt LastAccessTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ObjectUsage.LastAccessTime Stamp CompressValueList VARCHAR(8192) X(8192) TVFields.CompressValueList X(1) TVFields.TimeDimension X(1) TVFields.VTCheckType X(1) TVFields.TTCheckType UNICODE NOT CASESPECIFIC TimeDimension CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC VTCheckType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC TTCheckType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC ConstraintId BYTE(4) X(8) AccLogRuleTbl.ConstraintId ArrayColNumberOf Dimensions BYTEINT --9 UDTInfo.ArrayColNumberOf Dimensions ArrayColScope VARCHAR(3200) X(45) UDTInfo.ArrayColScope X(2) TVFields.FieldType X(30) TVFields.UDTName CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC ArrayColElementType CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC ArrayColElementUdtName CHAR(30) LATIN UPPERCASE NOT CASESPECIFIC Data Dictionary 89 Chapter 3: Views Reference ColumnsV[X] View Column Data Type Format Referenced Table.Column PartitioningColumn CHAR(1) LATIN X(1) TVFields.PartitioningColumn ZZZZZZZZZZZZZZZZ ZZ9 (explicit) TVFields.ColumnPartition Number X(2) TVFields.ColumnPartition Format X(2) TVFields.ColumnPartitionAC UPPERCASE NOT CASESPECIFIC NOT NULL ColumnPartitionNumber BIGINT NOT NULL ColumnPartitionFormat CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ColumnPartitionAC CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL PseudoUDTFieldId SMALLINT ---,--9 TVFields.PseudoUDTFieldId PseudoUDTFieldType CHAR(2) X(2) TVFields.PseudoUDTFieldType Usage Notes When querying DBC.Columns for a view, information on column attributes (for example, length and type) is NULL. Because column attributes correspond to the table for which they were defined, they are not stored in the Data Dictionary and are not accessible through this view. Information on the columns of views can be obtained with the HELP COLUMN statement. Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. For information about the possible values of TimeDimension column, see Appendix A: “View Column Values.” ArrayColElementUdtName Column If the object is an ARRAY data type, the name is only recorded in the ArrayColElementUdtName column if the element type for it is a UDT. The ArrayColElementUdt column is only included in the associated views when: 90 • TVFields.FieldType = A1 or AN • UDTInfo.TypeId = TVFields.TableId Data Dictionary Chapter 3: Views Reference ColumnsV[X] ColumnUDTName Column If the object is an ARRAY data type, the name is only recorded in the ColumnUDTName column if the element type for it is a UDT. ColumnPartitionNumber Column The column is not partitioned if the ColumnPartitionNumber is zero. CompressValueList Column The column contains the name of the compression routine where any complex data type column is defined to use the complex data type internal compression (for example, for a JSON data type, the CompressValueList column value would be “JSON_COMPRESS”). DecimalTotalDigits Column A value of -128 for the DecimalTotalDigits column indicates that the default is used. DecimalFractionalDigits Column The DecimalFractionalDigits column is always -128. Possible Values for the ArrayColElementType Column Value Description A1 One dimensional ARRAY data type AN Multidimensional ARRAY data type The ArrayColElementType column is only included in the associated views when: • TVFields.FieldType = A1 or AN • UDTInfo.TypeId = TVFields.TableId Possible Values for the ArrayColNumberOfDimensions Column The range of possible values is 1 through 5. The ArrayColNumberOfDimensions column is only included in the view when all of the following are true: • TVFields.FieldType = A1 or AN • UDTInfo.TypeId = TVFields.TableId For more information about ARRAY data type dimensions, see SQL Data Definition Language and SQL Data Types and Literals. Possible Values for the ArrayColScope Column The ArrayColScope column is only populated when the data type is created. The bound values for each dimension are a string in the [n:m] format. The ArrayColScope column is only included in the view when all of the following are true: Data Dictionary 91 Chapter 3: Views Reference ColumnsV[X] • TVFields.FieldType = A1 or AN • UDTInfo.TypeId = TVFields.TableId Possible Values for the Compressible Column Value Description A Algorithmic compression (ALC) column C Multi-value compression column N Non-compress columns U Any complex data type column defined to use the Teradata internal compression scheme (for example, the JSON data type). Complex data types are provided by Teradata. They are similar in functionality to user-defined types because they follow an object-oriented model. Possible Values for the CharType Column Value Description 1 Latin 2 Unicode 3 KanjiSJIS 4 Graphic 5 Kanji1 0 All other data types Possible Values for the ColumnType Column Note: UF, UV, LF, and LV are internally generated column types for Data Dictionary (database DBC) data only. For character user data, the field type is set to CF or CV. 92 Value Description ++ TD_ANYTYPE A1 One dimensional ARRAY data type AT ANSI Time BF BYTE Fixed BO Byte Large Object BV Byte Varying CF Character Fixed Data Dictionary Chapter 3: Views Reference ColumnsV[X] Value Description CO Character Large Object CV Character Varying Latin D Decimal DA Date DH Interval Day To Hour DM Interval Day To Minute DS Interval Day To Second DY Interval Day F Float HM Interval Hour To Minute HR Interval Hour HS Interval Hour To Second I1 1 Byte Integer I2 2 Byte Integer I8 8 Byte Integer I 4 Byte integer LF Pre-TD12.0 Character Fixed Locale (Kanji1 or Latin) Note: This column type is internally generated for Data Dictionary (database DBC) data only. Data Dictionary LV Pre-TD12.0 Character Varying Locale (Kanji1 or Latin) MI Interval Minute MO Interval Month MS Interval Minute To Second N Number PD PERIOD(DATE) PM PERIOD(TIMESTAMP(n) WITH TIMEZONE) PS PERIOD(TIMESTAMP (n)) PT PERIOD(TIME(n)) PZ PERIOD (TIME(n) WITH TIME ZONE) SC Interval Second SZ Timestamp With Time Zone 93 Chapter 3: Views Reference ColumnsV[X] Value Description TS Timestamp TZ ANSI Time With Time Zone UF Character Fixed Unicode Note: This column type is internally generated for Data Dictionary (database DBC) data only. UT UDT Type UV Character Varying Unicode Note: This column type is internally generated for Data Dictionary (database DBC) data only. YI Year Interval YM Interval Year To Month YR Year Possible Values for the IdColType Column Value Description NULL Non-identity column GA Generated always GE Generated always as row end. The required CREATE/ALTER TABLE (ANSI systemtime table form) column attribute that defines the ending bound of a system-time period. For more information about the CREATE/ALTER TABLE (ANSI system-time table form) statement, see ANSI Temporal Table Support. GD Generated by default GS Generated always as row start. The required CREATE/ALTER TABLE (ANSI system-time table form) column attribute that defines the beginning bound of a system-time period. For more information about the CREATE/ALTER TABLE (ANSI system-time table form) statement, see ANSI Temporal Table Support. Possible Values for the PsuedoUDTFieldType Column 94 Value Description PB Start column of the derived period column PE End column of the derived period column PP Derived period column Data Dictionary Chapter 3: Views Reference ColumnsV[X] Value Description NULL The column is not a start or end column of a derived period column or is a derived period column. Possible Values for the SPParameterType Column Value Description B INOUT parameter (for Stored Procedure only) C Column for TABLE function E Result type of the external function or method I Input parameter of a function or method O OUT parameter of a function or method S SELF parameter Possible Values for the TTCheckType Column Value Description A ANSIQUALIFIER Note: The TTCheckType column returns the value A when the qualifier is ANSIQUALIFIER for column-level CHECK constraints. NULL No transaction-time dimension C CURRENT TRANSACTIONTIME Possible Values for the UpperCaseFlag Column Note: Case flags U, C, and B are valid only for CHAR, VARCHAR, and LONG VARCHAR columns. Data Dictionary Value Description U Uppercase, not specific C Not uppercase, specific N Not uppercase, not specific B Both 95 Chapter 3: Views Reference ColumnsV[X] Possible Values for the VTCheckType Column Value Description A ANSIQUALIFIER. Note: The VTCheckType column returns the value A when the qualifier is ANSIQUALIFIER for column-level CHECK constraints. NULL No valid-time dimension C CURRENT VALIDTIME S SEQUENCED VALIDTIME N NONSEQUENCED VALIDTIME PsuedoUDTFieldId Column This column is the field ID of the derived period column to which the start or end column belongs. The PsuedoUDTFieldId column is NULL if it is not a start or end column of a derived period column or is a derived period column. Examples 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’; Result: 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’ 96 Data Dictionary Chapter 3: Views Reference ColumnUseCountV[X] ORDER BY Columnid; Result: ColumnName ----------EmpNo Name DeptNo JobTitle Salary YrsExp CommentString --------------------------------------Employee serial number. Employee name, last then first initial. Example 3 In this example, the business_time column is used to define a derived period using two date columns: • bus_start (The start column of the derived period.) • bus_end (The end column of the derived period.) CREATE TABLE emp (emp_id INTEGER NOT NULL, name VARCHAR(30), salary DECIMAL(5,2), dept_id INTEGER, bus_start DATE NOT NULL, bus_end DATE NOT NULL, PERIOD FOR business_time (bus_start, bus_end) ); Related Topics For more information about partitioning columns, see SQL Data Definition Language. ColumnUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT NULL Data Dictionary 97 Chapter 3: Views Reference ConnectRulesV View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName X(128) TVFields.FieldName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt UNICODE NOT NULL FieldName VARCHAR(128) UNICODE NOT NULL UsageType CHAR LATIN NOT NULL AccessCount BIGINT Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of accesses occurring on the columns of a particular table: SELECT FieldName, AccessCount FROM DBC.ColumnUseCountV WHERE DatabaseName = 'Personnel' AND TableName = 'Employee'; Result: FieldName ---------id name AccessCount -----------15 13 ConnectRulesV Category Security Database DBC 98 Data Dictionary Chapter 3: Views Reference ConnectRulesV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column TrustUser VARCHAR(128) X(128) Dbase.DatabaseName (UPI, NUSI) X(128) ConnectRulesTbl.ProxyUser (Composite UPI) X(1) ConnectRulesTbl.ProxyUserId (Composite NUSI) X(1) ConnectRulesTbl.GrantStatus (Composite NUSI) X(1) ConnectRulesTbl.WithoutRole X(128) ConnectRulesTbl.ProxyRole1 through ConnectRulesTbl.ProxyRole15 X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL ProxyUser VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ProxyUserType VARCHAR(1) UNICODE GrantStatus CHAR(1) LATIN NOT NULL WithoutRole CHAR(1) LATIN NOT NULL ProxyRole1 through ProxyRole15 VARCHAR(128) UNICODE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ConnectRulesTbl.CreateTimeStamp TrustOnly CHAR(1) LATIN X(1) ConnectRulesTbl.TrustOnly NOT CASESPECIFIC NOT NULL Examples Example 1 The following select statement returns the connect through privileges for all proxy users: SELECT TrustUser (FORMAT 'X(20)'), ProxyUser (FORMAT 'X(20)'), ProxyUserType FROM DBC.ConnectRules order by 2; Result: Data Dictionary 99 Chapter 3: Views Reference ConstraintFunctionsV TrustUser -------------------trustuser1 trustuser1 trustuser1 trustuser1 trustuser1 trustuser1 trustuser1 trustuser1 ProxyUser -------------------APPPXYUSER1 APPPXYUSER2 APPPXYUSER3 APPPXYUSER4 PXYUSER1 PXYUSER2 PXYUSER3 PXYUSER4 ProxyUserType ------------A A A A P P P P Example 2 The following select statement returns the connect through privilege for a specified proxy user including the granted roles: SELECT * FROM DBC.ConnectRules WHERE ProxyUser='PxyUser3'; Result: TrustUser ProxyUser ProxyUserType GrantStatus WithoutRole ProxyRole1 ProxyRole2 ProxyRole3 ProxyRole4 ProxyRole5 ProxyRole6 ProxyRole7 ProxyRole8 ProxyRole9 ProxyRole10 ProxyRole11 ProxyRole12 ProxyRole13 ProxyRole14 ProxyRole15 CreatorName CreateTimeStamp TrustOnly trustuser6 PXYUSER3 P G N ROLESHORT1 PROXYROLEMEDIUM8 ROLEFORPROXYROLEFORPROXYMAXX11 ? ? ? ? ? ? ? ? ? ? ? ? secureuser1 2010-01-11 06:42:04 N ConstraintFunctionsV Category Integrity Database DBC 100 Data Dictionary Chapter 3: Views Reference ConstraintValuesV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ConstraintName VARCHAR(128) X(128) SecConstraints.ConstraintName (UPI) X(2) ConstraintFunctions.StatementAction (Composite USI) X(128) Dbase.DatabaseName X(128) ConstraintFunctions.FunctionName UNICODE NOT NULL Action CHAR(2) CHARACTER SET LATIN UPPERCASE NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL FunctionName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ConstraintValuesV Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ConstraintName VARCHAR(128) X(128) SecConstraints.ConstraintName (UPI) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 101 Chapter 3: Views Reference CostProfiles_V View Column Data Type Format Referenced Table.Column ValueName VARCHAR(128) X(128) ConstraintValues.ValueName (5)9 ConstraintValues.ConstraintVal (Composite USI) X(1) ConstraintValues.IsBitPos UNICODE NOT CASESPECIFIC NOT NULL ValueConstant SMALLINT NOT NULL ValueIsBitPos CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CostProfiles_V Category Operations Database DBC View Columns and Referenced Table.Columns View Name Data Type Format Referenced Table.Column ProfileTypeName CHAR(30) LATIN X(30) CostProfileTypes.ProfileTypeName (USI) X(30) CostProfiles.ProfileName (USI) --,---,---,--9 (explicit) CostProfiles.ProfileId (UPI) X(1) CostProfiles.ProfileCat NOT CASESPECIFIC NOT NULL ProfileName CHAR(30) LATIN NOT CASESPECIFIC NOT NULL ProfileId INTEGER NOT NULL ProfileCat CHAR(1) LATIN NOT CASESPECIFIC NOT NULL 102 Data Dictionary Chapter 3: Views Reference CostProfileTypes_V View Name Data Type Format Referenced Table.Column ProfileDesc VARCHAR(2048) LATIN X(2048) CostProfiles.ProfileDesc NOT CASESPECIFIC Example The following example lists the cost profiles defined for the system. SELECT ProfileName (FORMAT 'X(16)', TITLE 'Name') , ProfileId (FORMAT '-----9', TITLE 'Id') , ProfileCat (FORMAT 'X', Title 'Cat') , ProfileDesc (FORMAT 'X(64)', Title 'Description') FROM DBC.CostProfiles_v ORDER BY 2; Result: Name Id Cat ------------- ------ --SysDefault 0 F V2R4 1 F V2R5 2 F V2R5_Solaris 3 F V2R4_Bynet 4 F V2R5_Bynet_V1 5 F V2R5_Bynet_V2 6 F symbios_half 7 F symbios_full 8 F emc 9 F lsi6283 10 F lsi6288_40 11 F lsi6288_52 12 F lsi6840_28 13 F lsi6840_40 14 F lsi6840_56 15 F lsi6285_20 16 F lsi6285_40 17 F V2R4_Array 18 F V2R5_Array 19 F Description --------------------------------------------SysDefault DBS cost values only. Partial pro V2R4 DBS cost values only. Partial profi V2R5 DBS cost values only. Partial profil V2R5 DBS cost values only. Specific to Bynet cost values for V2R4. Partial profile Bynet V1 cost values for V2R5. Partial prof Bynet V2 cost values for V2R5. Partial pro Disk array cost values for Half Populated Disk array cost values for Fully Populated Disk array cost values for EMC. Partial Disk array cost values for LSI 6283 array. Disk array cost values for LSI 6288 array Disk array cost values for LSI 6288 array Disk array cost values for LSI 6840 array Disk array cost values for LSI 6840 array Disk array cost values for LSI 6840 array Disk array cost values for LSI 6285 array Disk array cost values for LSI 6285 array Disk array cost values for V2R4 Default. Disk array cost values for V2R5 Default. CostProfileTypes_V Category Operations Database DBC Data Dictionary 103 Chapter 3: Views Reference CostProfileValues_V View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProfileTypeName CHAR(30) LATIN X(30) CostProfileTypes.ProfileTypeName (USI) X(2048) CostProfileTypes.ProfileTypeDesc NOT CASESPECIFIC NOT NULL ProfileTypeDesc VARCHAR(2048) LATIN NOT CASESPECIFIC Example The following example shows how to list the defined profile types. Only one type is defined. ==> SELECT ProfileTypeName (TITLE 'Type Name', FORMAT 'X(8)'), ProfileTypeDesc (TITLE 'Description', FORMAT 'X(80)') FROM DBC.CostProfileTypes_v; Result: Type Name Description --------- ---------------------------------------------------------Legacy Traditional (V2R6 & prior releases) cost values for legacy CostProfileValues_V Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProfileName CHAR(30) LATIN X(15) CostProfiles.ProfileName (USI) -----9 CostProfiles.ProfileId (UPI) NOT CASESPECIFIC NOT NULL ProfileId INTEGER NOT NULL 104 Data Dictionary Chapter 3: Views Reference CostProfileValues_V View Column Data Type Format Referenced Table.Column ConstName CHAR(64) LATIN X(30) ConstantDefs.ConstName -----9 ConstantDefs.ConstId (Composite USI) X(1) ConstantDefs.ConstCat NOT CASESPECIFIC NOT NULL ConstId INTEGER NOT NULL ConstCat CHAR(1)LATIN NOT CASESPECIFIC NOT NULL ConstVal FLOAT ----,---,--9.9999 ConstantValues.ConstVal ConstDesc VARCHAR(2048) LATIN X(2048) ConstantDefs.ConstDesc NOT CASESPECIFIC Example The following example lists the parameter values for a profile named V2R5_UseSpoolLimit: SELECT ConstName (TITLE 'Profile Name') , ConstId (TITLE 'Id', FORMAT '--9') , ConstVal (TITLE 'Value') , ConstCat (TITLE 'Cat') FROM DBC.CostProfileValues_v WHERE ProfileName = 'V2R5_UseSpoolLimit' ORDER BY 4 DESC, 1; <Note T="Result"> Result: Profile Name -----------------------------ApplySpoolLimit OptBitInst OptBMAndRowInst OptCharFieldInst OptIndexBlockSize OptMaxBldKeySize OptMaxRowIdsIndex OptNumFieldInst OptOutputRowInst OptOvhdOfRowCompInst OptRedistributeInst OptRowAccessInst OptRowIdInst OptRowidSize OptSpoolBlockSize OptSynonymInst OptTableBlockSize SpoolLimitPercent Data Dictionary Id --65 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 73 Value -------------1.0 33.0 98,500.0 261.0 49,152.0 1,000.0 8,030.0 37.0 1,641.0 242.0 73,389.0 409.0 27,139.0 12.0 131,072.0 27,139.0 49,152.0 100.0 Cat --I I I I I I I I I I I I I I I I I I 105 Chapter 3: Views Reference Database_Default_JournalsV[X] Database_Default_JournalsV[X] Category Database Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) UNICODE NOT CASESPECIFIC NOT NULL Journal_DB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL JournalName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles 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; Result: DatabaseName -----------DtBs1 106 Journal_DB ---------DtBs1 JournalName -----------DtBs1Jrnl Data Dictionary Chapter 3: Views Reference Databases2V[X] DtBs2 DtBs3 DtBs2 DtBs1 DtBs2Jrnl DtBs1Jrnl Databases2V[X] Category Database Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseNameI (UPI) X(8) Dbase.DatabaseId (USI) ---,--9 (explicit) Dbase.UnResolvedRICount UNICODE NOT CASESPECIFIC NOT NULL DatabaseId BYTE(4) NOT NULL UnResolvedRICount SMALLINT NOT NULL The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes 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. Data Dictionary 107 Chapter 3: Views Reference DatabasesV[X] DatabasesV[X] Category Database Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.CreatorName X(128) Dbase.OwnerName X(128) Dbase.AccountName X(1) Dbase.ProtectionType X(2) Dbase.JournalFlag ZZZ,ZZZ,ZZZ,ZZZ,ZZ9 Dbase.PermSpace UNICODE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL OwnerName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ProtectionType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL JournalFlag CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL PermSpace FLOAT NOT NULL 108 Data Dictionary Chapter 3: Views Reference DatabasesV[X] View Column Data Type Format Referenced Table.Column SpoolSpace FLOAT ZZZ,ZZZ,ZZZ,ZZZ,ZZ9 Dbase.SpoolSpace ZZZ,ZZZ,ZZZ,ZZZ,ZZ9 Dbase.TempSpace X(255) Dbase.CommentString NOT NULL TempSpace FLOAT NOT NULL CommentString VARCHAR(255) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) YYYY-MM-DDBHH:MI:SS Dbase.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL LastAlterTimeStamp TIMESTAMP(0) YYYY-MM-DDBHH:MI:SS Dbase.LastAlterTimeStamp DBKind CHAR(1) LATIN X(1) Dbase.RowType UPPERCASE NOT CASESPECIFIC NOT NULL AccessCount BIGINT --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt LastAccessTimeStamp TIMESTAMP(0) YYYY-MM-DDBHH:MI:SS ObjectUsage.LastAccessTime Stamp The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes You can use this view to query the characteristics of the databases you own and which you have privileges on. For information about the possible values for the JournalFlag column, see Appendix A: “View Column Values.” AccountName Column The AccountName column is the unexpanded default account name for the user or database. A database can only have one account. A user may have a default account plus other accounts. Data Dictionary 109 Chapter 3: Views Reference DatabaseUseCountV[X] If there is a profile for the user, and it specifies a default account, that account superseded this account name. JournalFlag Column The indicators in the JournalFlag column depend on: • 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 The settings defined for an individual table override the database defaults. For all the account names associated with a database or user, use the AccountInfo[X] system view. Example The statement shown in the following selects information about the Personnel database: ==> SELECT AccountName,ProtectionType,PermSpace,SpoolSpace FROM DBC.Databases WHERE DatabaseName = ’Personnel’; Result: AccountName --------------Teradata_Sample ProtectionType -------------F PermSpace --------100,000 SpoolSpace ------------1,339,884,032 DatabaseUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt UNICODE NOT NULL UsageType CHAR(3) LATIN NOT NULL AccessCount 110 BIGINT Data Dictionary Chapter 3: Views Reference DBCInfoV Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of accesses occurring on a particular database: SELECT AccessCount FROM DBC.DatabaseUseCountV WHERE DatabaseName = 'Personnel'; Result: AccessCount -------------------------16 DBCInfoV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column InfoKey VARCHAR(30) LATIN X(30) DBCInfoTbl.InfoKey (UPI) X(16384) DBCInfoTbl.InfoData NOT CASESPECIFIC NOT NULL InfoData VARCHAR(16384) UNICODE NOT CASESPECIFIC Data Dictionary 111 Chapter 3: Views Reference DBQLRulesV Example This SELECT statement retrieves the version and release of the current Teradata Database software. ==> SELECT infokey (format ‘x(30)’), infodata (format ‘x(20)’) FROM dbcinfo ORDER BY infokey; Result: InfoKey --------------------LANGUAGE SUPPORT MODE RELEASE VERSION InfoData -------------------Japanese 14.10j.00.00 14.10j.00.00 For the language support mode, InfoData is either Standard or Japanese. The values for Version and Release are broken down into 4 parts: • Major release • Minor release • Maintenance release • E-fix release For example, 14.10.02.03 represents the following: Value Description 14 Major release number 10 Minor release number 02 Maintenance release number 03 E-fix or patch release number DBQLRulesV Category Query Database DBC 112 Data Dictionary Chapter 3: Views Reference DBQLRulesV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) DBQLRuleTbl.AccountString (Composite UPI) X(30) DBQLRuleTbl.ApplName (Composite UPI) X(22) DBQLRuleTbl.TypeOfCriterion X(1) DBQLRuleTbl.ExplainFlag X(1) DBQLRuleTbl.ObjFlag X(1) DBQLRuleTbl.SqlFlag X(1) DBQLRuleTbl.StepFlag X(1) DBQLRuleTbl.XMLPlanFlag X(1) DBQLRuleTbl.StatsUsageFlag X(1) DBQLRuleTbl.DBQLOptions UNICODE NOT CASESPECIFIC NOT NULL AccountString VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ApplName CHAR(30) LATIN NOT CASESPECIFIC NOT NULL TypeOfRule VARCHAR(22) UNICODE ExplainFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL ObjFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL SqlFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL StepFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL XMLPlanFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL StatsUsageFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL Verbose CHAR(1) LATIN NOT CASESPECIFIC Data Dictionary 113 Chapter 3: Views Reference DBQLRulesV View Column Data Type Format Referenced Table.Column DetailedStats CHAR(1) LATIN X(1) DBQLRuleTbl.DBQLOptions X(1) DBQLRuleTbl.SummaryFlag X(1) DBQLRuleTbl.ThresholdFlag X(1) DBQLRuleTbl.ObjectUsage X(1) DBQLRuleTbl.ParamFlag X(1) DBQLRuleTbl.UtilityInfoFlag NOT CASESPECIFIC SummaryFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL ThresholdFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL ObjectUsage CHAR(1) LATIN NOT NULL ParamFlag CHAR(1) LATIN NOT CASESPECIFIC UtilityInfoFlag CHAR(1) LATIN NOT CASESPECIFIC TextSizeLimit INTEGER --,---,---,--9 (explicit) DBQLRuleTbl.TextSizeLimit SummaryVal1 through SummaryVal3 SMALLINT ---,--9 (explicit) DBQLRuleTbl.SummaryVal1 through DBQLRuleTbl.SummaryVal3 LockDelay INTEGER --,---,---,--9 DBQLRuleTbl.LockDelay AlgMode BYTEINT --Z(2)9 DBQLRuleTbl.AlgMode TypeOfCriterion VARCHAR(22) X(22) DBQLRuleTbl.TypeOfCriterion --,---,---,--9 DBQLRuleTbl.DetailDiag UNICODE DetailDiag INTEGER NOT NULL Usage Notes Only users with DBC or SystemFE privileges are able to use this view. LockDelay Column The LockDelay column returns the minimum elapsed time of a lock contention in centiseconds. Any lock contention greater than this time will be recorded in the DBC.DBQLXMLLockTbl table as specified in the BEGIN QUERY LOGGING WITH LOCK statement. The minimum LockDelay value is 5 centiseconds. 114 Data Dictionary Chapter 3: Views Reference DBQLRulesV Possible Values for the DetailedStats Column Value Description T Detailed statistics are provided. F Detailed statistics are not provided. Possible Values for the ExplainFlag Column Value Description T EXPLAIN text is logged. F EXPLAIN text is not provided. Possible Values for the ParamFlag Column Value Description T Query parameters and values are logged. F Query parameters and values are not logged. Possible Values for the ObjFlag Column Value Description T Object data is logged. F Object data is not logged. Possible Values for the ObjectUsage Column Value Description T Object use counts are logged. F Object use counts are not logged. Possible Values for the SQLFlag Column Data Dictionary Value Description T SQL text is logged. F SQL text is not provided. 115 Chapter 3: Views Reference DBQLRulesV Possible Values for the StatsUsageFlag Column Value Description T Statistics usage is logged. F Statistics usage is not logged. Possible Values for the StepFlag Column Value Description T Step-level data is logged. F Step-level data is not provided. Possible Values for the SummaryFlag Column Value Description T Summary information is logged. F Summary information is not provided. Possible Values for the ThresholdFlag Column Value Description T Counts the queries that are shorter or equal to SummaryVal1 in DBC.DBQLSummaryTbl. Provides detailed data on longer queries in DBC.DBQLogTbl. F Provides detailed data for all queries in DBC.DBQLogTbl unless the SummaryFlag is True. Possible values for the TypeOfCriterion Column 116 Value Description 0 ElapsedSec (Elapsed seconds) 1 CPUTime (CPU time in centiseconds) 2 IOCount (I/O count) 3 CPUTimeNorm (Normalized CPU time in centiseconds for coexistence systems) 4 ElapsedTime (Elapsed time in centiseconds) 5 No logging criterion. Data Dictionary Chapter 3: Views Reference DBQLRulesV Possible values for the TypeOfRule Column • Logging enabled • WITH NONE (No logging) Possible Values for the UtilityInfoFlag Column Value Description T TASM utility statistics are logged. F TASM utility statistics are not logged. Possible Values for the Verbose Column Value Description T Verbose EXPLAIN and related information in XML format are provided. F Verbose EXPLAIN and related information in XML format are not provided. Possible Values for the XMLPlanFlag Column Value Description T XML query plans are logged. F XML query plans are not logged. SummaryVal1, SummaryVal2, and SummaryVal3 Columns Column Description SummaryVal1 Returns the high value for interval 1 if the SummaryFlag or ThresholdFlag columns are T. This value can be in seconds, CPU centiseconds, or I/Os. SummaryVal2 Returns the high value for interval 2 if the SummaryFlag or ThresholdFlag columns are T. This value can be in seconds, CPU centiseconds, or I/Os. SummaryVal3 Returns the high value for interval 3 if the SummaryFlag or ThresholdFlag columns are T. The same value is used for interval 4. This value can be in seconds, CPU centiseconds, or I/Os. Data Dictionary 117 Chapter 3: Views Reference DeleteAccessLogV Example The following SELECT statement retrieves the rules in effect for users: SELECT * from DBC.DBQLRulesV; Result: UserName Account ApplicationName TypeOfRule Explain Object SQL Step XMLPlan StatsUsage Verbose DetailedStats Summary Threshold ObjectUsage Param UtilityInfo TextSize Summary//Low Med High LockDelay AlgMode TypeOfCriterion DetailDiag All Logging enabled F F F F F F F F F T F F F 1,000 3 ? ? 0 ? ElapsedSec ? Note: This rule was initiated as: BEGIN QUERY LOGGING LIMIT THRESHOLD = 3 and SQLText =1,000 on All; Queries longer than 3 seconds are logged in the DBQLogTbl (QryLog view). Shorter queries are counted and appear in the DBQLSummaryTbl (QryLogSummary view). Summary Low is for either Threshold or Summary. DeleteAccessLogV Category Security Database DBC 118 Data Dictionary Chapter 3: Views Reference DeleteOldInDoubtV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogDate DATE YY/MM/DD (explicit) AccLogTbl.TheDate 99:99:99 (explicit) AccLogTbl.TheTime NOT NULL LogTime TIME NOT NULL Usage Notes The access log contains entries according to the application of the access logging rules (see “AccessLogV” on page 40 and “AccLogRulesV” on page 44). 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 statement deletes entries logged more than 30 days before the current calendar date: ==> DELETE FROM DBC.DeleteAccessLog ALL; Result: DELETE COMPLETED. 79 RECORDS DELETED. DeleteOldInDoubtV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogicalHostId SMALLINT ---,--9 (explicit) InDoubtResLog.LogicalHostId (Composite NUPI) --,---,---,--9 (explicit) InDoubtResLog.SessionNumber NOT NULL SessionNumber INTEGER NOT NULL Data Dictionary 119 Chapter 3: Views Reference DeleteOldInDoubtV View Column Data Type Format Referenced Table.Column CoordTaskId VARBYTE(30) X(60) InDoubtResLog.CoordTaskId (Composite NUPI) X(60) InDoubtResLog.RunUnitId (CompositeNUPI) X(128) InDoubtResLog.LogonUserName X(128) InDoubtResLog.ResolvingUserLogon Name X(1) InDoubtResLog.CommitOrRollback YY/MM/DD (explicit) InDoubtResLog.UserLogonDate 99:99:99 (explicit) InDoubtResLog.UserLogonTime YY/MM/DD (explicit) InDoubtResLog.CompletionDate 99:99:99 (explicit) InDoubtResLog.CompletionTime X(1) InDoubtResLog.Options NOT NULL RunUnitId VARBYTE(30) NOT NULL LogonUserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ResolvingUserLogonName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CommitOrRollback CHAR(1) LATIN NOT CASESPECIFIC NOT NULL UserLogonDate DATE NOT NULL UserLogonTime TIME NOT NULL CompletionDate DATE NOT NULL CompletionTime TIME NOT NULL Options CHAR(1) LATIN NOT CASESPECIFIC 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. Possible Values for the CommitOrRollback Column 120 Value Description C Committed Data Dictionary Chapter 3: Views Reference DeleteUseCountV[X] Value Description R Rolled back 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; Result: DELETE COMPLETED. 5 ROWS REMOVED. DeleteUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.UserDeleteCnt UNICODE NOT NULL ObjectName VARCHAR(128) UNICODE NOT NULL UsageType CHAR(3) LATIN NOT NULL DeleteCount Data Dictionary BIGINT 121 Chapter 3: Views Reference DiskSpaceV[X] Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of deletes occurring on a particular object: SELECT DeleteCount FROM DBC.DeleteUseCountV WHERE DatabaseName = 'Personnel' AND ObjectName = 'Employee'; Result: DeleteCount -------------------------4 DiskSpaceV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column Vproc SMALLINT -(5)9 DatabaseSpace.Vproc X(128) Dbase.DatabaseName NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 122 Data Dictionary Chapter 3: Views Reference DiskSpaceV[X] View Column Data Type Format Referenced Table.Column AccountName VARCHAR(128) X(128) Dbase.AccountName -,---,---,---,---,---,---,--9 DataBaseSpace.MaxPermSpace -,---,---,---,---,---,---,--9 DataBaseSpace.MaxSpoolSpace -,---,---,---,---,---,---,--9 DataBaseSpace.MaxTempSpace -,---,---,---,---,---,---,--9 DataBaseSpace.CurrentPermSpace -,---,---,---,---,---,---,--9 DataBaseSpace.CurrentSpoolSpace -,---,---,---,---,---,---,--9 DataBaseSpace.CurrentPersistentSpool -,---,---,---,---,---,---,--9 DataBaseSpace.CurrentTempSpace -,---,---,---,---,---,---,--9 DataBaseSpace.PeakPermSpace -,---,---,---,---,---,---,--9 DataBaseSpace.PeakSpoolSpace -,---,---,---,---,---,---,--9 DataBaseSpace.PeakPersistentSpool -,---,---,---,---,---,---,--9 DataBaseSpace.PeakTempSpace UNICODE NOT CASESPECIFIC NOT NULL MaxPerm FLOAT NOT NULL MaxSpool FLOAT NOT NULL MaxTemp FLOAT NOT NULL CurrentPerm FLOAT NOT NULL CurrentSpool FLOAT NOT NULL CurrentPersistent Spool FLOAT CurrentTemp FLOAT NOT NULL NOT NULL PeakPerm FLOAT NOT NULL PeakSpool FLOAT NOT NULL PeakPersistentSpool FLOAT NOT NULL PeakTemp FLOAT NOT NULL MaxProfileSpool FLOAT -,---,---,---,---,---,---,--9 Profiles.SpoolSpace MaxProfileTemp FLOAT -,---,---,---,---,---,---,--9 Profiles.TempSpace The X view references these additional tables: Data Dictionary • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles 123 Chapter 3: Views Reference DiskSpaceV[X] 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 Database (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 or accountname. To create the history table, enter the following statement: CREATE TABLE DiskSpaceHist ( DataBaseName VARCHAR(30), AccountName VARCHAR(30), MaxPerm FLOAT, MaxSpool FLOAT, CurrentPerm FLOAT, PeakPerm FLOAT, PeakSpool FLOAT, Date DATE, Time FLOAT ) PRIMARY INDEX (DataBaseName, AccountName); Periodically, you can collect usage statistics using the following procedure: 1 Select statistics from the DiskSpace view and insert them in the history table. 2 Reset DiskSpace counters to zero for the next collection period. Note: You can reset the maximum and peak DiskSpace counters to zero using the ClearPeakDisk macro, which is provided on the release tape. 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 AccountName Column The AccountName column is the unexpanded default account name for the user or database. A database can only have one account. A user may have a default account plus other accounts. 124 Data Dictionary Chapter 3: Views Reference DiskSpaceV[X] If there is a profile for the user, and it specifies a default account, that account superseded this account name. CurrentPerm Column The CurrentPerm column value includes all AMPs unless a specific AMP is requested. CurrentPersistentSpool Column This column returns the persistent spool space (in bytes) currently used by the database on a specified AMP or on all AMPs if the SUM aggregate is specified. PeakPerm, PeakSpool, PeakPersistentSpool, and PeakTemp Columns You can use the DBC.ClearPeakDisk macro to reset the PeakPerm, PeakSpool, PeakPersistentSpool, and PeakTemp columns. PeakPersistentSpool Column This column returns the integer that represents the maximum persistent 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. Example The following SELECT statement displays the permanent disk space across all AMPs: ==> SELECT AMP,DatabaseName,CurrentPerm,MaxPerm FROM DBC.DiskSpace; Result: AMP --. . 0-0 0-0 1-0 1-0 1-0 1-0 . . 1-1 1-1 1-1 1-1 . . 1-2 Data Dictionary DatabaseName -----------. . stst14 ud12 atest a1 btest b2test . . atest a1 btest b2test . . atest CurrentPerm ----------. . 0 0 1,536 0 3,584 49,664 . . 1,536 0 3,584 50,688 . . 1,536 MaxPerm --------. . 125,000 125,000 125,000 247,500 5,000 250,000 . . 125,000 247,500 5,000 250,000 . . 125,000 125 Chapter 3: Views Reference ErrorTblsV[X] ErrorTblsV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ErrTblDbName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) X(128) Dbase.DatabaseName YYYY-MM-DDBHH:MI:SS ErrorTbls.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL ErrTblName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL BaseTblDbName VARCHAR(128) UNICODE NOT CASESPECIFIC BaseTblName VARCHAR(128) UNICODE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) NOT NULL The X view references these additional tables: 126 • DBC.AccessRights • DBC.Owner • DBC.RoleGrants • DBC.Roles Data Dictionary Chapter 3: Views Reference Events_ConfigurationV[X] Example The following example shows base data table u2.t1 has an error table u2.ET_t1, which is created by u2: ==> SELECT ErrTblDbName (char(8)), ErrTblName (char(8)), BaseTblDbName (char(8)), BaseTblName (char(8)), CreatorName (char(4)), CreateTimeStamp FROM DBC.ErrorTblsV; Result: ErrTblDbName -----------u2 ErrTblName ---------ET_t1 BaseTblDbName ------------u2 BaseTblName ----------t1 CreatorName ----------u2 CreateTimeStamp ------------------2006-08-28 11:47:56 Events_ConfigurationV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CreateDate DATE YY/MM/DD (explicit) RCEvent.CreateDate 99:99:99.99 (explicit) RCEvent.CreateTime --,---,---,--9 (explicit) RCEvent.EventNum (NUPI) X(30) RCEvent.EventType X(128) RCEvent.UserName NOT NULL CreateTime TIME NOT NULL EventNum INTEGER NOT NULL EventType CHAR(30)LATIN NOT CASESPECIFIC NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 127 Chapter 3: Views Reference Events_ConfigurationV[X] View Column Data Type Format Referenced Table.Column LogProcessor SMALLINT -(5)9 RCConfiguration.LogProcessor PhyProcessor SMALLINT ZZZZ9 (explicit) RCConfiguration.PhyProcessor Vproc SMALLINT -(5)9 RCConfiguration.Vproc ProcessorState CHAR(1) LATIN X(1) RCConfiguration.ProcessorState ---,--9 (explicit) RCConfiguration.RestartSeqNum NOT CASESPECIFIC NOT NULL RestartSeqNum SMALLINT The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes The Events_Configuration view contains rows for each archive activity that does not affect all AMPs in the Teradata Database 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 online. CreateDate and CreateTime Columns The CreateDate and CreateTime columns are updated by the PE on which the session is running. That is, 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 Database is connected to more than one client system and the client system clocks are not synchronized. Possible Values for the EventType Column 128 • CHECKPOINT • RESTORE • DELETE • ROLLBACK • DUMP • ROLLFORWARD Data Dictionary Chapter 3: Views Reference Events_MediaV[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; Result: 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 Events_MediaV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CreateDate DATE YY/MM/DD (explicit) RCEvent.CreateDate 99:99:99.99 (explicit) RCEvent.CreateTime --,---,---,--9 (explicit) RCEvent.EventNum (NUPI) X(30) RCEvent.EventType NOT NULL CreateTime TIME NOT NULL EventNum INTEGER NOT NULL EventType CHAR(30) LATIN NOT CASESPECIFIC NOT NULL Data Dictionary 129 Chapter 3: Views Reference Events_MediaV[X] View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) RCEvent.UserName X(44) RCEvent.DataSetName X(6) RCMedia.VolSerialId UNICODE NOT CASESPECIFIC NOT NULL DataSetName VARCHAR(44) UNICODE NOT CASESPECIFIC VolSerialId CHAR(6) LATIN NOT CASESPECIFIC NOT NULL VolSequenceNum SMALLINT ---,--9 (explicit) RCMedia.VolSequenceNum DupeDumpSet CHAR(1) LATIN X(1) RCMedia.DupeDumpSet NOT CASESPECIFIC NOT NULL The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes CreateDate and CreateTime Columns The CreateDate and CreateTime columns are updated by the PE on which the session is running. That is, 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 Database is connected to more than one client system and the client system clocks are not synchronized. Possible Values for the EventType Column 130 • CHECKPOINT • RESTORE • DELETE • ROLLBACK Data Dictionary Chapter 3: Views Reference EventsV[X] • DUMP • ROLLFORWARD 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' ; Result: 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 EventsV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column CreateDate DATE YY/MM/DD (explicit) RCEvent.CreateDate 99:99:99.99 (explicit) RCEvent.CreateTime --,---,---,--9 (explicit) RCEvent.EventNum (NUPI) X(30) RCEvent.EventType NOT NULL CreateTime TIME NOT NULL EventNum INTEGER NOT NULL EventType CHAR(30) LATIN NOT CASESPECIFIC NOT NULL Data Dictionary 131 Chapter 3: Views Reference EventsV[X] View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) RCEvent.UserName X(128) RCEvent.DatabaseName X(1) RCEvent.ObjectType X(1) RCEvent.AllAMPsFlag UNICODE NOT CASESPECIFIC NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ObjectType CHAR(1) LATIN NOT CASESPECIFIC AllAMPsFlag CHAR(1) LATIN NOT CASESPECIFIC NOT NULL RestartSeqNum SMALLINT ---,--9 (explicit) RCEvent.RestartSeqNum OperationInProcess CHAR(1) LATIN X(1) RCEvent.OperationInProces X(128) RCEvent.TableName X(128) RCEvent.CheckpointName NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC CheckpointName VARCHAR(128) UNICODE NOT CASESPECIFIC LinkingEventNum INTEGER --,---,---,--9 (explicit) RCEvent.LinkingEventNum DataSetName VARCHAR(44) X(44) RCEvent.DataSetName X(1) RCEvent.LockMode X(1) RCEvent.JournalUsed X(1) RCEvent.JournalSaved UNICODE NOT CASESPECIFIC LockMode CHAR(1) LATIN NOT CASESPECIFIC JournalUsed CHAR(1) LATIN NOT CASESPECIFIC JournalSaved CHAR(1) LATIN NOT CASESPECIFIC 132 Data Dictionary Chapter 3: Views Reference EventsV[X] View Column Data Type Format Referenced Table.Column IndexPresent CHAR(1) LATIN X(1) RCEvent.IndexPresent X(1) RCEvent.DupeDumpSet NOT CASESPECIFIC DupeDumpSet CHAR(1) LATIN NOT CASESPECIFIC The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes The Events view returns a row for each archive or recovery operation. The types of event rows are: Type of event row … A row is created for each … Checkpoint journal checkpointed. Delete journal deleted. Dump database or table dumped. Restore database or table restored. Rollback database or table rolled back. Rollforward database or table rolled forward. The Events view contains the following standard and optional fields: Data Dictionary Standard Fields Optional Fields EventNum DataSetName CreateDate TableName CreateTime CheckpointName UserName LinkingEventNum EventType LockMode DatabaseName JournalUsed 133 Chapter 3: Views Reference EventsV[X] Standard Fields Optional Fields ObjectType JournalSaved AllAMPsFlag IndexPresent RestartSeqNum DupeDumpSet CreateDate and CreateTime Columns The CreateDate and CreateTime columns are updated by the PE on which the session is running. That is, 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 Database is connected to more than one client system and the client system clocks are not synchronized. Possible Values for the AllAMPsFlag Column Value Description A ALL AMPS USED C ALL CLUSTERS P ALL PROCESSORS Possible Values for the EventType Column • CHECKPOINT • RESTORE • DELETE • ROLLBACK • DUMP • ROLLFORWARD Possible Values for the ObjectType Column 134 Value Description D Database J Journal Table Q Backup or restore of selected partitions T Table Data Dictionary Chapter 3: Views Reference ExportWidthV TableName Column If the object is a database, the TableName column is set to NULL. 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; Result: 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 ExportWidthV Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ExportDefinitionName VARCHAR(30) X(30) ExportWidth.ExportDefinitionName X(40) ExportWidth.ExportWidthRuleSet CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL ExportWidthRuleSet BYTE(20) NOT NULL How to Interpret ExportWidthRuleSet Column Values The values stored in the ExportWidthRuleSet column represent the export width rule set for the current export width definitions (pre-defined and user-defined export width definitions). Each export width definition has its own rule set. Data Dictionary 135 Chapter 3: Views Reference ExportWidthV An export width rule set is the set of export width conversion multiplier values for all of the fields of the server character sets for a single export width definition. A total of 40 values make up the rule set for one export width definition. Example Export Width Rule Sets This is an example of the rule sets for the pre-defined export width definitions. ExportDefinitionName --------------------EXPECTED MAXIMUM COMPATIBILITY ExportWidthRuleSet ----------------------------1112211111222232222211121111112222322222 1322323221332232322321123111122322323222 1112211111111231111111121111112222322222 What Each Digit Indicates A single digit in an export width rule set indicates two things: • The export width for the server character set. • The export width for the session character set. You can easily identify the export width rules for a server character set. The same 10 digits are always used to indicate the export width rules for the same server character set. • First set of 10 digits LATIN • Second set of 10 digits UNICODE • Third set of 10 digits KANJISJIS • Fourth set of 10 digits GRAPHIC Each of the 10 digits for a server character set are used to indicate the export width rule for the session character set. The same digit (based on the position of the digit) is always used to indicate the export width rule for the same session character set. This table lists the export width rule indicated by each digit in the set of 10 digits used for each server character set. Note: With the exception of the UTF16 session character set export width, the possible values for every digit in an export width rule set are 1, 2, 3, or 4. The possible values for the UTF16 session character set digit are 2 or 4. Digit (by position) Export Width For... 1 • Any session character set that ends in the string _0I • The KATAKANAEBCDIC session character set 2 Any session character set that ends in the string _0U 3 Any session character set that ends in the string _0S 4 The session character set UTF16 Note: The possible values for this digit are 2 or 4 5 136 The session character set UTF8 Data Dictionary Chapter 3: Views Reference ExportWidthV Digit (by position) Export Width For... 6 Any site-defined session character set with STATEMACHINE EUC1211 7 Any site-defined session character set with STATEMACHINE EUC1223 8 Any site-defined session character set with STATEMACHINE S80 9 Any site-defined session character set with STATEMACHINE S80A1E0 10 Any site-defined session character set with STATEMACHINE SOSI0E0F If you know how the ExportWidthRuleSet column values are grouped and the meaning of each of the 10 digits described in this table, you can determine the export width for the current server character set and session character set. This list gives the export width for an export width definition that has this rule set: 1112211111 2222322222 1112111111 2222322222. • • When exporting from the LATIN server character set and the session character set is UTF8, the export width is 2. The digit that represents the export width for this combination of character sets is in the 5th position in the first set of 10 digits in the rule set (the digit in brown). • 5th position digit indicates the UTF8 session character set. • First set of 10 digits indicates the LATIN server character set. When exporting from the KANJISJIS server character set and the session character set is UTF16, the export width is 2. The digit that represents the export width for this combination of character sets is in the 4th position in the third set of 10 digits in the rule set (the digit in blue). • 4th position digit indicates the UTF16 session character set. • Third set of 10 digits indicates the KANJISJIS server character set. Related Topics Data Dictionary For more information about ... See ... export width and using the DBSControl utility to make export width definition changes International Character Set Support. using the ReplaceExportDefinition stored procedure to create user-defined export width definitions SQL Functions, Operators, Expressions, and Predicates. 137 Chapter 3: Views Reference ExpStatsV ExpStatsV Category Optimizer Statistics Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMNameI (Composite UPI) X(255) TVFields.FieldName X(128) StatsTbl.StatsName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(10000) UNICODE NOT CASESPECIFIC StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5, 2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature NOT CASESPECIFIC 138 Data Dictionary Chapter 3: Views Reference ExpStatsV View Column Data Type Format Referenced Table.Column MaxIntervals SMALLINT ---,--9 StatsTbl.MaxInterval MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. To Get Information Not Contained in This View This view does not contain: Data Dictionary 139 Chapter 3: Views Reference ExternalSPsV[X] • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Example This example assumes the following statistics are collected: STATISTICS COLUMN CAST(o_orderdatetime AS DATE) AS Stats_OrderDate ON Orders; This query can be used to retrieve the statistics collected on single expressions: ==> SELECT * FROM dbc.ExpStatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics For more information about statistics collected on ... See ... non-indexed columns and single-column indexes “ColumnsV[X]” on page 86. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. tables “StatsV” on page 303 or “TableStatsV” on page 312. materialized temporary tables “TempTableStatsV” on page 325. multiple columns “MultiColumnStatsV[X]” on page 177. multiple expressions “MultiExpStatsV” on page 180. ExternalSPsV[X] Category Operations Database DBC 140 Data Dictionary Chapter 3: Views Reference ExternalSPsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) UDFInfo.FunctionName (Composite NUPI) X(12) UDFInfo.FunctionId (USI) ---,--9 (explicit) UDFInfo.NumParameters X(128) UDFInfo.ExternalName X(1) UDFInfo.SrcFileLanguage X(1) UDFInfo.NoSQLDataAccess X(1) UDFInfo.ParameterStyle X(1) UDFInfo.ExecProtectionMode UNICODE NOT CASESPECIFIC NOT NULL ExternalProcedureName VARCHAR(128) UNICODE UPPERCASE NOT NULL ExternalProcedureId BYTE(6) NOT NULL NumParameters SMALLINT NOT NULL ExternalName CHAR(30) LATIN CASESPECIFIC NOT NULL SrcFileLanguage CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL NoSQLDataAccess CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ParameterStyle CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ExecProtectionMode CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Data Dictionary 141 Chapter 3: Views Reference ExternalSPsV[X] View Column Data Type Format Referenced Table.Column ExtFileReference VARCHAR(1000) X(255) (explicit) UDFInfo.ExtFileReference ---,--9 (explicit) UDFInfo.CharacterType X(8) UDFInfo.Platform X(1) UDFInfo.RoutineKind UNICODE CASESPECIFIC CharacterType SMALLINT NOT NULL Platform CHAR(8) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL RoutineKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ParameterUDTIds VARBYTE(512) X(512) (explicit) UDFInfo.ParameterUDTIds AuthIdUsed BYTE(6) X(12) (explicit) TVM.AuthIdUsed AppCategory CHAR(1) LATIN X(1) UDFInfo.AppCategory X(128) UDFInfo.GLOPSetDatabaseName X(128) UDFInfo.GLOPSetMemberName UPPERCASE NOT CASESPECIFIC NOT NULL GLOPSetDatabaseName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC GLOPSetMemberName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC The X view references these additional tables: 142 • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Data Dictionary Chapter 3: Views Reference ExternalSPsV[X] Usage Notes For information about the possible values for the NoSQLDataAccess and RoutineKind columns, see Appendix A: “View Column Values.” Platform Column The Platform column value is LINUX64. This value is used for both SLES 10 and 11. Possible Values for the AppCategory Column Value Description C CLI O ODBC N .NET J JAVA S C and CPP external stored procedure or UDF Possible Values for the ExecProtectionMode Column Value Description P Protected mode U Unprotected mode Possible Values for the ParameterStyle Column Value Description S SQLStyle G GeneralStyle I InternalStyle J JavaStyle O SQLTable N InternalSQL_Style Possible Values for the SrcFileLanguage Column Data Dictionary Value Description C C 143 Chapter 3: Views Reference FunctionsV[X] Value Description P C++ J JAVA S SQL A SAS Example The following SELECT statement returns information about the external stored procedures in database ‘dba’: ==> SELECT * FROM DBC.ExternalSPs WHERE databasename = ‘dba’;DataDatabaseName dba ExternalProcedureName XSP_100 ExternalProcedureId 00006E0F0000 NumParameters 2 ExternalName xsp_100 SrcFileLanguage C NoSQLDataAccess Y ParameterStyle S ExecProtectionMode P ExtFileReference CS!xsp_100!/home/i18n/ckl/udftest/xsp_100.c CharacterType 1 Platform LINUX64 RoutineKind R ParameterUDTIds AuthIdUsed 00001E0A0000 AppCategory S GLOPSetDatabaseName ? GLOPSetMemberName ? FunctionsV[X] Category Operations Database DBC 144 Data Dictionary Chapter 3: Views Reference FunctionsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) UDFInfo.FunctionName (Composite NUPI) X(128) TVM.TVMName X(12) UDFInfo.FunctionId (USI) ---,--9 (explicit) UDFInfo.NumParameters X(255) (explicit) UDFInfo.ParameterDataTypes X(1) UDFInfo.FunctionType X(128) UDFInfo.ExternalName X(1) UDFInfo.SrcFileLanguage UNICODE NOT CASESPECIFIC NOT NULL FunctionName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL SpecificName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL FunctionId BYTE(6) NOT NULL NumParameters SMALLINT NOT NULL ParameterDataTypes VARCHAR(256) LATIN UPPERCASE NOT CASESPECIFIC FunctionType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ExternalName CHAR(30) LATIN CASESPECIFIC NOT NULL SrcFileLanguage CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Data Dictionary 145 Chapter 3: Views Reference FunctionsV[X] View Column Data Type Format Referenced Table.Column NoSQLDataAccess CHAR(1) LATIN X(1) UDFInfo.NoSQLDataAccess X(1) UDFInfo.ParameterStyle X(1) UDFInfo.DeterministicOpt X(1) UDFInfo.NullCall X(1) UDFInfo.PrepareCoun X(1) UDFInfo.ExecProtectionMode X(255) (explicit) UDFInfo.ExtFileReference ---,--9 (explicit) UDFInfo.CharacterType X(8) UDFInfo.Platform --,---,---,--9 UDFInfo.InterimFIdSize UPPERCASE NOT CASESPECIFIC NOT NULL ParameterStyle CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL DeterministicOpt CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL NullCall CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL PrepareCount CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ExecProtectionMode CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ExtFileReference VARCHAR(1000) UNICODE CASESPECIFIC CharacterType SMALLINT NOT NULL Platform CHAR(8) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL InterimFIdSize INTEGER NOT NULL 146 Data Dictionary Chapter 3: Views Reference FunctionsV[X] View Column Data Type Format Referenced Table.Column RoutineKind CHAR(1) LATIN X(1) UDFInfo.RoutineKind UPPERCASE NOT CASESPECIFIC NOT NULL ParameterUDTIds VARBYTE(512) X(512) (explicit) UDFInfo.ParameterUDTIds AuthIdUsed BYTE(6) X(12) (explicit) TVM.AuthIdUsed MaxOutParameters SMALLINT ---,--9 (explicit) UDFInfo.MaxOutParameters X(128) UDFInfo.GLOPSetDatabaseName X(128) UDFInfo.GLOPSetMemberName NOT NULL GLOPSetDatabaseName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC GLOPSetMemberName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC The X view references these additional tables: • DBC.AccessRights • DBC.Owners Usage Notes You can use this view to query for information on a particular function. For information about the possible values for the NoSQLDataAccess and RoutineKind columns, see Appendix A: “View Column Values.” ParameterDataTypes Column The ParameterDataTypes column can list a maximum number of 128 parameters. Possible Values for the ExecProtectionMode Column Data Dictionary Value Description P Protected mode U Unprotected mode 147 Chapter 3: Views Reference FunctionsV[X] Possible Values for the FunctionType Column Value Description A Aggregate B Aggregate and statistical C Contract function F Scalar L Table operator R Table S Statistical Possible Values for the MaxOutParameters Column Value Description 0 Table function with fixed output parameters. 1 to 2048 Varying output column table function. Possible Values for the ParameterStyle Column Value Description S SQLStyle G GeneralStyle I InternalStyle J JavaStyle O SQLTable N InternalSQL_Style Possible Values for the PrepareCount Column 148 Value Description Y PrepareCount option is selected for the statistical function. N PrepareCount option is not selected. Data Dictionary Chapter 3: Views Reference HostsInfoV Possible Values for the SrcFileLanguage Column Value Description C C P C++ J JAVA S SQL A SAS Example The following SELECT statement displays information about the overloaded functions named 'concat' in 'dba' database: ==> SELECT SpecificName, NumParameters, ParameterDataTypes FROM Functions WHERE DatabaseName = 'dba' and FunctionName = 'concat' order by 1,2,3; Result: SpecificName NumParameters ParameterDataType ------------- ------------- ----------------concat concat_3 concat_4 2 3 4 CFCF CFCFCF CFCFCFCF HostsInfoV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogicalHostId SMALLINT ZZZ9 (explicit) Hosts.LogicalHostId (UPI) NOT NULL Data Dictionary 149 Chapter 3: Views Reference IndexConstraintsV[X] View Column Data Type Format Referenced Table.Column HostName VARCHAR(128) X(128) Hosts.HostName (USI) X(128) Hosts.DefaultCharSet UNICODE NOT CASESPECIFIC NOT NULL DefaultCharSet VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Usage Notes If this view does not exist or no rows are found, user-defined international character sets are not available (see the “CharSetsV” on page 78), or have not been assigned as host defaults. In this case, the standard default is used (EBCDIC for IBM mainframe hosts and ASCII for all others). Possible Values for DefaultCharSet Column • EBCDIC • ASCII • The name of a user-defined character set as displayed in the CharSets view. Example The following SELECT statement selects any character sets assigned by the user as the defaults for the client systems in the Teradata Database configuration: ==> SELECT * FROM DBC.HostsInfo; Result: LogicalHostId ------------136 137 HostName --------VM LAN DefaultCharSet ---------------Norwegian_EBCDIC ASCII Related Topics For more information about the user-defined character sets and the values in DBC.HostsInfo, see International Character Set Support. IndexConstraintsV[X] Category Integrity 150 Data Dictionary Chapter 3: Views Reference IndexConstraintsV[X] Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TableConstraints.Name UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL IndexName VARCHAR(128) UNICODE IndexNumber SMALLINT ---,--9 (explicit) TableConstraints.IndexNumber ConstraintType CHAR(1) LATIN X(1) TableConstraints.ConstraintType X(255) TableConstraints.TableCheck X(1) TableConstraints.ConstraintCollation X(128) TableConstraints.CollName X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS TableConstraints.CreateTimeStamp UPPERCASE NOT CASESPECIFIC NOT NULL ConstraintText VARCHAR(16000) UNICODE CASESPECIFIC ConstraintCollation CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CollationName VARCHAR(128) UNICODE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp Data Dictionary TIMESTAMP(0) 151 Chapter 3: Views Reference IndexConstraintsV[X] View Column Data Type Format Referenced Table.Column CharSetID BYTEINT ZZ9 TableConstraints.CharSetID SessionMode CHAR(1) LATIN X(1) TableConstraints.SessionMode UPPERCASE NOT CASESPECIFIC ResolvedCurrent_Date DATE YY/MM/DD TableConstraints.ResolvedCurrent_Date ResolvedCurrent_Time Stamp TIMESTAMP(6) WITH TIME ZONE YYYY-MMDDBHH:MI:SS.S(F)Z TableConstraints.ResolvedCurrent_ TimeStamp The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes You can use this view to query for index constraints derived from partitioning expressions that are defined for a table. For information about the possible values for the ConstraintType column, see Appendix A: “View Column Values.” For more information about the implied table-level index CHECK constraint, see Database Design. CharSetID Column If the character set is user-defined, the ID in the CharSetID column should also exist in DBC.CharTranslations.CharSetID. IndexName and IndexNumber Columns Both columns are NULL if the partitioning is associated with a table or join index that does not have a primary index. Possible Values for the ResolvedCurrent_TimeStamp and ResolvedCurrent_Date Columns • This the last reconciled timestamp or date if the object is a join index or a table that is defined using: • CURRENT_TIMESTAMP • CURRENT_DATE or DATE Either the partition, JI definition, or temporal table has a system-defined join index. • 152 NULL in all other cases. Data Dictionary Chapter 3: Views Reference IndexStatsV[X] Possible Values for the SessionMode Column Value Description A ANSI T Teradata NULL For constraints not involving comparison of character data. Examples Example 1 The following query retrieves a list of tables and join indexes that have partitioning, including their index constraint text: SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name'), ConstraintText FROM DBC.IndexConstraints WHERE ConstraintType = 'Q' ORDER BY DatabaseName, TableName; Example 2 The following query retrieves a list of tables and join indexes that have single-level partitioning: SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name') FROM DBC.IndexConstraints WHERE ConstraintType = 'Q' AND ( SUBSTRING(ConstraintText FROM 1 FOR 13) < 'CHECK (/*02*/' OR SUBSTRING(ConstraintText FROM 1 FOR 13) > 'CHECK (/*15*/') ORDER BY DatabaseName, TableName; IndexStatsV[X] Category Optimizer Statistics Database DBC Data Dictionary 153 Chapter 3: Views Reference IndexStatsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseNameI (UPI) X(128) TVM.TVMNameI (Composite UPI) X(255) TVFields.FieldName X(128) StatsTbl.StatsName UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(10000) UNICODE NOT CASESPECIFIC NOT NULL StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(256) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5,2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(512) StatsTbl.ThresholdSignature NOT CASESPECIFIC MaxIntervals SMALLINT ---,--9 StatsTbl.MaxIntervals MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCoun 154 Data Dictionary Chapter 3: Views Reference IndexStatsV[X] View Column Data Type Format Referenced Table.Column AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCoun HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS.S(F) StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS.S(F) StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” ColumnName Column • If more than one column or expression is specified, each column or expression is separated by a comma. • The maximum number of columns is 64. • If expressions are in the list, the maximum number of columns can be reduced past the limit of 64, depending on the combined total size of the text in the expressions. • If the combined total size of the expression text causes the maximum column limit to be less than the actual number of columns in the list, an error occurs. IndexNumber Column The Index Number column is NULL if the partitioning is associated with a table or join index that does not have a primary index. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. Data Dictionary 155 Chapter 3: Views Reference IndexStatsV[X] Possible Values for the ValidStats Column Value Description T Statistics are valid. F Statistics are not valid. Note: Statistics can be not valid if the query cannot be parsed. For example, if a table is dropped, all statistics referencing it are not valid. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. To Get Information Not Contained in This View This view does not contain: • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Example This example assumes the following statistics have been collected: STATISTICS INDEX (o_orderkey) ,INDEX (o_custkey, o_orderstatus) ON Orders; This query can be used to retrieve the statistics: ==> SELECT * FROM dbc.IndexStatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics For more information about statistics collected on ... 156 See ... non-indexed columns and single-column indexes “ColumnStatsV[X]” on page 83. groups of non-indexed columns “MultiColumnStatsV[X]” on page 177. tables “StatsV” on page 303 and “TablesV[X]” on page 315. Data Dictionary Chapter 3: Views Reference IndexUseCountV[X] For more information about statistics collected on ... See ... materialized temporary tables “TempTableStatsV” on page 325. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. IndexUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.Name X(128) TVM.TVMName X(128) Indexes.Name ---,--9 Indexes.IndexNumber X(128) TVFields.FieldName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.AccessCount UNICODE NOT NULL TableName VARCHAR(128) UNICODE NOT NULL IndexName VARCHAR(128) UNICODE IndexNumber SMALLINT NOT NULL FieldName VARCHAR(128) UNICODE NOT NULL UsageType CHAR(3) LATIN NOT NULL AccessCount Data Dictionary BIGINT 157 Chapter 3: Views Reference IndicesV[X] Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of index accesses occurring on a particular object: SELECT IndexNumber, AccessCount FROM DBC.IndexUseCountV WHERE DatabaseName = 'Personnel' AND TableName = 'Employee'; Result: IndexNumber ----------1 AccessCount -------------------------1 IndicesV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 158 Data Dictionary Chapter 3: Views Reference IndicesV[X] View Column Data Type Format Referenced Table.Column IndexNumber SMALLINT ZZ9 (explicit) Indexes.IndexNumber X(1) Indexes.IndexType X(1) Indexes.UniqueFlag X(128) Indexes.Name X(128) TVFields.FieldName Z9 (explicit) Indexes.FieldPosition X(128) Dbase.DatabaseName NOT NULL IndexType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL UniqueFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL IndexName VARCHAR(128) UNICODE ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnPosition SMALLINT NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS Indexes.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS Indexes.LastAlterTimeStamp IndexMode CHAR(1) LATIN X(1) Indexes.IndexMode NOT CASESPECIFIC AccessCount BIGINT --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt LastAccessTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ObjectUsage,LastAccess TimeStamp Data Dictionary 159 Chapter 3: Views Reference IndicesV[X] View Column Data Type Format Referenced Table.Column UniqueOrPK CHAR(1) LATIN X(1) Indexes.UniqueOrPK VTConstraintType CHAR(1) LATIN X(1) Indexes.VTConstraintType TTConstraintType CHAR(1) LATIN X(1) Indexes.TTConstraintType SystemDefinedJI CHAR(1) LATIN X(1) Indexes.SystemDefinedJI IndexDatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(1) Indexes.LDIType UNICODE NOT CASESPECIFIC LDIType CHAR(1) LATIN Note: This column is reserved for future use. The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.Roles • DBC.RoleGrants 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 returns multiple rows. For information about the possible values for the IndexType column, see Appendix A: “View Column Values.” Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. IndexDatabaseName Column If the IndexDatabaseName column is a join or hash index, the value is not NULL. Possible Values for the IndexMode Column Note: The Index Number column is NULL if the partitioning is associated with a table or join index that does not have a primary index. 160 Value Description H Secondary index rows are hash distributed to the AMPs. Data Dictionary Chapter 3: Views Reference IndicesV[X] Value Description L Index rows are on the same AMP as the referenced data row. Note: If the index type is a join (J) or hash index (N) index, L is returned. In this instance, L represents an empty value. For information on the IndexType values, see “IndexType Column” on page 358. NULL Primary index Possible Values for the IndexNumber Column Value Description 1 Primary index Multiple of 4 (that is, a number between 4 and 128) Secondary index Possible Values for the SystemDefinedJI Column Value Description Y The TVM row describes a join index defined by the system. Such an index is defined when there are temporal constraints on the underlying base table. NULL Any other objects in the system or a user-defined join index. Possible Values for the TTConstraintType Column Value Description C CURRENT N NONSEQUENCED NULL Used when all rows on a table do not support TRANSACTIONTIME. If the table supports TRANSACTIONTIME, a value of NULL indicates that the row is for an index and not a temporal unique or primary constraint. S SEQUENCED Possible Values for the UniqueOrPK Column Data Dictionary Value Description U Unique 161 Chapter 3: Views Reference IndicesV[X] Value Description K Primary key NULL The unique or primary key constraint is not associated with a time dimension, or the row is not for a unique or primary key constraint description. Possible Values for the VTConstraintType Column Value Description A ANSIQUALIFIER Note: ANSI temporal tables require that the session temporal qualifier for systems using Teradata temporal tables be explicitly set to ANSIQUALIFIER. C CURRENT N NON-SEQUENCED NULL Used when all rows on a table do not support VALIDTIME. If the table supports VALIDTIME, a value of NULL indicates that the row is for an index and not a temporal unique or primary constraint. S SEQUENCED W Unique or primary key constraint defined with WITHOUT OVERLAPS. ANSI valid-time table definitions can include primary key and unique constraints that prevent rows from having valid-time periods that overlap. 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 ; The results of this query are as follows: TableName ---------Charges Charges Charges Department Employee Employee Project 162 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 Data Dictionary Chapter 3: Views Reference InDoubtLogV InDoubtLogV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogicalHostId SMALLINT ---,--9 (explicit) InDoubtResLog.LogicalHostId (Composite NUPI) --,---,---,--9 (explicit) InDoubtResLog.SessionNumber (Composite NUPI) X(60) InDoubtResLog.CoordTaskId (Composite NUPI) X(60) InDoubtResLog.RunUnitId (Composite NUPI) X(128) InDoubtResLog.LogonUserName X(128) InDoubtResLog.ResolvingUserLogon Name X(1) InDoubtResLog.CommitOrRollback YY/MM/DD (explicit) InDoubtResLog.UserLogonDate 99:99:99 (explicit) InDoubtResLog.UserLogonTime YY/MM/DD (explicit) InDoubtResLog.CompletionDate NOT NULL SessionNumber INTEGER NOT NULL CoordTaskId VARBYTE(30) NOT NULL RunUnitId VARBYTE(30) NOT NULL LogonUserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ResolvingUserLogonName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CommitOrRollback CHAR(1) LATIN NOT CASESPECIFIC NOT NULL UserLogonDate DATE NOT NULL UserLogonTime TIME NOT NULL CompletionDate DATE NOT NULL Data Dictionary 163 Chapter 3: Views Reference InsertUseCountV[X] View Column Data Type Format Referenced Table.Column CompletionTime TIME 99:99:99 (explicit) InDoubtResLog.CompletionTime X(1) InDoubtResLog.Options NOT NULL Options CHAR(1) LATIN NOT CASESPECIFIC Usage Notes Possible Values for the CommitOrRollback Column Value Description C Committed R Rolled back InsertUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.UserInsertCnt UNICODE NOT NULL ObjectName VARCHAR(128) UNICODE NOT NULL UsageType CHAR(3) LATIN NOT NULL InsertCount 164 BIGINT Data Dictionary Chapter 3: Views Reference JoinIndicesV Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of inserts occurring on a particular object: SELECT InsertCount FROM DBC.InsertUseCountV WHERE DatabaseName = 'Personnel' AND ObjectName = 'Employee'; Result: InsertCount -----------9 JoinIndicesV Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 165 Chapter 3: Views Reference JournalsV[X] View Column Data Type Format Referenced Table.Column JoinIdxDatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) X(1) Indexes.IndexType UNICODE NOT CASESPECIFIC NOT NULL JoinIdxName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL IndexType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Usage Notes For information about the possible values for the IndexType column, see Appendix A: “View Column Values.” Example The following SELECT statement displays the join indexes defined on the table user1.oneoneone: ==> SELECT joinidxdatabasename, joinidxname FROM joinindicesv WHERE databasename = 'user1' and tablename = 'oneoneone'; Result: JoinIdxDataBaseName ------------------user1 JoinIdxName -----------ji JournalsV[X] Category Schema Database DBC 166 Data Dictionary Chapter 3: Views Reference JournalsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column Tables_DB VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Journals_DB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL JournalName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles 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' ; Result: TableName --------PriceA . . . Data Dictionary Tables_DB --------Acctng . . . Journals_DB ----------Acctng . . . JournalName -----------JNLA . . . 167 Chapter 3: Views Reference LoadTablesInfoV[X] LoadTablesInfoV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName Note: This column is reserved for future use. UNICODE DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName Note: This column is reserved for future use. UNICODE LoadQueryBand VARCHAR(256) X(256) LoadTablesInfoTbl.LDI_QBValue Note: This column is reserved for future use. UNICODE SingleSession CHAR(1) LATIN X(1) LoadTablesInfoTbl.SingleSession INTEGER --,---,---,--9 LoadTablesInfoTbl.SessionNo SMALLINT ---,--9 LoadTablesInfoTbl.HostNo TIMESTAMP(6) WITH TIME ZONE YYYY-MMDDBHH:MI:SS LoadTablesInfoTbl.StartTimeStamp NOT CASESPECIFIC NOT CASESPECIFIC Note: This column is reserved for future use. ControlSessNum Note: This column is reserved for future use. ControlHostNum Note: This column is reserved for future use. StartTimeStamp Note: This column is reserved for future use. Usage Notes This view is reserved for future use. 168 Data Dictionary Chapter 3: Views Reference LogOnOffV[X] LogOnOffV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogDate DATE YY/MM/DD EventLog.DateFld (Composite NUPI) 99:99:99.99 EventLog.TimeFld (Composite NUPI) X(128) EventLog.UserName X(128) EventLog.AccountName X(12) EventLog.Event ZZZ9 (explicit) EventLog.LogicalHostId -(5)9 EventLog.IFPNo --,---,---,--9 (explicit) EventLog.SessionNo YY/MM/DD (explicit) EventLog.DateFId 99:99:99.99 (explicit) EventLog.TimeFId NOT NULL LogTime TIME NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Event CHAR(12) LATIN NOT CASESPECIFIC NOT NULL LogicalHostId SMALLINT NOT NULL IFPNo SMALLINT NOT NULL SessionNo INTEGER NOT NULL LogonDate DATE NOT NULL LogonTime TIME NOT NULL Data Dictionary 169 Chapter 3: Views Reference LogOnOffV[X] View Column Data Type Format Referenced Table.Column LogonSource VARCHAR(128) X(128) EventLog.LogonSource X(45) EventLog.ClientIpAddress X(1024) EventLog.ClientProgramName X(128) EventLog.ClientSystemUserId UNICODE NOT CASESPECIFIC ClientIpAddress VARCHAR(45) UNICODE ClientProgramName VARCHAR(1024) UNICODE ClientSystemUserId VARCHAR(128) UNICODE ClientConnectionType BYTEINT --9 EventLog.ClientConnectionType ClientCoordName VARCHAR(128) X(128) EventLog.ClientCoordName X(128) EventLog.ClientEnvName X(128) EventLog.ClientJobId X(128) EventLog.ClientJobName X(128) EventLog.ClientOsName X(128) EventLog.ClientProcThreadId X(128) EventLog.ClientSecProdGrp X(128) EventLog.ClientSecProdUserId UNICODE ClientEnvName VARCHAR(128) UNICODE ClientJobId VARCHAR(128) UNICODE ClientJobName VARCHAR(128) UNICODE ClientOsName VARCHAR(128) UNICODE ClientProcThreadId VARCHAR(128) UNICODE ClientSecProdGrp VARCHAR(128) UNICODE ClientSecProdUserId VARCHAR(128) UNICODE ClientTcpPortNumber INTEGER --,---,---,--9 EventLog.ClientTcpPortNumber ClientTdHostName VARCHAR(128) X(128) EventLog.ClientTdHostName X(128) EventLog.ClientTerminalId X(128) EventLog.ClientTransactionId UNICODE ClientTerminalId VARCHAR(128) UNICODE ClientTransactionId VARCHAR(128) UNICODE 170 Data Dictionary Chapter 3: Views Reference LogOnOffV[X] View Column Data Type Format Referenced Table.Column ClientUserOperId VARCHAR(128) X(128) EventLog.ClientUserOperId X(128) EventLog.ClientVmName X(128) EventLog.ClientVmUserId X(128) EventLog.MechanismName X(128) EventLog.ClientTDPReleaseId X(128) EventLog.ClientCLIv2ReleaseId X(128) EventLog.ClientSessionDesc X(128) EventLog.ClientWorkload X(128) EventLog.ClientJobData X(16) SessionTbl.ClientInterfaceVersion X(16) SessionTbl.ClientInterfaceVersion X(30) SessionTbl.ClientAttributesEx X(30) SessionTbl.ClientInterfaceVersion UNICODE ClientVmName VARCHAR(128) UNICODE ClientVmUserId VARCHAR(128) UNICODE MechanismName VARCHAR(128) UNICODE ClientTDPReleaseId VARCHAR(128) UNICODE ClientCLIv2ReleaseId VARCHAR(128) UNICODE ClientSessionDesc VARCHAR(128) UNICODE ClientWorkload VARCHAR(128) UNICODE ClientJobData VARCHAR(128) UNICODE ClientODBCDriverVersion VARCHAR(16) CHARACTER SET UNICODE NOT CASESPECIFIC ClientNetDataProviderVersion VARCHAR(16) CHARACTER SET UNICODE NOT CASESPECIFIC ClientODBCDriverManager Version CHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC ClientNetFrameworkVersion CHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC Data Dictionary 171 Chapter 3: Views Reference LogOnOffV[X] View Column Data Type Format Referenced Table.Column ClientAttributesEx VARCHAR(512) X(512) EventLog.ClientAttributesEx X(16) None X(30) None X(1) EventLog.RecoverableNetwork Protocol X(33) EventLog.LogonRedrive X(45) EventLog.ClientIPAddrByClient UNICODE ClientJDBCDriverVersion VARCHAR(16) UNICODE ClientJavaVersion VARCHAR(30) UNICODE RecoverableNetworkProtocol CHAR(1) LATIN NOT NULL LogonRedrive VARCHAR(33) UNICODE ClientIPAddrByClient VARCHAR(45) UNICODE ClientPortByClient INTEGER --,---,---,--9 EventLog.ClientPortByClient ServerIPAddrByClient VARCHAR(45) X(45) EventLog.ServerIPAddrByClien UNICODE ServerPortByClient INTEGER --,---,---,--9 EventLog.ServerPortByClient ClientIPAddrByUnity VARCHAR(45) X(45) EventLog.ClientIPAddrByUnity UNICODE ClientPortByUnity INTEGER --,---,---,--9 EventLog.ClientPortByUnity UnityClientSideIPAddr VARCHAR(45) X(45) EventLog.UnityClientSideIPAddr UNICODE UnityClientSidePort INTEGER --,---,---,--9 EventLog.UnityClientSidePort UnityServerSideIPAddr VARCHAR(45) X(45) EventLog.UnityServerSideIPAddr UNICODE UnityServerSidePort INTEGER --,---,---,--9 EventLog.UnityServerSidePort ServerIPAddrByUnity VARCHAR(45) X(45) EventLog.ServerIPAddrByUnity UNICODE ServerPortByUnity INTEGER --,---,---,--9 EventLog.ServerPortByUnity ServerIPAddrByServer VARCHAR(45) X(45) EventLog.ServerIPAddrByServer UNICODE ServerPortByServer INTEGER --,---,---,--9 EventLog.ServerPortByServer ClientCOPSuffixedHost Name VARCHAR(128) X(128) EventLog.ClientCOPSuffixedHost Name 172 UNICODE Data Dictionary Chapter 3: Views Reference LogOnOffV[X] View Column Data Type Format Referenced Table.Column UnitySessNo INTEGER --,---,---,--9 EventLog.UnitySessNo UnityVersion VARCHAR(128) X(128) EventLog.UnityVersion X(1571) EventLog.UnityAuthMechName X(1571) EventLog.UnityMechanismName X(1) EventLog.UserAuthenticatedBy X(128) EventLog.ClientTDSessionPool Name X(256) EventLog.RFU1 X(256) EventLog.RFU2 X(256) EventLog.RFU3 X(256) EventLog.RFU4 UNICODE UnityAuthMechName VARCHAR(1571) UNICODE UnityMechanismName VARCHAR(1571) UNICODE UserAuthenticatedBy VARCHAR(1) UNICODE ClientTDSessionPool Name VARCHAR(128) SecurityPolicy VARCHAR(256) UNICODE UNICODE UnitySecurityPolicy VARCHAR(256) UNICODE Unity_AuthUser VARCHAR(256) UNICODE UnityProxyLogon VARCHAR(256) UNICODE NOT CASESPECIFIC Usage Notes The LogonSource column is deprecated and will be replaced in a future release. For information about the LogonSource fields, see Appendix B: “LogonSource Column Fields and Examples.” Account Name Column The AccountName column is the current unexpanded account name for the session. Possible Values for the ClientConnectionType Column Data Dictionary Value Description 1 Client is connected using TCP/IP via the gateway. 2 Client is connected from a mainframe via a mainframe-attached host. 173 Chapter 3: Views Reference LogOnOffV[X] Possible Values for the Event Column Note: The names of the following values are truncated if they are more than 12 characters in length. If they are less than 12 characters in length, blank spaces are added. • Logon • Logoff • Logon failed This value means a logon failed for reasons other than “Bad User,” “Bad Account,” “Bad Password,” “Bad profile,” “IP restrict,” “Auth failed,” “Bad auth,” or “Secur policy.” Currently, those other reasons are a failure to conform to Logon Rules or an attempt to log on without a password, where the TDP logon exit does not approve the logon. • Bad user • Bad account This value means the user provided an account string during logon time, but that string does not match any of the account names specified for the user in the SQL CREATE USER or MODIFY USER statement. • Bad password • Bad profile The external profile associated with the logon request does not exist. External profiles are stored in the directory server. • Forced off This value indicates that the user session was terminated from the Teradata Database console or the PM/API. • IP restrict This value indicates the user is not permitted to log on from the IP address used. • Auth failed This value indicates an authentication error. • Bad auth This value may indicate other authentication errors: bad authentication field, deprecated logons, decryption failure, and so forth. • Secur policy This value indicates that a logon attempt failed because of a security policy violation. Possible Values for the LogonRedrive Column 174 Value Description '' Not participating MEMORY NON-FALLBACK RESPONSES Memory-based Redrive participation NULL or blanks Session is not participating in Redrive and database restarts will not be transparent to applications and users. Data Dictionary Chapter 3: Views Reference LogOnOffV[X] Possible Values for the RecoverableNetworkProtocol Column Value Description T True F False Possible Values for the SecurityPolicy and UnitySecurityPolicy Columns • No Policy • Plaintext • Integrity, Default • Integrity, Low • Integrity, Medium • Integrity, High • Confidentiality, Default • Confidentiality, Low • Confidentiality, Medium • Confidentiality, High The referenced table columns for SecurityPolicy (DBC.EventLog.RFU1) and UnitySecurityPolicy (DBC.EventLog.RFU2) are used to provide the audit trail information for the security policy. Possible Values for UnityProxyLogon The UnityProxyLogon column indicates if a TD2 logon without a password has occurred. Unity Director can log on a TD2 session using the PROXY mechanism on a managed database system, after the same user has successfully been logged on to another managed database system. Value Description T True indicates the TD2 session logged onto a managed database from Unity Director with no password after the user successfully logged onto another managed database. F False indicates the TD2 session logged on or attempted to log on with a password. Unity_AuthUser Column The referenced table column for Unity_AuthUser (DBC.EventLog.RFU3) is used to provide the audit trail information for the security policy. Data Dictionary 175 Chapter 3: Views Reference LogonRulesV UserName Column The UserName column returns “Non-existent User” when a user tries to log on with a bad username. Example The following SELECT statement displays information about the type of security policy enforced by the Gateway: ==> SELECT Logdate,Logtime,Event,SessionNo,SecurityPolicy,UnitySecurityPolicy, Unity_AuthUser FROM LogonOffV WHERE UnitySecurityPolicy is not NULL ORDER BY Logdate,LogTime; Result: LogDate 12/11/08 LogTime 13:55:47.86 Event Bad User SessionNo 1,001 SecurityPolicy No Policy UnitySecurityPolicy No Policy Unity_AuthUser CN=proxyconfhigh,DC=jrrlinux LogDate 12/11/08 LogTime 14:12:26.11 Event Bad User SessionNo 1,002 SecurityPolicy No Policy UnitySecurityPolicy No Policy Unity_AuthUser CN=proxyconfhigh,DC=jrrlinux Related Topics For more information about ... See ... how to control access, space, and ownership Database Design. the security policy (either enforced by Gateway or Unity Director) and the Unity Director user Security Administration. LogonRulesV Category Security Database DBC 176 Data Dictionary Chapter 3: Views Reference MultiColumnStatsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName ZZZ9 (explicit) LogonRuleTbl.LogicalHostId (Composite UPI) X(1) LogonRuleTbl.LogonStatus X(1) LogonRuleTbl.NullPassword X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS LogonRuleTbl.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL LogicalHostId SMALLINT NOT NULL LogonStatus CHAR(1) LATIN NOT CASESPECIFIC NOT NULL NullPassword CHAR(1) LATIN NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) Usage Notes The LogonRules view retrieves information about logon rules generated as a result of successfully processed GRANT LOGON/REVOKE LOGON statements. The LOGON rules can be used to redefine the SQL Data Control Language defaults. For more information, see SQL Data Control Language. The initial default is that all users can log on from all connected client systems. MultiColumnStatsV[X] Category Optimizer Statistics Database DBC Data Dictionary 177 Chapter 3: Views Reference MultiColumnStatsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMNameI (Composite UPI) X(255) TVFields.FieldName X(128) StatsTbl.StatsName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(10000) UNICODE NOT CASESPECIFIC StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5, 2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(512) StatsTbl.ThresholdSignature NOT CASESPECIFIC MaxIntervals SMALLINT ---,--9 StatsTbl.MaxInterval MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount 178 Data Dictionary Chapter 3: Views Reference MultiColumnStatsV[X] View Column Data Type Format Referenced Table.Column HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. To Get Information Not Contained in This View This view does not contain: Data Dictionary • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. 179 Chapter 3: Views Reference MultiExpStatsV Example This example assumes the following statistics have been collected: STATISTICS COLUMN (o_orderkey, o_orderdatetime) ON Orders; This query can be used to retrieve the statistics: ==> SELECT * FROM dbc.MultiColumnStatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics For more information about statistics collected on ... See ... non-indexed columns and single-column indexes “ColumnsV[X]” on page 86. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. tables “StatsV” on page 303 or “TableStatsV” on page 312. materialized temporary tables “TempTableStatsV” on page 325. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. MultiExpStatsV Category Optimizer Statistics Database DBC 180 Data Dictionary Chapter 3: Views Reference MultiExpStatsV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMNameI (Composite UPI) X(255) TVFields.FieldName X(128) StatsTbl.StatsName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(10000) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(10000) UNICODE NOT CASESPECIFIC StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5, 2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature NOT CASESPECIFIC MaxIntervals SMALLINT ---,--9 StatsTbl.MaxInterval MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount Data Dictionary 181 Chapter 3: Views Reference MultiExpStatsV View Column Data Type Format Referenced Table.Column HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” IndexNumber Column The Index Number column is NULL if the partitioning is associated with a table or join index that does not have a primary index. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. To Get Information Not Contained in This View This view does not contain: 182 • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Data Dictionary Chapter 3: Views Reference ObjectUseCountV[X] Example This example assumes the following statistics have been collected: STATISTICS COLUMN (o_orderno, CAST(o_orderdatetime AS DATE)) AS Stats_OrderDate ON Orders; This query can be used to retrieve statistics collected on multiple columns involving expressions: ==> SELECT * FROM dbc.MultiExpStatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics For more information about statistics collected on ... See ... non-indexed columns and single-column indexes “ColumnsV[X]” on page 86. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. tables “StatsV” on page 303 or “TableStatsV” on page 312. materialized temporary tables “TempTableStatsV” on page 325. multiple columns “MultiColumnStatsV[X]” on page 177. single expressions “ExpStatsV” on page 138. ObjectUseCountV[X] Category Accounting Database DBC Data Dictionary 183 Chapter 3: Views Reference PartitioningConstraintsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObectUsage.UserAccessCnt UNICODE NOT NULL ObjectName VARCHAR(128) UNICODE NOT NULL UsageType CHAR(3) LATIN NOT NULL AccessCount BIGINT Usage Notes Possible Values for the UsageType Column Name Description DML Data Manipulation Language STA Optimizer usage of statistics Example The following SELECT statement shows the number of accesses occurring on a particular object: SELECT AccessCount FROM DBC.ObjectUseCountV WHERE DatabaseName = 'Personnel' AND ObjectName = 'Employee'; The query returns the following result: AccessCount -------------------------16 PartitioningConstraintsV[X] Category Integrity Database DBC 184 Data Dictionary Chapter 3: Views Reference PartitioningConstraintsV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TableConstraints.Name ---,--9 (explicit) Indexes.IndexNumber X(1) TableConstraints.ConstraintType X(255) TableConstraints.TableCheck X(1) TableConstraints.ConstraintCollation X(128) TableConstraints.CollName X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL IndexName VARCHAR(128) UNICODE IndexNumber SMALLINT NOT NULL ConstraintType CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ConstraintText VARCHAR(16000) UNICODE CASESPECIFIC ConstraintCollation CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CollationName VARCHAR(128) UNICODE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVFields.CreateTimeStamp CharSetID BYTEINT ZZ9 TableConstraints.CharSetID Data Dictionary 185 Chapter 3: Views Reference PartitioningConstraintsV[X] View Column Data Type Format Referenced Table.Column SessionMode CHAR(1) LATIN X(1) TableConstraints.SessionMode UPPERCASE NOT CASESPECIFIC ResolvedCurrent_Date DATE YY/MM/DD TableConstraints.ResolvedCurrent_Date ResolvedCurrent_ TimeStamp TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z TableConstraints.ResolvedCurrent_Time Stamp DefinedCombined Partitions BIGINT ZZZZZZZZZZZZZZZZ ZZ9 (explicit) TableConstraints.DefinedCombined Partitions MaxCombined Partitions BIGINT NOT NULL ZZZZZZZZZZZZZZZZ ZZ9 (explicit) TableConstraints.MaxCombined Partitions PartitioningLevels SMALLINT ZZZZ9 (explicit) TableConstraints.PartitioningLevels ZZZZ9 (explicit) TableConstraints.ColumnPartitioning Level NOT NULL NOT NULL ColumnPartitioning Level SMALLINT NOT NULL The X view references these additional tables: • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes For information about the possible values for the ConstraintType column, see Appendix A: “View Column Values.” IndexNumber Column The Index Number column is NULL if the partitioning is associated with a table or join index that does not have a primary index. Possible Values for the ConstraintCollation Column 186 Value Description A ASCII C CHARSET_COLL E EBCDIC J JIS_COLL Data Dictionary Chapter 3: Views Reference PartitioningConstraintsV[X] Value Description M MULTINATIONAL U Use the session collation Possible Values for the MaxCombinedPartitions Column • Zero if ConstraintType is not ‘Q’ • Greater than or equal to the DefinedCombinedPartitions column • Zero if DefinedCombinedPartitions is zero Note: The MaxCombinedPartitions column value cannot change for an nonempty table. Examples This section contains examples of the use of this view to retrieve information about objects that have different types of partitioning and different levels of partitioning. For each example, this information is provided: • A brief description. • A query that could be used to retrieve the information. Example 1: Partitioned Objects The PartitioningConstraintsV view is used to retrieve a list of partitioned objects, regardless of the type of partitioning. This query could be used to retrieve this information. It does not contain any clauses to specify the type of partitioning. SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name') FROM DBC.PartitioningConstraintsV ORDER BY DatabaseName, TableName; Example 2: Objects with Column Partitioning The PartitioningConstraintsV view is used to retrieve a list of objects that have column partitioning. This query could be used to retrieve this information. It is very similar to the query used in “Example 1: Partitioned Objects,” but it contains a WHERE clause that specifies the type of partitioning. SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name') FROM DBC.PartitioningConstraintsV WHERE ColumnPartitioningLevel >= 1 ORDER BY DatabaseName, TableName; Example 3: Objects with 8-byte Multilevel Partitioning The PartitioningConstraintsV view is used to retrieve a list of object that: Data Dictionary • Have 8-byte, multilevel partitioning, and • One of the levels is column parititioning. 187 Chapter 3: Views Reference PeriodsV[X] This query could be used to retrieve this information. SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name') FROM DBC.PartitioningConstraintsV WHERE MaxCombinedPartitions >= 65536 AND PartitioningLevels >= 2 AND ColumnPartitioningLevel >= 1 ORDER BY DatabaseName, TableName; Example 4: Objects with 2-byte Single Level Column Partitioning The PartitioningConstraintsV view is used to retrieve a list of objects that: • Have 2-byte, single-level partitioning, and • The type of partitioning is column parititioning. This query could be used to retrieve this information. SELECT DatabaseName, TableName (TITLE 'Table/Join Index Name') FROM DBC.PartitioningConstraintsV WHERE MaxCombinedPartitions <= 65535 AND PartitioningLevels = 1 AND ColumnPartitioningLevel = 1 ORDER BY DatabaseName, TableName; Related Topics For more information about column partitioning levels, see SQL Data Types and Literals. PeriodsV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName UNICODE NOT NULL Table_Name VARCHAR(128) UNICODE NOT NULL 188 Data Dictionary Chapter 3: Views Reference PeriodsV[X] View Column Data Type Format Referenced Table.Column Period_Name VARCHAR(128) X(128) TVFields.FieldName ---,--9 TVFields.FieldId X(12) TVFields.TableId X(8) TVFields.DatabaseId X(128) TVFields.FieldName X(128) TVFields.FieldName UNICODE NOT NULL Fid SMALLINT NOT NULL Tid BYTE(6) NOT NULL DBid BYTE(4) NOT NULL START_COLUMN_NAME VARCHAR(128) UNICODE END_COLUMN_NAME VARCHAR(128) UNICODE Usage Notes For information about non-temporal period columns that are derived dynamically from the physical DateTime columns that store the beginning and ending bound values of the derived periods, see ANSI Temporal Table Support. START_COLUMN_NAME Column The START_COLUMN_NAME column is the name of the column that will store the start column name of the valid-time derived period column, system-time derived period column, or nontemporal derived period column. END_COLUMN_NAME Column The END_COLUMN_NAME is the name of the column that will store the end column name of the valid-time derived period column, system-time derived period column, or nontemporal derived period column. Example Suppose you have the following table definition: CREATE SET TABLE TEST.employee ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO ( eid INTEGER, jobdurstart DATE FORMAT 'YY/MM/DD' NOT NULL, jobdurend DATE FORMAT 'YY/MM/DD' NOT NULL, PERIOD FOR jobdur (jobdurstart, jobdurend), Data Dictionary 189 Chapter 3: Views Reference ProfileAsgdSecConstraintsV[X] ename CHAR(100) CHARACTER SET LATIN NOT CASESPECIFIC) PRIMARY INDEX ( eid ); The following statement entered in BTEQ retrieves rows from the PeriodsV[X] view for the employee table created: BTEQ -- Enter your SQL request or BTEQ command: .SET FOLDLINE ON .SET SIDETITLES ON SELECT * FROM DBC.PeriodsVX WHERE table_Name = 'employee'; *** Query completed. One row found. 8 columns returned. *** Total elapsed time was 2 seconds. DatabaseName test Table_Name employee Period_Name jobdur Fid 1,028 Tid 00008D090000 DBid 0000FA03 START_COLUMN_NAME jobdurstart END_COLUMN_NAME jobdurend ProfileAsgdSecConstraintsV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProfileName VARCHAR(128) X(128) Profiles.ProfileName X(128) SecConstraints.ConstraintName (UPI) X(128) ConstraintValues.ContraintVal (Composite USI) UNICODE NOT NULL ConstraintName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ValueName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 190 Data Dictionary Chapter 3: Views Reference ProfileInfoV[X] View Column Data Type Format Referenced Table.Column IsDefault CHAR(1) LATIN X(1) AsgdSecConstraints.IsDefault X(128) Dbase.DatabaseName UPPERCASE NOT CASESPECIFIC NOT NULL Assignor VARCHAR(128) UNICODE NOT NULL Usage Notes Possible Values for the IsDefault Column Value Description Y Default N Not the default ProfileInfoV[X] Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProfileName VARCHAR(128) X(128) Profiles.ProfileName X(128) Profiles.DefaultAccount UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL DefaultAccount VARCHAR(128) UNICODE NOT CASESPECIFIC Data Dictionary 191 Chapter 3: Views Reference ProfileInfoV[X] View Column Data Type Format Referenced Table.Column DefaultDB VARCHAR(128) X(128) Profiles.DefaultDatabase UNICODE SpoolSpace FLOAT ----,---,---,---,--9 Profiles.SpoolSpace TempSpace FLOAT ----,---,---,---,--9 (explicit) Profiles.TempSpace ExpirePassword SMALLINT ---,--9 (explicit) Profiles.ExpirePassword PasswordMinChar BYTEINT --9 (explicit) Profiles.PasswordMinChar PasswordMaxChar BYTEINT --9 (explicit) Profiles.PasswordMaxChar PasswordDigits CHAR(1) LATIN X(1) Profiles.PasswordDigits X(1) Profiles.PasswordSpecChar X(1) Profiles.PasswordRestrictWords UPPERCASE NOT CASESPECIFIC PasswordSpecChar CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC PasswordRestrictWords CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC MaxLogonAttempts BYTEINT ---9 (explicit) Profiles.MaxLogonAttempts LockedUserExpire SMALLINT ---,--9 (explicit) Profiles.LockedUserExpire PasswordReuse SMALLINT ---,--9 (explicit) Profiles.PasswordReUse CommentString VARCHAR(255) X(255) Profiles.CommentString X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS Profiles.CreateTimeStamp X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS Profiles.LastAlterTimeStamp UNICODE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) NOT NULL LastAlterName VARCHAR(128) UNICODE NOT CASESPECIFIC LastAlterTimeStamp TIMESTAMP(0) NOT NULL 192 Data Dictionary Chapter 3: Views Reference QryLockLogXMLV Usage Notes In ProfileInfo[X], if no profile is set up for the user or for ProfileInfo, and if no profile is defined, the view contains the following message: No rows found If the profile creator has been dropped, the ProfileInfo[X] view contains the information of that profile, which is shown with the text "Dropped User" for CreatorName or LastAlterName. Example The following query lists the parameter settings of all profiles in the system together with their parameter settings: SELECT CAST(ProfileName AS CHAR(15)), CAST (DefaultDB AS CHAR(15)), CAST (AccountName AS CHAR(15)) (NAMED DefaultAccount), SpoolSpace, TempSpace FROM DBC.ProfileInfo ORDER BY 1; *** Query completed. 3 rows found. 5 columns returned. Result: ProfileName ----------kanji HResources NTGroup DefaultDB --------japan personnel NT DefaultAccount -------------i18n ? ncrsandiego SpoolSpace ---------50000 ? 50000 TempSpace -----------50000 ? 50000 If multiple accounts are specified for the ACCOUNT parameters, only the first account (the default account) in the list is reflected in the display. The remaining accounts in the list can be retrieved by performing a SELECT on the existing view DBC.AccountInfo. Parameter settings for the profile assigned to the user may similarly be displayed by performing a SELECT on the new system view DBC.ProfilesInfoX. QryLockLogXMLV Category Query Database DBC Data Dictionary 193 Chapter 3: Views Reference QryLockLogXMLV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 DBQLXMLLockTbl.ProcID YYYY-MMDDBHH:MI:SS DBQLXMLLockTbl.CollectTimeStamp --Z(17)9 DBQLXMLLockTbl.QueryID --,---,---,--9 DBQLXMLLockTbl.XMLRowNo X(31000) DBQLXMLLockTbl.XMLTextInfo NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL XMLRowNo INTEGER NOT NULL XMLTextInfo CLOB(1048576) UNICODE NOT NULL Usage Notes Access to this view is granted based on the security policy of your site. The data from the QryLockLogXMLV view comes directly from the DBQLXMLLockTbl table. The DBQLXMLLockTbl table logs lock contentions in XML format. The XMLTextInfo column stores the XML data that needs to be shredded. The XML shredding feature is enabled by default in Teradata Database. Using Teradata client software, such as BTEQ or Teradata Viewpoint, you can call the SP_LockLog_Shredder stored procedure to shred the XML data in the DBQLXMLLockTbl table. Example The following statement retrieves all lock contentions in XML format from the DBC.QryXMLLockTbl table: sel * from DBC.QryLockLogXMLV; Result: ProcID 4 CollectTimeStamp 2012-11-06 18:38:18 QueryID 163829183239027280 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163829183239027280" CollectTimeStamp="2012-11-06T18:38:18.33" DelayStartTime="2012-1106T18:36:58.94" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="5952" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="0"/> <Transaction unique_1="4" unique_2="64668" vproc="16382"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1004" SessionID_Combined="1004"/> <ExpReqOrigin ExpReqProc="0"/> </SessionRef> <Job> <Message MessageClass="8" MessageKind="5" MessageClassName="SYSMSGEXPCLASS" MessageKindName="EXPRELMSG"/> <Operation WorkLevel="0" OperationType="Release lock" JobType="ExpressRequest"/> </Job> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Table"> </LockData> </BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1005" SessionID_Combined="1005"/> </SessionRef> <LockData 194 Data Dictionary Chapter 3: Views Reference QryLockLogXMLV LockTypeRequested="Access" LockObjectRequested="Row"> </LockData> </BlockedRef> </ContentionData> </ LockContention> </DBQLLockXML> ProcID 4 CollectTimeStamp 2012-11-06 18:41:01 QueryID 163839183238999124 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163839183238999124" CollectTimeStamp="2012-11-06T18:41:01.58" DelayStartTime="2012-1106T18:37:58.92" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="5961" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="9"/> <Transaction unique_1="0" unique_2="1630" vproc="16383"/> <Step StepLevel="0" StepNum_1="1" StepNum_2="0" StatementNo="1"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1006" SessionID_Combined="1006"/> <User UserName="DBC" AccountName="DBC"/> </SessionRef> <Job> <Message MessageClass="21" MessageKind="8" MessageClassName="SYSMSGS2SCLASS" MessageKindName="S2sSumKind"/> <Operation WorkLevel="0" OperationType="Local Aggregate SUM Step." JobType="AmpStep"/> </Job> <LockData LockTypeRequested="Read" LockObjectRequested="Row"> <RowStartKey> <RowKey rowparthash_1="10922" rowparthash_2="0" rowparthash_3="0" rowparthash_4="1004" rowhash_1="2384" rowhash_2="0" rowunique_1="1024" rowunique_2="2384" /> </RowStartKey> </LockData> </BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1007" SessionID_Combined="1007"/> </SessionRef> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Table"> </LockData> </BlockedRef> </ContentionData> </LockContention> </ DBQLLockXML> ProcID 4 CollectTimeStamp 2012-11-06 18:41:01 QueryID 163839183238999133 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163839183238999133" CollectTimeStamp="2012-11-06T18:41:01.58" DelayStartTime="2012-1106T18:38:58.97" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="5962" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="10"/> <Transaction unique_1="0" unique_2="1776" vproc="16383"/> <Step StepLevel="0" StepNum_1="1" StepNum_2="0" StatementNo="1"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1010" SessionID_Combined="1010"/> <User UserName="DBC" AccountName="DBC"/> </SessionRef> <Job> <Message MessageClass="21" MessageKind="8" MessageClassName="SYSMSGS2SCLASS" MessageKindName="S2sSumKind"/> <Operation WorkLevel="0" OperationType="Local Aggregate SUM Step." JobType="AmpStep"/> </Job> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Row"> <RowStartKey> <RowKey rowparthash_1="10922" rowparthash_2="0" rowparthash_3="0" rowparthash_4="0" rowhash_1="2384" rowhash_2="0" rowunique_1="0" rowunique_2="0" /> </RowStartKey> </LockData> </ BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1011" SessionID_Combined="1011"/> </SessionRef> <LockData LockTypeRequested="Read" LockObjectRequested="Table"> </LockData> </BlockedRef> </ContentionData> </LockContention> </ DBQLLockXML> ProcID 4 CollectTimeStamp 2012-11-06 18:41:01 QueryID 163829183239027306 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163829183239027306" CollectTimeStamp="2012-11-06T18:41:01.58" DelayStartTime="2012-1106T18:39:58.91" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="84" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="7"/> <Transaction unique_1="4" unique_2="64800" vproc="16382"/> <Step StepLevel="0" StepNum_1="0" StepNum_2="0" StatementNo="1"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1013" SessionID_Combined="1013"/> <User UserName="DBC" AccountName="DBC"/> </SessionRef> <Job> <Message MessageClass="21" MessageKind="11" MessageClassName="SYSMSGS2SCLASS" MessageKindName="S2sSumKind"/> <Operation WorkLevel="128" OperationType="Local Aggregate SUM Step." JobType="AmpStep"/> </Job> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Row"> <RowStartKey> <RowKey rowparthash_1="10922" rowparthash_2="0" rowparthash_3="0" rowparthash_4="1004" rowhash_1="2384" rowhash_2="0" rowunique_1="1024" rowunique_2="2384" /> </RowStartKey> </LockData> </ BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1012" SessionID_Combined="1012"/> </SessionRef> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Table"> </LockData> </BlockedRef> </ContentionData> </LockContention> </ DBQLLockXML> ProcID 4 CollectTimeStamp 2012-11-06 18:41:01 QueryID 163839183238999148 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163839183238999148" CollectTimeStamp="2012-11-06T18:41:01.58" DelayStartTime="2012-1106T18:40:02.71" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="483" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject Data Dictionary 195 Chapter 3: Views Reference QryLogEventHisV DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="10"/> <Transaction unique_1="0" unique_2="1834" vproc="16383"/> <Step StepLevel="0" StepNum_1="1" StepNum_2="0" StatementNo="1"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1014" SessionID_Combined="1014"/> <User UserName="DBC" AccountName="DBC"/> </SessionRef> <Job> <Message MessageClass="21" MessageKind="8" MessageClassName="SYSMSGS2SCLASS" MessageKindName="S2sSumKind"/> <Operation WorkLevel="0" OperationType="Local Aggregate SUM Step." JobType="AmpStep"/> </Job> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Row"> <RowStartKey> <RowKey rowparthash_1="10922" rowparthash_2="0" rowparthash_3="0" rowparthash_4="0" rowhash_1="2384" rowhash_2="0" rowunique_1="0" rowunique_2="0" /> </RowStartKey> </LockData> </ BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1015" SessionID_Combined="1015"/> </SessionRef> <LockData LockTypeRequested="Read" LockObjectRequested="Table"> </LockData> </BlockedRef> </ContentionData> </LockContention> </ DBQLLockXML> ProcID 4 CollectTimeStamp 2012-11-06 18:41:01 QueryID 163839183238999157 XMLRowNo 1 XMLTextInfo <?xml version="1.0" encoding="UTF-8"?> <!--XML row for DBQLLockXML--> <DBQLLockXML xsi:schemaLocation="http://schemas.teradata.com/dbqllockplan dbqllockplan.xsd" xmlns="http:// schemas.teradata.com/dbqllockplan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <LockContention QueryID="163839183238999157" CollectTimeStamp="2012-11-06T18:41:01.58" DelayStartTime="2012-1106T18:40:07.88" ErrorText="" AbortFlag="false" ErrorCode="0"> <ContentionData LockDelay="473" LocalDeadLock="false" GlobalDeadLock="false" MultipleBlocker="false" vproc="4"> <LockObject DatabaseName="systemfe" TableName="locktest"/> <BlockerRef> <RequestRef> <RequestID RequestID_1="0" RequestID_2="10"/> <Transaction unique_1="0" unique_2="1858" vproc="16383"/> <Step StepLevel="0" StepNum_1="1" StepNum_2="0" StatementNo="1"/> </RequestRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1016" SessionID_Combined="1016"/> <User UserName="DBC" AccountName="DBC"/> </SessionRef> <Job> <Message MessageClass="21" MessageKind="8" MessageClassName="SYSMSGS2SCLASS" MessageKindName="S2sSumKind"/> <Operation WorkLevel="0" OperationType="Local Aggregate SUM Step." JobType="AmpStep"/> </Job> <LockData LockTypeRequested="Exclusive" LockObjectRequested="Row"> <RowStartKey> <RowKey rowparthash_1="10922" rowparthash_2="0" rowparthash_3="0" rowparthash_4="0" rowhash_1="2384" rowhash_2="0" rowunique_1="0" rowunique_2="0" /> </RowStartKey> </LockData> </ BlockerRef> <BlockedRef> <SessionRef LogicalHostId="1"> <Session SessionID_1="0" SessionID_2="1017" SessionID_Combined="1017"/> </SessionRef> <LockData LockTypeRequested="Read" LockObjectRequested="Table"> </LockData> </BlockedRef> </ContentionData> </LockContention> </ DBQLLockXML> . . . Related Topics For more information about ... You can use ... the DBQLXMLLockTbl table Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to view the DBQLXMLLockTbl table and columns or see Database Administration. monitoring and displaying lock information the Lock Viewer portlet in Teradata Viewpoint. QryLogEventHisV Category Query Database DBC 196 Data Dictionary Chapter 3: Views Reference QryLogEventHisV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) TDWMEventHistory.ProcID (NUPI) YYYY-MMDDBHH:MI:SS TDWMEventHistory.BufferTS (NUPI) YYYY-MMDDBHH:MI:SS.S(F)Z TDWMEventHistory.EntryTS X(10) TDWMEventHistory.EntryKind NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL EntryTS TIMESTAMP(6) NOT NULL EntryKind CHAR(10) LATIN NOT CASESPECIFIC EntryID INTEGER --,---,---,--9 (explicit) TDWMEventHistory.EntryID EntryName VARCHAR(128) X(128) TDWMEventHistory.EntryName UNICODE NOT CASESPECIFIC EventValue FLOAT ----,---,---, ---,--9 (explicit) TDWMEventHistory.EventValue LastValue FLOAT ----,---,---, ---,--9 (explicit) TDWMEventHistory.LastValue Activity CHAR(10) LATIN X(10) TDWMEventHistory.Activity NOT CASESPECIFIC ActivityId INTEGER --,---,---,--9 (explicit) TDWMEventHistory.ActivityId ActivityName VARCHAR(128) X(128) TDWMEventHistory.ActivityName UNICODE NOT CASESPECIFIC ConfigId INTEGER --,---,---,--9 (explicit) TDWMEventHistory.ConfigId SeqNo SMALLINT ZZZ9 TDWMEventHistory.SeqNo Spare1 VARCHAR(128) X(128) TDWMEventHistory.Spare1 UNICODE NOT CASESPECIFIC Spare2 INTEGER --,---,---,--9 (explicit) TDWMEventHistory.Spare2 Spare3 FLOAT ----,---,---, ---,--9 (explicit) TDWMEventHistory.Spare3 Data Dictionary 197 Chapter 3: Views Reference QryLogEventHisV Usage Notes Possible Values for the Activity Column Value Description ACTIVE The Event...State is becoming active INACTIVE The Event...State is becoming inactive EXPRESSION The Event entry was used to determine that an expression is to be made active SYSCON The Expression entry was used to determine that a syscon is to be made active OPENV The Expression entry was used to determine that an openv is to be made active Possible Values for the EntryKind Column • EVENT • EXPRESSION • SYSCON • OPENV • STATE Example The following is an example SQL statement that demonstrates how data can be extracted from the QryLogEventHis view to give an explanation of the expression and events which caused a RED SysCon. WITH RECURSIVE CausalAnalysis(EntryTS, EntryKind, EntryID, EntryName, Activity, ActiveId) AS ( SELECT EntryTS, EntryKind, EntryID, EntryName, Activity, ActiveId FROM test.QryLogEventHis WHERE EntryKind = 'SYSCON' AND EntryName = 'RED' AND Activity = 'ACTIVE' UNION ALL SELECT Cause.EntryTS, Cause.EntryKind, Cause.EntryID, Cause.EntryName, Cause.Activity, Cause.ActiveId FROM CausalAnalysis Condition INNER JOIN test.QryLogEventHis Cause ON Condition.EntryKind = Cause.Activity AND Condition.EntryID = Cause.ActiveID ) SELECT * FROM CausalAnalysis 198 Data Dictionary Chapter 3: Views Reference QryLogEventsV ORDER BY 1 DESC; Result: EntryTS EntryKind EntryID EntryName Activity ActiveId ----------------------- ---------- -------- ------------ ---------- --------2006-03-22 14:20:49.12 SYSCON 30 RED ACTIVE 0 2006-03-22 14:19:49.06 EXPRESS 20 AWT & NODE SYSCON 30 2006-03-22 14:17:48.53 EVENT 11 NODE DOWN EXPRESS 20 2006-03-22 14:16:48.51 EVENT 10 LOW AWTS EXPRESS 20 QryLogEventsV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) TDWMEventLog.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS TDWMEventLog.BufferTS (Composite NUPI) NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL SessionID INTEGER --,---,---,--9 (explicit) TDWMEventLog.SessionID LogicalHostID SMALLINT ZZZ9 (explicit) TDWMEventLog.LogicalHostID WDID INTEGER --,---,---,--9 (explicit) TDWMEventLog.WDID OpEnvID INTEGER --,---,---,--9 (explicit) TDWMEventLog.OpEnvID SysConID INTEGER --,---,---,--9 (explicit) TDWMEventLog.SysConID EventTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z (explicit) TDWMEventLog.EventTime --,---,---,--9 (explicit) TDWMEventLog.EventCode NOT NULL EventCode INTEGER NOT NULL EventSubCode INTEGER --,---,---,--9 (explicit) TDWMEventLog.EventSubCode EventInfo VARCHAR(200) X(200) TDWMEventLog.EventInfo UNICODE NOT CASESPECIFIC Data Dictionary 199 Chapter 3: Views Reference QryLogExceptionsV Usage Notes These events may include a Teradata dynamic workload management software rule update or errors encountered during a Teradata dynamic workload management software rule activate or deactivate. Example The following statement retrieves rows from the QryLogEvents view: SELECT * from DBC.QryLogEvents; The query returns the following result: ProcID 16383 TimeStamp 2004-06-22 14:51:32 SessionID ? LogicalHostID ? WDID ? OpEnvID ? SysConID ? EventTime 2004-06-22 14:43:32.58 EventCode 3,158 EventSubCode ? EventInfo TDWM rules have been updated QryLogExceptionsV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) TDWMExceptionLog.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS TDWMExceptionLog.BufferTS (Composite NUPI) --Z(17)9 TDWMExceptionLog.QueryID NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL (18,0) NOT NULL 200 Data Dictionary Chapter 3: Views Reference QryLogExceptionsV View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) TDWMExceptionLog.UserName UNICODE NOT CASESPECIFIC SessionID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.SessionID RequestNum INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.RequestNum LogicalHostID SMALLINT ZZZ9 (explicit) TDWMExceptionLog.LogicalHostID AcctString VARCHAR(128) X(128) TDWMExceptionLog.AcctString (unexpanded) UNICODE NOT CASESPECIFIC WDID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.WDID OpEnvID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.OpEnvID SysConID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.SysConID ClassificationTime TIMESTAMP(6) YYYYMMDDBHH:MI:SS.S(F) Z (explicit) TDWMExceptionLog.ClassificationTime ExceptionTime TIMESTAMP(6) YYYYMMDDBHH:MI:SS.S(F) Z (explicit) TDWMExceptionLog.ExceptionTime NOT NULL ExceptionValue INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.ExceptionValue ExceptionAction CHAR(10) LATIN X(10) TDWMExceptionLog.ExceptionAction NOT CASESPECIFIC NewWDID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.NewWDID ExceptionCode INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.ExceptionCode NOT NULL ExceptionSubCode INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.ExceptionSubCode ErrorText VARCHAR(1024) X(255) TDWMExceptionLog.ErrorText X(200) TDWMExceptionLog.ExtraInfo UNICODE NOT CASESPECIFIC ExtraInfo VARCHAR(200) UNICODE NOT CASESPECIFIC RuleID INTEGER --,---,---,--9 (explicit) TDWMExceptionLog.RuleID WarningOnly CHAR(1) LATIN X(1) TDWMExceptionLog.WarningOnly NOT CASESPECIFIC Data Dictionary 201 Chapter 3: Views Reference QryLogExceptionsV View Column Data Type Format Referenced Table.Column RejectionCat SMALLINT ZZZ9 TDWMExceptionLog.RejectionCat Usage Notes This view contains entries for: 1 Logons rejected due to the Teradata dynamic workload management software throttle limits 2 Queries rejected due to the Teradata dynamic workload management software object access violations 3 Queries rejected due to the Teradata dynamic workload management software throttle limits if abort option is chosen 4 Queries subject to WD exception handling For more information about the possible values for the ExceptionValue column, see Appendix A: “View Column Values.” Possible Values for the ExceptionAction Column Value Description A Abort. Cannot be combined with other actions. C Change workload definition (WD). NewWlcId contains the new WD. L Log. E Execute Program. ExProgram contains the program name. T Alert. ExAlert contains the alert name. N No action. This option cannot be combined with other actions and disables exception detection. S Abort if the statement is a SELECT and no update has been done in the current (user) transaction. Q Post to queue table. Possible Values for the RejectionCat Column 202 Value Description 1 A rejection due to a TASM Filter rule 2 A rejection due to a TASM Throttle rule 3 A rejection due to a TASM Workload rule Data Dictionary Chapter 3: Views Reference QryLogExplainV Example The following SELECT statement retrieves the view for QryLogExceptions: SELECT * from DBC.QryLogExceptions; The query returns the following result: ProcID 16383 TimeStamp 2004-06-21 16:38:34.21 QueryID 201205134619838011 UserName TEST1 SessionID ? RequestNum ? LogicalHostID 1 AcctString DBC WDID ? OpEnvID ? SysConID ? ClassificationTime ? ExceptionTime 2004-06-21 17:38:34.21 ExceptionValue ? ExceptionAction ? NewWDID ? ExceptionCode 3,152 ExceptionSubCode ? ErrorText No access allowed, For all requests, For user TEST1, Regulation applies from 00:00 to 24:00 ExtraInfo ? RuleID ? WarningOnly ? RejectionCat ? QryLogExplainV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLExplainTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLExplainTbl.CollectTimeStamp (Composite NUPI) NOT NULL CollectTimestamp TIMESTAMP(6) NOT NULL Data Dictionary 203 Chapter 3: Views Reference QryLogExplainV View Column Data Type Format Referenced Table.Column QueryID DECIMAL(18,0) --Z(17)9 DBQLExplainTbl.QueryID --,---,---,--9 (explicit) DBQLExplainTbl.ExpRowNo X(31000) DBQLExplainTbl.ExplainText NOT NULL ExpRowNo INTEGER NOT NULL ExplainText VARCHAR (31000) UNICODE NOT CASESPECIFIC NOT NULL Usage Notes Because the explain can be larger than 64KB, it may use multiple rows to hold the data. Example SELECT Queryid, Explaintext FROM Qrylogexplain WHERE Queryid = 201205134619838011; Result: QueryID 201205134619838011 ExplainText 1) First, we lock a distinct DBC."pseudo table" for read on a RowHash to prevent global deadlock for DBC.DBSpace. 2) Next, we lock DBC.DBSpace for read, we lock DBC.dbase for access, and we lock DBC.SessionTbl for access. 3) We flush the DISKSPACE and AMPUSAGE caches. 4) We execute the following steps in parallel. 1) We do an all-AMPs RETRIEVE step from DBC.dbase by way of an all-rows scan into Spool 2 (all_amps), which is built locally on the AMPs. Then we do a SORT to order Spool 2 by row hash. The size of Spool 2 is estimated with low confidence to be 10 rows. The estimated time for this step is 1 hour and 1 minute. 2) We do an all-AMPs RETRIEVE step from DBC.SessionTbl by way of an all-rows scan with no residual conditions into Spool 4 (all_amps), which is redistributed by hash code to all AMPs. Then we do a SORT to order Spool 4 by the sort key in spool field1 eliminating duplicate rows. The size of Spool 4 is estimated with low confidence to be 2 rows. The estimated time for this step is 1 hour and 1 minute. 5) We do an all-AMPs RETRIEVE step from Spool 4 (Last Use) by way of an all-rows scan into Spool 3 (all_amps), which is duplicated on all AMPs. Then we do a SORT to order Spool 3 by row hash. The size of Spool 3 is estimated with no confidence to be 4 rows. 6) We execute the following steps in parallel. 1) We do an all-AMPs JOIN step from Spool 2 (Last Use) by way of an all-rows scan, which is joined to Spool 3 (Last Use) by way of an all-rows scan. Spool 2 and Spool 3 are joined using an exclusion merge join, with a join 204 Data Dictionary Chapter 3: Views Reference QryLogObjectsV condition of ("DatabaseName = UserName"). The result goes into Spool 5 (all_amps), which is duplicated on all AMPs. The size of Spool 5 is estimated with index join confidence to be20 rows. The estimated time for this step is 1 hour and 1 minute. 2) We do an all-AMPs RETRIEVE step from DBC.DBSpace by way of an all-rows scan into Spool 6 (all_amps), which is built locally on the AMPs. The size of Spool 6 is estimated with low confidence to be 134 rows. The estimated time for this step is 1 hour and 1 minute. 7) We do an all-AMPs JOIN step from Spool 5 (Last Use) by way of an allrows scan, which is joined to Spool 6 (Last Use) by way of an all-rows scan. Spool 5 and Spool 6 are joined using a single partition hash join, with a join condition of ("DatabaseId = DatabaseId"). The result goes into Spool 1 (group_amps), which is built locally on the AMPs. Then we do a SORT to order Spool 1 by the sort key in spool field1. The size of Spool 1 is estimated with index join confidence to be 134 rows. The estimated time for this step is 1 hour and 1 minute. 8) Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request. -> The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 1 hour and 1 minute. Note: The ExplainText does not contain any format. It is just one long string. The example was manually edited to add the line breaks to make it easier to read. QryLogObjectsV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLObjTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLObjTbl.CollectTimeStamp (Composite NUPI) --Z(17)9 DBQLObjTbl.QueryID NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL Data Dictionary 205 Chapter 3: Views Reference QryLogObjectsV View Column Data Type Format Referenced Table.Column ObjectDatabaseName VARCHAR(128) X(128) DBQLObjTbl.ObjectDatabaseName X(128) DBQLObjTbl.ObjectTableName X(128) DBQLObjTbl.ObjectColumnName X(8) DBQLObjTbl.ObjectID UNICODE NOT CASESPECIFIC ObjectTableName VARCHAR(128) UNICODE NOT CASESPECIFIC ObjectColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC ObjectID BYTE(4) NOT NULL ObjectNum INTEGER --,---,---,--9 (explicit) DBQLObjTbl.ObjectNum ObjectType CHAR(3) LATIN X(3) DBQLObjTbl.ObjectType NOT CASESPECIFIC NOT NULL FreqofUse INTEGER --,---,---,--9 (explicit) DBQLObjTbl.FreqofUse TypeOfUse VARCHAR(46) X(46) DBQLObjTbl.TypeofUse UNICODE Usage Notes If objects are requested, object information is stored in a DBQL table that contains a row for each object used in the query. IF the object is … THEN … an index the field ID is logged instead of a name. a column • the field ID is logged instead of a name • the object ID can be used to quality the field ID, which is not unique across the system. Object frequency can also be logged. This is the number of times an object is used in a query. 206 Data Dictionary Chapter 3: Views Reference QryLogObjectsV ObjectType Column Values Value Description Agg User-defined aggregate function AgS User-defined aggregate STAT function Aut Security authorization Col Column DB Database GLP GLOP set HIx Hash index Idx Index. For each index, there is a database name, table name, and column name. The ObjectId column is the identifier of the table and the ObjectNum column is the number of the index in that table. For multi-column indexes, there is one row for each column of the index that a query used. For example, if an index consists of three columns and the query uses all three, there will be three rows, each with a different column name. The column name will be null for an index for statements such as COLLECT STATISTICS, ALTER PROCEDURE, SHOW PROCEDURE, or SELECT COUNT(*). JIx Join index. For each join index, there is a database name and join index name in the ObjectTableName field. For these rows, the ColumnName indicates a column referred to by the join index. • ObjectType is ‘JIx.’ • ObjectId matches the ID of the join index. • ObjectNum is 0. Data Dictionary Jrl Journal Mac Macro NoT No type (unknown) SP Stored procedure Sta User-defined STAT function Tab Table TbF Table function Tmp Temporary TbO Table operator TbC Contract function Trg Trigger UDF User-defined function UDM User-defined method 207 Chapter 3: Views Reference QryLogObjectsV Value Description UDT User-defined type Viw View Vol Volatile XSP External stored procedure Possible Values for the TypeOfUse Column Value Description 1 Reference only 2 Access 3 Reference, access 6 Access, conditional 7 Reference, access, conditional 10 Access, inner join 14 Access, conditional, inner join 18 Access, outer join 22 Access, conditional, outer join 30 Access, conditional, inner and outer join 34 Access, sum 38 Access, conditional, sum 46 Access, conditional, sum, inner join 54 Access, conditional, sum, outer join 70 Access, conditional, full outer join 102 Access, conditional, sum, full outer join Example The following SELECT statement retrieves the object information of a query: SELECT QueryID, ObjectDatabaseName (Named ObjDBName), ObjectTableName (Named ObjTblName), ObjectColumnName (Named ObjColName), ObjectID (Named ObjId), ObjectNum (Named ObjNum), ObjectType (Named ObjType), FreqofUse FROM DBC.QryLogObjects where queryid = 201205134619838031; Result: QueryID 208 ObjDBName ObjTblName ObjColName ObjID ObjNum ObjType Freqof Data Dictionary Chapter 3: Views Reference QryLogParamJSON Use -----------------201205134619838031 201205134619838031 201205134619838031 201205134619838031 201205134619838031 201205134619838031 ----------D_PERSONNEL D_PERSONNEL D_PERSONNEL D_PERSONNEL D_PERSONNEL D_PERSONNEL ---------? DEPARTMENT DEPARTMENT DEPARTMENT DEPARTMENT DEPARTMENT ---------? ? DeptNo DeptName EmpCount Loc -------- ------00001604 0 00009005 0 00009005 1,025 00009005 1,026 00009005 1,027 00009005 1,028 -------- -----DB 1 Tab 1 Col 2 Col 1 Col 1 Col 1 QryLogParamJSON Category Query Database DBC View Columns and Source Table.Columns View Column Data Type Format Source Table.Column QueryID DECIMAL(18,0) --Z(17)9 DBQLParamTbl.QueryID NOT NULL RowNum INTEGER --,---,---,--9 (explicit) None ParamJSON JSON X(64000) DBQLParamTbl.ParamInfo NOT NULL Usage Notes This view provides access to parameter and metadata information in Teradata JSON UDT type. This view contains confidential user information and should be accessed only by trusted personnel with access to the restrictive user DBC password. For more information about the user DBC password, see Security Administration. To populate the columns in the QryLogParamJSON view, you must enable the PARAMINFO option in the BEGIN/REPLACE QUERY LOGGING statement. For more information about this option, see SQL Data Definition Language. RowNum This column exists only in the QryLogParamJSON view, which is generated by the TD_SYSFNLIB.TD_DBQLParam table operator function at runtime. For more information about this function, see SQL Functions, Operators, Expressions, and Predicates. Data Dictionary 209 Chapter 3: Views Reference QryLogParamJSON ParamJSON This column is generated by the TD_SYSFNLIB.TD_DBQLParam table operator function at runtime. This column converts the parameter values and metadata logged to the DBC.DBQLParamTbl.ParamInfo table column in Teradata JSON UDT type. For more information about this TD_SYSFNLIB.TD_DBQLParam table operator function, see SQL Functions, Operators, Expressions, and Predicates. For more information about the DBC.DBQLParamTbl.ParamInfo table column, see Database Administration. Example: Select JSON Data from QryLogParamJSON This example assumes the PARAMINFO option is enabled in the BEGIN/REPLACE QUERY LOGGING statement. The SELECT statement selects data from QryLogParamJSON and converts all rows in the DBC.DBQLParamTbl table to a JSON document. Run this query from BTEQ with width set to 500. .width 500; select QueryID, RowNum, ParamJSON from QryLogParamJSON; The query returns the following results: QueryID -------------------307190733539634351 RowNum ----------1 307190733539634351 2 ParamJSON -----------------------------------------------{"QueryID":"307190733539634351","HostCharSet":"127", "ParamInfo":[{"Name":"x","Type":"INTEGER","Size":4,"Position":1}]} {"QueryID":"307190733539634351","Data Record":{"x":"10"}} Example: Select PARMINFO from QryLogParamJSON This example returns the PARMINFO information for each parameter in the JSON document in a row. This returns the name, type, position, and value for each parameter in the parameterized request. select QueryID, RowNum, ParamJSON.ParamInfo from QryLogParamJSON; The query returns the following results: QueryID -------------------307190733539634351 307190733539634351 RowNum ----------1 2 ParamJSON.ParamInfo ---------------------------------------------------[{"Name":"x","Type":"INTEGER","Size":4,"Position":1}] ? Example: Extract JSON Name/Value Pairs from the JSON Document This example selects particular name/value pairs from the JSON document using JSON string syntax. If a row does not have a specific name requested, null is returned. select QueryID, RowNum, ParamJSON."Data Record" from QryLogParamJSON; The query returns the following results: QueryID -------------------307190733539634351 307190733539634351 210 RowNum ----------1 2 ParamJSON.Data Record --------------------------------------------? {"x":"10"} Data Dictionary Chapter 3: Views Reference QryLogParamV Example: Extract Specific JSON Values from the JSON Document This example selects specific values from the JSON name/value pair using JSON string syntax. If a row does not have a specific name requested, null is returned. select QueryID, RowNum, ParamJSON."Data Record".x from QryLogParamJSON; The query returns the following results: QueryID -------------------307190733539634351 307190733539634351 RowNum ----------1 2 ParamJSON.Data Record.x --------------------------------------------? 10 QryLogParamV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column QueryID DECIMAL(18,0) --Z(17)9 DBQLParamTbl.QueryID NOT NULL RowNum INTEGER --,---,---,--9 (explicit) None ParamJSON CLOB X(60000) DBQLParamTbl.ParamInfo NOT NULL Usage Notes This view contains confidential user information and should be accessed only by trusted data personnel with access to the restrictive user DBC password. For more information about the user DBC password, see Security Administration. To populate the columns in the QryLogParamV view, you must enable the PARAMINFO option in the BEGIN/REPLACE QUERY LOGGING PARAMINFO statement. For more information about this option, see SQL Data Definition Language. RowNum Column This column is generated by the TD_SYSFNLIB.TD_DBQLParam table operator function at runtime. For more information about this function, see SQL Functions, Operators, Expressions, and Predicates. Data Dictionary 211 Chapter 3: Views Reference QryLogParamV ParamJSON Column This column is generated by the TD_SYSFNLIB.TD_DBQLParam table operator function at runtime. This column converts the parameter values and metadata logged to the DBC.DBQLParamTbl.ParamInfo table column into JSON format. For more information about this TD_SYSFNLIB.TD_DBQLParam table operator function, see SQL Functions, Operators, Expressions, and Predicates. For more information about the DBC.DBQLParamTbl.ParamInfo table column, see Database Administration. Example This example assumes the PARAMINFO option is enabled in the BEGIN/REPLACE QUERY LOGGING statement. The following SELECT statement converts all rows in the DBC.DBQLParamTbl table to a JSON document: SELECT QueryID, RowNum, ParamJSON from QryLogParam; The query returns the following results: QueryID -------------------307192920408671138 RowNum ----------1 307192920408671138 2 212 ParamJSON --------------------------------------------{"QueryID":"307192920408671138","HostCharSet":"127","ParamInfo": [{"Name":"xABc","Type":"INTEGER","Size":4,"Position":1}, {"Name":"yBflt","Type":"REAL","Size":8,"Position":2}, {"Name":"zCDbl","Type":"REAL","Size":8,"Position":3}, {"Name":"fxStr","Type":"CHAR","Size":20,"Position":4}, {"Name":"varStr","Type":"VARCHAR","Size":25,"Position":5}, {"Name":"fxByte","Type":"BYTE","Size":4,"Position":6}, {"Name":"vrByte","Type":"VARBYTE","Size":25,"Position":7}, {"Name":"nmbr","Type":"NUMBER","Size":18,"Position":8}, {"Name":"dcml","Type":"DECIMAL","Size":8,"Position":9}, {"Name":"dt","Type":"DATE","Size":4,"Position":10}, {"Name":"ts","Type":"CHAR","Size":26,"Position":11}, {"Name":"blb","Type":"BLOB","Size":60,"Position":12}, {"Name":"clb","Type":"CLOB","Size":60,"Position":13}, {"Name":"intrvl","Type":"CHAR","Size":5,"Position":14}, {"Name":"tme","Type":"CHAR","Size":15,"Position":15}]} {"QueryID":"307192920408671138","Data Record":{"xABc":"1","yBflt":"+5.78000000000000E000", "zCDbl":"+9.86700000000000E-001","fxStr":null, "varStr":"Test Var String 01","fxByte":"00005AB1", "vrByte":"5ABCFE6789EFBCAB5EF0","nmbr":"1234.679","dcml ":"54328567.45","dt":"2013/09/10","ts":"2013-09-10 10:41:32.000000","blb":"BAABBCCDDEEFF123456789AABBCCDDEEFF", "clb":"This is a CLOB column string 01","intrvl":" 7859", "tme":"10:56:35.000000"}} Data Dictionary Chapter 3: Views Reference QryLogSQLV QryLogSQLV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLSqlTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLSqlTbl.CollectTimeStamp (Composite NUPI) --Z(17)9 DBQLSqlTbl.QueryID --,---,---,--9 (explicit) DBQLSqlTbl.SqlRowNo X(31000) DBQLSqlTbl.SqlTextInfo NOT NULL CollectTimestamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL SqlRowNo INTEGER NOT NULL SqlTextInfo VARCHAR (31000) UNICODE NOT CASESPECIFIC NOT NULL Usage Notes This view is populated if the SQL is requested for the query in addition to the default information row. If the additional SQL text is greater than 64KB, multiple rows are generated. Possible Values for the SQLTextInfo Column • Unavailable • Null Note: These are conditions where the SQL is not available to DBQL at the end of the query or when a query fails. In this instance, the SqlTextInfo may be Null, or it may be unavailable. The world “unavailable” is seen when it fails to translate correctly, for example, when the SQL is submitted from a mainframe in EBCDIC format or when UNICODE translation is required. Example The following SELECT statement retrieves the SQL text information of a query. Data Dictionary 213 Chapter 3: Views Reference QryLogStepsV SELECT QueryID, SqlRowNo, SqlTextInfo from DBC.QryLogSQL WHERE QueryId=201205134619838024; Result: QueryID SqlRowNo ------------------ --------201205134619838024 1 SqlTextInfo ---------------------------CREATE TABLE table1A, FALLBACK, NO BEFORE JOURNAL, NO AFTER JOURNAL (i INTEGER, i2 INTEGER) PRIMARY INDEX( i ); Note: The SQL text is not edited to remove any blanks; it is stored the same way you entered the text. QryLogStepsV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLStepTbl.ProcID (NUPI) YYYY-MMDDBHH:MI:SS (exp licit) DBQLStepTbl.CollectTimeStamp (NU PI) --Z(17)9 DBQLStepTbl.QueryID ---,--9 (explicit) DBQLStepTbl.StepLev1Num NOT NULL CollectTimestamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL StepLev1Num SMALLINT NOT NULL StepLev2Num SMALLINT ---,--9 (explicit) DBQLStepTbl.StepLev2Num StepName CHAR(6) LATIN X(6) DBQLStepTbl.StepName NOT CASESPECIFIC NOT NULL 214 Data Dictionary Chapter 3: Views Reference QryLogStepsV View Column Data Type Format Referenced Table.Column StepStartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLStepTbl.StepStartTime StepStopTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLStepTbl.StepStopTime ElapsedTime INTERVAL HOUR(4) TO SECOND(6) -h(4):mm:ss.s(6) DBQLStepTbl.StepStartTime, EstProcTime FLOAT ----,---,---,---,-9.999 (explicit) DBQLStepTbl.EstProcTime EstCPUCost FLOAT ZZ,ZZZ,ZZ9.999 (ex plicit) DBQLStepTbl.EstCPUCost CPUtime FLOAT ZZ,ZZZ,ZZ9.999 (ex plicit) DBQLStepTbl.CPUtime IOcount FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.IOcount EstRowCount FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.EstRowCount EstRowCountSkew FLOAT ----,---,---,---,--9 DBQLStepTbl.EstRowCountSkew DBQLStepTbl.StepStopTime (explicit) EstRowCountSkewMatch FLOAT ----,---,---,---,--9 (explicit) DBQLStepTbl.EstRowCountSkew Match RowCount FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.RowCount RowCount2 FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.RowCount2 RowCount3 FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.RowCount3 NumOfActiveAMPs INTEGER --,---,---,-9 (explicit) DBQLStepTbl.NumOfActiveAMPs MaxAmpCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.MaxAmpCPUTime MaxCPUAmpNumber SMALLINT ---,--9 (explicit) DBQLStepTbl.MaxCPUAmpNumber MinAmpCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.MinAmpCPUTime MaxAmpIO FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.MaxAmpIO MaxIOAmpNumber SMALLINT ---,--9 (explicit) DBQLStepTbl.MaxIOAmpNumber MinAmpIO FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.MinAmpIO Data Dictionary 215 Chapter 3: Views Reference QryLogStepsV View Column Data Type Format Referenced Table.Column SpoolUsage FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.SpoolUsage MaxAMPSpool FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.MaxAmpSpool MaxSpoolAmpNumber SMALLINT ---,--9 (explicit) DBQLStepTbl.MaxSpoolAmpNumber MinAMPSpool FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.MinAmpSpool StepWD INTEGER --,---,---,-9 (explicit) DBQLStepTbl.StepWD LSN INTEGER --,---,---,-9 (explicit) DBQLStepTbl.LSN UtilityTableId BYTE(4) X(8) DBQLStepTbl.UtilityTableId RowsWComprColumns FLOAT ----,---,---,---,-9 (explicit) DBQLStepTbl.RowsWComprColumns EstIOCost FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.EstIOCost EstNetCost FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.EstNetCost EstHRCost FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.EstHRCost CPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.CPUTimeNorm MaxAmpCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.MaxAmpCPUTime Norm MaxCPUAmpNumberNorm SMALLINT ---,--9 (explicit) DBQLStepTbl.MaxCPUAmpNumber Norm MinAmpCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLStepTbl.MinAmpCPUTime Norm NumCombinedPartitions BIGINT --,---,---,---,---,---,-9 (explicit) DBQLStepTbl.NumCombined Partitions NumContexts INTEGER --,---,---,-9 (explicit) DBQLStepTbl.NumContexts NumCPReferences INTEGER --,---,---,-9 (explicit) DBQLStepTbl.NumCPReferences StepInstance INTEGER --,---,---,--9 DBQLStepTbl.StepInstance StepStatus CHAR(10) LATIN X(10) DBQLStepTbl.StepStatus DispatchSeq INTEGER --,---,---,--9 DBQLStepTbl.DispatchSeq StatementNum INTEGER --,---,---,--9 DBQLStepTbl.StatementNum TriggerNestLevel SMALLINT --Z(4)9 DBQLStepTbl.TriggerNestLeve 216 Data Dictionary Chapter 3: Views Reference QryLogStepsV View Column Data Type Format Referenced Table.Column TriggerKind VARCHAR(128) LATI N X(128) DBQLStepTbl.TriggerKind NOT CASESPECIFIC FragmentNum INTEGER --,---,---,--9 DBQLStepTbl.FragmentNum IOKB FLOAT ----,---,---,---,-9.999 DBQLStepTbl.IOKB VHLogicalIO FLOAT ----,---,---,---,-9.999 DBQLStepTbl.VHLogicalIO VHPhysIO FLOAT ----,---,---,---,-9.999 DBQLStepTbl.VHPhysIO VHLogicalIOKB FLOAT ----,---,---,---,-9.999 DBQLStepTbl.HLogicalIOKB VHPhysIOKB FLOAT ----,---,---,---,-9.999 DBQLStepTbl.VHPhysIOKB PhysIO FLOAT ----,---,---,---,-9.999 DBQL.StepTbl.VHPhysIO PhysIOKB FLOAT ----,---,---,---,-9.999 DBQLStepTbl.PhysIOKB LockDelay FLOAT ----,---,---,---,-9.999 DBQLStepTbl.LockDelay SSRReceiverCount INTEGER --,---,---,--9 DBQLStepTbl.SSRReceiverCount DMLLoadId INTEGER --,---,---,--9 DBQLStepTbl.DMLLoadId FLOAT ----,---,---,---,--9 DBQLStepTbl.ServerByteCount FLOAT ----,---,---,---,--9 DBQLStepTbl.ExtraField19 Note: This column is reserved for future use. ServerByteCount Note: This column is also documented in the QueryGrid manuals. PersistentSpool Usage Notes If step information of the query is requested, a step table is populated with a row for each step . CPUTimeNorm Column The CPUTimeNorm calculation is made for each PE in the system. It is used for systems with processors where each node may have CPUs with different scaling factors. Data Dictionary 217 Chapter 3: Views Reference QryLogStepsV FragmentNum Column This column is NULL for static plans only. LockDelay Column The maximum wait time to get a lock on an object in centiseconds. The maximum value is 32,767 centiseconds. NumContexts Column If no contexts are allocated, the value of the NumContexts column is NULL. NumCPReferences Column If there are no column partitioning, the value of the NumCPReferences column is NULL. RowCount Column If the row count for a step is 18,446,744,073,709,551,615, the number is logged in the RowCo unt column as 1.8446744073709552e+19. Note: The value formatted as a decimal value is 18,446,744,073,709,551,616 due to float arith metic. ServerByteCount The ServerByteCount column is the total number of bytes sent to or received from a foreign server for each step. Possible Values for the NumCombinedPartitions Column The value of the NumCombinedPartitions column is non-zero only if: • There is static partition elimination for the step (for a query submitted to a Teradata Databa se 14.0 or later). • A source table has column partitions. Otherwise, the NumCombinedPartitions column is NULL. Possible Values for the TriggerKind Column • BegLoop • FetchQualRows • BldUsingRow • GetActvCnt • IdColWithRowTrig • SkipQualRows • EndLoop Example The following SELECT statement retrieves all rows that match the query ID 30719092576202 3013 from the QryLogStepsV view: 218 Data Dictionary Chapter 3: Views Reference QryLogStepsV select * from qrylogstepsv where queryid = 307190925762023013; The query returns the following result: ProcID CollectTimeStamp QueryID StepLev1Num StepLev2Num StepName StepStartTime StepStopTime ElapsedTime EstProcTime EstCPUCost CPUTime IOcount EstRowCount EstRowCountSkew EstRowCountSkewMatch RowCount RowCount2 RowCount3 NumOfActiveAMPs MaxAmpCPUTime MaxCPUAmpNumber MinAmpCPUTime MaxAmpIO MaxIOAmpNumber MinAmpIO SpoolUsage MaxAMPSpool MaxSpoolAmpNumber MinAMPSpool StepWD LSN UtilityTableID RowsWComprColumns EstIOCost EstNetCost EstHRCost CPUtimeNorm MaxAmpCPUTimeNorm MaxCPUAmpNumberNorm MinAmpCPUTimeNorm NumCombinedPartitions NumContexts NumCPReferences StepInstance StepStatus DispatchSeq StatementNum TriggerNestLevel TriggerKind FragmentNum IOKB VHLogicalIO VHPhysIO VHLogicalIOKB Data Dictionary 30719 2014-03-13 07:21:39 307190925762023013 1 0 MLK 2014-03-13 07:21:35.090000 2014-03-13 07:21:35.090000 0:00:00.000000 0.000 0.000 0.008 0 0 0 0 4 0 ? 4 0.004 2 0.000 0 ? 0 0 0 ? 0 ? ? ? 0 0.000 0.000 0.000 0.538 0.269 2 0.000 ? ? ? 1 AMPokay 1 1 0 ? ? 0.000 0.000 0.000 0.000 219 Chapter 3: Views Reference QryLogSummaryV VHPhysIOKB PhysIO PhysIOKB LockDelay SSRReceiverCount DMLLoadID ServerByteCount PersistentSpool 0.000 0.000 0.000 ? ? ? ? 0 QryLogSummaryV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLSummaryTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLSummaryTbl.CollectTimeStamp (Composite NUPI) NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL UserID BYTE(4) X(8) DBQLSummaryTbl.UserID AcctString VARCHAR(128) X(128) DBQLSummaryTbl.AcctString UNICODE NOT CASESPECIFIC LogicalHostID SMALLINT ZZZ9 (explicit) DBQLSummaryTbl.LogicalHostID AppID CHAR(30) X(30) DBQLSummaryTbl.AppID X(30) DBQLSummaryTbl.ClientID X(45) DBQLSummaryTbl.ClientAddr X(8) DBQLSummaryTbl.ProfileID UNICODE NOT CASESPECIFIC ClientID CHAR(30) UNICODE NOT CASESPECIFIC ClientAddr CHAR(45) LATIN NOT CASESPECIFIC ProfileID 220 BYTE(4) Data Dictionary Chapter 3: Views Reference QryLogSummaryV View Column Data Type Format Referenced Table.Column SessionID INTEGER --,---,---,--9 (explicit) DBQLSummaryTbl.SessionID --,---,---,--9 (explicit) DBQLSummaryTbl.QueryCount X(1) DBQLSummaryTbl.ValueType ----,---,---,---,--9.999 (explicit) DBQLSummaryTbl.QuerySeconds ZZZ,ZZZ,999 (explicit) DBQLSummaryTbl.QuerySeconds, NOT NULL QueryCount INTEGER NOT NULL ValueType CHAR(1) LATIN NOT CASESPECIFIC QuerySeconds FLOAT NOT NULL AverageTime FLOAT DBQLSummaryTbl.QueryCount TotalIOCount FLOAT ----,---,---,---,--9 (explicit) DBQLSummaryTbl.TotalIOCount AverageIO FLOAT Z(10) DBQLSummaryTbl.TotalIOCount, DBQLSummaryTbl.QueryCount AMPCPUTime FLOAT ZZZ,ZZZ.999 (explicit) DBQLSummaryTbl.AMPCPUTime AverageAmpCPU FLOAT ZZZ,ZZZ.999 (explicit) DBQLSummaryTbl.AMPCPUTime, ZZZ,ZZZ.999 DBQLSummaryTbl.ParserCPUTime ParserCPUTime FLOAT DBQLSummaryTbl.QueryCount (explicit) AverageParserCPU FLOAT ZZZ,ZZZ.999 DBQLSummaryTbl.ParserCPUTime, (explicit) DBQLSummaryTbl.QueryCount AMPCPUTimeNorm FLOAT ZZZ,ZZZ.999 (explicit) DBQLSummaryTbl.AMPCPUTimeNorm AverageAmpCPUNorm FLOAT ZZZ,ZZZ.999 (explicit) DBQLSummaryTbl.AMPCPUTimeNorm, DBQLSummaryTbl.QueryCount ParserCPUTimeNorm FLOAT ZZZ,ZZZ.999 (explicit) DBQLSummaryTbl.ParserCPUTimeNorm AverageParserCPU Norm FLOAT ZZZ,ZZZ.999 DBQLSummaryTbl.ParserCPUTimeNorm, (explicit) DBQLSummaryTbl.QueryCount LowHist FLOAT ----,---,---,---,--9.999 (explicit) DBQLSummaryTbl.LowHist ----,---,---,---,--9.999 (explicit) DBQLSummaryTbl.HighHist NOT NULL HighHist FLOAT NOT NULL Data Dictionary 221 Chapter 3: Views Reference QryLogTDWMSumV Usage Notes For the summary case, a row exists for each collection if the count of the queries run in that time frame (LowHist to HighHist) is greater than 0. For threshold, one row (with LowHist=TypeofCriterion and HighHist=0) exists for the collection if there were queries shorter than LowHist seconds. Example The following SELECT statement retrieves the summary information of a session (if logging was initiated with “Begin Query Logging limit Summary = 5,10,20 IOcount on all;”): SELECT sessionid, valuetype, querycount, averageio, totaliocount,lowhist FROM Qrylogsummary WHERE sessionid = 1048 or sessionid = 1049 or sessionid = 1050 ORDER BY timestamp, sessionid, lowhist; Result: SessionID --------1,048 1,048 1,048 1,048 1,049 1,050 1,050 ValueType --------I I I I I I I QueryCount AverageIO ---------- ----------31 6 9 15 15 54 65 2 981 1 8 1 24 TotalIOCount -----------4 56 224 3,519 1,962 8 24 LowHist ------0.00 5.00 10.00 20.00 20.00 5.00 20.00 QryLogTDWMSumV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) TDWMSummaryLog.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS TDWMSummaryLog.BufferTS (Composite NUPI) --,---,---,--9 (explicit) TDWMSummaryLog.WDID NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL WDID INTEGER NOT NULL 222 Data Dictionary Chapter 3: Views Reference QryLogTDWMSumV View Column Data Type Format Referenced Table.Column OpEnvID INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.OpEnvID SysConID INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.SysConID StartColTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z (explicit) TDWMSummaryLog.StartColTime --,---,---,--9 (explicit) TDWMSummaryLog.Arrivals --,---,---,--9 (explicit) TDWMSummaryLog.ActiveCount --,---,---,--9 (explicit) TDWMSummaryLog.Completions ZZZZZZ.99 TDWMSummaryLog.MinRespTime ZZZZZZ.99 TDWMSummaryLog.MaxRespTime ZZZZZZ.99 TDWMSummaryLog.AvgRespTime ZZZZZZ.99 TDWMSummaryLog.MinCPUTime ZZZZZZ.99 TDWMSummaryLog.MaxCPUTime ZZZZZZ.99 TDWMSummaryLog.AvgCPUTime --,---,---,--9 (explicit) TDWMSummaryLog.DelayedCount ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgDelayTime --,---,---,--9 (explicit) TDWMSummaryLog.ExceptionAbCount --,---,---,--9 (explicit) TDWMSummaryLog.ExceptionMvCount --,---,---,--9 (explicit) TDWMSummaryLog.ExceptionCoCount NOT NULL Arrivals INTEGER NOT NULL ActiveCount INTEGER NOT NULL Completions INTEGER NOT NULL MinRespTime FLOAT NOT NULL MaxRespTime FLOAT NOT NULL AvgRespTime FLOAT NOT NULL MinCPUTime FLOAT NOT NULL MaxCPUTime FLOAT NOT NULL AvgCPUTime FLOAT NOT NULL DelayedCount INTEGER NOT NULL AvgDelayTime FLOAT NOT NULL ExceptionAbCount INTEGER NOT NULL ExceptionMvCount INTEGER NOT NULL ExceptionCoCount INTEGER NOT NULL Data Dictionary 223 Chapter 3: Views Reference QryLogTDWMSumV View Column Data Type Format Referenced Table.Column ExceptionCount INTEGER -(10)9 TDWMSummaryLog.ExceptionAbCount, TDWMSummaryLog.ExceptionMvCount, TDWMSummaryLog.ExceptionCoCount MetSLGCount INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.MetSLGCount --,---,---,--9 (explicit) TDWMSummaryLog.AbortCount --,---,---,--9 (explicit) TDWMSummaryLog.ErrorCount --,---,---,--9 (explicit) TDWMSummaryLog.RejectedCount NOT NULL AbortCount INTEGER NOT NULL ErrorCount INTEGER NOT NULL RejectedCount INTEGER NOT NULL MovedInCount INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.MovedInCount IntervalDelayCnt INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.IntervalDelayCnt DelayedQueries INTEGER --,---,---,--9 (explicit) TDWMSummaryLog.DelayedQueries OtherCount FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.OtherCount VirtualPartNum INTEGER --,---,---,--9 TDWMSummaryLog.VirtualPartNum AvgIOWaitTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgIOWaitTime MaxIOWaitTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxIOWaitTime AvgOtherWaitTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgOtherWaitTime MaxOtherWaitTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxOtherWaitTime AvgCPURunDelay FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgCPURunDelay MaxCPURunDelay FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxCPURunDelay AvgSeqRespTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgSeqRespTime MaxSeqRespTime FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxSeqRespTime AvgLogicalIO FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgLogicalIO 224 Data Dictionary Chapter 3: Views Reference QryLogTDWMSumV View Column Data Type Format Referenced Table.Column MaxLogicalIO FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxLogicalIO AvgLogicalKBs FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgLogicalKBs MaxLogicalKBs FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxLogicalKBs AvgPhysicalIO FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgPhysicalIO MaxPhysicalIO FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxPhysicalIO AvgPhysicalKBs FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.AvgPhysicalKBs MaxPhysicalKBs FLOAT ----,---,---,---,--9 (explicit) TDWMSummaryLog.MaxPhysicalKBs ThrottleBypassed INTEGER --,---,---,--9 TDWMSummaryLog.ThrottleBypassed Usage Notes This view contains a historical record of WD activity. Abort, Completions, and ErrorCount Columns For these columns, dashboard interval is used for the API data and logging interval is used for logging data to the disk. MetSLGCount Column For this column, queries completing in a WD that do not have a declared Response Time Service Level Goal (SLG) are also counted as meeting the SLG. Example The following SELECT statement retrieves the QryLogTDWMSum view: SELECT * from DBC.QryLogTDWMSum; The query returns the following result: ProcID CollectTimeStamp WDID OpEnvID SysConID StartColTime Arrivals ActiveCount Completions MinRespTime MaxRespTime Data Dictionary 30718 2013-12-16 16:52:33 12 1 1 2013-12-16 16:52:33.130000 4 0 4 .01 .13 225 Chapter 3: Views Reference QryLogTDWMV AvgRespTime MinCPUTime MaxCPUTime AvgCPUTime DelayedCount AvgDelayTime ExceptionAbCount ExceptionMvCount ExceptionCoCount ExceptionCount MetSLGCount AbortCount ErrorCount RejectedCount MovedInCount IntervalDelayCnt DelayedQueries OtherCount VirtualPartNum AvgIOWaitTime MaxIOWaitTime AvgOtherWaitTime MaxOtherWaitTime AvgCPURunDelay MaxCPURunDelay AvgSeqRespTime MaxSeqRespTime AvgLogicalIO MaxLogicalIO AvgLogicalKBs MaxLogicalKBs AvgPhysicalIO MaxPhysicalIO AvgPhysicalKBs MaxPhysicalKBs ThrottleBypassed .05 .27 4.04 1.61 0 0 0 0 0 0 4 0 0 0 0 0 0 0 1 0 0 1 3 0 0 0 0 125 259 5,705 12,640 2 6 62 248 0 QryLogTDWMV Category Query Database DBC 226 Data Dictionary Chapter 3: Views Reference QryLogTDWMV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLogTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLogTbl.CollectTimeStamp (Composite NUPI) --Z(17)9 DBQLogTbl.QueryID X(8) DBQLogTbl.UserID X(128) DBQLogTbl.UserName X(128) DBQLogTbl.DefaultDatabase X(128) DBQLogTbl.AcctString --,---,---,--9 DBQLogTbl.SessionId ZZZ9 DBQLogTbl.LogicalHostId --,---,---,--9 DBQLogTbl.RequestNum NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL UserID BYTE(4) NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC DefaultDatabase VARCHAR(128) UNICODE AcctString VARCHAR(128) UNICODE NOT CASESPECIFIC SessionId INTEGER NOT NULL LogicalHostId SMALLINT NOT NULL RequestNum INTEGER NOT NULL InternalRequestNum INTEGER --,---,---,--9 DBQLogTbl.InternalRequestNum LastStateChange TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLogTbl.LastStateChange DelayTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.DelayTime WDID INTEGER --,---,---,--9 (explicit) DBQLogTbl.WDID OpEnvID INTEGER --,---,---,--9 (explicit) DBQLogTbl.OpEnvID SysConID INTEGER --,---,---,--9 (explicit) DBQLogTbl.SysConID LSN INTEGER --,---,---,--9 (explicit) DBQLogTbl.LSN Data Dictionary 227 Chapter 3: Views Reference QryLogTDWMV View Column Data Type Format Referenced Table.Column NoClassification CHAR(1) LATIN X(1) DBQLogTbl.NoClassification X(1) DBQLogTbl.WDOverride X(1) DBQLogTbl.ResponseTimeMet NOT CASESPECIFIC WDOverride CHAR(1) LATIN NOT CASESPECIFIC ResponseTimeMet CHAR(1) LATIN NOT CASESPECIFIC ExceptionValue INTEGER --,---,---,--9 (explicit) DBQLogTbl.ExceptionValue FinalWDID INTEGER --,---,---,--9 (explicit) DBQLogTbl.FinalWDID TDWMEstMaxRows FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.TDWMEstMaxRows TDWMEstLastRows FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.TDWMEstLastRows TDWMEstTotalTime FLOAT ZZZZ9.999999 DBQLogTbl.TDWMEstTotalTime TDWMEstMemUsage FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.TDWMEstMemoryUsage TDWMAllAmpFlag CHAR(1) LATIN X(1) DBQLogTbl.TDWMAllAmpFlag X(1) DBQLogTbl.TDWMConfLevelUsed NOT CASESPECIFIC TDWMConfLevelUsed CHAR(1) LATIN NOT CASESPECIFIC TDWMRuleID INTEGER --,---,---,--9 DBQLogTbl.TDWMRuleID StatementGroup VARCHAR(128) X(128) DBQLogTbl.StatementGroup --,---,---,--9 DBQLogTbl.SessionWDID UNICODE NOT CASESPECIFIC SessionWDID INTEGER Usage Notes The non-unique primary index for this view is a combination of ProcID and TimeStamp fields. This combination causes each dispatcher to write its DBQL cache entries to a single AMP. This is important for database efficiency. For information about the possible values for the ExceptionValue column, see Appendix A: “View Column Values.” TDWMEstMemUsage Column This column returns the estimated memory (in MB) used to classify a query into a workload definition. 228 Data Dictionary Chapter 3: Views Reference QryLogTDWMV Possible Values for the StatementGroup Column Value Description UCAbort An unconditional abort from the session or Gateway vproc or Teradata Director Program kill between requests. This may reflect the abort of an open transaction. If an UCAbort occurs, the value is zero. AsynchAbort An asynchronous abort from the session or Gateway vproc or Teradata Director Program kill. Note: If the AsynchAbort occurs when the request is in the dispatcher, the StatementGroup column values are the usual values for the request, and an error is generated. Example The following SELECT statement retrieves the QryLogTDWMV view: SELECT * from QryLogTDWMV; The query returns the following result: ProcID 30718 CollectTimeStamp 2013-12-16 16:35:27 QueryID 307188518253277390 UserID 00000104 UserName TEST1 DefaultDatabase TEST1 AcctString SALES SessionID 1,007 LogicalHostID 1 RequestNum 5 InternalRequestNum 5 LastStateChange 2013-12-16 08:50:32.960000 DelayTime ? WDID 12 OpEnvID 1 SysConID 1 LSN ? NoClassification WDOverride ResponseTimeMet ExceptionValue ? FinalWDID 12 TDWMEstMaxRows 1,170,869,760 TDWMEstLastRows 1 TDWMEstTotalTime 2331.764361 TDWMEstMemUsage 4.375 TDWMAllAmpFlag T TDWMConfLevelUsed N TDWMRuleID ? StatementGroup Select SessionWDID 12 Data Dictionary 229 Chapter 3: Views Reference QryLogUtilityV QryLogUtilityV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 DBQLUtilityTbl.ProcID (Composite NUPI) NOT NULL CollectTimeStamp TIMESTAMP(6) DBQLUtilityTbl.CollectTimestamp (Composite NUPI) NOT NULL YYYY-MMDDBHH:MI:SS.S(F)Z UtilityName VARCHAR(30) X(30) DBQLUtilityTbl.UtilityName X(1) DBQLUtilityTbl.FastExportNoSpool X(1) DBQLUtilityTbl.ExtendedMLoad X(1) DBQLUtilityTbl.DSAOperation X(2048) DBQLUtilityTbl.UtilityRequest X(128) DBQLUtilityTbl.JobName UNICODE NOT CASE SPECIFIC FastExportNoSpool CHAR(1) LATIN NOT CASE SPECIFIC ExtendedMLoad CHAR(1) LATIN NOT CASE SPECIFIC DSAOperation CHAR(1) LATIN NOT CASE SPECIFIC UtilityRequest VARCHAR(2048) UNICODE NOT CASE SPECIFIC JobName VARCHAR(128) UNICODE NOT CASE SPECIFIC JobInstanceID INTEGER --,---,---,--9 DBQLUtilityTbl.JobInstanceID LSN INTEGER --,---,---,--9 DBQLUtilityTbl.LSN 230 Data Dictionary Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) DBQLUtilityTbl.UserName --,---,---,--9 DBQLUtilityTbl.SessionID ZZZ9 DBQLUtilityTbl.LogicalHostID YYYY-MMDDBHH:MI:SS DBQLUtilityTbl.LogonDateTime UNICODE NOT CASE SPECIFIC SessionID INTEGER NOT NULL LogicalHostID SMALLINT NOT NULL LogonDateTime TIMESTAMP(6) NOT NULL WDID INTEGER --,---,---,--9 DBQLUtilityTbl.WDID FinalWDID INTEGER --,---,---,--9 DBQLUtilityTbl.FinalWDID SessionWDID INTEGER --,---,---,--9 DBQLUtilityTbl.SessionWDID TDWMRuleID INTEGER --,---,---,--9 DBQLUtilityTbl.TDWMRuleID CPUDecayLevel SMALLINT ---,--9 DBQLUtilityTbl.CPUDecayLevel IODecayLevel SMALLINT ---,--9 DBQLUtilityTbl.IODecayLevel UserID BYTE(4) X(8) DBQLUtilityTbl.UserID X(8) DBQLUtilityTbl.ZoneID X(128) DBQLUtilityTbl.AcctString X(128) DBQLUtilityTbl.ExpandAcctString NOT NULL ZoneID BYTE Note: This column is reserved for future use. NOT NULL AcctString VARCHAR(128) UNICODE NOT CASE SPECIFIC ExpandAcctString VARCHAR(128) UNICODE NOT CASE SPECIFIC AcctStringTime TIME 99:99:99 DBQLUtilityTbl.AcctStringTime AcctStringHour SMALLINT --9 DBQLUtilityTbl.AcctStringHour AcctStringDate DATE YY/MM/DD DBQLUtilityTbl.AcctStringDate LogonSource CHAR(128) LATIN X(128) DBQLUtilityTbl.LogonSource NOT CASE SPECIFIC Data Dictionary 231 Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column AppID CHAR(30) X(30) DBQLUtilityTbl.AppID X(30) DBQLUtilityTbl.ClientID X(45) DBQLUtilityTbl.ClientAddr X(6160) DBQLUtilityTbl.QueryBand UNICODE NOT CASE SPECIFIC ClientID CHAR(30) UNICODE NOT CASE SPECIFIC ClientAddr CHAR(45) LATIN NOT CASE SPECIFIC QueryBand VARCHAR(6160) UNICODE NOT CASE SPECIFIC ProfileID BYTE(4) X(8) DBQLUtilityTbl.ProfileID ProxyUser VARCHAR(128) X(128) DBQLUtilityTbl.ProxyUser X(128) DBQLUtilityTbl.ProxyRole UNICODE NOT CASE SPECIFIC ProxyRole VARCHAR(128) UNICODE NOT CASE SPECIFIC OpEnvID INTEGER --,---,---,--9 DBQLUtilityTbl.OpEnvID SysConID INTEGER --,---,---,--9 DBQLUtilityTbl.SysConID NoClassification CHAR(1) LATIN X(1) DBQLUtilityTbl.NoClassification Note: This column is reserved for future use. NOT CASE SPECIFIC WDOverride CHAR(1) LATIN X(1) DBQLUtilityTbl.WDOverride Note: This column is reserved for future use. NOT CASE SPECIFIC ResponseTimeMet CHAR (1) LATIN X(1) DBQLUtilityTbl.ResponseTimeMet Note: This column is reserved for future use. NOT CASE SPECIFIC DelayTime FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.DelayTime 232 Data Dictionary Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column JobStartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.JobStartTime JobEndTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.JobEndTime RowsInserted FLOAT ----,---,---,---,--9 DBQLUtilityTbl.RowsInserted RowsUpdated FLOAT ----,---,---,---,--9 DBQLUtilityTbl.RowsUpdated RowsDeleted FLOAT ----,---,---,---,--9 DBQLUtilityTbl.RowsDeleted RowsExported FLOAT ----,---,---,---,--9 DBQLUtilityTbl.RowsExported NumSesOrBuildProc SMALLINT ZZZZ9 DBQLUtilityTbl.NumSesOr BuildProc MaxDataWaitTime FLOAT ----,---,---,---,--9 DBQLUtilityTbl.MaxDataWaitTime MaxDataWaitTimeID INTEGER --,---,---,--9 DBQLUtilityTbl.MaxDataWaitTime ID Phase0StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase0StartTime Phase0EndTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase0EndTime Phase0TotalCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase0TotalCPU Time Phase0TotalCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase0TotalCPU TimeNorm Phase0ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase0ParserCPU Time Phase0ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase0ParserCPU TimeNorm Phase0TotalIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase0TotalIO Phase0IOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase0IOKB Phase0PhysIO FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase0PhysIO Phase0PhysIOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase0PhysIOKB Phase1StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase1StartTime Phase1EndTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase1EndTime Phase1TotalCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1TotalCPU Time Phase1TotalCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1TotalCPU TimeNorm Data Dictionary 233 Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column Phase1MaxCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1MaxCPU Time Phase1MaxCPUAmpNumber SMALLINT ---,--9 DBQLUtilityTbl.Phase1MaxCPU AmpNumber Phase1MaxCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQUtilityTbl.Phase1MaxCPU TimeNorm Phase1MaxCPUAmpNumber Norm SMALLINT ---,--9 DBQLUtilityTbl.Phase1MaxCPU AmpNumberNorm Phase1ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1ParserCPU Time Phase1ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1ParserCPU TimeNorm Phase1RSGCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1RSGCPU Time Phase1RSGCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase1RSGCPU TimeNorm Phase1TotalIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1TotalIO Phase1MaxIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1MaxIO Phase1MaxIOAmpNumber SMALLINT ---,--9 DBQLUtilityTbl.Phase1MaxIOAmp Number Phase1IOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase1IOKB Phase1PhysIO FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase1PhysIO Phase1PhysIOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase1PhysIOKB Phase1MaxAWTUsage BYTEINT --9 DBQLUtilityTbl.Phase1MaxAWT Usage Phase1MaxAMPMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1MaxAMP MemoryUsage Phase1MaxRSGMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1MaxRSG MemoryUsage Phase1RowCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1RowCount Phase1BlockCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1BlockCount Phase1ByteCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase1ByteCount Phase2StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase2StartTime Phase2EndTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase2EndTime 234 Data Dictionary Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column Phase2TotalCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2TotalCPU Time Phase2TotalCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2TotalCPU TimeNorm Phase2MaxCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2MaxCPU Time Phase2MaxCPUAmpNumber SMALLINT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2MaxCPU AmpNumber Phase2MaxCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2MaxCPU TimeNorm Phase2MaxCPUAmpNumber Norm SMALLINT ---,--9 DBQLUtilityTbl.Phase2MaxCPU AmpNumberNorm Phase2ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2ParserCPU Time Phase2ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2ParserCPU TimeNorm Phase2RSGCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2RSGCPU Time Phase2RSGCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase2RSGCPU TimeNorm Phase2TotalIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2TotalIO Phase2MaxIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2MaxIO Phase2MaxIOAmpNumber SMALLINT ---,--9 DBQLUtilityTbl.Phase2MaxIOAmp Number Phase2IOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase2IOKB Phase2PhysIO FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase2PhysIO Phase2PhysIOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase2PhysIOKB Phase2MaxAWTUsage BYTEINT --9 DBQLUtilityTbl.Phase2MaxAWT Usage Phase2MaxAMPMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2MaxAMP MemoryUsage Phase2MaxRSGMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2MaxRSG MemoryUsage Phase2RowCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2RowCount Phase2BlockCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2BlockCount Phase2ByteCount FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase2ByteCount Data Dictionary 235 Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column Phase3StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase3StartTime Phase3EndTime TIMESTAMPE(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase3EndTime Phase3TotalCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3TotalCPU Time Phase3TotalCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3TotalCPU TimeNorm Phase3ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3ParserCPU Time Phase3ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3ParserCPU TimeNorm Phase3RSGCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3RSGCPU Time Phase3RSGCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase3RSGCPU TimeNorm Phase3TotalIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase3TotalIO Phase3IOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase3IOKB Phase3PhysIO FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase3PhysIO Phase3PhysIOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase3PhysIOKB Phase3MaxAWTUsage BYTEINT --9 DBQLUtilityTbl.Phase3MaxAWT Usage Phase3MaxAMPMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase3MaxAMP MemoryUsage Phase3MaxRSGMemory Usage FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase3MaxRSG MemoryUsage Phase4StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase4StartTime Phase4EndTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F)Z DBQLUtilityTbl.Phase4EndTime Phase4TotalCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase4TotalCPU Time Phase4TotalCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase4TotalCPU TimeNorm Phase4ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase4ParserCPU Time Phase4ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLUtilityTbl.Phase4ParserCPU TimeNorm 236 Data Dictionary Chapter 3: Views Reference QryLogUtilityV View Column Data Type Format Referenced Table.Column Phase4TotalIO FLOAT ----,---,---,---,--9 DBQLUtilityTbl.Phase4TotalIO Phase4IOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase4IOKB Phase4PhysIO FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase4PhysIO Phase4PhysIOKB FLOAT ----,---,---,---,--9.999 DBQLUtilityTbl.Phase4PhysIOKB Usage Notes Possible Values for the FastExportNoSpool Column Value Description Y No spool mode. N Spool mode for FastExport utilities is used. Possible Values for the ExtendedMLoad Column Value Description Y Extended MultiLoad (MLOADX) protocol is used. N MLOADX protocol is not used. Possible Values for the DSAOperation Column Value Description D SQL DUMP request is issued. R SQL RESTORE request is issued. Examples The following SELECT statement retrieves the start time, end time, and row counts for FastLoad or TPT Load jobs submitted by USER1 since December 1, 2013: SELECT UtilityName, LSN, JobStartTime, JobEndTime, RowsInserted FROM DBC.QryLogUtilityV WHERE UserName = 'USER1' AND (UtilityName = 'FASTLOAD' OR UtilityName = 'TPTLOAD') AND JobStartTime > DATE '2013-12-01' ORDER BY JobStartTime; Result: UtilityName Data Dictionary LSN JobStartTime JobEndTime RowsInserted 237 Chapter 3: Views Reference QryLogV ----------FASTLOAD FASTLOAD TPTLOAD ----47 48 54 ---------------------------2013-12-02 09:19:22.150000 2013-12-02 09:19:24.250000 2013-12-02 10:07:41.700000 ---------------------------2013-12-02 09:30:59.670000 2013-12-02 09:30:44.820000 2013-12-02 10:07:48.940000 ------------100,000 100,000 81,920 Related Topics For information about how the DBQLUtilityTbl table and how it is populated, see Database Administration. QryLogV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 (explicit) DBQLogTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLogTbl.CollectTimestamp (Composite NUPI) --Z(17)9 DBQLogTbl.QueryID X(8) DBQLogTbl.UserID X(128) DBQLogTbl.UserName X(128) DBQLogTbl.DefaultDatabase X(128) DBQLogTbl.AcctString NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL UserID BYTE(4) NOT NULL UserName VARCHAR(128) UNICODE NOT CASESPECIFIC DefaultDatabase VARCHAR(128) UNICODE NOT CASESPECIFIC AcctString VARCHAR(128) UNICODE NOT CASESPECIFIC 238 Data Dictionary Chapter 3: Views Reference QryLogV View Column Data Type Format Referenced Table.Column ExpandAcctString VARCHAR(128) X(128) DBQLogTbl.ExpandAcctString --,---,---,--9 (explicit) DBQLogTbl.SessionID ZZZ9 (explicit) DBQLogTbl.LogicalHostID --,---,---,--9 (explicit) DBQLogTbl.RequestNum --,---,---,--9 DBQLogTbl.InternalRequestNum UNICODE NOT CASESPECIFIC SessionID INTEGER NOT NULL LogicalHostID SMALLINT NOT NULL RequestNum INTEGER NOT NULL InternalRequestNum INTEGER NOT NULL TxnUniq BYTE(4) X(8) DBQLogTbl.TxnUniq LockLevel VARCHAR(10) LATIN X(10) DBQLogTbl.LockLevel YYYY-MMDDBHH:MI:SS DBQLogTbl.LogonDateTime NOT CASE SPECIFIC LogonDateTime TIMESTAMP(6) NOT NULL AcctStringTime TIME 99:99:99 (explicit) DBQLogTbl.AcctStringTime AcctStringHour SMALLINT --9 (explicit) DBQLogTbl.AcctStringHour AcctStringDate DATE YY/MM/DD (explicit) DBQLogTbl.AcctStringDate LogonSource VARCHAR(128) X(128) DBQLogTbl.LogonSource X(30) DBQLogTbl.AppID X(30) DBQLogTbl.ClientID X(45) DBQLogTbl.ClientAddr CHARACTER SET LATIN NOT CASESPECIFIC AppID CHAR(30) UNICODE NOT CASESPECIFIC ClientID CHAR(30) UNICODE NOT CASESPECIFIC ClientAddr CHAR(45) LATIN NOT CASESPECIFIC Data Dictionary 239 Chapter 3: Views Reference QryLogV View Column Data Type Format Referenced Table.Column QueryBand VARCHAR(6160) X(6160) DBQLogTbl.QueryBand UNICODE NOT CASESPECIFIC ProfileID BYTE(4) X(8) DBQLogTbl.ProfileID StartTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLogTbl.StartTime YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLogTbl.FirstStepTime, DBQLogTbl.StartTime NOT NULL FirstStepTime TIMESTAMP(6) NOT NULL FirstRespTime TIMESTAMP(6) YYYY-MMDDBHH:MI:SS.S(F) Z (explicit) DBQLogTbl.FirstRespTime ElapsedTime INTERVAL HOUR(4) TO SECOND(6) -h(2):mm:ss.s(6) DBQLogTbl.FirstRespTime, DBQLogTbl.StartTime NumSteps SMALLINT ---,--9 (explicit) DBQLogTbl.NumSteps NOT NULL NumStepswPar SMALLINT ---,--9 (explicit) DBQLogTbl.NumStepswPar MaxStepsInPar SMALLINT ---,--9 (explicit) DBQLogTbl.MaxStepsInPar NumResultRows FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.NumResultRows TotalIOCount FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.TotalIOCount AMPCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.AMPCPUTime ParserCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ParserCPUTime UtilityByteCount FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.UtilityByteCount UtilityRowCount FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.UtilityRowCount ErrorCode INTEGER --,---,---,--9 (explicit) DBQLogTbl.ErrorCode ErrorText VARCHAR(1024) X(255) DBQLogTbl.ErrorText X(1) DBQLogTbl.WarningOnly UNICODE NOT CASESPECIFIC WarningOnly CHAR(1) LATIN NOT CASESPECIFIC 240 Data Dictionary Chapter 3: Views Reference QryLogV View Column Data Type Format Referenced Table.Column AbortFlag CHAR(1) LATIN X(1) DBQLogTbl.AbortFlag X(1) DBQLogTbl.CacheFlag X(20) DBQLogTbl.StatementType X(20) DBQLogTbl.StatementGroup X(10000) DBQLogTbl.QueryText NOT CASESPECIFIC CacheFlag CHAR(1) LATIN NOT CASESPECIFIC StatementType CHAR(20) LATIN NOT CASESPECIFIC StatementGroup VARCHAR(128) UNICODE QueryText VARCHAR(10000) UNICODE NOT CASESPECIFIC NumOfActiveAMPs INTEGER --,---,---,--9 (explicit) DBQLogTbl.NumOfActiveAMPs MaxAMPCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.MaxAmpCPUTime MaxCPUAmpNumber SMALLINT ---,--9 (explicit) DBQLogTbl.MaxCPUAmpNumber MinAmpCPUTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.MinAmpCPUTime MaxAmpIO FLOAT ----,---,---,---,--9 DBQLogTbl.MaxAmpIO MaxIOAmpNumber SMALLINT ---,--9 (explicit) DBQLogTbl.MaxIOAmpNumber MinAmpIO FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.MinAmpIO SpoolUsage FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.SpoolUsage LSN INTEGER --,---,---,--9 (explicit) DBQLogTbl.LSN EstResultRows FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.EstResultRows EstProcTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.EstProcTime EstMaxRowCount FLOAT ----,---,---,---,--9 (explicit) DBQLogTbl.EstMaxRowCount TDWMEstMemUsage FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.TDWMEstMemory AMPCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.AMPCPUTimeNorm ParserCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ParserCPUTimeNorm MaxAMPCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.MaxAmpCPUTimeNorm MaxCPUAmpNumber Norm SMALLINT ---,--9 DBQLogTbl.MaxCPUAmpNumberNorm Data Dictionary 241 Chapter 3: Views Reference QryLogV View Column Data Type Format Referenced Table.Column MinAmpCPUTimeNorm FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.MinAmpCPUTimeNorm ParserExpReq FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ParserExpReq ProxyUser VARCHAR(128) X(128) DBQLogTbl.ProxyUser X(128) DBQLogTbl.ProxyRole X(1024) DBQLogTbl.SessionTemporalQualifier X(128) DBQLogTbl.CalendarName UNICODE NOT CASESPECIFIC ProxyRole VARCHAR(128) UNICODE NOT CASESPECIFIC SessionTemporalQualifier VARCHAR(1024) LATIN NOT CASESPECIFIC CalendarName VARCHAR(128) UNICODE NOT NULL CPUDecayLevel SMALLINT ---,--9 (explicit) DBQLogTbl.CPUDecayLevel IODecayLevel SMALLINT ---,--9 (explicit) DBQLogTbl.IODecayLevel TacticalCPUException INTEGER --,---,---,--9 DBQLogTbl.TacticalCPUException TacticalIOException INTEGER --,---,---,--9 DBQLogTbl.TacticalIOException SeqRespTime FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.SeqRespTime ReqIOKB FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ReqIOKB ReqPhysIO FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ReqPhysIO ReqPhysIOKB FLOAT ZZ,ZZZ,ZZ9.999 DBQLogTbl.ReqPhysIOKB DataCollectAlg BYTEINT --Z(2)9 DBQLogTbl.DataCollectAlg CallNestingLevel BYTEINT --Z(2)9 DBQLogTbl.CallNestingLevel NumRequestCtx BYTEINT --Z(2)9 DBQLogTbl.NumRequestCtx KeepFlag CHAR(1) X(1) DBQLogTbl.KeepFlag X(1) DBQLogTbl.QueryRedriven X(10) DBQLogTbl.ReDriveKind YYYY-MMDDBHH:MI:SS.S(F) Z DBQLogTbl.LastResponseTime UNICODE QueryRedriven CHAR(1) UNICODE ReDriveKind CHAR(10) UNICODE LastRespTime 242 TIMESTAMP(6) Data Dictionary Chapter 3: Views Reference QryLogV View Column Data Type Format Referenced Table.Column DisCPUTime FLOAT ----,---,---,---,--9.999 DBQLogTbl.DisCPUTime Statements INTEGER --,---,---,--9 DBQLogTbl.Statements DisCPUTimeNorm FLOAT ----,---,---,---,--9.999 DBQLogTbl.DisCPUTimeNorm TxnMode CHAR(10) LATIN X(10) DBQLogTbl.TxnMode RequestMode CHAR(5) LATIN X(5) DBQLogTbl.RequestMode DBQLStatus INTEGER --,---,---,--9 DBQLogTbl.DBQLStatus NumFragments INTEGER --,---,---,--9 DBQLogTbl.NumFragments VHLogicalIO FLOAT ----,---,---,---,--9.999 DBQLogTbl.VHLogicalIO VHPhysIO FLOAT ----,---,---,---,--9.999 DBQLogTbl.VHPhysIO VHLogicalIOKB FLOAT ----,---,---,---,--9.999 DBQLogTbl.VHLogicalIOKB VHPhysIOKB FLOAT ----,---,---,---,--9.999 DBQLogTbl.VHPhysIOKB LockDelay FLOAT ----,---,---,---,--9.999 DBQLogTbl.LockDelay CheckpointNum FLOAT ----,---,---,---,--9 DBQLogTbl.CheckpointNum FLOAT ----,---,---,---,--9 DBQLogTbl.UnityTime UtilityInfoAvailable CHAR(1) X(1) DBQLogTbl.UtilityInfoAvailable UnitySQL CHAR(1) X(1) DBQLogTbl.UnitySQL ThrottleBypassed CHAR(1) X(1) DBQLogTbl.ThrottleBypassed IterationCount INTEGER --,---,---,--9 DBQLogTbl.IterationCount TTGranularity VARCHAR(30) X(30) DBQLogTbl.TTGranularity Note: This column is reserved for future use. UnityTime Note: This column is reserved for future use. Note: This column is reserved for future use. UNICODE NOT CASE SPECIFIC NOT NULL MaxStepMemory FLOAT ----,---,---,---,--9.999 DBQLogTbl.MaxStepMemory TotalServerByteCount FLOAT ----,---,---,---,--9 DBQLogTbl.TotalServerByteCount FLOAT ----,---,---,---,--9 DBQLogTbl.ExtraField20 Note: This column is also documented in the QueryGrid manuals. PersistentSpool Data Dictionary 243 Chapter 3: Views Reference QryLogV Usage Notes The LogonSource column is deprecated and will be replaced in a future release. For information about the LogonSource fields, see Appendix B: “LogonSource Column Fields and Examples.” The DBQLogTbl.ExtraFieldXX columns (where XX represents the number of the column) are reserved for future use. These fields will be converted to a column name in a future release. IterationCount Column This column logs the iteration count for the data parcel associated with a request. This value is NULL for requests with a single using data row and no using data row. NumFragments Column This column is NULL for static plans only. SessionTemporalQualifier Column When a DML or SELECT request refers to a temporal table but omits a temporal qualifier, the system uses the value of the session temporal qualifier. This is the session temporal qualifier in effect when the query is logged. For example, this column uses the ANSIQUALIFIER value if the session temporal qualifier is set to ANSIQUALIFIER for ANSI temporal tables. For more information about the session temporal qualifiers, see Temporal Table Support and ANSI Temporal Table Support. TDWMEstMemUsage Column This column returns the estimated memory (in MB) used to classify a query into a workload definition. TotalServerByteCount The TotalServerByteCount column is the total number of bytes read from or sent to foreign servers involved in the request. Possible Values for the CacheFlag Column 244 Value Description T Query is found in step cache. S Query is a parameterized query and a specific plan is generated. G Query is parameterized query and a generic plan is generated. A Query is a parameterized query and a specific always decision is taken. That is, each time a query is submitted using values are peeked at and the query is parsed. Data Dictionary Chapter 3: Views Reference QryLogV Possible Values for the CPUDecayLevel Column • 0 • 1 • 2 Possible Values for the IODecayLevel Column • 0 • 1 • 2 Possible Values for the LockLevel Column • NOLOCK • ACCESS • READ • WRITE • EXCLUSIVE • UNKNOWN Possible Values for the NumResultRows Column For an Enhanced Statement Status (ESS) client, the value 18,446,744,073,709,551,615 could mean that number or higher. Note: The value formatted as a decimal value is 18,446,744,073,709,551,616 due to float arithmetic. For a non-ESS client, a warning message is returned if the actual activity count exceeds 4294967295. The same value (modulo 2^32) is logged in the NumResultRows column. The value 4294967295 along with the warning message indicates the actual counter is one of the following: 1 A multiple of 4294967296 minus 1. 2 Is equal to 18,446,744,073,709,551,615. 3 Is greater than 18,446,744,073,709,551,615. The maximum internal counter is 18,446,744,073,709,551,615. The value 4294967295 or less, without the warning message, is the actual row count. Data Dictionary 245 Chapter 3: Views Reference QryLogV Possible Values for the QueryText Column Value Description Unavailable and the RequestNum column value is zero. An unconditional abort (UCAbort) from the session or Gateway vproc or Teradata Director Program kill between requests. This may reflect the abort of an open transaction. * SQL query An asynchronous abort (AsynchAbort) from the session or Gateway vproc or Teradata Director Program kill naming a specific request number. If the abort occurs when the request in the dispatcher, the StatementType column and StatementGroup column values are the usual values for the request, and the error code indicates that the request was aborted. Possible Values for the QueryRedriven Column Value Description E The request was re-parsed due to an internal Parser error. M The request was re-parsed due to an internal Parser memory limit. R The request was re-driven due to a database restart. N The request was not redriven or re-parsed. Possible Values for the RedriveKind Column Value Description '' Not participating. MN Memory nonfallback responses. Possible Values for the RequestNum, StatementGroup, and StatementType Columns 246 Value Description UCAbort An unconditional abort from the session or Gateway vproc or Teradata Director Program kill between requests. This may reflect the abort of an open transaction. If an UCAbort occurs, the value is zero. Data Dictionary Chapter 3: Views Reference QryLogV Value Description AsynchAbort An asynchronous abort from the session or Gateway vproc or Teradata Director Program kill. Note: If AsynchAbort occurs, the value is the normal client request number. If the AsynchAbort occurs when the request is in the dispatcher, the StatementType and StatementGroup column values are the usual values for the request, and an error is generated. Possible Values for the ThrottleBypassed Column Value Description 1 ThrottleBypass ruleset attribute is set. 0 ThrottleBypass ruleset attribute is not set. Possible Values for the TTGranularity Column Value Description LOGICALROW Row is timestamped with the time the row is processed by the AMP. REQUEST Row is timestamped with the time the request is submitted. TRANSACTION Row is timestamped with the time when the first non-locking reference is made to a temporal table, or when the built-in function TEMPORAL_TIMESTAMP is first accessed during the transaction. Possible Values for the UtilityInfoAvailable Column Value Description Y SQL request has utility information (for example, from DSA or the control SQL session of a load or export utility) logged in the DBQLUtilityTbl table. N SQL request does not have utility information logged in the DBQLUtilityTbl table. Examples Example 1 The following SELECT statement retrieves all rows that match the query ID 30719092576202 3013 from the QryLogV view: select * from qrylogv where queryid = 307190925762023013; The query returns the following result: Data Dictionary 247 Chapter 3: Views Reference QryLogV ProcID 30719 CollectTimeStamp 2014-03-13 07:21:13 QueryID 307190925762023013 UserID 00000100 UserName DBC DefaultDatabase DBC AcctString DBC ExpandAcctString DBC SessionID 1,000 LogicalHostID 1 RequestNum 15 InternalRequestNum 15 TxnUniq ? LockLevel ? LogonDateTime 2014-03-13 07:21:16 AcctStringTime ? AcctStringHour ? AcctStringDate ? LogonSource (TCP/ IP) d565 153.64.138.47 SDLL8125 4652 CH151001 BTEQ 01 LSS AppID BTEQ ClientID CH151001 ClientAddr 153.64.138.47 QueryBand ? ProfileID ? StartTime 2014-03-13 07:21:34.910000 FirstStepTime 2014-03-13 07:21:35.090000 FirstRespTime 2014-03-13 07:21:35.140000 ElapsedTime 0:00:00.230000 NumSteps 7 NumStepswPar 1 MaxStepsInPar 2 NumResultRows 5 TotalIOCount 819 AMPCPUTime 0.068 ParserCPUTime 0.128 UtilityByteCount ? UtilityRowCount ? ErrorCode 0 ErrorText ? WarningOnly AbortFlag CacheFlag StatementType Select StatementGroup Select QueryText sel databasename, tablename,tablekind from dbc .tables sample 5; NumOfActiveAMPs 4 MaxAMPCPUTime 0.028 MaxCPUAmpNumber 2 MinAmpCPUTime 0.008 MaxAmpIO 209 MaxIOAmpNumber 0 MinAmpIO 200 SpoolUsage 266,240 LSN ? EstResultRows 5 EstProcTime 0.551 EstMaxRowCount 1,795 248 Data Dictionary Chapter 3: Views Reference QryLogV TDWMEstMemUsage AMPCPUTimeNorm ParserCPUTimeNorm MaxAMPCPUTimeNorm MaxCPUAmpNumberNorm MinAmpCPUTimeNorm ParserExpReq ProxyUser ProxyRole SessionTemporalQualifier CalendarName CPUDecayLevel IODecayLevel TacticalCPUException TacticalIOException SeqRespTime ReqIOKB ReqPhysIO ReqPhysIOKB DataCollectAlg CallNestingLevel NumRequestCtx KeepFlag QueryRedriven ReDriveKind LastRespTime DisCPUTime Statements DisCPUTimeNorm TxnMode RequestMode DBQLStatus NumFragments VHLogicalIO VHPhysIO VHLogicalIOKB VHPhysIOKB LockDelay CheckpointNum UnityTime UtilityInfoAvailable UnitySQL ThrottleBypassed IterationCount TTGranularity MaxStepMemory TotalServerByteCount PersistentSpool 0.000 4.573 8.608 1.883 2 0.538 0.038 ? ? ? TERADATA ? ? ? ? ? 36,058.000 3.000 3.000 3 0 1 N N ? 2014-03-13 07:21:35.140000 0.000 1 0.000 BTET Exec 2 ? 0.000 0.000 0.000 0.000 ? ? ? N ? ? ? LogicalRow 0.375 0 0 Example 2 This example shows you how to track data volume for specific load jobs: SELECT UtilityByteCount,UtilityRowCount from DBC.DBQLogTbl where Utility ByteCount is not NULL or UtilityRowCount is not NULL; Result: UtilityByteCount ----------------- Data Dictionary UtilityRowCount --------------- 249 Chapter 3: Views Reference QryLogXMLV 431 52 25 1 QryLogXMLV Category Query Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ProcID DECIMAL(5,0) -(5)9 DBQLXMLTbl.ProcID (Composite NUPI) YYYY-MMDDBHH:MI:SS DBQLXMLTbl.CollectTimeStamp (Composite NUPI) --Z(17)9 DBQLXMLTbl.QueryID --,---,---,--9 DBQLXMLTbl.XMLRowNo X(31000) DBQLXMLTbl.XMLTextInfo NOT NULL CollectTimeStamp TIMESTAMP(6) NOT NULL QueryID DECIMAL(18,0) NOT NULL XMLRowNo INTEGER NOT NULL XMLTextInfo VARCHAR(31000) UNICODE NOT CASESPECIFIC NOT NULL XMLDocType INTEGER --,---,---,--9 DBQLXMLTbl.XMLDocType XMLPlanEnabled VARCHAR(1) X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType UNICODE StatsUsageEnabled VARCHAR(1) UNICODE VerboseEnabled VARCHAR(1) UNICODE DetailedStatsEnabled VARCHAR(1) UNICODE 250 Data Dictionary Chapter 3: Views Reference QryLogXMLV View Column Data Type Format Referenced Table.Column HasXMLPlanData VARCHAR(1) X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType X(1) DBQLXMLTbl.XMLDocType UNICODE HasStatsUsageData VARCHAR(1) UNICODE HasVerboseData VARCHAR(1) UNICODE HasDetailedStatsData VARCHAR(1) UNICODE Usage Notes Possible Values for the HasXMLPlanData, HasStatsUsageData, HasVerboseData, and HasDetailedStatsData Columns For these columns, a value of Y or N can be specified. If you specify Y, the data is contained in the XMLTextInfo column on behalf of the specific logging [Option], where Option represents the STATSUSAGE or XMLPlan. Possible Values for the XMLDocType Column Note: Teradata recommends that you use the Has[Option]Data and [Option]Enabled columns rather than the XMLDocType column directly, where Option represents the STATSUSAGE or XMLPLan. Queries against these columns allow you to specify a Y or N value rather than bit mapped values. For more information about these columns, see “Possible Values for the HasXMLPlanData, HasStatsUsageData, HasVerboseData, and HasDetailedStatsData Columns” or “Possible Values for the XMLPlanEnabled, StatsUsageEnabled, VerboseEnabled, and DetailedStatsEnabled Columns” on page 251. Possible Values for the XMLPlanEnabled, StatsUsageEnabled, VerboseEnabled, and DetailedStatsEnabled Columns For these columns, a value of Y or N can be specified. If you specify Y, the [Option], where Option represents the STATSUSAGE or XMLPlan, was enabled when the data in XMLTextInfo was logged. Examples Example 1 This example shows how to extract query plan information from the DBC.QryLogXMLV view. SELECT cast(t.result_value as char(30)) as "ColumnName" FROM (SELECT QueryID, XMLTextInfo FROM DBC.QryLogXMLV WHERE QueryID = 163833139835340224) as x(QueryID, XMLTextInfo), Data Dictionary 251 Chapter 3: Views Reference RCC_ConfigurationV[X] table( sysxml.xmlextractvalues(cast(x.QueryID as varchar(18)), x.XMLTextinfo, null, '//Field[@JoinAccessFrequency>0]/@Name')) as t ORDER BY 1; Result: ColumnName -----------------------------a1 b1 Example 2 The following SELECT statement retrieves all documents that have statistics recommendations: SELECT xmltextinfo FROM dbc.QryLogXMLV WHERE HasStatsUsageData = 'Y'; Example 3 The following SELECT statement retrieves the number of queries where the STATUSAGE option was enabled but had no statistics recommendations: SELECT Count(*) FROM dbc.QryLogXMLV WHERE StatsUsageEnabled = 'Y' AND HasStatsUsageData = 'N'; Example 4 The following SELECT statement retrieves all documents with the DETAILED sub-option enabled: SELECT xmltextinfo FROM dbc.QryLogXMLV WHERE DetailedStatsEnabled = 'Y'; Example 5 The following SELECT statement retrieves the number of queries where the DETAILED suboption was enabled but had no detailed statistics information: SELECT Count(*) FROM dbc.QryLogXMLV WHERE DetailedStatsEnabled = 'Y' AND HasDetailedStatsData = 'N'; Related Topics For more information about the DBQL logging options, see Database Administration. RCC_ConfigurationV[X] Category Operations Database DBC 252 Data Dictionary Chapter 3: Views Reference RCC_ConfigurationV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column EventNum INTEGER --,---,---,--9 (explicit) RCConfiguration.EventNum (NUPI) NOT NULL LogProcessor SMALLINT -(5)9 RCConfiguration.LogProcessor PhyProcessor SMALLINT ZZZZ9 (explicit) RCConfiguration.PhyProcessor Vproc SMALLINT -(5)9 RCConfiguration.Vproc ProcessorState CHAR(1) LATIN X(1) RCConfiguration.ProcessorState ---,--9 (explicit) RCConfiguration.RestartSeqNum NOT CASESPECIFIC NOT NULL RestartSeqNum SMALLINT The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RCEvent • DBC.RoleGrants • DBC.Roles Example The following SELECT statement selects event and processor information from the RCC_Configuration view: ==> SELECT EventNum, LogProcessor, PhyProcessor FROM RCC_Configuration; Result: EventNum -------21 75 88 . . 21 75 . . Data Dictionary LogProcessor -----------1 1 1 . . 2 2 . . PhyProcessor -----------1-0 1-0 1-0 . . 1-2 1-2 . . 253 Chapter 3: Views Reference RCC_MediaV[X] RCC_MediaV[X] Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column EventNum INTEGER --,---,---,--9 RCMedia.EventNumber X(6) RCMedia.VolSerialId NOT NULL VolSerialId CHAR(6) LATIN NOT NULL VolSequenceNum SMALLINT ---,--9 RCMedia.VolSequenceNum DupeDumpSet CHAR(1) LATIN X(1) RCMedia.DupeDumpSet NOT NULL Example The following SELECT statement selects all rows and all columns from the RCC_Media view: ==> SELECT * FROM DBC.RCC_Media; Result: 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 . . ReconfigDeleteOrderV Category Operations 254 Data Dictionary Chapter 3: Views Reference ReconfigDeleteOrderV Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column OrderNumber INTEGER ZZZZZZZZZ9 ReconfigDeleteOrderTbl.OrderNumber (UPI) X(128) ReconfigDeleteOrderTbl.DatabaseName (NUPI) X(128) ReconfigDeleteOrderTbl.TableName (NUPI) BYTEINT ZZ9 ReconfigDeleteOrderTbl.CheckTableOption CHAR(1) LATIN X(1) ReconfigDeleteOrderTbl.ProcessOffline NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CheckTableOption Note: This column is reserved for future use. ProcessOffline UPPERCASE NOT CASESPECIFIC NOT NULL Usage Notes This view provides the users a way to access the ReconfigDeleteOrderTbl. Users with the appropriate privileges can SELECT, INSERT, UPDATE, or DELETE on the base table using the view. Note that only SELECT, INSERT, UPDATE, and/or DELETE should be granted to users by user DBC. Possible Values for the ProcessOffline Column Note: For the ProcessOffline column, tables undergoing large-scale changes should not be processed during online redistribution. Flag these tables for offline redistribution by setting this field to Y. Data Dictionary Value Description Y Table should be processed (deleted or redistributed) offline during the offline portion of the Reconfig deletion or redistribution phase. 255 Chapter 3: Views Reference ReconfigInfoV Value Description N Table should be processed (deleted or redistributed) online during the online of the Reconfig deletion or redistribution phase. (This is the default.) OrderNumber Column The OrderNumber column allows gaps in the set of user-defined values (for example, you can have a set of 10 values that include 1, 2, 3, 5, 7, 8, 9, 12, 13, and 18). Related Topics For more information about the reconfiguration process and the Reconfig utility, see Support Utilities. ReconfigInfoV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ReconfigId INTEGER ZZZZZZZZZ9 ReconfigInfoTbl.ReconfigId (UPI) X(512) ReconfigInfoTbl.Description ZZ9 ReconfigInfoTbl.ReconfigType YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginTimeStamp NOT NULL Description VARCHAR(512) UNICODE NOT CASESPECIFIC ReconfigType BYTEINT NOT NULL BeginTimeStamp TIMESTAMP(0) NOT NULL EndTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndTimeStamp BeginRedistTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginRedistTime Stamp 256 Data Dictionary Chapter 3: Views Reference ReconfigInfoV View Column Data Type Format Referenced Table.Column EndRedistTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndRedistTime Stamp BeginDelTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginDelTimeStamp EndDelTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndDelTimeStamp Status CHAR(10) LATIN X(10) ReconfigInfoTbl.Status ----,---,---,---,--9 ReconfigInfoTbl.CurrByteCount ----,---,---,---,--9 ReconfigInfoTbl.CurrTabRedistCount ----,---,---,---,--9 ReconfigInfoTbl.CurrTabDeleteCount ----,---,---,---,--9 ReconfigInfoTbl.EstRemainRedistSecs ----,---,---,---,--9 ReconfigInfoTbl.EstRemainDeleteSecs NOT CASESPECIFIC NOT NULL CurrByteCount FLOAT NOT NULL CurrTabRedistCount FLOAT NOT NULL CurrTabDeleteCount FLOAT NOT NULL EstRemainRedistSecs FLOAT NOT NULL EstRemainDeleteSecs FLOAT NOT NULL AddAmpCount SMALLINT ZZZZ9 ReconfigInfoTbl.AddAmpCount DelAmpCount SMALLINT ZZZZ9 ReconfigInfoTbl.DelAmpCount MovAmpCount SMALLINT ZZZZ9 ReconfigInfoTbl.MovAmpCount ModAmpCount SMALLINT ZZZZ9 ReconfigInfoTbl.ModAmpCount NodeCount SMALLINT ZZZZ9 ReconfigInfoTbl.NodeCount ZZZZ9 ReconfigInfoTbl.TotTaskCount ZZZZZZZZZ9 ReconfigInfoTbl.TotTableCount ----,---,---,---,--9 ReconfigInfoTbl.TotByteCount ----,---,---,---,--9 ReconfigInfoTbl.TotCatchUpByte Count NOT NULL TotTaskCount SMALLINT NOT NULL TotTableCount INTEGER NOT NULL TotByteCount FLOAT NOT NULL TotCatchUpByteCount FLOAT NOT NULL Data Dictionary 257 Chapter 3: Views Reference ReconfigInfoV View Column Data Type Format Referenced Table.Column TotJournalByteCount FLOAT ----,---,---,---,--9 ReconfigInfoTbl.TotJournalByteCount ----,---,---,---,--9 ReconfigInfoTbl.ActualRedistSecs ----,---,---,---,--9 ReconfigInfoTbl.ActualDeleteSecs ----,---,---,---,--9 ReconfigInfoTbl.EstRedistSecs ----,---,---,---,--9 ReconfigInfoTbl.EstDeleteSecs NOT NULL ActualRedistSecs FLOAT NOT NULL ActualDeleteSecs FLOAT NOT NULL EstRedistSecs FLOAT NOT NULL EstDeleteSecs FLOAT NOT NULL BeginCalcHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginCalcHBTime Stamp EndCalcHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndCalcHBTime Stamp BeginWrSpaceTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrSpaceTime Stamp EndWrSpaceTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrSpaceTime Stamp BeginPHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginPHBNewTime Stamp EndPHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndPHBNewTime Stamp BeginFBHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginFBHBNewTime Stamp EndFBHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndFBHBNewTime Stamp BeginWrPHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrPHBTime Stamp EndWrPHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrPHBTime Stamp BeginWrFBHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrFBHBTime Stamp EndWrFBHBTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrFBHBTime Stamp BeginWrCfgTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrCfgTime Stamp 258 Data Dictionary Chapter 3: Views Reference ReconfigInfoV View Column Data Type Format Referenced Table.Column EndWrCfgTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrCfgTimeStamp BeginWrCfgNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrCfgNewTime Stamp EndWrCfgNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrCfgNewTime Stamp BeginWrBkupIdTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrBkupIdTime Stamp EndWrBkupIdTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrBkupIdTime Stamp BeginWrBMTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginWrBMTime Stamp EndWrBMTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndWrBMTimeStamp BeginDelHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginDelHBNewTime Stamp EndDelHBNewTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndDelHBNewTimeS tamp BeginVProcCfgTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.BeginVProcCfgTime Stamp EndVProcCfgTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigInfoTbl.EndVProcCfgTime Stamp Usage Notes This view provides the end user a way to access the ReconfigInfoTbl. Users with the appropriate privileges can SELECT or DELETE from the base table using the view. Note: Only SELECT and/or DELETE privileges should be granted to users by user DBC. Possible Values for the ReconfigType Column Value Description 1 Online Reconfig 2 Offline Reconfig Possible Values for the Status Column Data Dictionary • Start • Redist • Delete 259 Chapter 3: Views Reference ReconfigRedistOrderV • Checktable • Abort • Idle • Pause • Offline • Complete • RedistFail • DeleteFail • RcoFail ReconfigRedistOrderV Category Operations Database DBC View Columns and Referenced Table.Columns View Name Data Type Format Referenced Table.Column OrderNumber INTEGER ZZZZZZZZZ9 ReconfigRedistOrderTbl.OrderNumber (UPI) X(128) ReconfigRedistOrderTbl.DatabaseName (USI) X(128) ReconfigRedistOrderTbl.TableName (Composite USI) X(1) ReconfigRedistOrderTbl.ProcessOffline NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ProcessOffline CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL 260 Data Dictionary Chapter 3: Views Reference ReconfigTableStatsV Usage Notes The ReconfigRedistOrderV view provides the end user a way to access the ReconfigRedistOrderTbl. Users with the appropriate privileges can SELECT, INSERT, UPDATE, or DELETE on the base table via the view. Note: Only SELECT, INSERT, UPDATE, and/or DELETE should be granted to users by user DBC. Possible Values for the ProcessOffline Column Note: For the ProcessOffline column, tables undergoing large-scale changes should not be processed during online redistribution. Flag these tables for offline redistribution by setting this field to Y. Value Description Y Table should be processed (deleted or redistributed) offline during the offline portion of the Reconfig deletion or redistribution phase. N Table should be processed (deleted or redistributed) online during the online of the Reconfig deletion or redistribution phase. (This is the default.) ReconfigTableStatsV Category Optimizer Statistics Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ReconfigId INTEGER ZZZZZZZZZ9 ReconfigTableStatsTbl.ReconfigId (Composite UPI) X(1) ReconfigTableStatsTbl.Phase (Composite UPI) X(12) ReconfigTableStatsTbl.TableId NOT NULL Phase CHAR(1) LATIN NOT CASESPECIFIC NOT NULL TableId BYTE(6) NOT NULL Data Dictionary 261 Chapter 3: Views Reference ReconfigTableStatsV View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) ReconfigTableStatsTbl.DatabaseName (UPI) X(128) ReconfigTableStatsTbl.TableName (UPI) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Status BYTEINT ZZ9 ReconfigTableStatsTbl.Status BeginTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigTableStatsTbl.BeginTimeStamp EndTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReconfigTableStatsTbl.EndTimeStamp TotRowCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.TotRowCount ----,---,---,---,--9 ReconfigTableStatsTbl.TotByteCount ----,---,---,---,--9 ReconfigTableStatsTbl.TotCPUSecs ----,---,---,---,--9 ReconfigTableStatsTbl.TotIOCount ----,---,---,---,--9 ReconfigTableStatsTbl.LowRowCount NOT NULL TotByteCount FLOAT NOT NULL TotCPUSecs FLOAT NOT NULL TotIOCount FLOAT NOT NULL LowRowCount FLOAT NOT NULL LowRowCountAmp SMALLINT ZZZZ9 ReconfigTableStatsTbl.LowRowCountAmp HighRowCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.HighRowCount NOT NULL HighRowCountAmp SMALLINT ZZZZ9 ReconfigTableStatsTbl.HighRowCountAmp LowByteCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.LowByteCount NOT NULL LowByteCountAmp SMALLINT ZZZZ9 ReconfigTableStatsTbl.LowByteCountAmp HighByteCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.HighByteCount ZZZZ9 ReconfigTableStatsTbl.HighByteCountAmp NOT NULL HighByteCountAmp 262 SMALLINT Data Dictionary Chapter 3: Views Reference ReconfigTableStatsV View Column Data Type Format Referenced Table.Column LowCPUSecsCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.LowCPUSecsCount NOT NULL LowCPUSecsCount Amp SMALLINT ZZZZ9 ReconfigTableStatsTbl.LowCPUSecsCount Amp HighCPUSecsCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.HighCPUSecsCount NOT NULL HighCPUSecsCount Amp SMALLINT ZZZZ9 ReconfigTableStatsTbl.HighCPUSecsCount Amp LowIOCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.LowIOCount NOT NULL LowIOCountAmp SMALLINT ZZZZ9 ReconfigTableStatsTbl.LowIOCountAmp HighIOCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.HighIOCount NOT NULL HighIOCountAmp SMALLINT ZZZZ9 ReconfigTableStatsTbl.HighIOCountAmp NUSICount SMALLINT ZZZZ9 ReconfigTableStatsTbl.NUSICount X(1) ReconfigTableStatsTbl.FallBackFlag ZZZZZZZZZ9 ReconfigTableStatsTbl.DBlockSize X(1) ReconfigTableStatsTbl.SortFlag ----,---,---,---,--9 ReconfigTableStatsTbl.ActualRedistSecs ----,---,---,---,--9 ReconfigTableStatsTbl.ActualDeleteSecs ----,---,---,---,--9 ReconfigTableStatsTbl.EstRedistSecs ----,---,---,---,--9 ReconfigTableStatsTbl.EstDeleteSecs ----,---,---,---,--9 ReconfigTableStatsTbl.FSGIOCount NOT NULL FallBackFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL DBlockSize INTEGER NOT NULL SortFlag CHAR(1) NOT NULL ActualRedistSecs FLOAT NOT NULL ActualDeleteSecs FLOAT NOT NULL EstRedistSecs FLOAT NOT NULL EstDeleteSecs FLOAT NOT NULL FSGIOCount FLOAT NOT NULL Data Dictionary 263 Chapter 3: Views Reference ReconfigTableStatsV View Column Data Type Format Referenced Table.Column FSysReadCount FLOAT ----,---,---,---,--9 ReconfigTableStatsTbl.FSysReadCount ----,---,---,---,--9 ReconfigTableStatsTbl.FSysWriteCount ----,---,---,---,--9 ReconfigTableStatsTbl.FSysMiscCount ----,---,---,---,--9 ReconfigTableStatsTbl.MsgRcvCount ----,---,---,---,--9 ReconfigTableStatsTbl.MsgSendCount ----,---,---,---,--9 ReconfigTableStatsTbl.MsgMiscCount ----,---,---,---,--9 ReconfigTableStatsTbl.MsgWaitRcvTime ----,---,---,---,--9 ReconfigTableStatsTbl.MsgWaitSendTime ----,---,---,---,--9 ReconfigTableStatsTbl.MsgWaitMiscTime ZZZZZZZZZ9 ReconfigTableStatsTbl.NoMemFlushCount ZZZZZZZZZ9 ReconfigTableStatsTbl.CkptFlushCount ----,---,---,---,--9 ReconfigTableStatsTbl.Count1 NOT NULL FSysWriteCount FLOAT NOT NULL FSysMiscCount FLOAT NOT NULL MsgRcvCount FLOAT NOT NULL MsgSendCount FLOAT NOT NULL MsgMiscCount FLOAT NOT NULL MsgWaitRcvTime FLOAT NOT NULL MsgWaitSendTime FLOAT NOT NULL MsgWaitMiscTime FLOAT NOT NULL NoMemFlushCount INTEGER NOT NULL CkptFlushCount INTEGER NOT NULL CheckTableError FLOAT Note: This column is not currently used. NOT NULL Usage Notes This view provides the end user a way to access the ReconfigTableStatsTbl. Users with the appropriate privileges can SELECT or DELETE from the base table via the view. Note that only SELECT and/or DELETE privileges should be granted to users by user DBC. DBlockSize Column The default value for DBlockSize is zero. 264 Data Dictionary Chapter 3: Views Reference RepCaptureRulesV PartitionCount Column The default value for PartitionCount column is 1, which means the table is not a partitioned table. Possible Values for the FallBackFlag Column Value Description Y Fallback table (default) N Non-fallback table Possible Values for the Phase Column Value Description R Redistribution phase D Deletion/rebuild NUSI phase Possible Values for the Status Column Value Description 0 Not completed 1 Completed 2 Retry RepCaptureRulesV Category Security Database DBC Data Dictionary 265 Chapter 3: Views Reference RepCaptureRulesV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column RuleSetName VARCHAR(128) X(128) RepRulesetTbl.RuleSetName (Composite USI) X(128) RepGroup.GroupName X(1) RepCaptureRulesTbl.ObjectKind (NUPI) X(1) RepCaptureRulesTbl.DefaultOption X(300) RepCaptureRulesTbl.LikePattern X(1) RepCaptureRulesTbl.LikeEscape X(300) RepCaptureRulesTbl.NotLikePattern X(1) RepCaptureRulesTbl.NotLikeEscape UNICODE NOT CASESPECIFIC NOT NULL GroupName VARCHAR(128) UNICODE NOT NULL ObjectKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL DefaultOpt CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL LikePattern VARCHAR(300) UNICODE NOT CASESPECIFIC NOT NULL LikeEscape CHAR(1) UNICODE NOT CASESPECIFIC NotLikePattern VARCHAR(300) UNICODE NOT CASESPECIFIC NotLikeEscape CHAR(1) UNICODE NOT CASESPECIFIC Example The following SELECT statement selects all non-default rules defined for a table object: ==> SELECT GroupName, RulesetName, LikePattern, LikeEscape, NotLikePattern, NotLikeEscape FROM DBC.RepCaptureRulesV WHERE DefaultOpt = 'N' AND ObjectKind = 'T' 266 Data Dictionary Chapter 3: Views Reference RepTablesV[X] ORDER BY GroupName, RulesetName, LikePattern, LikeEscape, NotLikePattern, NotLikeEscape; Result: GroupName repgroup RuleSetName prmtablers LikePattern repuser.prmtab% LikeEscape ? NotLikePattern ? NotLikeEscape ? GroupName repgroup RuleSetName subtablers LikePattern repuser.subtab% LikeEscape ? NotLikePattern repuser.subtabx% NotLikeEscape ? RepTablesV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column GroupName VARCHAR(128) X(128) RepGroup.GroupID X(128) TVM.TVMName UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT NULL ResolvedDTSV[X] Category Schema Data Dictionary 267 Chapter 3: Views Reference ResolvedDTSV[X] Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ResolvedCurrent_Date DATE YY/MM/DD TableConstraints.ResolvedCurrent _Date ResolvedCurrent_TimeStamp TIMESTAMP(6) WITH TIME ZONE YYYY-MMDDBHH:MI:SS.S(F)Z TableConstraints.ResolvedCurrent _TimeStamp TableName VARCHAR(128) X(128) TVM.TableName X(128) Dbase.DatabaseName UNICODE NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Usage Notes Possible Values for the ResolvedCurrent_TimeStamp and ResolvedCurrent_Date Columns • This the last reconciled timestamp or date if the object is a join index or a table that is defined using: • CURRENT_TIMESTAMP • CURRENT_DATE or DATE Either the partition, JI definition, or temporal table has a system-defined join index. • NULL in all other cases. Example The following SELECT statement selects the last resolved date from the ResolvedDTSV view: ==> SELECT ResolvedCurrent_Date FROM ResolvedDTSV WHERE TableName='Customer' AND DatabaseName='Sales' AND ResolvedCurrent_Date IS NOT NULL; The query returns the following result: ResolvedCurrent_Date -------------------09/01/01 268 Data Dictionary Chapter 3: Views Reference RestrictedWordsV RestrictedWordsV Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column RestrictedWord VARCHAR(30) X(30) PasswordRestrictions.RestrictedWord (UPI) UNICODE UPPERCASE NOT NULL RI_Child_TablesV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 (explicit) ReferencingTbls.ReferenceIdx X(128) ReferencingTbls.ReferenceIdxName X(8) ReferencingTbls.ReferencingDbID (Composite NUPI) X(12) ReferencingTbls.ReferencingTblId (Composite NUPI) NOT NULL IndexName VARCHAR(128) UNICODE NOT CASESPECIFIC ChildDbID BYTE(4) NOT NULL ChildTID BYTE(6) NOT NULL Data Dictionary 269 Chapter 3: Views Reference RI_Child_TablesV[X] View Column Data Type Format Referenced Table.Column ChildKeyFID SMALLINT ---,--9 ReferencingTbls.ForeignKeyFID X(8) ReferencingTbls.ReferencedDbID X(12) ReferencingTbls.ReferencedTblID ---,--9 (explicit) ReferencingTbls.ParentKeyFID X(1) ReferencingTbls.InconsistentFlag X(128) Dbase.DatabaseName NOT NULL ParentDbID BYTE(4) NOT NULL ParentTID BYTE(6) NOT NULL ParentKeyFID SMALLINT NOT NULL InconsistencyFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReferencingTbls.CreateTimeStamp VTFKType CHAR(1) LATIN X(1) ReferencingTbls.VTFKType TTFKType CHAR(1) LATIN X(1) ReferencingTbls.TTFKType VTPKType CHAR(1) LATIN X(1) ReferencingTbls.VTPKType TTPKType CHAR(1) LATIN X(1) ReferencingTbls.TTPKType Corresponding Tables The corresponding tables for DBC.RI_Child_TablesV is DBC.ReferencingTbl. The corresponding tables for DBC.RI_Child_TablesV[X] are: • DBC.AccessRights • DBC.Dbase • DBC.Owners • DBC.ReferencingTbls • DBC.RoleGrants • DBC.Roles Usage Notes This view is similar to the All_RI_Children view, but contains the IDs of databases, tables, and columns instead of the names for access control purposes. The administrator can control who 270 Data Dictionary Chapter 3: Views Reference RI_Child_TablesV[X] 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. Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. InconsistencyFlag Column If the value in the InconsistencyFlag column is Y, it may be possible to validate the reference indexes that have been marked as inconsistent. Possible Values for the VTFKType Column Value Description A ANSIQUALIFIER Note: The Teradata temporal valid-time tables are compatible with ANSI validtime tables, however to use ANSI temporal tables requires that the session temporal qualifier for systems using Teradata temporal tables be explicitly set to ANSIQUALIFIER. C Current foreign key N Nonsequenced foreign key P Referential integrity constraint for ANSI Temporal tables. Temporal constraints can be defined for valid-time period column names with the special PERIOD keyword. R Temporal relationship constraint (TRC) referential integrity S Sequenced foreign key NULL The child table is non-temporal or does not support ValidTime. Possible Values for the TTFKType Column Data Dictionary Value Description C Current foreign key N Nonsequenced foreign key NULL A child table is a nontemporal table or a table that does not support TransactionTime S Sequenced foreign key 271 Chapter 3: Views Reference RI_Distinct_ChildrenV[X] Possible Values for the TTPKType Column Value Description C Current parent key S Sequenced parent key N Nonsequenced parent key NULL If the parent table is a nontemporal table or the table does not support either ValidTime or TransactionTime Possible Values for the VTPKType Column Value Description A ANSIQUALIFIER C Current parent key S Sequenced parent key N Nonsequenced parent key NULL If the parent table is a nontemporal table or the table does not support either ValidTime or TransactionTime P Referential integrity constraint for ANSI Temporal tables. Temporal referential constraints can be defined for valid-time period column in temporal tables by specifying the valid-time derived PERIOD column names with the special PERIOD keyword. RI_Distinct_ChildrenV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 (explicit) ReferencingTbls.ReferenceIdx NOT NULL 272 Data Dictionary Chapter 3: Views Reference RI_Distinct_ChildrenV[X] View Column Data Type Format Referenced Table.Column IndexName VARCHAR(128) X(128) ReferencingTbls.ReferenceIdxName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(1) ReferencingTbls.InconsistentFlag X(128) Dbase.DatabaseName YYYY-MM-DDBHH:MI:SS ReferencingTbls.CreateTimeStamp UNICODE NOT CASESPECIFIC ChildDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL InconsistencyFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) Corresponding Tables The corresponding tables for DBC.RI_Distinct_ChildrenV are: • DBC.DBase • DBC.ReferencingTbls • DBC.TVM The corresponding tables for DBC.RI_Distinct_ChildrenV[X] are: Data Dictionary 273 Chapter 3: Views Reference RI_Distinct_ParentsV[X] • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.ReferencingTbls • DBC.RoleGrants • DBC.Roles • DBC.TVM RI_Distinct_ParentsV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 (explicit) ReferencedTbls.ReferenceIdx X(128) ReferencedTbls.ReferenceIdxName X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) Dbase.DatabaseName NOT NULL IndexName VARCHAR(128) UNICODE NOT CASESPECIFIC ParentDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ParentTable VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ChildDB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 274 Data Dictionary Chapter 3: Views Reference RI_Parent_TablesV[X] View Column Data Type Format Referenced Table.Column ChildTable VARCHAR(128) X(128) TVM.TVMName X(1) ReferencedTbls.InconsistentFlag X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS ReferencedTbls.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL InconsistencyFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) Corresponding Tables The corresponding tables for DBC.RI_Distinct_ParentsV are: • DBC.Dbase • DBC.ReferencedTbls • DBC.TVM The corresponding tables for DBC.RI_Distinct_ParentsV[X] are: • DBC.AccessRights • DBC.Dbase • DBC.Owners • DBC.ReferencedTbls • DBC.RoleGrants • DBC.Roles • DBC.TVM RI_Parent_TablesV[X] Category Integrity Data Dictionary 275 Chapter 3: Views Reference RI_Parent_TablesV[X] Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column IndexID SMALLINT ---,--9 ReferencedTbls.ReferenceIdx X(128) ReferencedTbls.ReferenceIdxName X(8) ReferencedTbls.ReferencedDbID (Composite NUPI) X(12) ReferencedTbls.ReferencedTblid (Composite NUPI) ---,--9 ReferencedTbls.ParentKeyFID X(8) ReferencedTbls.ReferencingDbID X(12) ReferencedTbls.ReferencingTblID ---,--9 ReferencedTbls.ForeignKeyFID X(1) ReferencedTbls.InconsistentFlag X(128) Dbase.DatabaseName NOT NULL IndexName VARCHAR(128) UNICODE NOT CASESPECIFIC ParentDbID BYTE(4) NOT NULL ParentTID BYTE(6) NOT NULL ParentKeyFID SMALLINT NOT NULL ChildDbID BYTE(4) NOT NULL ChildTID BYTE(6) NOT NULL ChildKeyFID SMALLINT NOT NULL InconsistencyFlag CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ReferencedTbls.CreateTimeStamp VTPKType CHAR(1) LATIN X(1) ReferencedTbls.VTPKType TTPKType CHAR(1) LATIN X(1) ReferencedTbls.TTPKType VTFKType CHAR(1) LATIN X(1) ReferencedTbls.VTFKType 276 Data Dictionary Chapter 3: Views Reference RI_Parent_TablesV[X] View Column Data Type Format Referenced Table.Column TTFKType CHAR(1) LATIN X(1) ReferencedTbls.TTFKType Corresponding Tables The corresponding table for DBC.RI_Parent_TablesV is DBC.ReferencedTbls. The corresponding tables for DBC.RI_Parent_TablesV[X] are: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.ReferencedTbls • DBC.RoleGrants • DBC.Roles Usage Notes The RI_Parent_Tables view is similar to the All_RI_Parents view, but contains 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. Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. InconsistencyFlag Column If the value in the InconsistencyFlag column is Y, it may be possible to validate the reference indexes that have been marked as inconsistent. Possible Values for the TTFKType Column Data Dictionary Value Description C Current foreign key N Nonsequenced foreign key NULL A child table is a nontemporal table or a table that does not support TransactionTime S Sequenced foreign key 277 Chapter 3: Views Reference RI_Parent_TablesV[X] Possible Values for the TTPKType Column Value Description C Current parent key S Sequenced parent key N Nonsequenced parent key NULL If the parent table is a nontemporal table or the table does not support either ValidTime or TransactionTime Possible Values for the VTFKType Column Value Description A ANSIQUALIFIER Note: The Teradata temporal valid-time tables are compatible with ANSI validtime tables, however to use ANSI temporal tables requires that the session temporal qualifier for systems using Teradata temporal tables be explicitly set to ANSIQUALIFIER. C Current foreign key N Nonsequenced foreign key P Referential integrity constraint for ANSI Temporal tables. Temporal constraints can be defined for valid-time period column names with the special PERIOD keyword. R Temporal relationship constraint (TRC) referential integrity S Sequenced foreign key NULL The child table is non-temporal or does not support ValidTime. Possible Values for the VTPKType Column 278 Value Description A ANSIQUALIFIER C Current parent key S Sequenced parent key N Nonsequenced parent key NULL If the parent table is a nontemporal table or the table does not support either ValidTime or TransactionTime Data Dictionary Chapter 3: Views Reference RoleInfoV[X] Value Description P Referential integrity constraint for ANSI Temporal tables. Temporal referential constraints can be defined for valid-time period column in temporal tables by specifying the valid-time derived PERIOD column names with the special PERIOD keyword. RoleInfoV[X] Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column RoleName VARCHAR(128) X(128) Roles.RoleName X(128) Dbase.DatabaseName X(255) Roles.CommentString UNICODE NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CommentString VARCHAR(255) UNICODE CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS Roles.CreateTimeStamp ExtRole CHAR(1) LATIN X(1) Roles.ExtRole UPPERCASE NOT NULL Example The following SELECT statement returns the names of the role creators: ==> SELECT rolename (char(8)), creatorname (char(8)), commentstring (char(20)), createtimestamp, ExtRole from DBC.Roleinfo; Result: RoleName Data Dictionary CreatorName CommentString CreateTimeStamp ExtRole 279 Chapter 3: Views Reference RoleMembersV[X] -------r1 ----------u1 -------------------Comments on r1 ------------------- ------2002-08-13 10:26:19 N r2 u2 Comments on r2 2002-08-13 10:26:25 Y RoleMembersV[X] Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column RoleName VARCHAR(128) X(128) Roles.RoleName X(128) Dbase.DatabaseName UNICODE NOT NULL Grantor VARCHAR(128) UNICODE NOT CASESPECIFIC WhenGranted TIMESTAMP(0) YYYY-MMDDBHH:MI:SS RoleGrants.CreateTimeStamp DefaultRole VARCHAR(1) X(1) None X(1) RoleGrants.WithAdmin UNICODE WithAdmin CHAR(1) LATIN UPPERCASE NOT NULL Usage Notes Roles without members are excluded from the result set of RoleMembers. Possible Values for the WithAdmin Column 280 Value Description Y Yes N No Data Dictionary Chapter 3: Views Reference SecConstraintsV[X] Example The following query lists all roles and their members: SELECT CAST(rolename AS CHAR(15)), CAST(grantee AS CHAR(20)), CAST(grantor AS CHAR(20)), whengranted FROM DBC.RoleMembers ORDER BY 1,2; Result: RoleName ---------role_a role_a role_b . . . Grantee -------user_1 user_2 user_1 . . . Grantor -------DBA DBA SysFe . . . WhenGranted -------------------97-10-15 14:32:59 97-10-15 11:00:01 98-04-24 09:10:15 . . . SecConstraintsV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ConstraintName VARCHAR(128) X(128) SecConstraints.ConstraintName (UPI) X(2) SecConstraints.DataType X(1) SecConstraints.Nullable UNICODE NOT CASESPECIFIC NOT NULL DataType CHAR(2) CHARACTER LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Nullable CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Data Dictionary 281 Chapter 3: Views Reference SecurityDefaultsV View Column Data Type Format Referenced Table.Column SizeInBytes SMALLINT -(5)9 SecConstraints.ColumnWidth -(5)9 SecConstraints.AssigneeCount X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS SecConstraints.CreateTimeStamp NOT NULL AssigneeCount SMALLINT NOT NULL Creator VARCHAR(128) UNICODE CreateTimeStamp TIMESTAMP(0) NOT NULL Usage Notes Possible Values for the DataType Column Value Description I1 Byte array I2 Smallint Possible Values for the Nullable Column Value Description Y Yes N No SecurityDefaultsV Category Security Database DBC 282 Data Dictionary Chapter 3: Views Reference SecurityDefaultsV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ExpirePassword SMALLINT ---,--9 SysSecDefaults.ExpirePassword --9 SysSecDefaults.PasswordMinChar --9 SysSecDefaults.PasswordMaxChar X(1) SysSecDefaults.PasswordDigits X(1) SysSecDefaults.PasswordSpecChar X(1) SysSecDefaults.PasswordRestrictWords ---9 (explicit) SysSecDefaults.MaxLogonAttempts ---,--9 (explicit) SysSecDefaults.LockedUserExpire ---,--9 (explicit) SysSecDefaults.PasswordReUse NOT NULL PasswordMinChar BYTEINT NOT NULL PasswordMaxChar BYTEINT NOT NULL PasswordDigits CHAR(1) LATIN UPPERCASE NOT NULL PasswordSpecChar CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL PasswordRestrictWords CHAR(1) LATIN UPPERCASE NOT NULL MaxLogonAttempts BYTEINT NOT NULL LockedUserExpire SMALLINT NOT NULL PasswordReuse SMALLINT NOT NULL Related Topics For more information about controlling access, space, and ownership, see the following manuals: Data Dictionary • Database Administration • Database Design • Security Administration 283 Chapter 3: Views Reference SecurityLogV[X] SecurityLogV[X] Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column LogDate DATE YY/MM/DD (explicit) AccLogTbl.TheDate 99:99:99 (explicit) AccLogTbl.TheTime NOT NULL LogTime TIME NOT NULL LogType SMALLINT ---,--9 AccLogTbl.StatementKind UserName VARCHAR(128) X(128) AccLogTbl.UserName X(128) AccLogTbl.AccountName X(128) AccLogTbl.DatabaseName X(128) AccLogTbl.TVMName X(8192) AccLogTbl.StatementText UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE Text VARCHAR(8192) UNICODE Corresponding Tables The corresponding table for DBC.SecurityLogV is DBC.AccLogTbl. The corresponding tables for DBC.SecurityLogV[X] are: 284 Data Dictionary Chapter 3: Views Reference ServerInfoV[X] • DBC.AccLogTbl • DBC.DBase • DBC.Owners This view also references the userdb view. Note: The DatabaseName column was previously named ObjectName. Usage Notes Possible Values for the Partition Column Value Description DBC/SQL SQL Session EXPORT FASTEXPORT FASTLOAD FASTLOAD session HUTPARSE ARC data session MLOAD MULTILOAD session MONITOR Sessions running in a performance monitoring application NONE Session is recognized but not yet assigned ServerInfoV[X] Category Operations Database DBC View Columns and Source Table.Columns View Column Data Type Format Source Table.Column NameInfo VARCHAR(128) X(128) ServerInfo.NameInfo UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 285 Chapter 3: Views Reference ServerV[X] View Column Data Type Format Source Table.Column NVPType VARCHAR(7) X(7) ServerInfo.NameInfoType X(128) TVM.TVMName X(256) ServerInfo.ValueInfo UNICODE NOT CASESPECIFIC ServerName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ValueInfo VARCHAR(32000) UNICODE NOT CASESPECIFIC Usage Notes This Teradata QueryGrid connector Data Dictionary view provides details about the name value pairs used by foreign servers defined in the Teradata Database system. Possible Values for NVPType • IMPORT • EXPORT • GLOBAL • UNKNOWN Related Topics For more information, see Teradata QueryGrid documentation. ServerV[X] Category Operations Database DBC 286 Data Dictionary Chapter 3: Views Reference ServerV[X] View Columns and Source Table.Columns View Column Data Type Format Source Table.Column ServerID BYTE(6) X(12) TVM.TVMId X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) Dbase.DatabaseName NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ServerName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVM.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVM.LastAlterTimeStamp AuthorizationName VARCHAR(128) X(128) TVM.AuthName X(15) TVM.AuthorizationType UNICODE NOT CASESPECIFIC AuthorizationType VARCHAR(15) UNICODE NOT CASESPECIFIC Usage Notes This Teradata QueryGrid connector Data Dictionary view provides details about the foreign servers defined in the Teradata Database system. Data Dictionary 287 Chapter 3: Views Reference SessionInfoV[X] Possible Values for AuthorizationType Value Description T Invoker Trusted S Definer Trusted '' Unknown Example of ServerV[X] The following SELECT statement returns information about the foreign server objects created by user 'dba'. select * from DBC.ServerV where CreatorName = 'dba'; Result: ServerID 000011960000 DataBaseName TD_SERVER_DB ServerName SERVER_1 CreatorName dba CreateTimeStamp 2014-12-02 19:51:46 LastAlterName dba LastAlterTimeStamp 2014-12-02 19:51:46 ServerID 000012960000 DataBaseName TD_SERVER_DB ServerName SERVER_2 CreatorName dba CreateTimeStamp 2014-12-02 19:51:50 LastAlterName dba LastAlterTimeStamp 2014-12-02 19:51:50 AuthorizationName user1 AuthorizationType INVOKER TRUSTED Related Topics For more information, see Teradata QueryGrid documentation. SessionInfoV[X] Category Accounting Database DBC 288 Data Dictionary Chapter 3: Views Reference SessionInfoV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) SessionTbl.UserName X(128) SessionTbl.AccountName --,---,---,--9 SessionTbl.SessionNo (Composite UPI) X(128) SessionTbl.CurrentDataBase -(5)9 SessionTbl.IFPNo UNICODE NOT NULL AccountName VARCHAR(128) UNICODE NOT NULL SessionNo INTEGER NOT NULL DefaultDatabase VARCHAR(128) UNICODE IFPNo SMALLINT NOT NULL Partition CHAR(16) LATIN X(20) SessionTbl.Partition LogicalHostId SMALLINT ZZZ9 SessionTbl.LogicalHostId ---,--9 SessionTbl.HostNo (Composite UPI) X(1) SessionTbl.CurrentCollation YY/MM/DD SessionTbl.LogonDate 99:99:99.99 SessionTbl.LogonTime NOT NULL HostNo SMALLINT NOT NULL CurrentCollation CHAR(1) LATIN NOT NULL UPPERCASE LogonDate DATE NOT NULL LogonTime TIME NOT NULL LogonSequenceNo BYTE(4) X(8) SessionTbl.LogonSequenceNo LogonSource VARCHAR(128) X(128) SessionTbl.LogonSource X(1) SessionTbl.ExpiredPassWord UNICODE ExpiredPassword CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC TwoPCMode VARCHAR(1) LATIN X(1) SessionTbl.Options Transaction_Mode VARCHAR(1) LATIN X(1) SessionTbl.Options Data Dictionary 289 Chapter 3: Views Reference SessionInfoV[X] View Column Data Type Format Referenced Table.Column CurrentRole VARCHAR(128) X(128) SessionTbl.CurrentRole X(128) SessionTbl.ProfileName X(128) SessionTbl.LogonAcct X(1) SessionTbl.LDAP X(128) SessionTbl.AuditTrailId X(16) SessionTbl.IsolationLevel X(2048) SessionTbl.QueryBand X(128) SessionTbl.ProxyUser X(128) SessionTbl.ProxyCurRole X(1024) SessionTbl.TemporalQualifier X(128) SessionTbl.CalendarName X(2048) SessionTbl.ExtendedLogonSource UNICODE ProfileName VARCHAR(128) UNICODE NOT CASESPECIFIC LogonAcct VARCHAR(128) UNICODE NOT NULL LDAP CHAR(1) LATIN UPPERCASE NOT NULL AuditTrailId VARCHAR(128) UNICODE UPPERCASE NOT NULL CurIsolationLevel VARCHAR(16) UNICODE QueryBand VARCHAR(2048) UNICODE NOT CASESPECIFIC ProxyUser VARCHAR(128) UNICODE NOT CASESPECIFIC ProxyCurRole VARCHAR(128) UNICODE NOT CASESPECIFIC TemporalQualifier VARCHAR(1024) LATIN NOT CASESPECIFIC CalendarName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ExtendedLogonSource VARCHAR (2048) UNICODE 290 Data Dictionary Chapter 3: Views Reference SessionInfoV[X] View Column Data Type Format Referenced Table.Column ClientIpAddress VARCHAR(45) X(45) SessionTbl.ClientIpAddress X(1024) SessionTbl.ClientProgramName X(128) SessionTbl.ClientSystemUserId UNICODE ClientProgramName VARCHAR(1024) UNICODE ClientSystemUserId VARCHAR(128) UNICODE ClientConnectionType BYTEINT --9 SessionTbl.ClientConnectionType ClientCoordName VARCHAR(128) X(128) SessionTbl.ClientCoordName X(128) SessionTbl.ClientEnvName X(128) SessionTbl.ClientJobId X(128) SessionTbl.ClientJobName X(128) SessionTbl.ClientOsName X(128) SessionTbl.ClientProcThreadId X(128) SessionTbl.ClientSecProdGrp X(128) SessionTbl.ClientSecProdUserId UNICODE ClientEnvName VARCHAR(128) UNICODE ClientJobId VARCHAR(128) UNICODE ClientJobName VARCHAR(128) UNICODE ClientOsName VARCHAR(128) UNICODE ClientProcThreadId VARCHAR(128) UNICODE ClientSecProdGrp VARCHAR(128) UNICODE ClientSecProdUserId VARCHAR(128) UNICODE ClientTcpPortNumber INTEGER --,---,---,--9 SessionTbl.ClientTcpPortNumber ClientTdHostName VARCHAR(128) X(128) SessionTbl.ClientTdHostName X(128) SessionTbl.ClientTerminalId X(128) SessionTbl.ClientTransactionId X(128) SessionTbl.ClientUserOperId UNICODE ClientTerminalId VARCHAR(128) UNICODE ClientTransactionId VARCHAR(128) UNICODE ClientUserOperId VARCHAR(128) UNICODE Data Dictionary 291 Chapter 3: Views Reference SessionInfoV[X] View Column Data Type Format Referenced Table.Column ClientVmName VARCHAR(128) X(128) SessionTbl.ClientVmName X(128) SessionTbl.ClientVmUserId X(128) SessionTbl.MechanismName X(128) SessionTbl.ClientTDPReleaseId X(128) SessionTbl.ClientCLIv2ReleaseId X(128) SessionTbl.ClientSessionDesc X(128) SessionTbl.ClientWorkload X(128) SessionTbl.ClientJobData X(16) SessionTbl.ClientODBCDriverVersion X(16) SessionTbl.ClientNetDataProvider Version X(30) SessionTbl.ClientODBCDriverManager Version X(30) SessionTbl.ClientNetFrameworkVersion X(512) SessionTbl.ClientAttributesEx X(16) None UNICODE ClientVmUserId VARCHAR(128) UNICODE MechanismName VARCHAR(128) UNICODE ClientTDPReleaseId VARCHAR(128) UNICODE ClientCLIv2ReleaseId VARCHAR(128) UNICODE ClientSessionDesc VARCHAR(128) UNICODE ClientWorkload VARCHAR(128) UNICODE ClientJobData VARCHAR(128) UNICODE ClientODBCDriver Version VARCHAR(16) UNICODE NOT CASESPECIFIC ClientNetDataProvider Version VARCHAR(16) CHARACTER SET UNICODE NOT CASESPECIFIC ClientODBCDriver ManagerVersion CHAR(30) UNICODE NOT CASESPECIFIC ClientNetFramework Version CHAR(30) UNICODE NOT CASESPECIFIC ClientAttributesEx VARCHAR(512) UNICODE ClientJDBCDriverVersion VARCHAR(16) UNICODE 292 Data Dictionary Chapter 3: Views Reference SessionInfoV[X] View Column Data Type Format Referenced Table.Column ClientJavaVersion VARCHAR(30) X(30) None X(30) SessionTbl.ExportDefinitionName UNICODE ExportDefinitionName VARCHAR(30) CHARACTER SET LATIN ExportWidthRuleSet BYTE(20) X(40) SessionTbl.ExportWidthRuleSet RecoverableNetwork Protocol CHAR(1) LATIN X(1) SessionTbl.RecoverableNetwork Protocol X(33) SessionTbl.LogonRedrive X(45) SessionTbl.ClientIPAddrByClient UPPERCASE NOT CASESPECIFIC NOT NULL LogonRedrive VARCHAR(33) UNICODE ClientIPAddrByClient VARCHAR(45) UNICODE ClientPortByClient INTEGER --,---,---,--9 SessionTbl.ClientPortByClient ServerIPAddrByClient VARCHAR(45) X(45) SessionTbl.ServerIPAddrByClien UNICODE ServerPortByClient INTEGER --,---,---,--9 SessionTbl.ServerPortByClient ClientIPAddrByUnity VARCHAR(45) X(45) SessionTbl.ClientIPAddrByUnity UNICODE ClientPortByUnity INTEGER --,---,---,--9 SessionTbl.ClientPortByUnity UnityClientSideIPAddr VARCHAR(45) X(45) SessionTbl.UnityClientSideIPAddr UNICODE UnityClientSidePort INTEGER --,---,---,--9 SessionTbl.UnityClientSidePort UnityServerSideIPAddr VARCHAR(45) X(45) SessionTbl.UnityServerSideIPAddr UNICODE UnityServerSidePort INTEGER --,---,---,--9 SessionTbl.UnityServerSidePort ServerIPAddrByUnity VARCHAR(45) X(45) SessionTbl.ServerIPAddrByUnity UNICODE ServerPortByUnity INTEGER --,---,---,--9 SessionTbl.ServerPortByUnity ServerIPAddrByServer VARCHAR(45) X(45) SessionTbl.ServerIPAddrByServer --,---,---,--9 SessionTbl.ServerPortByServer UNICODE ServerPortByServer Data Dictionary INTEGER 293 Chapter 3: Views Reference SessionInfoV[X] View Column Data Type Format Referenced Table.Column ClientCOPSuffixedHost Name VARCHAR(128) X(128) SessionTbl.ClientCOPSuffixedHost Name UnitySessNo INTEGER --,---,---,--9 SessionTbl.UnitySessNo UnityVersion VARCHAR(128) X(128) SessionTbl.UnityVersion X(1571) SessionTbl.UnityAuthMechName X(1571) SessionTbl.UnityMechanismName UNICODE UNICODE UnityAuthMechName VARCHAR(1571) UNICODE UnityMechanismName VARCHAR(1571) UNICODE UserAuthenticatedBy VARCHAR(1) X(1) SessionTbl.UserAuthenticatedBy ClientTDSessionPool Name VARCHAR(128) X(128) SessionTbl.ClientTDSessionPoolName TTGranularity VARCHAR(30) X(30) SessionTbl.TTGranularity X(1) SessionTbl.LoadingOp UNICODE NOT CASE SPECIFIC NOT NULL LoadingOp CHAR(1) LATIN Note: This column is reserved for future use. Usage Notes Information about current session pools, which are a collection of sessions that are logged on to the Teradata Database under the same logonid, may be accessed by entering the DISPLAY POOL command. For more information on DISPLAY POOL, see Teradata Director Program Reference. The LogonSource column is deprecated and will be replaced in a future release. For information about the LogonSource fields, see Appendix B: “LogonSource Column Fields and Examples.” Possible Values for the ClientConnectionType Column 294 Value Description 1 Client is connected using TCP/IP via the gateway. 2 Client is connected from a mainframe via a mainframe-attached host. Data Dictionary Chapter 3: Views Reference SessionInfoV[X] Possible Values for the CurrentCollation Column Value Description A ASCII E EBCDIC H Host M Multinational C CharSet_Coll J JIS_Coll Possible Values for the ExpiredPassword Column Value Description Y Yes, by Session Control procedures N No, by the Parser when a new password is assigned to the user Possible Values for the ExpiredPassword Column Value Description Y Yes, by Session Control procedures N No, by the Parser when a new password is assigned to the user Possible Values for the LogonRedrive Column Value Description '' Not participating MEMORY NON-FALLBACK RESPONSES Memory-based Redrive participation NULL or blanks Session is not participating in Redrive and database restarts will not be transparent to applications and users. Possible Values for the Partition Column Data Dictionary Value Description 7 Console Utility Partition number 295 Chapter 3: Views Reference SessionInfoV[X] Value Description 8 Partition in which DBC console procedures will be started by the Host utility 9 File System Partition number 10 Gateway partition number 11 Worker Task Partition number 12 Session Control Partition number 13 Dispatcher Partition number 14 Parser Partition number 15 Startup Partition number 17 Resource Sampling Subsystem (RSS) StartUp Partition number 18 Distributed Database File (DDF) Server Partition number 19 Relay Services Gateway (RSG) Partition number 47 Replication Gateway rsgdbsmain partition number Possible Values for the TTGranularity Column Value Description LOGICALROW Row is timestamped with the time the row is processed by the AMP. REQUEST Row is timestamped with the time the request is submitted. TRANSACTION Row is timestamped with the time when the first non-locking reference is made to a temporal table, or when the built-in function TEMPORAL_TIMESTAMP is first accessed during the transaction. Example The following SELECT statement displays information on all current session. ==> SELECT UserName, SessionNo, DefaultDatabase, LogonSource FROM DBC.SessionInfo; Result: UserName SessionNo DefaultDatabase LogonSource --------- --------- --------------- ---------------------------DBC 1,005 DBC <TCP/IP> EB9F 141.206.1.84 Example: LogonSource The following screen displays LogonSource information from the current sessions: ==>sel logonsource from dbc.sessiontbl; 296 Data Dictionary Chapter 3: Views Reference ShowColChecksV[X] Result: (TCP/IP) EB9F 141.206.1.84 L3PC024 21767 BC120317 BTEQ 0 Related Topics For information about ... See ... interpreting the ExportWidthRuleSet column “ExportWidthV” on page 135. using the DBSControl utility to make export width definition changes International Character Set Support. ShowColChecksV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DataBaseNameI (UPI) X(128) TVM.TVMNameI (Composite UPI) X(128) TVFields.FieldName UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 297 Chapter 3: Views Reference ShowColChecksV[X] View Column Data Type Format Referenced Table.Column ColCheck VARCHAR(8192) X(255) TVFields.ColumnCheck X(128) Dbase.DatabaseNameI (UPI) UNICODE CreatorName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVFields.CreateTimeStamp TimeDimension CHAR(1) LATIN X(1) TVFields.TimeDimension VTCheckType CHAR(1) LATIN X(1) TVFields.VTCheckType TTCheckType CHAR(1) LATIN X(1) TVFields.TTCheckType Corresponding Tables The corresponding tables for DBC.ShowColChecksV are: • DBC.DBase • DBC.TVFields • DBC.TVM The corresponding tables for DBC.ShowColChecksV[X] are: • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles • DBC.TVFields • DBC.TVM Usage Notes Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. For more information about the possible values for the TimeDimension column, see Appendix A: “View Column Values.” 298 Data Dictionary Chapter 3: Views Reference ShowTblChecksV[X] Possible Values for the TTCheckType Column Value Description A ANSIQUALIFIER Note: The TTCheckType column returns the value A when the qualifier is ANSIQUALIFIER for column-level CHECK constraints. NULL No transaction-time dimension C CURRENT TRANSACTIONTIME Possible Values for the VTCheckType Column Value Description A ANSIQUALIFIER. Note: The VTCheckType column returns the value A when the qualifier is ANSIQUALIFIER for column-level CHECK constraints. NULL No valid-time dimension C CURRENT VALIDTIME S SEQUENCED VALIDTIME N NONSEQUENCED VALIDTIME ShowTblChecksV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName (UPI) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 299 Chapter 3: Views Reference ShowTblChecksV[X] View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMNameI (Composite UPI) X(128) TableConstraints.Name X(255) TableConstraints.TableCheck X(128) Dbase.DatabaseNameI (UPI) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL CheckName VARCHAR(128) UNICODE TblCheck VARCHAR(16000) UNICODE CASESPECIFIC CreatorName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TableConstraints.CreateTimeStamp VTCheckType CHAR(1) LATIN X(1) TableConstraints.VTCheckType TTCheckType CHAR(1) LATIN X(1) TableConstraints.TTCheckType The X view references these additional tables: • DBC.Owners • DBC.RoleGrants • DBC.Roles Usage Notes You can use this view to query for table constraints that are defined for a database. For information about the possible values for the VTCheckType column, see Appendix A: “View Column Values.” Possible Values for the TTCheckType Column 300 Value Description NULL No transaction-time dimension C CURRENT TRANSACTIONTIME Data Dictionary Chapter 3: Views Reference Software_Event_LogV Software_Event_LogV Category Operations Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column TheDate DATE YY/MM/DD (explicit) SW_Event_Log.TheDate (Composite NUPI) 99:99:99.999999 (explicit) SW_Event_Log.TheTime (Composite NUPI) Z99-99999-99 (explicit) SW_Event_Log.Event_Tag NOT NULL TheTime TIME NOT NULL Event_Tag INTEGER NOT NULL Category BYTEINT Z9 (explicit) SW_Event_Log.Category Severity SMALLINT ZZ9 (explicit) SW_Event_Log.Severity PMA INTEGER ZZ9-99 (explicit) SW_Event_Log.PMA Vproc INTEGER -(5)9 (explicit) SW_Event_Log.Vproc Partition BYTEINT Z9 (explicit) SW_Event_Log.Partition Task SMALLINT ZZZZ9 (explicit) SW_Event_Log.Task TheFunction VARCHAR(32) LATIN X(32) SW_Event_Log.TheFunction X(64) SW_Event_Log.SW_Version ZZ9 (explicit) SW_Event_Log.Line X(255) SW_Event_Log.Text NOT CASESPECIFIC SW_Version VARCHAR(64) LATIN NOT CASESPECIFIC Line BYTEINT NOT NULL Text VARCHAR(30000) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 301 Chapter 3: Views Reference Software_Event_LogV Usage Notes Possible Values for the Category Column Value Description 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 TPSys Possible Values for the Severity Column 302 Value Description 0 Hardware and software are informational events (Occurrence) 10 Software abnormality -- informational (SW abnormality) 20 Hardware abnormality -- informational (HW abnormality) 30 Recoverable user error (UserError retry) 40 Unrecoverable user error (UserError) 50 Unrecoverable user error, no user restart (UserFatal) 60 Unrecoverable Vproc error, Vproc restart required (VprocError) 70 Unrecoverable Vproc error, no Vproc restart (VprocFatal) 80 Recoverable PDE error (OSErrorRetry) 90 Unrecoverable PDE error, restart required (OSError) Data Dictionary Chapter 3: Views Reference StatsV Value Description 100 Unrecoverable PDE error, restart not possible (OSFatal) 110 Unrecoverable CPU hardware error, restart required (CPUError) 120 Unrecoverable CPU hardware error, CPU stay down (CPUFatal) 130 Unrecoverable PMA hardware error, PMA restart required (PMAError) 140 Unrecoverable PMA hardware error, PMA stays down (PMAFatal) 200 Unrecoverable system error, system restart required (SystemError) 210 Unrecoverable System error, restart not possible (SystemFatal) 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’ ; Result: TheDate -------92/08/20 TheTime -------10:10:30 Category -------4 Severity -------50 StatsV Category Optimizer Statistics Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) DBase.DatabaseName UNICODE NOT NULL Data Dictionary 303 Chapter 3: Views Reference StatsV View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) VTVM.TVMName X(255) StatsTbl.ExpressionList UNICODE NOT NULL ColumnName VARCHAR(10000) UNICODE FieldIdList VARCHAR(1000) LATIN X(255) StatsTbl.FieldIdList StatsName VARCHAR(128) X(255) StatsTbl.StatsName UNICODE ExpressionCount SMALLINT ---,--9 StatsTbl.ExpressionCount StatsId INTEGER --,---,---,--9 StatsTbl.StatsId X(1) StatsTbl.StatsType NOT NULL StatsType CHAR(1) LATIN NOT NULL StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature SampleSizePct DECIMAL(5, 2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature MaxIntervals SMALLINT ---,--9 StatsTbl.MaxIntervals MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq StatsSkipCount INTEGER --,---,---,--9 StatsTbl.Reserved1 304 Data Dictionary Chapter 3: Views Reference StatsV View Column Data Type Format Referenced Table.Column CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” ColumnName Column • If more than one column or expression is specified, each column or expression is separated by a comma. • The maximum number of columns is 64. • If expressions are in the list, the maximum number of columns can be reduced past the limit of 64, depending on the combined total size of the text in the expressions. • If the combined total size of the expression text causes the maximum column limit to be less than the actual number of columns in the list, an error occurs. IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. FieldIdList Column The FieldIdList column is NULL for fields that involve expressions. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. Possible Values for the StatsType Column Data Dictionary Value Description T Table 305 Chapter 3: Views Reference StatsV Value Description I Join Index N Hash Index V View Q Query L Link Row SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. To Get Information Not Contained in This View This view does not contain: • Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Example This example assumes the following statistics have been collected: STATISTICS INDEX (o_orderkey) ,INDEX (o_custkey, o_orderstatus) ON Orders; This query can be used to retrieve the statistics: ==> SELECT * FROM dbc.StatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics 306 For information about statistics collected on ... See ... non-indexed columns and single-column indexes “ColumnsV[X]” on page 86. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. multiple columns “MultiColumnStatsV[X]” on page 177. Data Dictionary Chapter 3: Views Reference StatUseCountV[X] For information about statistics collected on ... See ... tables “TableStatsV” on page 312. materialized temporary tables “TempTableStatsV” on page 325. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. StatUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(10000) StatsTbl.StatName --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt UNICODE NOT NULL TableName VARCHAR(128) UNICODE NOT NULL StatName VARCHAR(10000) UNICODE AccessCount BIGINT Example The following SELECT statement shows the number of statistics accesses ocarina on a particular table: SELECT StatName, AccessCount FROM DBC.StatUseCountV WHERE DatabaseName = 'Personnel' AND TableName = 'Employee'; The query returns the following result: StatName AccessCount --------- -----------ST1_id 10 Data Dictionary 307 Chapter 3: Views Reference Table_LevelConstraintsV[X] Table_LevelConstraintsV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TableConstraints.Name X(255) TableConstraints.TableCheck X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ConstraintName VARCHAR(128) UNICODE ConstraintText VARCHAR(16000) UNICODE CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TableConstraints.CreateTimeStamp VTCheckType CHAR(1) LATIN X(1) TableConstraints.VTCheckType TTCheckType CHAR(1) LATIN X(1) TableConstraints.TTCheckType The X view references these additional tables: 308 • DBC.Owners • DBC.RoleGrants • DBC.Roles Data Dictionary Chapter 3: Views Reference Tables2V[X] Usage Notes For information about the possible values for the VTCheckType column, see Appendix A: “View Column Values.” Possible Values for the TTCheckType Column Value Description NULL No transaction-time dimension C CURRENT TRANSACTIONTIME Tables2V[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column TVMName VARCHAR(128) X(128) TVM.TVMNameI (Composite UPI) X(12) TVM.TVMId (USI) X(8) TVM.DatabaseId (Composite UPI) ---,--9 TVM.ParentCount ---,--9 TVM.ChildCount UNICODE UPPERCASE NOT CASESPECIFIC NOT NULL TVMId BYTE(6) NOT NULL DatabaseId BYTE(4) NOT NULL ParentCount SMALLINT NOT NULL ChildCount SMALLINT NOT NULL The X view references these additional tables: Data Dictionary 309 Chapter 3: Views Reference Tables3V[X] • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Tables3V[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseNameI X(128) TVM.TVMNameI X(128) TVFields.FieldName X(12) TVFields.TableId (NUPI, Composite USI) ---,--9 TVFields.FieldId (Composite USI) UNICODE NOT NULL TableName VARCHAR(128) UNICODE UPPERCASE NOT NULL FieldName VARCHAR(128) UNICODE NOT NULL TableId BYTE(6) NOT NULL FieldId SMALLINT NOT NULL The X view references these additional tables: 310 • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Data Dictionary Chapter 3: Views Reference TableSizeV[X] TableSizeV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column Vproc SMALLINT -(5)9 DataBaseSpace.Vproc X(128) Dbase.DatabaseName X(128) Dbase.AccountName X(128) TVM.TVMName (NUSI) ---,---,---,---,--9 (explicit) DataBaseSpace.CurrentPermSpace ---,---,---,---,--9 (explicit) DataBaseSpace.PeakPermSpace NOT NULL DataBaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccountName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CurrentPerm FLOAT NOT NULL PeakPerm FLOAT NOT NULL The X view references these additional tables: Data Dictionary • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles 311 Chapter 3: Views Reference TableStatsV 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 Database (or for all AMPs if the SUM aggregate is used). AccountName Column The AccountName column is the unexpanded default account name for the user or database. A database can only have one account. A user may have a default account plus other accounts. If there is a profile for the user, and it specifies a default account, that account superseded this account name. CurrentPerm Column The CurrentPerm column value includes all AMPs unless a specific AMP is requested. PeakPerm Column You can use the DBC.ClearPeakDisk macro to reset the PeakPerm column. 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’ ; The query returns the following result: Sum(PeakPerm) ------------260,608 Sum(CurrentPerm) ---------------260,608 TableStatsV Category Optimizer Statistics Database DBC 312 Data Dictionary Chapter 3: Views Reference TableStatsV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) DBase.DatabaseName X(128) TVM.TVMName X(255) StatsTbl.ExpressionList X(255) StatsTbl.StatsName UNICODE NOT NULL TableName VARCHAR(128) UNICODE NOT NULL ColumnName VARCHAR(10000) UNICODE StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature SampleSizePct DECIMAL(5, 2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature MaxIntervals SMALLINT ---,--9 StatsTbl.MaxIntervals MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq StatsSkipCount INTEGER --,---,---,--9 StatsTbl.Reserved1 CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.CreateTimeStamp Data Dictionary 313 Chapter 3: Views Reference TableStatsV View Column Data Type Format Referenced Table.Column LastCollectTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS StatsTbl.LastAlterTimeStamp Usage Notes This view is used by the following client tools: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain This view is also used by any client application that requires the statistical information. TSET exports the statistical information for data tables as part of Target Level Emulation. For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” ColumnName Column • If more than one column or expression is specified, each column or expression is separated by a comma. • The maximum number of columns is 64. • If expressions are in the list, the maximum number of columns can be reduced past the limit of 64, depending on the combined total size of the text in the expressions. • If the combined total size of the expression text causes the maximum column limit to be less than the actual number of columns in the list, an error occurs. IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. To Get Information Not Contained in This View This view does not contain: • 314 Statistics on tables protected by row-level security. To get these statistics, create views on DBC.StatsTbl. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Data Dictionary Chapter 3: Views Reference TablesV[X] • Information about column attributes. To get this information, join the DBC.StatsTbl table to the DBC.TVFields table. You can view details about this table via Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Example This example assumes the following statistics have been collected: STATISTICS INDEX (o_orderkey) ,INDEX (o_custkey, o_orderstatus) ON Orders; This query can be used to retrieve the statistics: ==> SELECT * FROM dbc.TableStatsV WHERE databasename = 'sales' AND tablename = ‘orders’; Related Topics For more information about statistics collected on ... See ... Non-indexed columns and single-column indexes “ColumnStatsV[X]” on page 83. Indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. Multiple columns “MultiColumnStatsV[X]” on page 177. Tables “StatsV” on page 303. materialized temporary tables “TempTableStatsV” on page 325. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. TablesV[X] Category Schema Database DBC Data Dictionary 315 Chapter 3: Views Reference TablesV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName zzzz(9) (explicit) TVM.Version X(1) TVM.TableKind X(1) TVM.ProtectionType X(2) TVM.JournalFlag X(128) Dbase.DatabaseName X(255) TVM.RequestText X(255) TVM.CommentString ---,--9 TVM.ParentCount ---,--9 TVM.ChildCount UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Version SMALLINT NOT NULL TableKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL ProtectionType CHAR(1) LATIN UPPERCASE NOT NULL JournalFlag CHAR(2) LATIN UPPERCASE NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL RequestText VARCHAR(12,500) UNICODE CommentString VARCHAR(255) UNICODE ParentCount SMALLINT NOT NULL ChildCount SMALLINT NOT NULL 316 Data Dictionary Chapter 3: Views Reference TablesV[X] View Column Data Type Format Referenced Table.Column NamedTblCheckCount SMALLINT ---,--9 TVM.NamedTblCheckCount X(1) TVM.UnnamedTblCheckExist NOT NULL UnnamedTblCheckExist CHAR(1) LATIN UPPERCASE NOT NULL PrimaryKeyIndexId SMALLINT ---,--9 TVM.PrimaryKeyIndexId RepStatus CHAR(1) LATIN X(1) TVM.TblStatus UPPERCASE CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVM.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TVM.LastAlterTimeStamp RequestTxtOverflow CHAR(1) LATIN X(1) TVM.RequestTxtOverflow AccessCount INTEGER --,---,---,--9 ObjectUsage.UserAccessCnt LastAccessTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ObjectUsage.LastAccessTime Stamp UtilVersion SMALLINT -----9 (explicit) TVM.UtilVersion QueueFlag CHAR(1) LATIN X(1) TVM.QueueFlag X(1) TVM.CommitOpt X(1) TVM.TransLog X(1) TVM.CheckOpt X(1) TVM.TemporalProperty YY/MM/DD TVM.ResolvedCurrent_Date UPPERCASE NOT NULL CommitOpt CHAR(1) LATIN NOT NULL TransLog CHAR(1) LATIN NOT NULL CheckOpt CHAR(1) LATIN NOT NULL TemporalProperty CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC ResolvedCurrent_Date Data Dictionary DATE 317 Chapter 3: Views Reference TablesV[X] View Column Data Type Format Referenced Table.Column ResolvedCurrent_TimeStamp TIMESTAMP(6) WITH TIME ZONE YYYY-MMDDBHH:MI:SS.S(F)Z TVM.ResolvedCurrent_Time Stamp SystemDefinedJI CHAR(1) LATIN X(1) JI X(1) TVM.VTQualifier X(1) TVM.TTQualifier ZZZZ9 (explicit) TVM.PIColumnCount ZZZZ9 (explicit) TVM.PartitioningLevels X(1) TVM.LoadProperty UPPERCASE NOT CASESPECIFIC VTQualifier CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC TTQualifier CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC PIColumnCount SMALLINT NOT NULL PartitioningLevels SMALLINT NOT NULL LoadProperty CHAR(1) LATIN Note: This column is reserved for future use. UPPERCASE CurrentLoadId INTEGER --,---,---,--9 TVM.CurrentLoadId LoadIdLayout CHAR(1) LATIN X(1) TVM.LoadIdLayout Note: This column is reserved for future use. UPPERCASE DelayedJI CHAR(1) LATIN X (1) TVM.DelayedJI Note: This column is reserved for future use. UPPERCASE NOT CASESPECIFIC Note: This column is reserved for future use. NOT CASESPECIFIC NOT CASESPECIFIC Note: The DBC.TVM table contains one row for each table, view, stored procedure, join index, macro, UDT, UDM, or UDF. The X view references these additional tables: 318 • DBC.AccessRights • DBC.Owners • DBC.RoleGrants • DBC.Roles Data Dictionary Chapter 3: Views Reference TablesV[X] Usage Notes For information about the possible values for JournalFlag or TableKind columns, see Appendix A: “View Column Values.” Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. Possible Values for the ResolvedCurrent_TimeStamp and ResolvedCurrent_Date Columns • This the last reconciled timestamp or date if the object is a join index or a table that is defined using: • CURRENT_TIMESTAMP • CURRENT_DATE or DATE Either the partition, JI definition, or temporal table has a system-defined join index. • NULL in all other cases. Possible Values for the SystemDefinedJI Column Value Description Y The entry is corresponding to a system-defined join index. NULL Any other objects in the system. RequestText Column 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 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. If the table is renamed, the RequestText still contains the old table name. The new table name is not put in the RequestText. TemporalProperty Column Data Dictionary Value Description S A system-versioned system-time table. U A bitemporal (system-versioned system-time and valid-time) table. W A nontemporal table that contains a system-time derived period column but that is not system versioned. 319 Chapter 3: Views Reference TablesV[X] Value Description X A valid-time temporal table that contains a system-time derived period column but that is not system versioned. Version and UtilVersion Columns The UtilVersion column may be zero or null for tables created prior to V2R6.0. For tables created in V2R6.0 or later, both Version and UtilVersion are initially one. The following table shows when the UtilVersion column is modified, and how it’s modified: New Value or UtilVersion UtilVersion Current Value Data Definition Change Any value Significant change (by an ALTER TABLE statement) to keep an archive from being restored or copied. = Version NULL or zero Not significant Version -1 Any other value Not significant No change The Version column is increased by one for any data definition change other than enabling or disabling journaling for the table. Version in the above table is the version after it’s been incremented. The following table shows how the UtilVersion column is checked when selected partitions are restored or copied: UtilVersion Value Requirements NULL or zero The Version of the archive must match the Version of the table Any other value If the archive UtilVersion is zero, the Version of the Archive must match the UtilVersion of the table; otherwise, the UtilVersion column of the archive must equal the UtilVersion of the table Note: To restore or copy selected partitions, the table must already exist. 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’ ; The query returns the following result: TableName ------------ 320 CreatorName ----------- TableKind --------- ProtectionType -------------- Data Dictionary Chapter 3: Views Reference TableTextV[X] NewEmp EmployeeInfo Employee Department Project Charges GREENE GREENE DBC DBC JONES JONES M V T T T T F F F F F F Related Topics For more information about primary indexes and partitioning levels, see SQL Data Definition Language. TableTextV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(1) TVM.TableKind X(255) TextTbl.TextString ---,--9 (explicit) TextTbl.LineNo UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableKind CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL RequestText VARCHAR(32000) UNICODE LineNo SMALLINT NOT NULL Data Dictionary 321 Chapter 3: Views Reference TableTextV[X] The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles • DBC.TextTbl • DBC.TVM Usage Notes For information about the possible values for the TableKind column, see Appendix A: “View Column Values.” RequestText Column The request text data reflects the definitions specified by the user for the object. IF the request text … THEN the request text is saved in … is up to 12500 characters TVM exceeds 12500 characters DBC.TextTbl This view contains the complete text of the object definition. Note: Users do not need to use this view if there is no overflow in TVM. The request text for an object could be stored in one or more rows depending on the size of the text. The LineNo column provides the sequence of multiple rows stored in the TextTbl for the object. To put the text in a proper sequence, you must select the text using ORDER BY clause on LineNo from this view. Example The following SELECT statement displays information about tables, views, and macros in the Personnel database, assuming that text for the database object is more than 12500 characters. SELECT TableName,TableKind, LineNo, RequestText( char(50)) FROM DBC.TableText WHERE DatabaseName = 'Personnel' ORDER BY TableName, LineNo; 322 Data Dictionary Chapter 3: Views Reference TblSrvInfoV[X] TblSrvInfoV[X] Category Operations Database DBC View Columns and Source Table.Columns View Column Data Type Format Source Table.Column ServerName VARCHAR(128) X(128) TVM.TVMName X(128) Dbase.DatabaseName X(128) ServerTblOpInfo.TblopName X(128) ServerTblOpInfo.TblopDBName X(128) ServerInfo.NameInfo X(256) ServerInfo.ValueInfo X(7) ServerTblOpInfo.TblOpType UNICODE NOT CASESPECIFIC NOT NULL SrvDataBaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TblOpName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TbpOpDataBaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL NameInfo VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ValueInfo VARCHAR(32000) UNICODE NOT CASESPECIFIC TableOperatorType VARCHAR(7) UNICODE NOT CASESPECIFIC Data Dictionary 323 Chapter 3: Views Reference TblSrvV[X] Usage Notes This Teradata QueryGrid connector view returns the name value pairs defined for a foreign server. Possible Values for TableOperatorType • IMPORT • EXPORT • UNKNOWN Related Topics For more information, see Teradata QueryGrid documentation. TblSrvV[X] Category Operations Database DBC View Columns and Source Table.Columns View Column Data Type Format Source Table.Column ServerName VARCHAR(128) X(128) TVM.TVMName X(128) Dbase.DatabaseName X(128) ServerTblOpInfo.TblopName UNICODE NOT CASESPECIFIC NOT NULL SrvDataBaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TblOpName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 324 Data Dictionary Chapter 3: Views Reference TempTableStatsV View Column Data Type Format Source Table.Column TblOpDBName VARCHAR(128) X(128) ServerTblOpInfo.TblopDBName X(7) ServerTblOpInfo.TblOpType UNICODE NOT CASESPECIFIC NOT NULL TableOperatorType VARCHAR(7) UNICODE NOT CASESPECIFIC Usage Notes This Teradata QueryGrid connector view returns information about the foreign servers and their associated table operators. Possible Values for TableOperatorType • IMPORT • EXPORT • UNKNOWN Related Topics For more information, see Teradata QueryGrid documentation. TempTableStatsV Category Optimizer Statistics Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 325 Chapter 3: Views Reference TempTableStatsV View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName X(255) TVFields.FieldName X(255) StatsTbl.StatsName UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(1000) UNICODE NOT CASESPECIFIC StatsName VARCHAR(128) UNICODE StatsSource CHAR(1) LATIN X(1) StatsTbl.StatsSource ValidStats CHAR(1) LATIN X(1) StatsTbl.ValidStats DBSVersion VARCHAR(32) LATIN X(32) StatsTbl.DBSVersion UPPERCASE NOT CASESPECIFIC NOT NULL IndexNumber SMALLINT ---,--9 StatsTbl.IndexNumber SampleSignature VARCHAR(256) LATIN X(255) StatsTbl.SampleSignature NOT CASESPECIFIC SampleSizePct DECIMAL(5,2) zz9.99 StatsTbl.SampleSizePct ThresholdSignature VARCHAR(512) LATIN X(255) StatsTbl.ThresholdSignature NOT CASESPECIFIC MaxIntervals SMALLINT ---,--9 StatsTbl.MaxIntervals MaxValueLength INTEGER ---,--9 StatsTbl.MaxValueLength RowCount FLOAT ----,---,---,---,--9 StatsTbl.RowCount UniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.UniqueValueCount PNullUniqueValueCount FLOAT ----,---,---,---,--9 StatsTbl.PNullUniqueValueCount NullCount FLOAT ----,---,---,---,--9 StatsTbl.NullCount AllNullCount FLOAT ----,---,---,---,--9 StatsTbl.AllNullCount HighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.HighModeFreq PNullHighModeFreq FLOAT ----,---,---,---,--9 StatsTbl.PNullHighModeFreq 326 Data Dictionary Chapter 3: Views Reference TempTableStatsV View Column Data Type Format Referenced Table.Column CreateTimeStamp TIMESTAMP(0) YYYYMMDDBHH:MI:SS.S(F ) StatsTbl.CreateTimeStamp LastCollectTimeStamp TIMESTAMP(0) YYYYMMDDBHH:MI:SS.S(F StatsTbl.LastCollectTimeStamp LastAlterTimeStamp TIMESTAMP(0) YYYYMMDDBHH:MI:SS.S(F ) StatsTbl.LastAlterTimeStamp Usage Notes The following client tools use this view: • Teradata System Emulation Tool (TSET) • Teradata Visual Explain Any client application that requires statistical information used by the Optimizer also uses this view. The information returned includes the following: • Columns Statistics • Table Name • Database Name • Statistics ID For information about the possible values for the StatsSource column, see Appendix A: “View Column Values.” ColumnName Column • If more than one column or expression is specified, each column or expression is separated by a comma. • The maximum number of columns is 64. • If expressions are in the list, the maximum number of columns can be reduced past the limit of 64, depending on the combined total size of the text in the expressions. • If the combined total size of the expression text causes the maximum column limit to be less than the actual number of columns in the list, an error occurs. IndexNumber Column The IndexNumber is NULL if the statistics were not collected on the index. MaxInterval and MaxValueLength Columns If these statistics are collected with system determined maximum intervals and maximum value length, the MaxInterval and MaxValueLength columns are NULL. SampleSizePct Column If sampling is not used, the SampleSizePct column is set to 0 or 100. Data Dictionary 327 Chapter 3: Views Reference TriggersV[X] Related Topics For information about statistics collected on ... See ... non-indexed columns and single-column indexes “ColumnStatsV[X]” on page 83. indexes for which two or more columns have been defined “IndexStatsV[X]” on page 153. multiple columns “MultiColumnStatsV[X]” on page 177. tables “StatsV” on page 303 or “TableStatsV” on page 312. single expressions “ExpStatsV” on page 138. multiple expressions “MultiExpStatsV” on page 180. TriggersV[X] Contains information about event-driven, specialized procedures attached to a single table and stored in the database. Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DataBaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL SubjectTableDatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 328 Data Dictionary Chapter 3: Views Reference TriggersV[X] View Column Data Type Format Referenced Table.Column TableName VARCHAR(128) X(128) TVM.TVMName X(128) TriggersTbl.TriggerName X(1) TriggersTbl.TriggerEnabled X(1) TriggersTbl.ActionTime X(1) TriggersTbl.TriggerEvent X(1) TriggersTbl.Kind UNICODE NOT CASESPECIFIC NOT NULL TriggerName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL EnabledFlag CHAR(1) LATIN UPPERCASE NOT NULL ActionTime CHAR(1) LATIN UPPERCASE NOT NULL Event CHAR(1) LATIN UPPERCASE NOT NULL Kind CHAR(1) LATIN UPPERCASE NOT NULL OrderNumber SMALLINT ---,--9 TriggersTbl.TriggerOrder TriggerComment VARCHAR(255) X(255) TriggersTbl.CommentString X(255) TVM.RequestText X(128) Dbase.DatabaseName UNICODE RequestText VARCHAR(12500) UNICODE CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI: SS TriggersTbl.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 329 Chapter 3: Views Reference TriggersV[X] View Column Data Type Format Referenced Table.Column LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TriggersTbl.LastAlterTimeStamp AccessCount INTEGER --,---,---,--9 TriggersTbl.AccessCount LastAccessTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS TriggersTbl.LastAccess TimeStamp CreateTxtOverflow CHAR(1) LATIN X(1) TriggersTbl.CreateTxtOverflow VTEventType CHAR(1) LATIN X(1) TriggersTbl.VTEventType TTEventType CHAR(1) LATIN X(1) TriggersTbl.TTEventType The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles • DBC.TriggersTbl • DBC.TVM Usage Notes Some of the column values show information related to a Teradata temporal table or an ANSI temporal table. For more information about these tables, see ANSI Temporal Table Support and Temporal Table Support. Possible Values for the Event Column Value Description U Update I Insert D Delete Possible Values for the VTEventType Column Value Description A ANSIQUALIFIER Note: ANSI temporal tables require that the session temporal qualifier for systems using Teradata temporal tables be explicitly set to ANSIQUALIFIER. 330 Data Dictionary Chapter 3: Views Reference TriggersV[X] Value Description C CURRENT VALIDTIME N NONSEQUENCED VALIDTIME NULL No valid-time dimension S SEQUENCED VALIDTIME Possible Values for the TTEventType Column Value Description A ANSIQUALIFIER. Note: ANSI temporal tables require that the session temporal qualifier for systems using Teradata temporal tables be explicitly set to ANSIQUALIFIER. C CURRENT TRANSACTIONTIME N NONSEQUENCED TRANSACTIONTIME NULL No transaction-time dimension S SEQUENCED TRANSACTIONTIME T Nontemporal to indicate that transaction-time is ignored even though the table supports a transaction-time dimension Examples Example 1 The following SELECT returns this information: • Name of the database in which the triggering table is defined for those cases in which a trigger is defined in a different database than the triggering table • Names of the triggering tables • Names of the database in which the trigger is defined • Trigger names This query identifies those triggers for which the trigger must be dropped if the database containing the triggering table is deleted. SELECT SubjectTableDatabaseName, TableName, DatabaseName, TriggerName FROM Triggers WHERE DatabaseName <> SubjectTableDatabaseName ORDER BY 1, 2, 3, 4; Example 2 This query identifies those triggers for which the trigger must be dropped if the database containing the triggering table is deleted. Data Dictionary 331 Chapter 3: Views Reference UDTInfoV SELECT SubjectTableDatabaseName, TableName, DatabaseName, TriggerName FROM Triggers WHERE DatabaseName <> SubjectTableDatabaseName ORDER BY 1, 2, 3, 4; Related Topics For more information about triggers, see SQL Data Definition Language. UDTInfoV Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column TypeId BYTE(6) X(12) UDTInfo.TypeID X(8) UDTInfo.DatabaseId (Composite NUPI) X(128) UDTInfo.TypeName X(1) UDTInfo.TypeKind X(1) UDTInfo. INSTANTIABLE X(1) UDTInfo.FINAL X(1) UDTInfo.OperatorAll X(128) UDTInfo.DefaultTransform Group NOT NULL DatabaseId BYTE(4) NOT NULL TypeName VARCHAR(128) UNICODE NOT NULL TypeKind CHAR(1) LATIN NOT NULL INSTANTIABLE CHAR(1) LATIN NOT NULL FINAL CHAR(1) LATIN NOT NULL OperatorAll CHAR(1) LATIN NOT NULL DefaultTransformGroup VARCHAR(128) UNICODE 332 Data Dictionary Chapter 3: Views Reference UDTInfoV View Column Data Type Format Referenced Table.Column OrderingForm CHAR(1) LATIN X(1) UDTInfo.OrderingForm NOT NULL OrderingCategory CHAR(1) LATIN X(1) UDTInfo.OrderingCategory OrderingRoutineId BYTE(6) X(12) UDTInfo.OrderingRoutine Id CastCount BYTEINT --9 UDTInfo.CastCount NOT NULL Usage Notes OrderingRoutineID Column You can specify an Embedded Services ordering routine by setting the OrderingRoutineId column to '000000000000'XB. Embedded Services refers to a procedure in which one of the database integration methods is called directly. Possible Values for the OrderingCategory Column Value Description R Relative M Map Possible Values for the OrderingForm Column Value Description N None F Full E Equals only Possible Values for the TypeKind Column Value Description S Structure D Distinct I Internal Example Data Dictionary 333 Chapter 3: Views Reference UpdateUseCountV[X] The following SELECT statement retrieves information about the predefined Array type "ArrayVec," which is provided by the DIP scripts: SELECT TypeId, TypeKind, OrderingForm, OrderingCategory, CastCount FROM DBC.UDTInfoV WHERE TypeName = 'ArrayVec'; The query returns the following result: TypeId -----------000090060000 TypeKind -------I OrderingForm -----------F OrderingCategory ---------------M CastCount --------0 UpdateUseCountV[X] Category Accounting Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName X(3) ObjectUsage.UsageType --,---,---,---,---,---,--9 ObjectUsage.UserUpdateCnt UNICODE NOT NULL ObjectName VARCHAR(128) NOT NULL FieldName VARCHAR(128) NOT NULL UsageType CHAR(3) NOT NULL UpdateCount BIGINT Usage Notes Possible Values for the UsageType Column 334 Name Description DML Data Manipulation Language Data Dictionary Chapter 3: Views Reference User_Default_JournalsV[X] Name Description STA Optimizer usage of statistics Example The following SELECT statement displays the number of updates occurring on a particular object: SELECT FieldName, UpdateCount FROM DBC.UpdateUseCountV WHERE DatabaseName = 'Personnel' AND ObjectName = 'Employee'; The query returns the following result: FieldName ---------id name UpdateCount -----------1 0 User_Default_JournalsV[X] Category Schema Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) UNICODE NOT CASESPECIFIC NOT NULL Journal_DB VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL JournalName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL Data Dictionary 335 Chapter 3: Views Reference UserGrantedRightsV The X view references these additional tables: • DBC.AccessRights • DBC.DBase • DBC.Owners • DBC.RoleGrants • DBC.Roles • DBC.TVM 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; Result: UserName -------Usr1 Usr2 Usr3 Journal_DB ---------Usr1 Usr2 Usr3 JournalName ----------Usr1Jrnl Usr2Jrnl Usr3Jrnl UserGrantedRightsV Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 336 Data Dictionary Chapter 3: Views Reference UserGrantedRightsV View Column Data Type Format Referenced Table.Column ColumnName VARCHAR(128) X(128) TVFields.FieldName X(128) Dbase.DatabaseName X(2) AccessRights.AccessRight X(1) AccessRights.WithGrant X(1) AccessRights.AllnessFlag X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS AccessRights.CreateTimeStamp UNICODE NOT CASESPECIFIC NOT NULL Grantee VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccessRight CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL GrantAuthority CHAR(1) LATIN UPPERCASE NOT NULL AllnessFlag CHAR(1) LATIN UPPERCASE NOT NULL CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) Usage Notes For more information about the possible values for the AccessRight column, see Appendix A: “View Column Values.” Possible Values for the AllnessFlag Column Data Dictionary Value Description Y Yes N No 337 Chapter 3: Views Reference UserRightsV Example The following SELECT statement displays all privileges that the current user has granted to other users. ==> SELECT DatabaseName,TableName,Grantee,AccessRight FROM DBC.UserGrantedRights; Result: DatabaseName -----------Personnel Personnel Personnel TableName --------Employee Employee Employee Grantee ------Greene Greene Greene AccessRight ----------R U I UserRightsV Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column DatabaseName VARCHAR(128) X(128) Dbase.DatabaseName X(128) TVM.TVMName X(128) TVFields.FieldName UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL 338 Data Dictionary Chapter 3: Views Reference UserRightsV View Column Data Type Format Referenced Table.Column AccessRight CHAR(2) LATIN X(2) AccessRights.AccessRight X(1) AccessRights.WithGrant X(128) Dbase.DatabaseNameI (UPI) X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS AccessRights.CreateTimeStamp UPPERCASE NOT CASESPECIFIC NOT NULL GrantAuthority CHAR(1) LATIN UPPERCASE NOT NULL GrantorName VARCHAR(128) UNICODE UPPERCASE NOT CASESPECIFIC CreatorName VARCHAR(128) UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) 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 of a user due to ownership of objects, nor does it return information about privileges inherited by a user from PUBLIC or roles. To obtain information about privileges inherited from roles, use the UserRoleRights view. For implicit privileges, use the Children[X] and Tables[X] views to determine all the objects owned by a user. For information about the possible values for the AccessRight column, see Appendix A: “View Column Values.” Example The following SELECT statement displays information about all tables in the Personnel database on which privileges were granted to the requesting user. ==> SELECT * FROM DBC.UserRights WHERE DatabaseName=’Personnel’ AND TableName = ’All’ ; Data Dictionary 339 Chapter 3: Views Reference UserRoleRightsV Result: DatabaseName -----------Personnel Personnel Personnel TableName --------Employee Employee Employee AccessRight ----------R U I GrantorName ----------DBC DBC DBC UserRoleRightsV Category Security Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column RoleName VARCHAR(128) X(128) Roles.RoleName X(128) Dbase.DatabaseName X(128) TVM.TVMName (NUSI) X(128) TVFields.FieldName X(2) AccessRights.AccessRight UNICODE NOT NULL DatabaseName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL TableName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL ColumnName VARCHAR(128) UNICODE NOT CASESPECIFIC NOT NULL AccessRight CHAR(2) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL 340 Data Dictionary Chapter 3: Views Reference UsersV View Column Data Type Format Referenced Table.Column GrantorName VARCHAR(128) X(128) Dbase.DatabaseName YYYY-MMDDBHH:MI:SS AccessRights.CreateTimeStamp UNICODE NOT CASESPECIFIC CreateTimeStamp TIMESTAMP(0) Usage Notes The UserRoleRights view is similar to the AllRoleRights view. However, UserRoleRights has additional WHERE conditions that restrict the result set to rows belonging to the current role of the user and all roles nested within that. For information about the possible values for the AccessRight column, see Appendix A: “View Column Values.” Example The following SELECT statement returns all privileges granted to the current role of the user and the roles nested within the current role. ==> SELECT CAST(RoleName as CHAR(16)) as RoleName, CAST(DatabaseName as CHAR(15)) as Databases, CAST(TableName as CHAR(15)) as TVMs --, CAST(ColumnName as CHAR(10)) as Columns, CAST(AccessRight as CHAR(5)) as AccRights, CAST(GrantorName as CHAR(15)) as Grantor FROM DBC.UserRoleRights ORDER BY 1,2,3,5; Result: RoleName -------------roles017_r1f roles017_r2d Databases --------------roles017_3_db roles017_3_db TVMs --------------roles017_3_v2 roles017_3_v2 AccRights --------R R Grantor --------roles017_3 roles017_3 UsersV Category Database Database DBC Data Dictionary 341 Chapter 3: Views Reference UsersV View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) Dbase.CreatorName UNICODE NOT CASESPECIFIC NOT NULL CreatorName VARCHAR(128) UNICODE NOT NULL PasswordLastModDate DATE YY/MM/DD Dbase.PasswordModDate PasswordLastModTime TIME(0) HH:MI:SS Dbase.PasswordModTime OwnerName VARCHAR(128) X(128) Dbase.OwnerName -,---,---,---,---,---,---,--9 (explicit) Dbase.PermSpace UNICODE NOT NULL PermSpace FLOAT NOT NULL SpoolSpace FLOAT -,---,---,---,---,---,---,-9(explicit) Dbase.SpoolSpace TempSpace FLOAT -,---,---,---,---,---,---,-9(explicit) Dbase.TempSpace ProtectionType CHAR(1) LATIN X(1) Dbase.ProtectionType X(2) Dbase.JournalFlag X(255) Dbase.StartupString X(128) Dbase.AccountName X(128) Dbase.DefaultDataBase X(255) Dbase.CommentString UPPERCASE NOT NULL JournalFlag CHAR(2) LATIN UPPERCASE NOT NULL StartupString VARCHAR(255) UNICODE DefaultAccount VARCHAR(128) UNICODE NOT CASESPECIFIC DefaultDataBase VARCHAR(128) UNICODE CommentString VARCHAR(255) UNICODE 342 Data Dictionary Chapter 3: Views Reference UsersV View Column Data Type Format Referenced Table.Column DefaultCollation CHAR(1) LATIN X(1) Dbase.DefaultCollation UPPERCASE NOT NULL PasswordChgDate DATE YY/MM/DD Dbase.PasswordChgDate LockedDate DATE YY/MM/DD Dbase.LockedDate LockedTime INTEGER 99:99 Dbase.LockedTime LockedCount BYTEINT ---9 Dbase.LockedCount TimeZoneHour BYTEINT ---9 Dbase.TimeZoneHour TimeZoneMinute BYTEINT ---9 Dbase.TimeZoneMinute DefaultDateForm CHAR(1) LATIN X(1) Dbase.DefaultDateForm UPPERCASE CreateTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS Dbase.CreateTimeStamp LastAlterName VARCHAR(128) X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL LastAlterTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS Dbase.LastAlterTimeStamp DefaultCharType SMALLINT ---,--9 Dbase.DefaultCharType RoleName VARCHAR(128) X(128) Dbase.RoleName X(128) Dbase.ProfileName UNICODE NOT NULL ProfileName VARCHAR(128) UNICODE AccessCount BIGINT --,---,---,---,---,---,--9 ObjectUsage.UserAccessCnt LastAccessTimeStamp TIMESTAMP(0) YYYY-MMDDBHH:MI:SS ObjectUsage.LastAccessTimeStamp ExportDefinitionName VARCHAR(30) X(30) ExportWidth.ExportDefinitionName X(40) ExportWidth.ExportWidthRuleSet CHARACTER SET LATIN NOT CASESPECIFIC ExportWidthRuleSet Data Dictionary BYTE(20) 343 Chapter 3: Views Reference UsersV Usage Notes During a session, the account name may be changed. For the current account name of the session, see “SessionInfoV[X]” on page 288. For information about the possible values for the JournalFlag column, see Appendix A: “View Column Values.” DefaultAccount Column The DefaultAccount column is the name of the default account, if any, for the user. Possible Values for the DefaultCharType Column Value Description 1 Latin 2 Unicode 3 KanjiSJIS 4 Graphic 5 Kanji1 Possible Values for the DefaultCollation Column Value Description A ASCII E EBCDIC H Host M Multinational C CharSet_Coll J JIS_Coll Possible Value for the DefaultDataBase Column If the default database is not defined in a CREATE/MODIFY USER statement, the DefaultDataBase column is the user space and NULL is returned. Note: At logon, the DefaultDataBase column may be superseded by a default account in a profile, if the user has a profile that specifies a default account. UserName Column For this column, the SYSTEMUSERID is a system user name that tracks console utility activity such as table rebuild, Diskcopy, or Scandisk. 344 Data Dictionary Chapter 3: Views Reference UsrAsgdSecConstraintsV[X] 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; Result: 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 Related Topics For more information about ... See ... controlling access, space, and ownership Database Design. interpreting the ExportWidthRuleSet column “ExportWidthV” on page 135. using the DBSControl utility to make export width definition changes International Character Set Support. UsrAsgdSecConstraintsV[X] Category Integrity Database DBC View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column UserName VARCHAR(128) X(128) Dbase.DatabaseName X(128) SecConstraints.ConstraintName (UPI) UNICODE NOT NULL ConstraintName VARCHAR(128) UNICODE NOT NULL Data Dictionary 345 Chapter 3: Views Reference ZoneGuestsV[X] View Column Data Type Format Referenced Table.Column ValueName VARCHAR(128) X(128) ConstraintValues.ConstraintVal X(1) AsgdSecConstraints.IsDefault X(128) Dbase.DatabaseName UNICODE NOT CASESPECIFIC NOT NULL IsDefault CHAR(1) LATIN UPPERCASE NOT CASESPECIFIC NOT NULL Assignor VARCHAR(128) UNICODE NOT NULL Usage Notes Possible Values for the IsDefault Column Value Description Y Default N Not the default ZoneGuestsV[X] Category Security Database DBC 346 Data Dictionary Chapter 3: Views Reference ZonesV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ZoneName VARCHAR(128) X(128) Zones.ZoneNameI Note: This column is reserved for future use. UNICODE X(128) Dbase.DatabaseNameI UPPERCASE NOT CASESPECIFIC NOT NULL GuestName VARCHAR(128) Note: This column is reserved for future use. UNICODE GuestKind VARCHAR(4) Note: This column is reserved for future use. NOT NULL GrantorName VARCHAR(128) Note: This column is reserved for future use. UNICODE GrantedTimeStamp TIMESTAMP(0) Note: This column is reserved for future use. NOT NULL NOT NULL X(4) X(128) Dbase.DatabaseNameI YYYY-MMDDBHH:MI:SS ZoneGuests.CreateTimeStamp NOT NULL Usage Notes This view is reserved for future use. ZonesV[X] Category Security Database DBC Data Dictionary 347 Chapter 3: Views Reference ZonesV[X] View Columns and Referenced Table.Columns View Column Data Type Format Referenced Table.Column ZoneName VARCHAR(128) X(128) Zones.ZoneNameI Note: This column is reserved for future use. UNICODE X(128) Dbase.DatabaseNameI X(1) Zones.RootType X(128) Dbase.DatabaseNameI X(128) Dbase.DatabaseNameI YYYY-MMDDBHH:MI:SS Zones.CreateTimeStamp UPPERCASE NOT CASESPECIFIC NOT NULL RootName VARCHAR(128) Note: This column is reserved for future use. UNICODE RootType CHAR(1) LATIN Note: This column is reserved for future use. UPPERCASE NOT CASESPECIFIC ZoneDBAName VARCHAR(128) Note: This column is reserved for future use. UNICODE CreatorName VARCHAR(128) Note: This column is reserved for future use. UNICODE CreateTimeStamp TIMESTAMP(0) Note: This column is reserved for future use. NOT NULL NOT NULL NOT NULL NOT NULL Usage Notes This view is reserved for future use. 348 Data Dictionary CHAPTER 4 Data Dictionary Tables You can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to list the Data Dictionary tables and view details about each table column. For information about Teradata Studio Express and to download the tool, go to: http://developer.teradata.com/tools/articles/teradata-studio-express-14-00-now-available How Tables Are Created The Data Dictionary tables are created during system initialization (SysInit), by the Table Initialization Program, or both. The tables store information about the system (system metadata) that is essential for it to function. The information is also essential to users that are responsible for managing the system. The system automatically updates the information in the tables to reflect the current state of the system. Accessing Tables Data Dictionary tables can be accessed only by users who have the required privileges to the tables. Access to the tables is strictly controlled to ensure that users (including system administrators) cannot modify them. Notice: To ensure that the system functions properly, do not modify or delete any Data Dictionary tables. Use Data Dictionary views to access data in the tables to ensure that the tables are not accidentally modified or deleted. Non-Hashed Tables When a table is nonhashed, all of the rows of the table are kept on a single AMP. For example, the DBC.DatabaseSpace table only keeps track of the space for a single AMP. Similarly, recovery tables only contain the information necessary to recover any activity/transaction that occurred on their own AMP. The following table lists the nonhashed and NO FALLBACK Data Dictionary tables. Data Dictionary Non-Hashed, NO FALLBACK Tables Description Acctg Resource usage by Acct/User 349 Chapter 4: Data Dictionary Tables DBCExtension Tables Non-Hashed, NO FALLBACK Tables Description ChangedRowJournal Down-AMP recovery journal DatabaseSpace Database and table space accounting LocalSessionStatusTable Last request status by AMP LocalTransactionStatusTable Last transaction consensus status OrdSysChngTable AMP recovery journal RecoveryLockTable Recovery session locks RecoveryPJTable Permanent journal recovery SavedTransactionStatus AMP recovery table SysRcvStatJournal Recovery, Reconfig, and startup info TransientJournal Backout uncommitted transactions UtilityLockJournalTable Host utility lock records DBCExtension Tables The DBCExtension database is used to obtain the Global and Persistent (GLOP) sets used to define a particular mapping of data, how the data in the set is mapped, and the actual GLOP data that is mapped. The following tables are contained in the DBCExtension system database. Table Description GLOP_Map The GLOP_Map table contains the possible mappings for the particular set. GLOP_Set The GLOP_Set table describes the type of mapping for a set Glop_Data The GLOP_Data table describes the actual data to be mapped for a particular GLOP set reference. Related Topics For information on the DBCExtension.GLOP_Add, DBCExtension.GLOP_Remove, DBCExtension.GLOP_Change, and DBCExtension.GLOP_Report stored procedures that provide user access to the tables, see SQL External Routine Programming or refer to the table column definitions in Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. 350 Data Dictionary Chapter 4: Data Dictionary Tables Updating Tables Updating Tables When a data definition statement is processed, the system tables are updated automatically. When a table is changed by an ALTER, CREATE, DROP, or RENAME statement, the Teradata Database automatically increments the version count for that table. For more information about creating, changing, and dropping tables, see SQL Data Definition Language. You cannot use the INSERT or UPDATE, or DELETE SQL commands to alter the Data Dictionary in any way. Character Data Character data in the Data Dictionary affects the following kinds of view columns: • Object Name • Text Strings • Other Character Data Object Names To make the Data Dictionary field definitions consistent across all Teradata platforms, the following attributes apply to each object name: • All object name columns are VARCHAR(128) CHARACTER SET UNICODE. • The default format for the object names is defined as X (128). Text Strings In the Data Dictionary, there are object names, SQL Text, and various other fields (for example, Title) that are Unicode. Other Character Data The server character set of non-object name character fields in the Data Dictionary is Latin. These fields (for example, CHAR(1) or CHAR(2)) have a fixed set of values (for example, Y, N, A, CV, and so on) and contain characters from U+0020 to U+007F (for example, A is U+0041). For more information about server character sets, see International Character Set Support. Maintaining System Logs Some Data Dictionary tables are in the form of logs, which accumulate increasing amounts of data over time. To avoid excess use of perm space, you should periodically delete older Data Dictionary 351 Chapter 4: Data Dictionary Tables Maintaining System Logs information from the log tables using either SQL DELETE requests or the Log Table Cleanup function in Teradata Viewpoint. Note: Older log data can also be transferred to other storage media if site policy requires longterm log record retention. You can create backup log tables to store log history and periodically copy data from the active logs and archive it to backup tables or long-term table storage. using the BTEQ .EXPORT command, FastExport, or a Backup and Restore (BAR) Software. Data Dictionary Logs that Require Manual Purging Logs Description Logs that can be either purged manually or using Teradata Viewpoint. Access Log (DBC.AccLogTbl) Data collected as defined in a BEGIN LOGGING statement, for each privilege check of an attempted user access of a database object. DBQ Logs: Data collected during database query logging (DBQL), if DBQL is enabled. • • • • • • DBC.DBQLSummaryTbl DBC.DBQLStepTbl DBC.DBQLogTbl DBC.DBQLObjTbl DBC.DBQLExplainTbl DBC.DBQLSqlTbl Event Log (DBC.EventLog) Data collected automatically by the system for each user logon event. ResUsage Logs: ResUsage tables collect data on system resource usage. • • • • • • • • • • • You can enable ResUsage data collection and set the collection rate using either: DBC.ResUsageSpma DBC.ResUsageSvpr DBC.ResUsageShst DBC.ResUsageIpma DBC.ResUsageIvpr DBC.ResUsageScpu DBC.ResUsageSldv DBC.ResUsageSawt DBC.ResUsageSps DBC.ResUsageSpdsk DBC.ResUsageSvdsk • The ctl utility SCREEN RSS command • Teradata Viewpoint data collectors The collection rate determines how quickly data accumulates and when the logs should be purged. SWEvent Log (DBC.SW_Event_Log) The system automatically inserts rows in response to software errors and system events, for use by Teradata Customer Service. TDWM Logs: Logs for Teradata Viewpoint workload management functions. • DBC.TDWMSummaryLog • DBC.TDWMEventLog • DBC.TDWMExceptionLog 352 Data Dictionary Chapter 4: Data Dictionary Tables Maintaining System Logs Logs Description Logs that can only be purged manually. In Doubt transaction Log (DBC.InDoubtResLog) Contains a row for each transaction where completion was in doubt. Manually Deleting Old Log Data You can use the Teradata SQL DELETE statement to purge outdated log data, for example DBC.LogOnOff log data. Note: The user executing the SQL statement must have the DELETE privilege on the corresponding view. For example: You can purge DBC.LogOnOff log data based on age. Teradata recommends retaining 90 days of log data and purging directly from the DBC.EventLog table. DELETE FROM DBC.EventLog WHERE (DATE-DateFld) > 90; You can purge information for an account after a cost accounting period has closed. DELETE FROM DBC.AMPUsageV WHERE Accountname = ’$M619’; Related Topics Data Dictionary For more information on ... See ... how to manually purge old logs or copy the data to backup tables Database Administration. using the Log Table Clean Up function in Teradata Viewpoint to purge log data Teradata Viewpoint User Guide. 353 Chapter 4: Data Dictionary Tables Maintaining System Logs 354 Data Dictionary APPENDIX A View Column Values Many column types can be found in multiple system views or tables. The values of the most common column types in the system are listed below. AccessRight Column Value Description AE ALTER EXTERNAL PROCEDURE AF ALTER FUNCTION AP ALTER PROCEDURE AS ABORT SESSION CA CREATE AUTHORIZATION CD CREATE DATABASE CE CREATE EXTERNAL PROCEDURE CF CREATE FUNCTION CG CREATE TRIGGER CM CREATE MACRO CO CREATE PROFILE CP CHECKPOINT CR CREATE ROLE CS CREATE SERVER CT CREATE TABLE CU CREATE USER CV CREATE VIEW CZ Note: This value is reserved for future use. CREATE ZONE Data Dictionary D DELETE DA DROP AUTHORIZATION 355 Appendix A: View Column Values AccessRight Column Value Description DD DROP DATABASE DF DROP FUNCTION DG DROP TRIGGER DM DROP MACRO DO DROP PROFILE DP DUMP DR DROP ROLE DS DROP SERVER DT DROP TABLE DU DROP USER DV DROP VIEW DZ Note: This value is reserved for future use. DROP ZONE 356 E EXECUTE (MACRO) EF EXECUTE FUNCTION GC CREATE GLOP GD DROP GLOP GM GLOP MEMBER I INSERT IX INDEX MR MONITOR RESOURCE MS MONITOR SESSION NT NONTEMPORAL OA OVERRIDE DUMP OD OVERRIDE DELETE POLICY OI OVERRIDE INSERT POLICY OP CREATE OWNER PROCEDURE OR OVERRIDE RESTORE OS OVERRIDE SELECT POLICY OU OVERRIDE UPDATE POLICY PC CREATE PROCEDURE Data Dictionary Appendix A: View Column Values ConstraintType Column Value Description PD DROP PROCEDURE PE EXECUTE PROCEDURE R RETRIEVE/SELECT RF REFERENCE RO REPLCONTROL RS RESTORE SA SECURITY CONSTRAINT ASSIGNMENT (system wide) SD SECURITY CONSTRAINT DEFINITION (system wide) SH SHOW SR SET RESOURCE RATE SS SET SESSION RATE ST STATISTICS TH CTCONTROL U UPDATE UM UDT METHOD UT UDT TYPE UU UDT USAGE ZO Note: This value is reserved for future use. ZONE OVERRIDE ConstraintType Column Data Dictionary Value Description C Explicit table-level constraint check P Nonpartitioned Primary Index Q Partitioning constraint S Hash-ordered Secondary Index without ALL K Primary key U Unique constraint R References constraint 357 Appendix A: View Column Values ExceptionValue Column Value Description V Value-ordered Secondary Index without ALL H Hash-ordered Secondary Index with ALL O Value-ordered secondary with ALL ExceptionValue Column These values show up as an integer. A conversion to hex extracts the bit values. For example, a value of 1024 converted to hex is 400. Value Description 0x00000001 Exception time limit exceeded 0x00000002 CPU time (AMP and PE) limit exceeded 0x00000004 Blocked time limit exceeded 0x00000008 Disk to CPU ratio exceeded 0x00000010 AMP CPU skew limit exceeded 0x00000020 AMP I/O count limit exceeded 0x00000040 AMP I/O skew limit exceeded 0x00000080 Max row count (for a step) exceeded 0x00000100 Max row count (for a query) exceeded 0x00000200 Spool space limit exceeded 0x00000400 Number of AMPS used in query exceeded IndexType Column 358 Value Description P Nonpartitioned primary index Q Partitioned primary index S Secondary index J Join index N Hash index Data Dictionary Appendix A: View Column Values JournalFlag Column Value Description K Primary key U Unique constraint V Value-ordered secondary index H Hash-ordered ALL covering secondary index O Valued-ordered ALL covering secondary index I Ordering column of a composite secondary index G Geospatial non-unique secondary index. Note: This value applies only to the IndicesV view. JournalFlag Column Value Description N No journal (default) S Single journal D Dual journal L Local AFTER journal (not used for BEFORE) NoSQLDataAccess Column Value Description Y No SQL in the external stored procedures C Contains SQL R Reads SQL data M Modifies SQL data ProcessOffline Column Note: Tables undergoing large-scale changes should not be processed during online redistribution. Flag these tables for offline redistribution by setting this field to Y. Data Dictionary 359 Appendix A: View Column Values RoutineKind Column Value Description Y Table should be process (deleted or redistributed) offline during the offline portion of the Reconfig deletion or redistribution phase. N Table should be processed (deleted or redistributed) online during the online of the Reconfig deletion or redistribution phase. (This is the default.) RoutineKind Column Value Description C Constructor D Decompress UDF E Compress UDF M Mutator O Observer R Regular function StatsSource Column Value Description I Internally generated S User collected with COLLECT STATS (system built) U User collected with COLLECT STATS VALUES clause C Copied from other sources T Transferred with CREATE TABLE...AS statement TableKind Column 360 Value Description A Aggregate function Data Dictionary Appendix A: View Column Values TableKind Column Value Description B Combined aggregate and ordered analytical function C Table operator parser contract function D JAR E External stored procedure F Standard function G Trigger H Instance or constructor method I Join index J Journal K Foreign server object. Note: K is supported on the Teradata-to-Hadoop connector only. Data Dictionary L User-defined table operator M Macro N Hash index O Table with no primary index and no partitioning P Stored procedure Q Queue table R Table function S Ordered analytical function T Table with a primary index, partitioning, or both U User-defined data type V View X Authorization Y GLOP set Z UIF 361 Appendix A: View Column Values TimeDimension Column TimeDimension Column Value Description N Nontemporal column (default) R Temporal relationship constraint (TRC) column T Transaction-time column V Valid-time column S SYSTEM_TIME derived period column VTCheckType Column 362 Value Description NULL No valid-time dimension C CURRENT VALIDTIME S SEQUENCED VALIDTIME N NONSEQUENCED VALIDTIME Data Dictionary APPENDIX B LogonSource Column Fields and Examples LogonSource Column Note: The LogonSource column is deprecated and will be replaced in a future release. The LogonSource column includes information about the source of sessions logged on from a client, including information on the TDP and job name. It is referenced in the following: • • Views: • LogOnOffV[X] • SessionInfoV[X] • QryLogV Tables: • EventLog • SessionTbl Mainframe-Attached Systems Using the CLIv2 API The origin of the CLIv2 mainframe session being reported, such as the user ID or session number of the client system. LogonSource can contain the following names and identifiers. Unless otherwise noted, each of the LogonSource string fields contains eight characters. Field Name Description Operating System Name Name of the client operating system for this logon. (Field 1) The valid name is MVS. TDP ID Unique identifier for the mainframe TDP controlling this logon. (Field 2) Job Name This is the job name. (Field 3) Environment Name The valid environments are BATCH, CICS, IMS, and TSO. (Field 4) Data Dictionary 363 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description User ID from Security Product This is the user ID provided by the security product in use. Note: If no security product is in use, this is blank. (Field 5) Group from Security Product This is the group ID provided by the security product in use. (Field 6) If no security product is in use, this is blank. Program Name Use of this field is deprecated because it is not possible to determine whether it specifies an executable application name or a unique identifier provided by an application using the CLIv2 Workload specification (see Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems). (Field 7) Instead, you should use the Actual Program Name field, which provides a reliable name for the executable application Coordinator Name (Field 8) Name of the Coordinator if the logon is part of a two-phase commit logon. This is used only by the CICS and IMS mainframe transaction managers; otherwise, it is blank. Transaction ID (Field 9) Unique identifier for the transaction as determined by the transaction manager. This is used only by the CICS and IMS mainframe transaction managers; otherwise, it is blank. Terminal ID Unique identifier for the terminal as determined by CICS. (Field 10) This is used only for CICS; otherwise, it is blank. User/Operator ID Unique identifier for the user or operator as determined by CICS. (Field 11) This is used only for CICS; otherwise, it is blank. Actual Program Name This field contains the name of the executable application. (Field 12) Job ID This field contains the job ID. (Field 13) 364 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Format ID Format identifier that can be used to parse the earlier positional information in the LogonSource attribute. If the field ends with the following four characters, the format ID is present: (Field 14) LSS Note: In the example above, the first character of the four character format ID is a blank space. The first set of two characters indicate the number of values found before the Actual Program Name, which is either 07 or 11. The second set of two characters indicates the version of the format ID. If the value is 01, the field contains the Job ID. If the value is 02, the field contains both the Actual Program Name and the Job ID value. If no Format ID is present, no Job ID value exists and only the first 7 or 11 fields of the LogonSource string are present. Self-Defining EBCDIC Items (Field 15 or later) The following self-defining EBCDIC items have variable lengths and contain the specified information within the parentheses that follow the field name in the LogonSource string: • TDP(): TDP release ID. See Teradata Director Program Reference. • CL2(): CLIv2 release ID. See Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems. • SESSDESC(): Descriptive information specified by the application using the CLIv2 Session-desc specification. See Teradata Call-Level Interface Version 2 Reference for MainframeAttached Systems. • WORKLOAD(): Information specified by the application using the CLIv2 Workload specification. The information is intended to be used by Teradata Database. See Teradata Call-Level Interface Version 2 Reference for Mainframe-Attached Systems. Note: If the length of the self-defining items causes the LogonSource string to exceed 128 characters, Teradata Database truncates them as necessary and indicates the truncation with the string ‘…)’ if enough space remains to do so. Workstation-Attached Systems Using CLIv2 API The origin of the CLIv2 workstation-attached session being reported, such as the user ID or session number of the client system. Note: The corresponding LogOnOffV[X] or SessionInfoV[X] column shown in the table below appears in the LogOnOffV[X] and SessionInfoV[X] views and EventLog and SessionTbl tables only. Teradata strongly recommends that applications which use the LogonSource fields instead use the corresponding LogOnOffV[X] or SessionInfoV[X] columns, also referred to as ClientAttribute columns. Data Dictionary 365 Appendix B: LogonSource Column Fields and Examples LogonSource Column You can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to learn more about the ClientAttribute columns. Field Name Description Mode The literal string indicating the connection type, for example: (Field 1) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientConnectionType This field is always 8 characters long. This information is provided by the gateway. (Field 2) Hexadecimal TCP port or socket number on the workstation-attached client system. Value is 1 indicating the client is connected using TCP/IP via the gateway. To learn more about the possible values for this column see “Possible Values for the ClientConnectionType Column” on page 173 or you can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. TCP/IP TCP Port or Socket Number Description ClientTcpPortNumber Integer value of the TCP port or socket number. ClientIpAddress Standard string representation of the IPv4 or IPv6 IP address. ClientTdHostName Teradata Database host name that the client used to connect to Teradata Database. ClientProcThreadId Client process or thread ID. This field contains 4 hexadecimal characters. The maximum value is 64K -1 This information is provided by the gateway. IP Address (Field 3) IP address of the workstation-attached client system. This field contains a maximum of 45 characters. This information is provided by the gateway. TDP ID (Field 4) Unique ID for the network TDP controlling this logon. The number of characters depends on the value for the TDP ID that was specified when you logged on. Client Process ID (Field 5) ID for the process on the workstation-attached client system. This field contains a maximum of 10 decimal digits. 366 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client User ID User ID for the logged on user as defined for the workstation-attached client system. (Field 6) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientSystemUserId Client user ID. ClientProgramName Client system program name. ClientJobData Client job data from the LSINFO environmental variable. This field contains a maximum of 92 characters. Client Program ID for the CLIv2-based client program. (Field 7) This field contains a maximum of 256 characters. LSINFO Optional text derived from the LSINFO environment variable. (Field 9) The size of LSINFO depends on how many characters remain available in LogonSource after fields 1 through 8 have been assembled. If the size of LSINFO exceeds the remaining space in LogonSource, CLIv2 truncates the data to fit the available space. Examples Example 1: An Archive Job (TCP/IP) 07DC 10.243.71.25 DW_OLD 2482 ROOT ARCMAIN 01 LSS Field contents: Field 1 2 3 4 5 6 7 8 Contents TCP/IP 07DC 10.243.71.25 DW_OLD 2482 ROOT ARCMAIN 01 LSS Description Connection mode TCP port or societ identifier IP address of the client system TDP ID for the TDP making the connection with Teradata Database for this logon Client process identifier Client system user ID Client program Format ID Example 2: A BTEQ Job (TCP/IP) 0675 141.206.34.18 CS4400S1 2304 Data Dictionary AG110058 BTEQ 01 LSS "THIS IS A TEST!" 367 Appendix B: LogonSource Column Fields and Examples LogonSource Column JDBC Driver API When the application writing to LogonSource connects to Teradata Database using the JDBC driver, the definitions of the LogonSource string fields are as follows. Note: The corresponding LogOnOffV[X] or SessionInfoV[X] column shown in the table below appears in the LogOnOffV[X] and SessionInfoV[X] views and EventLog and SessionTbl tables only. Teradata strongly recommends that applications which use the LogonSource fields instead use the corresponding LogOnOffV[X] or SessionInfoV[X] columns, also referred to as ClientAttribute columns. You can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to learn more about the ClientAttribute columns. Field Name Description Mode The literal string indicating the connection type, for example: (Field 1) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientConnectionType This field is always 8 characters long. This information is provided by Teradata Database. (Field 2) Hexadecimal TCP port or socket number on the client system. Value is 1 indicating the client is connected using TCP/IP via the gateway. To learn more about the possible values for this column see “Possible Values for the ClientConnectionType Column” on page 173 or you can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. TCP/IP TCP Port or Socket Number Description ClientTcpPortNumber Integer value of the TCP port or socket number. ClientIpAddress Standard string representation of the IPv4 or IPv6 IP address. This field contains 4 hexadecimal characters. The maximum value is 64K -1 This information is provided by Teradata Database. IP Address (Field 3) IP address of the client system. This field contains a maximum of 45 characters. This information is provided by Teradata Database. 368 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description TDP ID TDP ID for the TDP making the connection with Teradata Database for this logon. (Field 4) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientTdHostName Description Teradata Database host name that the client used to connect to Teradata Database. This field fills whatever space remains after fields 5 through 8 have been filled. This field contains a maximum of 97 characters, and is truncated to the space remaining after all the other fields have been written. This field comprises 5 components: • Teradata Database host name specified by the application. • SEMICOLON character. • Host name or IP address of the Teradata Database node that was connected. • COLON character. • Port number of the Teradata Database node that was connected. This information is provided by the Teradata JDBC driver. Data Dictionary 369 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client Process/Thread ID An ID for the Java process or thread on the client system. (Field 5) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientProcThreadId Client process or thread ID. ClientSystemUserId Client user ID. The field contains a maximum of 12 characters. Because Java threads are not tied to particular database connections, any thread can execute requests on a connection that was originally created by a different thread. To avoid confusion, the Teradata JDBC driver provides a unique connection ID, which is derived from the hash code of the connection object. This field comprises 2 components: • The four-character literal string, for example: CID= • The unique connection ID. This information is provided by the Teradata JDBC driver. Client User ID (Field 6) User ID for the logged on user as defined for the client system. This field contains a maximum of 20 characters. This information is provided by the Teradata JDBC driver. 370 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client Program An ID for the Java client program. (Field 7) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientProgramName Client system program name. ClientAttributesEx Description of the client that does not match any of the other client attributes fields. This field contains a maximum of 26 characters. This field comprises 4 components: • • • • The literal string JDBC. The JDBC driver version. SEMICOLON character. The system version number: getProperty This field is retrieved using the following method: System.getProperty(“j ava.version”) This information is provided by the Teradata JDBC driver. Format ID (Field 8) A format ID that can be used to parse the earlier positional information in the LogonSource attribute. If the field ends with the following four characters, the format ID is present: LSS Note: In the example above, the first character in the four character format ID is a blank space. This field is always 6 characters long. For JDBC connections, this value is always: 01 LSS This information is provided by the Teradata JDBC driver. Example (TCP/IP) 137D 153.64.135.140 CS4400S1;CS4400S1COP1/153.64.208.223:1025 CID=337D0F TN180005 JDBC14.10.00.00;1.4.2_04 01 LSS Field contents: Data Dictionary 371 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field 1 2 3 4 5 6 7 Contents Description TCP/IP Connection mode 137D TCP port/societ number on the network system 153.64.135.140 IP address of the network client system CS4400S1;CS4400S1COP1/153.64.208.223:102 TDP ID for the TDP making the connection with Teradata Database for this logon5CID=337DoF Client Java process/thread ID TN180005 Client user ID JDBC14.10.00.00;1.4.2_o4 Name of the Java client program801 LSSFormat ID ODBC Driver API The origin of the ODBC session being reported, such as the user ID or process ID of the client system. When the application writing to LogonSource connects to Teradata Database using the ODBC driver, the definitions of the LogonSource string fields are as follows. Note: The corresponding LogOnOffV[X] or SessionInfoV[X] column shown in the table below appears in the LogOnOffV[X] and SessionInfoV[X] views and EventLog and SessionTbl tables only. Teradata strongly recommends that applications which use the LogonSource fields instead use the corresponding LogOnOffV[X] or SessionInfoV[X] columns, also referred to as ClientAttribute columns. You can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to learn more about the ClientAttribute columns. Field Name Description Mode The literal string indicating the connection type, for example: (Field 1) TCP/IP This field is always 8 characters long. This information is provided by Teradata Database. 372 Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientConnectionType Description Value is 1 indicating the client is connected using TCP/IP via the gateway. To learn more about the possible values for this column see “Possible Values for the ClientConnectionType Column” on page 173 or you can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description TCP Port or Socket Number Hexadecimal TCP port or socket number on the network client system. (Field 2) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientTcpPortNumber Integer value of the TCP port or socket number. ClientIpAddress Standard string representation of the IPv4 or IPv6 IP address. ClientTdHostName Teradata Database host name that the client used to connect to Teradata Database. This field contains 4 hexadecimal characters. The maximum value is 64K -1 This information is provided by Teradata Database. IP Address (Field 3) IP address of the network client system. This field contains a maximum of 45 characters. This information is provided by Teradata Database. TDP ID (Field 4) TDP ID for the network TDP making the connection with Teradata Database for this logon. This field fills whatever space remains after fields 5 and 6 have been filled. This field comprises 5 components: • Teradata Database host name specified by the application. • SEMICOLON character. • Host name or IP address of the Teradata Database node that was connected. • COLON character. • Port number of the Teradata Database node that was connected. This information is provided by the Teradata ODBC driver. Data Dictionary 373 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client Process ID ID for the ODBC process on the network client system. (Field 5) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientProcThreadId Client process or thread ID. ClientSystemUserId Client user ID. This field contains a maximum of 12 characters. This information is not provided by the Teradata ODBC driver. Client User ID User ID for the logged on user as defined for the network client system. (Field 6) This field contains a maximum of 20 characters. This information is provided by the Teradata ODBC driver. Example: Teradata ODBC Driver (TCP/IP) 0F6D 141.206.34.228 CS4400S1.TD.TERADATA.COM 3780 GR120994 Field contents: Field 1 2 3 4 Contents TCP/IP 0F6D 141.206.34.228 CS4400S1.FP.TERADATA.COM 5 6 3780 GR120994 Description Connection mode TCP port/societ number on the network system IP address of the network client system TDP ID for the TDP making the connection with Teradata Database for this logon Process ID Client user ID .NET Data Provider for Teradata API The origin of the .NET Data Provider for Teradata session being reported, such as the user ID or process ID of the client system. LogonSource can contain the following names and identifiers. When the application writing to LogonSource connects to Teradata Database using the .NET Data Provider driver, the definitions of the LogonSource string fields are as follows. Note: The corresponding LogOnOffV[X] or SessionInfoV[X] column shown in the table below appears in the LogOnOffV[X] and SessionInfoV[X] views and EventLog and SessionTbl tables only. Teradata strongly recommends that applications which use the LogonSource fields instead use the corresponding LogOnOffV[X] or SessionInfoV[X] columns, also referred to as ClientAttribute columns. 374 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column You can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express to learn more about the ClientAttribute columns. Field Name Description Mode The literal string indicating the connection type, for example: (Field 1) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientConnectionType This field is always 8 characters long. This information is provided by Teradata Database. (Field 2) Hexadecimal TCP port or socket number on the network client system. Value is 1 indicating the client is connected using TCP/IP via the gateway. To learn more about the possible values for this column see “Possible Values for the ClientConnectionType Column” on page 173 or you can use Teradata Administrator, Teradata SQL Assistant, or Teradata Studio Express. TCP/IP TCP Port or Socket Number Description ClientTcpPortNumber Integer value of the TCP port or socket number. ClientIpAddress Standard string representation of the IPv4 or IPv6 IP address. This field contains 4 hexadecimal characters. The maximum value is 64K -1. This information is provided by Teradata Database. IP Address (Field 3) IP address of the network client system. This field contains a maximum of 45 characters. This information is provided by Teradata Database. Data Dictionary 375 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description TDP ID TDP ID for the network TDP making the connection with Teradata Database for this logon. (Field 4) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientTdHostName Description Teradata Database host name that the client used to connect to Teradata Database. This field fills whatever space remains after fields 5 through 8 have been filled. Fields 4 through 8 contains a maximum of 97 characters, and Teradata Database truncates the TDP ID field to the space remaining after all the other fields have been written. If not enough space remains, then the data for TDP ID is removed from the LogonSource string. This field comprises 5 components: • DataSource name specified by the application. • COLON character. • IP address of the Teradata Database node that was connected. • COLON character. • Port number of the Teradata Database node that was connected. This information is provided by .NET Data Provider for Teradata. 376 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Corresponding LogOnOffV[X] or SessionInfoV[X] Column Client Process ID ID for the client process. ClientProcThreadId (Field 5) .NET Data Provider removes this field if both the TDP ID and Client User ID fields have been removed, but the resulting string is still longer than the allotted 97 characters for .NET Data Provider for Teradatasupplied fields in LogonSource. Description Client process or thread ID. The field is retrieved using the following function call: Process.GetCurrentPro cessID().ID This information is provided by .NET Data Provider for Teradata. Data Dictionary 377 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client User ID User ID for the logged on user as defined for the client system. (Field 6) Corresponding LogOnOffV[X] or SessionInfoV[X] Column Description ClientSystemUserId Client user ID. The field comprises 3 components: • The domain name. This value is retrieved using the following function call: System.Environment .UserDomainName If a security exception is encountered, the field contains a QUESTION MARK character. • The REVERSE SOLIDUS (\) character (U+005C). • The user name. The value is retrieved using the following function call: System.Environment .UserName If a security exception is encountered, the field contains a QUESTION MARK character. This information is provided by .NET Data Provider for Teradata. 378 Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Client Program ID for the program running on the client system. (Field 7) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientProgramName Description Client system program name. This field comprises 7 components: • The program name. This value is retrieved using the following function call: Process.GetCurrent Process().ProcessN ame If a security exception is encountered, the field contains a QUESTION MARK character. • COLON character. • The literal character string NET. This identifies .NET Data Provider for Teradata. • COLON character. • The literal character string: SS This identifies the session as a standard SQL session. • COLON character. The 12-character release number for the .NET Data Provider for Teradata in the format nn.nn.nn.nnn, where n represents an integer value. This information is provided by .NET Data Provider for Teradata. Data Dictionary 379 Appendix B: LogonSource Column Fields and Examples LogonSource Column Field Name Description Format ID Format ID that can be used to parse the earlier positional information in the LogonSource attribute. (Field 8) Corresponding LogOnOffV[X] or SessionInfoV[X] Column ClientAttributesEx Description Description of the client that does not match any of the other client attributes fields. If the field ends with the following four characters, the format ID is present: LSS Note: In the example above, the first character in the four character format ID is a blank space. This field is always 6 characters long. For .NET Data Provider for Teradata connections, this value is always: 01 LSS This information is provided by .NET Data Provider for Teradata. Note: The data in fields 4 through 7 can be truncated or removed entirely from the LogonSource string as required to ensure that the total length of the fields provided by .NET Data Provider for Teradata does not exceed 97 characters. When field values must be eliminated, they are eliminated in the following order: 380 • TDP ID (Field 4) • Client User ID (Field 6) • Client Process/Thread ID (Field 5) Data Dictionary Appendix B: LogonSource Column Fields and Examples LogonSource Column Example: .NET Data Provider for Teradata API (TCP/IP) 057E 153.64.135.76 SALES:153.64.116.95:1025 3808 CORP\TDUSER TESTAPP:NET:SS:12.00.00.000 01 LSS Field contents: Field 1 2 3 4 Contents TCP/IP 057E 153.64.135.76 SALES:153.64.116.95:1025 5 6 7 8 3608 CORP\TDUSER TESTAPP:NET:SS:12.00.00.000 01 LSS Description Connection mode TCP port/societ number on the network system IP address of the network client system TDP ID for the TDP making the connection with Teradata Database for this logon Client process ID Client user ID Client program The literal 01 LSS, indicating LogonSource string version 01 PDE Internal Session The origin of the PDE internal session being reported, such as the node name or process ID of the client system. LogonSource can contain the following names and identifiers. Field Name Description Library Name Name of the library that logged the session on. (Field 1) Process ID Unique identifier for the application process running on the client system. (Field 2) Application Name Name of the application running on the client system. (Field 3) Node Name Number of the node on which the application logged on. (Field 4) Example: PDE Internal Session 108E 153.64.137.84 LNXMPP 35 Field contents: Field 1 2 Contents 108E 153.64.137.84 3 4 LNXMPP 35 Description Number of the library (LIBDBSUTIL) that logged this session on Unique ID for the application process running on the client system. Name of the application running on the client system. Number of the node on which the application logged on. Data Types for Unicode Views The data types for the compatibility and Unicode views are the same for all versions of the LogonSource column. Data Dictionary 381 Appendix B: LogonSource Column Fields and Examples LogonSource Column 382 Data Dictionary APPENDIX C Database Objects This chapter provides details about each database object stored in the system table. Databases The database objects in the Teradata Database platform contain: • Database name, creator name, owner name, and account name • Space allocation (if any) including: • Permanent • Spool • Temporary • Number of fallback tables • Collation type • Creation timestamp • Date and time the database was last altered and the name that altered it • Role and profile names • Revision numbers for the UDF library and any XSP libraries by Application Category External Stored Procedures External stored procedures are defined and stored as database objects. The source code and the object code are stored in the database of the user space. External stored procedure objects contain: Data Dictionary • C/C++ source and object code for the external stored procedure if its language is not Java. • External stored procedure name • External name • Data types of the parameters • Source file language • Data accessing characteristic • Parameter passing convention • Execution protection mode • Character type 383 Appendix C: Database Objects JARs • Platform type Corresponding Tables and Privileges External stored procedures information is stored in: • DBC.TVM (stores attributes) • DBC.TVFields • DBC.AccLogRuleTbl • DBC.DBase • DBC.AccessRights The privileges relating to external stored procedures are: • CREATE OWNER PROCEDURE • CREATE PROCEDURE • ALTER PROCEDURE • DROP PROCEDURE • EXECUTE PROCEDURE Related Topics For more information on external stored procedures, see SQL External Routine Programming. JARs JAR files are created externally to the database but are defined and stored as a database object when installed on the system. The object code of the externally created JAR file is stored in the database of the user space. The JAR objects contain: • Java object code for the JAR • JAR name • External name • Platform type • Revision number Corresponding Tables and Privileges JAR information is stored in: • DBC.TVM (stores attributes) • DBC.JARS (stores attributes) • DBC.DBase • DBC.AccessRights The privileges relating to JARs are: 384 Data Dictionary Appendix C: Database Objects Java External Stored Procedures • CREATE EXTERNAL PROCEDURE • DROP PROCEDURE • CREATE FUNCTION • DROP FUNCTION Related Topics For more information on JARs, see SQL External Routine Programming. Java External Stored Procedures Java external stored procedures are defined and stored as database objects. Java external stored procedure objects contain: • Java external stored procedure name • External file reference • Data types of the parameters • Source file language • Data accessing characteristic • Parameter passing convention • Execution protection mode • Character type • Platform type Corresponding Tables and Privileges Java external stored procedure information is stored in: • DBC.TVM (stores attributes) • DBC.TVFields • DBC.AccLogRuleTbl • DBC.DBase • DBC.AccessRights • DBC.Routine_Jar_Usage (stores attributes) • DBC.UDFInfo The privileges relating to Java external stored procedures are: Data Dictionary • CREATE OWNER PROCEDURE • CREATE EXTERNAL PROCEDURE • ALTER PROCEDURE • DROP PROCEDURE • EXECUTE PROCEDURE 385 Appendix C: Database Objects Java UDFs Related Topics For more information on Java external stored procedures, see SQL External Routine Programming. Java UDFs Java user-defined functions (UDFs) are defined and stored as database objects. Java UDF objects contain: • Function call name • Specific name • External name • Data types of the parameters • Function class • Source file language • Data accessing characteristic • Parameter passing convention • Deterministic characteristic • Null-call characteristic • Execution protection mode • Character type • Platform type Corresponding Tables and Privileges Java UDF information is stored in: • DBC.TVM (stores attributes) • DBC.TVFields • DBC.AccLogRuleTbl • DBC.DBase • DBC.AccessRights • DBC.Routine_Jar_Usage (stores attributes) • DBC.UDFInfo (stores attributes) The privileges relating to Java UDFs are the following: 386 • ALTER FUNCTION • CREATE FUNCTION • DROP FUNCTION • EXECUTE FUNCTION Data Dictionary Appendix C: Database Objects Stored Procedures Related Topics For more information about ... See ... Java UDFs SQL External Routine Programming. tables affected by UDFs Chapter 3: “Views Reference.” Stored Procedures Stored procedures are database objects executed on the Teradata Database. Typically, stored procedures consist of: • a procedure name • input and output parameters • procedure body. For more information see SQL Stored Procedures and Embedded SQL. For each stored procedure, the database includes a stored procedure table that contains the stored procedure body you write and the corresponding compiled stored procedure object code. Data dictionary tables contain stored procedure parameters and attributes. The Transient Journal (TJ) record holds the host request number for a stored procedure, in addition to the DBS request number, to return a correct response to the query status for a request after DBS restarts. Corresponding Tables and Logging Rules Stored procedure object information is stored in: • DBC.TVM • DBC.TVFields • DBC.AccessRights • DBC.AccLogRuleTbl The SPObjectCodeRows column 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: Data Dictionary • Session mode • Platform type • Print option • Stored procedure text storage option • Version number • Warning option • Hardware architecture 387 Appendix C: Database Objects Tables The SPParameterType column in the DBC.TVFields table contains information about the stored procedure parameters. Parameter types for this column include IN, INOUT, or OUT. The following table lists the privileges stored in the AccessRights table and their corresponding logging rules stored in the AccLogRuleTbl table. Privilege Logging Rule CREATE OWNER PROCEDURE AcrCreOwnerProcedure CREATE PROCEDURE AcrCreateProcedure ALTER PROCEDURE AcrAlterProcedure EXECUTE PROCEDURE AcrExecuteProcedure DROP PROCEDURE AcrDropProcedure Related Topics For more information about ... See ... tables affected by stored procedures Chapter 3: “Views Reference.” usage of stored procedures SQL External Routine Programming. Tables The table objects in the Teradata Database platform contain: 388 • Location, identification, version • Database name, table name, creator name, 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 privileges • Indexes • Constraints • Table backup and protection (including fallback and permanent journaling status) • Date and time the object was created Data Dictionary Appendix C: Database Objects Triggers Triggers The Trigger objects in the Teradata Database platform contain: • IDs of the: • Table • Trigger • Database and subject table database • User who created the trigger • User who last updated the trigger • Timestamp for the last update • Indexes • Trigger name and: • Whether the trigger is enabled • The event that fires the trigger • The order in which triggers fire • Default character set • Creation text and time stamp • Overflow text, that is, trigger text that exceeds a specified limit • Fallback tables Users The user objects in the Teradata Database platform contain: Data Dictionary • User name, creator name, and owner name • Password string and password change date • Space allocation, including: • Permanent • Spool • Temporary • Default account, database, collation, character type, and date form • Creation timestamp • Name and time stamp of the last alteration made to the user • Role and profile name 389 Appendix C: Database Objects UDFs UDFs UDFs are defined and stored as database objects. The UDF source code and object code is stored in the database of the user space. The UDF objects contain: • C source code and object code if its language is not Java • Function call name • Specific name • External name • Data types of the parameters • Function class • Source file language • Data accessing characteristic • Parameter passing convention • Deterministic characteristic • Null-call characteristic • Execution protection mode • Character type • Platform type Corresponding Tables and Privileges UDF information is stored in: • DBC.TVM • DBC.UDFInfo (stores attributes) • DBC.TVFIelds • DBC.AccLogRuleTbl • DBC.DBase • DBC.AccessRights The privileges relating to UDFs are: 390 • ALTER FUNCTION • CREATE FUNCTION • DROP FUNCTION • EXECUTE FUNCTION Data Dictionary Appendix C: Database Objects UDMs Related Topics For more information about ... See ... tables affected by UDFs Chapter 3: “Views Reference.” UDFs SQL External Routine Programming. UDMs User-defined methods (UDMs) are defined and stored as a database object. Object attributes are stored in DBC.UDFInfo, and the source code and object code are stored in the database of the user space. The UDM objects contain: • C source code and object code for the user defined method • Function call name • Name (specific and external) • Data types of the parameters • Function class • Source file language • Data accessing characteristic • Parameter passing convention • Deterministic characteristic • Null-call characteristic • Execution protection mode • Character type • Platform type UDTs The user-defined type (UDT) objects in the Teradata Database platform contain: • Data Dictionary DBC.UDTInfo - one entry per UDT • Type name • Type kind (Distinct or Structured) • Whether the type is instantiable • Default transform group (name) • Ordering form (full ordering or equals only - distinct and structured types are always full) 391 Appendix C: Database Objects Views or Macros • • Ordering category (map or relative - distinct and structured types are always map) • Ordering routine ID • Cast count DBC.UDTCast - one entry per cast for a UDT • Whether cast is implicit assignment • Cast routine ID • DBC.UDFInfo - one entry for the auto-generated default constructor of the UDT; entries are the same as for a regular (C/C++) UDF • DBC.UDTTransform - one entry for the UDT transform group and routine identifiers • Default transform group name • ToSQL routine ID • FromSQL routine ID Views or Macros The view or macro objects in the Teradata Database platform contain: 392 • View or macro text • Creation time attributes • User and creator privileges Data Dictionary