Teradata Database Utilities - Volume 1 A-F Release 12.0 B035-1102-067A March 2010 The product or products described in this book are licensed products of Teradata Corporation or its affiliates. Teradata, BYNET, DBC/1012, DecisionCast, DecisionFlow, DecisionPoint, Eye logo design, InfoWise, Meta Warehouse, MyCommerce, SeeChain, SeeCommerce, SeeRisk, Teradata Decision Experts, Teradata Source Experts, WebAnalyst, and You’ve Never Seen Your Business Like This Before are trademarks or registered trademarks of Teradata Corporation or its affiliates. Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc. AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc. BakBone and NetVault are trademarks or registered trademarks of BakBone Software, Inc. EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation. GoldenGate is a trademark of GoldenGate Software, Inc. Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company. Intel, Pentium, and XEON are registered trademarks of Intel Corporation. IBM, CICS, DB2, MVS, RACF, Tivoli, and VM are registered trademarks of International Business Machines Corporation. Linux is a registered trademark of Linus Torvalds. LSI and Engenio are registered trademarks 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. Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries. QLogic and SANbox trademarks or registered trademarks of QLogic Corporation. SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc. SPARC is a registered trademarks of SPARC International, Inc. Sun Microsystems, Solaris, Sun, and Sun Java are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. 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 collective membership mark and a service mark of Unicode, Inc. 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 e-mail: [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 © 2002–2010 by Teradata Corporation. All Rights Reserved. Preface Purpose This book, Utilities, describes the utility programs that support the Teradata Database and consists of three volumes: • Volume 1 includes utilities A-F. • Volume 2 includes utilities G-S. • Volume 3 includes utilities T-Z. Topics covered in this book include utilities A through F. Use this book in conjunction with the other volumes. Chapter names reflect the utility common name followed by the name of the executable utility program enclosed in parentheses, for example, Control GDO Editor (ctl). Use the executable program name to start the utility from the command line or Database Window. Some utilities are restricted to running on specific platforms. Refer to the User Interfaces section of each chapter to determine the platforms that support each utility. Audience The utilities described in this book are used primarily by Teradata Support Center field engineers, Teradata Database developers, System Test and Verification personnel, and system administrators. For example, these utilities are used to display control parameters, display DBS control record fields, find and correct problems within the file system, initialize the Teradata Database, rebuild tables in the database, and manage the virtual processors (vprocs). These utilities are also used to abort transactions and processes; monitor system performance, resources, and status, perform internal system checking, and perform system configuration, initialization, recovery, and tuning. Users should be familiar with the Teradata Database console running the Database Window (DBW) and your client (host) system. Experienced utilities users can refer to the simplified command descriptions in Utilities Quick Reference, which provides the syntax diagrams for each Teradata Database utility. Supported Software Release This book supports Teradata® Database 12.0. Utilities 3 Preface Prerequisites Prerequisites You should be familiar with using the Database Window (DBW) to run the other utilities. In addition, you might want to review the following related books: • Graphical User Interfaces: Database Window and Teradata MultiTool • Performance Management • Resource Usage Macros and Tables • Platform-dependent Teradata Database Installation/Upgrade/Migration documents For detailed information about the Archive and Recovery, FastExport, FastLoad, MultiLoad, and Teradata Parallel Data Pump utilities, see the following client utilities books: • Teradata Archive/Recovery Utility Reference • Teradata FastExport Reference • Teradata FastLoad Reference • Teradata MultiLoad Reference • Teradata Parallel Data Pump Reference Changes to This Book This volume includes the following changes to support the current release: Date Utility Description Teradata Database 12.0 March 2010 CheckTable CheckTable can display the following new error messages during general checking phases of all check levels: • 2935: Table header format is invalid. • 6719: The dictionary object name or text string can not be translated. DBS Control New fields added: • DBQL Log Last Resp • MLoadDiscardDupRowUPI 4 Teradata Database 12.0 November 2009 DBS Control • Added SmallDepotCylsPerPdisk and LargeDepotCylsPerPdisk. • Added documentation for new DBQL Log Last Resp field. Teradata Database 12.0 July 2009 DBS Control Added documentation for MPS_IncludePEOnlyNodes. Teradata Database 12.0 October 2007 cufconfig • Updated default values for JREPath. • Changed JAVA_HOME to TD_JAVA_HOME DBS Control Added documentation for MonSesCPUNormalization field. Filer Updated syntax diagram and description for WFLUSH command. Utilities Preface Changes to This Book Date Utility Description Teradata Database 12.0 Check Table • Updated some explanations and added error numbers to lists of potential errors that lacked them. • Updated and corrected syntax diagram for CHECK command. • Added new information for new COMPRESSCHECK option of CHECK command. • Format of row IDs made consistent with other hex number output. September 2007 Utilities 5 Preface Changes to This Book Date Utility Description Teradata Database 12.0 ctl • Added information on new RSS options and added new screen shot. • Updated descriptions of print buttons and print checkbox commands to decouple from particular GUI control types. • Added documentation for new LogOnly option of Cylinder Read setting. cufconfig • Added the -j option and the following new fields to the UDF GDO: JavaLibraryPath, JREPath, JavaLogPath, JavaEnvFile, JavaServerTasks, JavaVersion, and JavaBaseDebugPort. These changes support Java external stored procedures. • Added the following new fields to the UDF GDO: UDFLibPath, UDFIncPath, UDFEnvFile, CLILibPath, CLIIncPath, and CLIEnvFile. These changes support SQL invocation via external stored procedures. • Provided better descriptions of the following existing fields: SWDistNodeID, UDFServerTasks, SecureServerAMPs, ParallelUserServerAMPs, SecureServerPEs, ParallelUserServerPEs, and SecureGroupMembership. DBS Control • Removed references to obsolete SHAPasswordEncryption field. • Added documentation for DisablePeekUsing field. • Added documentation for NewHashBucketSize and CurHashBucketSize fields. • Enhanced explanation of PPICacheThrP. • Changed documentation for DateForm, System TimeZone Hour, and System TimeZone Minute field to indicate that changes to these settings affect new sessions begun after the DBS Control Record has been written. Existing sessions are not affected. A database restart is not required. • Added four new RSS tables to system tables section. • Added documentation for IVMaxWorkloadCache field, and updated documentation for IAMaxWorkloadCache field. • Updated documentation for DBQL Options field. This field is obsolete in Teradata Database 12.0, but is reserved for future DBQL use. • Added information on new support for Windows-compatible session character sets to tables under Export Width Table ID section. • Added information for new MaxLoadAWT field. Updated documentation for MaxLoadTasks field describing how it relates to MaxLoadAWT. • Removed references to DBC.HW_Event_Log. • Updated ReadLockOnly description. • Updated RollbackPriority field to indicate recommended setting is now TRUE. • Updated information for RedistBufSize field. Now used mainly for load utilities. • Updated information on FreeSpacePercent field. DIP • Added information on changes to DIPDEM for Query Banding. • New scripts DIPSQLJ and DIPPWD. • Updated information on cost profiles provided by DIPOCES script. September 2007 (continued) 6 Utilities Preface Changes to This Book Date Utility Description Teradata Database 12.0 DUL/DULTAPE • Removed documentation of the “dbs64” option. This option is no longer necessary because DUL now detects the type of database automatically. • Updated chapter to removed old references to V1, except where they were literals. • Reorganized chapter and headings for clarity. Ferret • Updated the description of the INQUIRE option for SCANDISK. • Updated PACKDISK information to indicate that occurrences of mini cylinder packs can be monitored by checking the software event log on all platforms. • Added information about the new CR option for SCANDISK, which allows cylinder reads when running SCANDISK. The new default is not to use cylinder reads. • Added information about the display options /S, /M, and /L for SCANDISK. • Valid values for PRIORITY command are 0, 1, 2, and 3, corresponding to priorities low, medium, high, and rush. • Added information about flags available with the ENABLE and DISABLE commands • Enhanced description of DEFRAGMENT command. Filer • Added the following information to support the Restartable SCANDISK feature: • Added information on using the restartscandisk.pl Perl script to run SCANDISK in restartable mode. • Added information for the new TABLE option. • Updated the description of the INQUIRE option. • Added information about the new CR option for SCANDISK, which allows cylinder reads when running SCANDISK. The new default is not to use cylinder reads. • Added information about the display options /S, /M, and /L for SCANDISK. • Removed CSA from the list of WAL log record types that can be displayed using the WHERE clause. The CSA record type is not supported. • Removed the /V option of the FIB command. This option is not supported. • Valid values for PRIORITY command are 0, 1, 2, and 3, corresponding to priorities low, medium, high, and rush. • Updated example for memctx. • For the FIB command, added cylstatustype abbreviations for DEFRAG, DEPOT, and WAL. • Added information on new ALTCI and ALTWCI commands. • Added information on new WSUMMARY command. • Added information about flags available with the ENABLE and DISABLE commands. September 2007 (continued) Utilities 7 Preface Changes to This Book Date Utility Description Teradata Database V2R6.2 ctl • Inline Commit and Run Exposed are no longer available options for Minimum Node Action. • Write All To Disk is no longer available. • Battery Status is no longer available. • Chapter reorganized. DBS Control • New SHAPasswordEncryption control record field controls whether Teradata Database uses SHA-256 encryption algorithm for encrypting passwords. • Made corrections to Default Export Widths tables for GRAPHIC server charset support. • Clarified description of ObjectUseCountCollectRate field. • Updated description of PPICacheThrP field to include information about 64-bit systems. • Fixed description of when changes take effect for DateForm, System TimeZone Hour, and System TimeZone Minute. • Added the following new fields for WAL: • DisableWAL • DisableWALforDBs • Large Depot Slots • MaxSyncWALWrites • Small Depot Slots • WAL Buffers • WAL Checkpoint Interval • Deleted the WriteDBsToDisk field. This field was replaced by the DisableWALforDBs field. • New UtilityReadAheadCount field specifies the number of data blocks the Teradata utilities will preload when performing sequential scans. • New StandAloneReadAheadCount field specifies the number of data blocks the Teradata utilities will preload when the utilities or file system startup run as standalone tasks. DIP Added description of new DIPDEM script, which supports distribution of UDT, UDF, and XSP libraries, and BAR of UDT, UDF, XSP and SPL source, objects. Ferret • • September 2006 • • • • • • 8 Renamed subtable identifiers from table_id or tableid to tid. New NOCR option in SCANDISK specifies to use regular data block preloads instead of cylinder reads. SCANDISK includes checking the WAL log. SCOPE can set the scope to just the WAL log. SCOPE ALL resets the scope to the default startup settings. SHOWBLOCKS displays WAL log statistics. SHOWDEFAULTS displays WAL log context information. SHOWSPACE displays WAL log space utilization. Utilities Preface Changes to This Book Date Utility Description Teradata Database V2R6.2 Filer • September 2006 (continued) • • • • • • • Added information on starting Filer with the diagnostic options (-w, -x, -y, -z, -n, and -r). Added the following commands for WAL: DEPOT, MEMWCTX, MEMWDB, MEMWREC, MODIFY REDO, WABC, WAL, WCI, WCID, WDB, WDBD, WDBREC, WFIND, WFLUSH, WMI, and WREC. New WHERE clause can be used with the DISPLAY, WAL, or WREC command to restrict selection to a subset of WAL log records within a range. Updated the following commands with WAL information: BLK, CHECKSUM, CI, DB, DELETE, DISPLAY, FIB, IDENT, INIT, MEMBLK, NEXT, PATCH, PREV, SCANDISK, and SHOWDEFAULTS. Renamed subtable identifiers from table_id or tableid to tid. Renamed RowID ranges from rowrange to ridrange. Renamed ordinal range specifications from rangeopt to ordinalrange. Reorganized chapter to list commands in alphabetical order. fsgwizard Deleted chapter. fsgwizard is no longer used due to the implementation of WAL. Teradata Database V2R6.1 awtmon The new awtmon utility prints AMP worker tasks (AWT) inuse count information in a condensed summary format. November 2005 ctl The information about the following has been added: • The ctl utility automatically updates data and provides consistency to the Control GDO display. • Updated the ctl utility and added information for Linux. • The Screen Debug command and the Debug screen allow users to control whether or not logons are enabled. Users can enable or disable logons by setting the Enable Logons field to allow all users to log on to the system, to not allow any users to log on to the system or to allow only DBC users to log on to the system. cufconfig The cufconfig utility now allows you to configure the number of protected mode or secure server processes specified in the UDF Globally Distributed Object (GDO) file. The following fields can also be modified in the UDF GDO file: • • • • • • Utilities UDFServerTasks SecureServerAMPS ParallelUserServerAMPs SecureServerPEs ParallelUserServerPEs SecureGroupMembership 9 Preface Changes to This Book Date Utility Description Teradata Database V2R6.1 CheckTable The information about the following has been added: • The CheckTable utility only checks the table header of base global temporary tables and their instances. • The new TABLES=n clause specifies the number of tables to be checked simultaneously in parallel mode. • The new ERROR ONLY option specifies that CheckTable displays only bypassed tables and tables with errors and warnings. • CheckTable reports the summary information after an abort. • The CONCURRENT MODE RETRY LIMIT option skips all locked tables and retries these locked tables after CheckTable finishes checking all specified tables not locked by other sessions. The following applies: • If RETRY LIMIT is not specified, then CheckTable keeps retrying the locked tables forever or until all tables are checked successfully. • If RETRY LIMIT is greater than 0, then CheckTable will continue to retry until the RETRY LIMIT is reached. • If RETRY LIMIT is equal to 0, then CheckTable will not retry skipped tables. • If RETRY LIMIT is negative, then CheckTable displays an error message. • CheckTable provides a summary of table warning messages in the summary report. November 2005 (continued) Database Window (DBW) 10 Supervisor (Supvr) subwindow Status Line now displays the status as “Reading” when the DBW is connected and the PDE is up. If the PDE is down, commands cannot be entered into the command input line. Utilities Preface Changes to This Book Date Utility Description Teradata Database V2R6.1 DBSControl • The following new General fields are added: • CheckTable Table Lock Retry Limit specifies the time duration that CheckTable, in nonconcurrent mode, will retry a table check when the table is locked by another application. • DisableUDTImplCastForSysFuncOp disables/enables implicit cast/ conversion of UDT expressions passed to system operators/functions. • EnableCostProfileTLE specifies whether Optimizer Cost Profile System (OCES) diagnostics are enabled in combination with Target Level Emulation (TLE). • EnableSetCostProfile controls usage of DIAGNOSTIC SET PROFILE... statements to dynamically change cost profiles used for query planning. • UseVirtualSysDefault defines the system default cost profile when the CostProfileId field is equal to 0. • The following new Performance fields are added: • MaxRequestsSaved specifies the number of request-to-step cache entries allowed on each PE. • ReadLockOnly replaces the AccessLockOnAccr field. It enables or disables the special read-or-access lock protocol on the DBC.AccessRights table during access rights validation and on dictionary tables accessed by read-only queries during request parsing. • The valid range of values for the MaxLoadTasks General field is now 0 to 30 tasks. However, the MaxLoadTasks field can only be set to greater than 15 if the internal field MaxLoadAWT is set to non-zero. In addition, the MaxLoadTasks field works differently depending on the value of the MaxLoadAWT field. • Updated the description of the ObjectUseCountCollectRate General field to specify that object use access information is not counted for EXPLAIN, INSERT EXPLAIN or DUMP EXPLAIN statements. inittpa The inittpa utility is no longer available for starting and stopping the TPA on all nodes in an MPP system. You can use the following commands to start and stop the TPA in an MPP system: November 2005 (continued) • To start the TPA, enter: pcl -s /etc/init.d/ tpa start • To stop the TPA on one node, enter: /etc/init.d/tpa stop • To stop the TPA on all nodes, enter: tpareset -x <reason> Utilities 11 Preface Additional Information Additional Information Additional information that supports this product and Teradata Database is available at the following Web sites. Type of Information Description Source Overview of the release The Release Definition provides the following information: http://www.info.teradata.com/ Information too late for the manuals • Overview of all the products in the release • Information received too late to be included in the manuals • Operating systems and Teradata Database versions that are certified to work with each product • Version numbers of each product and the documentation for each product • Information about available training and support center Additional information related to this product Use the Teradata Information Products web site to view or download the most recent versions of all manuals. Specific manuals that supply related or additional information to this manual are listed. CD-ROM images Ordering information for manuals 12 Click General Search. In the Publication Product ID field, enter 1725 and click Search to bring up the following Release Definition: • Base System Release Definition B035-1725-067K http://www.info.teradata.com/ Click General Search, and do one of the following: • In the Product Line field, select Software Teradata Database for a list of all of the publications for this release, • In the Publication Product ID field, enter one of the following book numbers: • Graphical User Interfaces: Database Window and Teradata MultiTool B035-1095-067A • Performance Management B035-1097-067A • Resource Usage Macros and Tables B035-1099-067A This site contains a link to a downloadable CD-ROM image of all customer documentation for this release. Customers are authorized to create CD-ROMs for their use from this image. http://www.info.teradata.com/ Use the Teradata Information Products web site to order printed versions of manuals. http://www.info.teradata.com/ Click General Search. In the Title or Keyword field, enter CD-ROM, and Click Search. Click How to Order under Print & CD Publications. Utilities Preface References to Microsoft Windows and Linux Type of Information Description Source General information about Teradata The Teradata home page provides links to numerous sources of information about Teradata. Links include: Teradata.com • Executive reports, case studies of customer experiences with Teradata, and thought leadership • Technical information, solutions, and expert advice • Press releases, mentions and media resources References to Microsoft Windows and Linux This book refers to “Microsoft Windows” and “Linux.” For Teradata Database 12.0, these references mean the following: • “Windows” is Microsoft Windows Server 2003 32-bit and Microsoft Windows Server 2003 64-bit. • “Linux” is SUSE Linux Enterprise Server 9 and SUSE Linux Enterprise Server 10. Teradata plans to release Teradata Database support for SUSE Linux Enterprise Server 10 before the next major or minor release of the database. Therefore, information about this SUSE release is included in this document. The announcement regarding availability of SUSE Linux Enterprise Server 10 will be made after Teradata Database 12.0 GCA. Please check with your account representative regarding SUSE Linux Enterprise Server 10 availability in your location. Utilities 13 Preface References to Microsoft Windows and Linux 14 Utilities Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Supported Software Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Changes to This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 References to Microsoft Windows and Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Chapter 1: Teradata Database Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . 27 User Logon for Administrator Utilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Alphabetical Listing of Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Functional Listing of Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Chapter 2: Abort Host (aborthost) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Chapter 3: AMP Load (ampload) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Chapter 4: AWT Monitor (awtmon) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Chapter 5: CheckTable (checktable) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Data Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Referential Integrity Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Recommendations for Running CheckTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Using Function Keys and Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Utilities 15 Table of Contents Determining the Status of a Table Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 Stopping Table Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 CHECK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 CHECKTABLEB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 CheckTable Check Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 Level-Pendingop Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 Level-One Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 Level-Two Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 Level-Three Checking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 CheckTable General Checks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 CHECK Command Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 CheckTable and Deadlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 CheckTable Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 Using Valid Characters in Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 Using Wildcard Characters in Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 Chapter 6: CNS Run (cnsrun) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 Chapter 7: Configuration Utility (config) . . . . . . . . . . . . . . . . . . . . . . . .109 About the Configuration Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110 Message Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 Command Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113 Command List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 ADD AMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 ADD HOST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 ADD PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 BEGIN CONFIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 DEFAULT CLUSTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 DEL AMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 DEL HOST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 DEL PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 END CONFIG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 LIST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 LIST AMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 LIST CLUSTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 16 Utilities Table of Contents LIST HOST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 LIST PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 MOD AMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 MOD HOST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 MOD PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 MOVE AMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 MOVE PE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 SHOW CLUSTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 SHOW HOST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 SHOW VPROC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 STOP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Configuration Utility Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Chapter 8: Control GDO Editor (ctl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 ctl Screens (Tabs) and Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Using ctl from Teradata MultiTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Screens (Tabs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Using ctl From the Command Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HARDWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . HELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PRINT group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PRINT variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . READ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . variable = setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 181 182 183 185 186 187 188 189 190 204 206 Chapter 9: Cufconfig Utility (cufconfig) . . . . . . . . . . . . . . . . . . . . . . . . . 207 UDF GDO Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Utilities 17 Table of Contents Chapter 10: Database Initialization Program (DIP) . . . . . . . . . .223 DIP Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229 Chapter 11: DBS Control (dbscontrol) . . . . . . . . . . . . . . . . . . . . . . . . . . .233 DBS Control Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234 DBS Control Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .236 HELP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .239 MODIFY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .241 QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243 WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244 General Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246 Century Break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249 CheckTable Table Lock Retry Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251 Client Reset Timeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .252 CostProfileId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253 CurHashBucketSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256 DateForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257 DBQLFlushRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258 DBQL Log Last Resp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .259 DeadlockTimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261 DisableUDTImplCastForSysFuncOp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .262 EnableCostProfileTLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .263 EnableSetCostProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 Export Width Table ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266 Expected Default Export Widths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .266 Compatibility Default Export Widths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268 Maximum Default Export Widths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .270 ExternalAuthentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .273 HashFuncDBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .274 IdCol Batch Size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .275 LockLogger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .277 LockLogger Delay Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278 LockLogger Delay Filter Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .279 LockLogSegmentSize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280 18 Utilities Table of Contents MaxDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281 MaxLoadAWT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 About AWTs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 MaxLoadTasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 About AWTs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 MDS Is Enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Memory Limit Per Transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 MLoadDiscardDupRowUPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 MonSesCPUNormalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 MPS_IncludePEOnlyNodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 NewHashBucketSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 ObjectUseCountCollectRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 RollbackPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 Rollbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 RollbackRSTransaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 RollForwardLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 RoundHalfwayMagUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 RSDeadLockInterval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 SessionMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 Spill File Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 SysInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 System TimeZone Hour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 System TimeZone Minute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 Target Level Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 Temporary Storage Page Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 UseVirtualSysDefault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 File System Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Cylinders Saved for PERM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 DefragLowCylProd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 DisableWAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 DisableWALforDBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 FreeSpacePercent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 JournalDBSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 LargeDepotCylsPerPdisk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 MaxSyncWALWrites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 MiniCylPackLowCylProd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 PermDBAllocUnit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 Utilities 19 Table of Contents PermDBSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326 SmallDepotCylsPerPdisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .327 WAL Buffers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .329 WAL Checkpoint Interval. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330 Performance Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .330 DBSCacheCtrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332 DBSCacheThr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .333 DictionaryCacheSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .335 DisablePeekUsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .336 DisableSyncScan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .337 HTMemAlloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .338 IAMaxWorkloadCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .339 IVMaxWorkloadCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .340 MaxParseTreeSegs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .341 MaxRequestsSaved . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .342 PPICacheThrP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .343 ReadAhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .346 Read Ahead Count. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .347 ReadLockOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348 RedistBufSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349 SkewAllowance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350 StandAloneReadAheadCount. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 StepsSegmentSize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 SyncScanCacheThr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .353 UtilityReadAheadCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354 Checksum Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354 System Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357 System Journal Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359 System Logging Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .360 User Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362 Permanent Journal Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .363 Temporary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .364 Chapter 12: Dump Unload/Load Utility (dul, dultape) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .365 What DUL Does . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366 20 Utilities Table of Contents Starting and Running DUL/DULTAPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368 Saving Dumps to Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 Transferring Windows Dump Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 Mailing Dump Tapes to the Teradata Support Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 Restarting DUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 Return Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 DUL Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 DUL Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 ABORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 .CMS (VM Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 DATABASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 DROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 HELP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 LOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 LOGOFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 LOGON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 .OS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 QUIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 SEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 SELECT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 SHOW TAPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 SHOW VERSIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 .TSO (MVS Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 UNLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Sample Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 Chapter 13: Ferret Utility (ferret) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 User Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 Redirecting Input and Output (INPUT and OUTPUT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 About the Teradata Database File System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 About Write Ahead Logging (WAL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 Ferret Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 Using Ferret Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 Classes of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 Vproc Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Utilities 21 Table of Contents Ferret Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .434 Defining Command Parameters Using SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .434 Summary of Ferret Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .435 Ferret Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .436 DATE/TIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .437 DEFRAGMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .438 DISABLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .441 ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .442 ERRORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .443 HELP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .445 INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .446 OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .447 PACKDISK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .449 PRIORITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .454 QUIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .455 RADIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .456 SCANDISK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .457 SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .468 SHOWBLOCKS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479 SHOWDEFAULTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .482 SHOWFSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .483 SHOWSPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .490 TABLEID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .492 UPDATE DATA INTEGRITY FOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .494 Chapter 14: Filer Utility (filer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497 Starting Filer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497 Write Ahead Logging (WAL). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506 The Teradata Database File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506 Filer Diagnostic Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508 Filer Command Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513 Specifying Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .515 Cylinders and Sectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516 Multitoken Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516 Numeric Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516 Stored Input Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .517 Rows (rowid) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .518 22 Utilities Table of Contents Specifying RowID Ranges (ridrange) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .520 PPI Table Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 NPPI Table Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522 Specifying a Subtable Identifier (tid) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 Specifying Display Ranges (ordinalrange). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 Specifying a WHERE clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 Hex Dumps Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 Filer Command Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537 Filer Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 ACCESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 ALTCI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 ALTWCI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 BLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 CHECKSUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 CI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 CID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566 DATE/TIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 DB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569 DBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573 DBROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 DEPOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578 DISABLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 DISPLAY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582 DROP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 DUMPDISK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588 ENABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590 ERRORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591 FIB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 FIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 HELP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600 IDENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608 INIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 INPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 MEMBLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 MEMCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 MEMDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619 MEMDUMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 Utilities 23 Table of Contents MEMROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .623 MEMSORCTX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .625 MEMWCTX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .626 MEMWDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .629 MEMWREC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .631 MI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .633 MODIFY REDO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .638 NEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .642 OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .644 PACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .646 PATCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .647 PREV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .651 PRIORITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .654 QUIT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .655 RADIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .656 RENAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .658 RESETFREECYL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .659 ROW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .660 SCANDISK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .668 Starting SCANDISK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .671 SCOPE or VPROC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .692 SEGZERO (or SEG0). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .693 SET FREECYL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .695 SHOWDEFAULTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .696 SRD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .702 STAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .704 SYNCSCAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .705 TABLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .707 TABLEID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .716 TRACEPRINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .719 TRASH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .720 UNJOIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .721 VPROC or SCOPE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .723 WABC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .724 WAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .729 WCI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .732 WCID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .734 WDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .736 24 Utilities Table of Contents WDBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 WDBREC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 WFIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744 WFLUSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746 WMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 WREC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749 WSUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753 WRITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758 Filer Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759 Appendix A: How to Read Syntax Diagrams . . . . . . . . . . . . . . . . . . . 761 Syntax Diagram Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761 Appendix B: Starting the Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765 MP-RAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 Starting Utilities from Database Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 Starting Utilities from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from Teradata MultiTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from Database Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from the Teradata Command Prompt . . . . . . . . . . . . . . . . . . . . . . . . . 769 769 770 772 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from Teradata MultiTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from Database Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Utilities from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 773 775 777 MVS and VM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 Starting Utilities from HUTCNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783 Utilities 25 Table of Contents 26 Utilities CHAPTER 1 Teradata Database Utilities This chapter lists the Teradata Database utilities, giving a brief description of each. The utilities are documented in the subsequent chapters of Utilities, Volume 1, Volume 2, and Volume 3. For information on starting the utilities, see “Appendix B Starting the Utilities” on page 765. For information on utilities related to Teradata Database security, see Security Administration. For detailed information on Archive and Recovery, FastExport, FastLoad, MultiLoad, and TPump utilities, see the following client utilities books: • Teradata Archive/Recovery Utility Reference • Teradata FastExport Reference • Teradata FastLoad Reference • Teradata MultiLoad Reference • Teradata Parallel Data Pump Reference User Logon for Administrator Utilities Access to administrator utilities usually is limited to rights specifically granted in the Teradata Database. For more information about the utilities that a system administrator would use, see “Functional Listing of Utilities” on page 32. Users of these utilities should log on using their Teradata Database user names. Externally authenticated users (such as those with directory or kerberos user names) might not have access to administrator utilities. By convention, the Utilities books use the standard TD 2 logon format (Teradata authentication) when discussing logons. For more information about logon formats, external authentication, and the rights of externally authenticated users, see Security Administration. Utilities 27 Chapter 1: Teradata Database Utilities Alphabetical Listing of Utilities Alphabetical Listing of Utilities The following table lists the Teradata Database utilities that are documented in the volumes of this book. The table briefly describes the purpose of each utility. Utility Purpose Abort Host (aborthost) Aborts all outstanding transactions running on a failed host, until the system restarts the host. AMP Load (ampload) Displays the load on all AMP vprocs in a system, including the number of AMP worker tasks (AWTs) available to each AMP vproc, and the number of messages waiting (message queue length) on each AMP vproc. AWT Monitor (awtmon) Collects and displays a user-friendly summary of the AMP Worker Task (AWT) in-use count snapshots for the local node or all nodes in Teradata Database. CheckTable (checktable) Checks for inconsistencies between internal data structures such as table headers, row identifiers, and secondary indexes. CNS Run (cnsrun) Allows running of database utilities from scripts. Configuration Utility (config) Defines AMPs, PEs, and hosts, and describes their interrelationships for Teradata Database. Control GDO Editor (ctl) Displays the fields of the PDE Control Parameters GDO, and allows modification of the settings. Note: This utility runs only under Microsoft Windows and Linux. It is analogous to the Xctl Utility (xctl) utility on MP-RAS systems. 28 Cufconfig Utility (cufconfig) Displays configuration settings for the user-defined function and external stored procedure subsystem, and allows these settings to be modified. Database Initialization Program (DIP) Executes one or more of the standard DIP scripts packaged with Teradata Database. These scripts create a variety of database objects that can extend the functionality of Teradata Database with additional, optional features. DBS Control (dbscontrol) Displays the DBS Control Record fields, and allows these settings to be modified. Dump Unload/Load (DUL, DULTAPE) Saves system dump tables to tape, and restores system dump tables from tape. Ferret Utility (ferret) Defines the scope of an action, such as a range of tables or selected vprocs, displays the parameters and scope of the action, and performs the action, either moving data to reconfigure data blocks and cylinders, or displaying disk space and cylinder free space percent in use of the defined scope. Filer Utility (filer) Finds and corrects problems within the file system. Gateway Control (gtwcontrol) Modifies default values in the fields of the Gateway Control Globally Distributed Object (GDO). Utilities Chapter 1: Teradata Database Utilities Alphabetical Listing of Utilities Utility Purpose Gateway Global (gtwglobal) Monitors and controls the Teradata Database LAN-connected users and their sessions. Lock Display (lokdisp) Displays a snapshot capture of all real-time database locks and their associated currently-running sessions. Locking Logger (dumplocklog) Logs transaction identifiers, session identifiers, lock object identifiers, and the lock levels associated with currently-executing SQL statements. Modify MPP List (modmpplist) Allows modification of the node list file (mpplist). Priority Scheduler (schmon, xschmon) Creates, modifies, and monitors Teradata Database process prioritization parameters. All processes have an assigned priority based on their Teradata Database session. This priority is used by Priority Scheduler to allocate CPU and I/O resources. Query Configuration (qryconfig) Reports the current Teradata Database configuration, including the Node, AMP, and PE identification and status. Query Session (qrysessn) Monitors the state of selected Teradata Database sessions on selected logical host IDs. Reconfiguration Utility (reconfig) Uses the component definitions created by the Configuration Utility to establish an operational Teradata Database. Reconfiguration Estimator (reconfig_estimator) Estimates the elapsed time for reconfiguration based upon the number and size of tables on the current system, and provides time estimates for the following phases: • Redistribution • Deletion • NUSI building Recovery Manager (rcvmanager) Displays information used to monitor progress of a Teradata Database recovery. Resource Check Tools (dbschk, nodecheck, syscheck) Identifies slow down and potential hangs of Teradata Database, and displays system statistics that help identify the cause of the problem. RSS Monitor (rssmon) Displays real-time resource usage of Parallel Database Extensions (PDE) on a per-node basis. Selects relevant data fields from specific Resource Sampling Subsystem (RSS) tables to be examined for PDE resource usage monitoring purposes. Note: This utility runs only under MP-RAS. Show Locks (showlocks) Displays locks placed by Archive and Recovery and Table Rebuild operations on databases and tables. For details Archive and Recovery, see Teradata Archive/Recovery Utility Reference. For details on Table Rebuild operations, see “Table Rebuild” in Utilities. Utilities 29 Chapter 1: Teradata Database Utilities Alphabetical Listing of Utilities Utility Purpose System Initializer (sysinit) Initializes Teradata Database. Creates or updates the DBS Control Record and other Globally Distributed Objects (GDOs), initializes or updates configuration maps, and sets hash function values in the DBS Control Record. Table Rebuild (rebuild) Rebuilds tables that Teradata Database cannot automatically recover, including the primary or fallback portions of tables, entire tables, all tables in a database, or all tables in an Access Module Processor (AMP). Table Rebuild can be run interactively or as a background task. Tdlocaledef Utility (tdlocaledef) Converts a Specification for Data Formatting file (SDF) into an internal, binary format (a GDO) for use by Teradata Database. The SDF file is a text file that defines how Teradata Database formats numeric, date, time, and currency output. TDN Statistics (tdnstat) Performs GetStat/ResetStat operations and displays or clears Teradata Database Network Services statistics. TDN Tuner (tdntune) Displays and allows modification of Teradata Network Services tunable parameters. The utility provides a user interface to view, get, or update the Teradata Network Services, which are specific to tunable parameters. Two-Phase Commit Console (tpccons) Performs the following two-phase commit (2PC) related functions: Task List (tsklist) Displays information about PDE processes and their tasks. Update DBC (updatedbc) Recalculates the PermSpace and SpoolSpace values in the DBASE table for the user DBC, and the MaxPermSpace and MaxSpoolSpace values of the DATABASESPACE table for all databases based on the values in the DBASE table. Update Space (updatespace) Recalculates the permanent, temporary, or spool space used by a single database or by all databases in a system. Verify _pdisks (verify_pdisks) Verifies that the pdisks on Teradata Database are accessible and are mapped correctly. Vpacd and Vpacadm Utilities (vpacd, vpacadm) Improves the performance of systems with several CPUs and high levels of concurrency. Vproc Manager (vprocmanager) Manages the virtual processors (vprocs). For example, obtains status ofspecified vprocs, initializes vprocs, forces a vproc to restart, and forces a Teradata Database restart. Xctl Utility (xctl) Displays the fields of the PDE Control Parameters GDO, and allows modification of the settings. • Displays a list of coordinators that have in-doubt transactions. • Displays a list of sessions that have in-doubt transactions. • Resolves in-doubt transactions. Note: This utility runs only under Microsoft Windows and Linux. Note: This utility runs only under MP-RAS. Note: This utility runs only under MP-RAS. It is analogous to the Control GDO Editor (ctl) utility on Windows and Linux systems. 30 Utilities Chapter 1: Teradata Database Utilities Alphabetical Listing of Utilities Utility Purpose Xperfstate Utility (xperfstate) Displays real-time performance data for the PDE system, including systemwide CPU utilization, system-wide disk utilization, and more. Note: This utility runs only under MP-RAS. Xpsh Utility (xpsh) A GUI front-end that allows performance of various MPP system level tasks, such as debugging, analysis, and monitoring. Note: This utility runs only under MP-RAS. Utilities 31 Chapter 1: Teradata Database Utilities Functional Listing of Utilities Functional Listing of Utilities The following table lists the Teradata Database utilities that are documented in the volumes of this book, grouped into these functional categories. • Installation, configuration, migration, and upgrade • System administration and maintenance • Database administration and operation • Diagnostics and troubleshooting Function Utilities Users Installation, Configuration, Migration, and Upgrade • CheckTable (checktable) • Configuration Utility (config) • Control GDO Editor (ctl) • Cufconfig Utility (cufconfig) • DBS Control (dbscontrol) • Database Initialization Program (DIP) • Ferret (ferret) • Gateway Control (gtwcontrol) • Modify MPP List (modmpplist) • Priority Scheduler (schmon/xschmon) • Reconfiguration Estimator (reconfig_estimator) • Reconfiguration Utility (reconfig) • System Initializer (sysinit) • Xctl Utility (xctl) System support personnel 32 Utilities Chapter 1: Teradata Database Utilities Functional Listing of Utilities Function Utilities Users System Administration and Maintenance • Cufconfig Utility (cufconfig) • Dump Unload/Load (DUL, DULTAPE) • Ferret (ferret) • Gateway Control (gtwcontrol) • Gateway Global (gtwglobal) • Priority Scheduler (schmon/xschmon) • Vpacd and Vpacadm Utilities (vpacd, vpacadm) • Xpsh Utility (xpsh) System administrators Utilities 33 Chapter 1: Teradata Database Utilities Functional Listing of Utilities Function Utilities Users Database Administration and Operation • Abort Host (aborthost) • AMP Load (ampload) • CheckTable (checktable) • DBS Control • (dbscontrol) • Ferret Utility (ferret) • Lock Display (lokdisp) • Locking Logger (dumplocklog) • Query Configuration (qryconfig) • Query Session (qrysessn) • Recovery Manager (rcvmanager) • Showlocks (showlocks) • Table Rebuild (rebuild) • Two-Phase Commit Console (tpccons) • Update DBC (updatedbc) • Update Space (updatespace) • Vproc Manager (vprocmanager) Teradata Database administrators 34 Utilities Chapter 1: Teradata Database Utilities Functional Listing of Utilities Function Utilities Users Diagnostics and Troubleshooting • AWT Monitor (awtmon) • CheckTable (checktable) • CNS Run (cnsrun) • Ferret Utility (ferret) • Filer Utility (filer) • Gateway Control (gwcontro) • Resource Check Tools (dbschk, nodecheck, syscheck) • RSS Monitor (rssmon) • Table Rebuild (rebuild) • Task List (tsklist) • TDN Statistics (tdnstat) • TDN Tuner (tdntune) • Verify Pdisks (verify_pdisks) • Xperfstate Utility (xperfstate) System support personnel Utilities 35 Chapter 1: Teradata Database Utilities Functional Listing of Utilities 36 Utilities CHAPTER 2 Abort Host (aborthost) The Abort Host utility, aborthost, allows you to cancel all outstanding transactions running on a host that is no longer operating. Audience Users of Abort Host include the following: • Teradata Database operators • Teradata Database system programmers • Teradata Database system administrators Prerequisites You should be familiar with Teradata Database client (host software), particularly the Teradata Director Program (TDP). User Interfaces aborthost runs on the following platforms and interfaces: Platform Interfaces MP-RAS Database Window Windows Database Window Linux Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Utilities 37 Chapter 2: Abort Host (aborthost) Aborting Teradata Database Transactions Aborting Teradata Database Transactions To abort all Teradata Database transactions for a particular host, do the following ✔ Type the following and press Enter: ABORT HOST nnn where nnn is the host number. If you attempt a logon or a start request to a host that has been aborted in this manner, the system displays this error message: Host quiesced by operator After running Abort Host, the only way to re-establish communication with the Teradata Database is to restart the appropriate TDP. 38 Utilities CHAPTER 3 AMP Load (ampload) The Amp Load utility, ampload, displays the AMP vproc usage of AMP Worker Tasks (AWTs) on Teradata Database, representing the load on each AMP vproc. The utility also displays the number of messages queued for each AMP vproc, which can demonstrate congestion on the system. Audience Users of ampload include the following: • Field engineers • Teradata Database System administrators • Teradata Database developers • Teradata Support Center User Interfaces ampload runs on the following platforms and interfaces: Platform Interfaces MP-RAS Command line Database Window Windows Command line (“Teradata Command Prompt”) Database Window Linux Command line Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Utilities 39 Chapter 3: AMP Load (ampload) Usage Notes Usage Notes The following table describes the components of the ampload display. Component Description Vproc Number Uniquely identifies the vproc across the entire system. Rel. Vproc# Represents the number of the vproc number relative to the node upon which the vproc resides. Node ID Identifies the node cabinet number and module number upon which the vproc resides. Msg Count Represents the number of messages waiting (message queue length) on the AMP vproc. AWT Availability Count Represents the number of AMP work tasks (AWTs) available to the AMP vproc. Examples From the Database Window After you start ampload from the Database Window, the following appears: Vproc No. ----4 0 1 5 6 2 3 7 Rel. Vproc# -----1 1 2 2 3 3 4 4 Node ID -----1-05 1-04 1-04 1-05 1-05 1-04 1-04 1-05 Msg AWT Availability Count Count ------- ---------------0 80 0 79 1 80 0 80 0 80 1 80 1 80 0 80 From the Command Line or Teradata Command Prompt After you start ampload from the Command Line or Teradata Command Prompt, the following appears: Vproc No. ----4 5 6 7 40 Rel. Vproc# -----1 2 3 4 Node ID -----1-05 1-05 1-05 1-05 Msg Count ------0 0 0 0 AWT Availability Count --------------80 80 80 80 Utilities CHAPTER 4 AWT Monitor (awtmon) The AWT Monitor utility, awtmon, collects and displays a user-friendly summary of the AMP Worker Task (AWT) in-use count snapshots for the local node or all nodes in the Teradata Database system. This information is useful for debugging purposes, including hot-AMP conditions. Audience Users of awtmon include the following: • Teradata Support Center • Teradata Database administrators • Teradata Database programmers User Interfaces awtmon runs on the following platforms and interfaces: Platform Interfaces MP-RAS Command line Windows Command line (“Teradata Command Prompt”) Linux Command line For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Utilities 41 Chapter 4: AWT Monitor (awtmon) Syntax Syntax awtmon -h -d -s -S amp_cnt -t threshold t n 1102B102 where: Syntax element … Specifies … -h the awtmon online help. -d debug mode. -s to display system-wide AWT in-use count snapshots. -S amp_cnt to display AWT in-use count snapshots in summary format if the total number of AMP count (to be printed) is greater than or equal to amp_cnt. By default, the -S option is enabled with 24. For a system-wide AWT in-use count snapshots display (the -s option), amp_cnt is a total AMP count from all TPA nodes. - t threshold to display the AMP # and AWT in-use count snapshots if the AWT in-use count is greater than or equal to threshold. The default is 1. tn to display AWT in-use count snapshots in a loop. awtmon samples the AWT inuse counters for n iterations in t-second intervals. The default value for n is 2. Usage Notes By default, awtmon displays the AWT in-use count snapshots on the local node. When you use the -s option, awtmon gathers and displays system-wide AWT in-use count snapshots in summary output mode on a large system to reduce overall output size. Teradata recommends to use the -s and -t options together on a large system to filter out the output size. This allows you to locate any hot AMPs or nodes in the system. Once the hot AMPs or nodes are identified, you can then run awtmon on them. 42 Utilities Chapter 4: AWT Monitor (awtmon) Usage Notes Example 1 To display all AWT in-use count snapshots on a local node, type the following: awtmon The following displays: Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp Amp 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 : : : : : : : : : : : : : : : : Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: 62: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 Example 2 To display all AWT in-use count snapshots on a local node with a three-loop count in a twosecond sleep interval, type the following: awtmon 2 3 The following displays: ====> Mon Jan 24 11:36:45 2005 <===== LOOP_0: Amp 2000: Inuse: 31: NEW: 17 LOOP_0: Amp 2007: Inuse: 32: NEW: 17 LOOP_0: Amp 2008: Inuse: 31: NEW: 17 LOOP_0: Amp 2015: Inuse: 34: NEW: 19 LOOP_0: Amp 2016: Inuse: 32: NEW: 18 LOOP_0: Amp 2023: Inuse: 33: NEW: 19 LOOP_0: Amp 2024: Inuse: 31: NEW: 17 LOOP_0: Amp 2031: Inuse: 31: NEW: 17 LOOP_0: Amp 2032: Inuse: 31: NEW: 17 LOOP_0: Amp 2039: Inuse: 32: NEW: 17 ====> Mon Jan 24 11:36:47 2005 <===== LOOP_1: Amp 2000: Inuse: 36: NEW: 17 LOOP_1: Amp 2007: Inuse: 36: NEW: 16 LOOP_1: Amp 2008: Inuse: 36: NEW: 17 LOOP_1: Amp 2015: Inuse: 36: NEW: 16 LOOP_1: Amp 2016: Inuse: 35: NEW: 16 LOOP_1: Amp 2023: Inuse: 36: NEW: 17 LOOP_1: Amp 2024: Inuse: 35: NEW: 16 LOOP_1: Amp 2031: Inuse: 35: NEW: 16 LOOP_1: Amp 2032: Inuse: 35: NEW: 16 LOOP_1: Amp 2039: Inuse: 36: NEW: 16 ====> Mon Jan 24 11:36:49 2005 <==== LOOP_2: Amp 2000: Inuse: 35: NEW: 16 LOOP_2: Amp 2007: Inuse: 37: NEW: 17 Utilities ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: 14 15 14 15 14 14 14 14 14 15 ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: 19 20 19 20 19 19 19 19 19 20 ONE: 19 ONE: 20 43 Chapter 4: AWT Monitor (awtmon) Usage Notes LOOP_2: LOOP_2: LOOP_2: LOOP_2: LOOP_2: LOOP_2: LOOP_2: LOOP_2: Amp Amp Amp Amp Amp Amp Amp Amp 2008: 2015: 2016: 2023: 2024: 2031: 2032: 2039: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: Inuse: 36: 38: 37: 37: 37: 38: 37: 38: NEW: NEW: NEW: NEW: NEW: NEW: NEW: NEW: 17 17 17 17 17 18 17 17 ONE: ONE: ONE: ONE: ONE: ONE: ONE: ONE: 19 21 20 20 20 20 20 21 Example 3 To display AWT in-use count snapshots greater than or equal to 60 on a local node with a three-loop count in a two-second interval, type the following: awtmon -t 60 2 3 The following displays: ====> Tue Dec 16 08:55:49 2003 <==== LOOP_0: Amp 17 : Inuse: 62: NEW: 49 ONE: 13 LOOP_0: Amp 24 : Inuse: 62: NEW: 47 ONE: 15 LOOP_0: Amp 29 : Inuse: 60: NEW: 50 ONE: 10 LOOP_0: Amp 30 : Inuse: 60: NEW: 50 ONE: 10 LOOP_0: Amp 42 : Inuse: 62: NEW: 48 ONE: 14 ====> Tue Dec 16 08:55:52 2003 <==== LOOP_1: Amp 0 : Inuse: 60: FOUR: 1 NEW: 50 ONE: LOOP_1: Amp 6 : Inuse: 60: NEW: 50 ONE: 10 LOOP_1: Amp 17 : Inuse: 62: NEW: 48 ONE: 14 LOOP_1: Amp 24 : Inuse: 62: NEW: 46 ONE: 16 LOOP_1: Amp 29 : Inuse: 62: NEW: 50 ONE: 12 LOOP_1: Amp 30 : Inuse: 62: NEW: 50 ONE: 12 LOOP_1: Amp 35 : Inuse: 60: NEW: 50 ONE: 10 LOOP_1: Amp 36 : Inuse: 60: NEW: 50 ONE: 10 LOOP_1: Amp 42 : Inuse: 62: NEW: 48 ONE: 14 ====> Tue Dec 16 08:55:54 2003 <==== LOOP_2: Amp 0 : Inuse: 60: FOUR: 1 NEW: 50 ONE: LOOP_2: Amp 6 : Inuse: 60: NEW: 50 ONE: 10 LOOP_2: Amp 17 : Inuse: 62: NEW: 48 ONE: 14 LOOP_2: Amp 24 : Inuse: 62: NEW: 46 ONE: 16 LOOP_2: Amp 29 : Inuse: 62: NEW: 50 ONE: 12 LOOP_2: Amp 30 : Inuse: 62: NEW: 50 ONE: 12 LOOP_2: Amp 35 : Inuse: 60: NEW: 50 ONE: 10 LOOP_2: Amp 36 : Inuse: 60: NEW: 50 ONE: 10 LOOP_2: Amp 42 : Inuse: 62: NEW: 47 ONE: 15 9 9 Note: In-use count snapshots less than 60 are skipped. 44 Utilities Chapter 4: AWT Monitor (awtmon) Usage Notes Example 4 To display AWT in-use count snapshots greater than or equal to 50 in a summary format with a three-loop count in a two-second sleep interval, type the following: awtmon -S 8 -t 50 2 3 The following displays: ====> Tue Dec 16 08:53:44 LOOP_0: Inuse: 55 : Amps: LOOP_0: Inuse: 56 : Amps: LOOP_0: Inuse: 57 : Amps: ====> Tue Dec 16 08:53:47 LOOP_1: Inuse: 54 : Amps: LOOP_1: Inuse: 55 : Amps: LOOP_1: Inuse: 56 : Amps: ====> Tue Dec 16 08:53:49 LOOP_2: Inuse: 54 : Amps: LOOP_2: Inuse: 55 : Amps: LOOP_2: Inuse: 56 : Amps: 2003 <==== 5,6,11,12,17,18,23,29,30,35,36,41,42 0,47 24 2003 <==== 5,6,11,12,17,18,23,29,30,35,36,41,42 0,47 24 2003 <==== 5,11,12,17,18,23,29,30,35,36,41,42 0,6,47 24 Example 5 To display system-wide AWT in-use count snapshots greater than or equal to 50 in a summary format, type the following: awtmon -s -t 50 The following displays: ====> Tue byn001-4: byn001-4: byn001-4: byn001-4: byn001-4: byn001-4: byn001-5: byn001-5: byn001-5: byn001-5: byn001-5: byn001-5: byn002-5: byn002-5: Utilities Dec 16 08:58:07 2003 <==== LOOP_0: Inuse: 57 : Amps: 17,42 LOOP_0: Inuse: 58 : Amps: 5,11,12,35,41 LOOP_0: Inuse: 59 : Amps: 30 LOOP_0: Inuse: 60 : Amps: 23,36 LOOP_0: Inuse: 62 : Amps: 0 LOOP_0: Inuse: 63 : Amps: 6,18,24,29,47 LOOP_0: Inuse: 52 : Amps: 16,22 LOOP_0: Inuse: 53 : Amps: 28 LOOP_0: Inuse: 55 : Amps: 7,34,46 LOOP_0: Inuse: 56 : Amps: 10,13,19,43 LOOP_0: Inuse: 57 : Amps: 1,25,31,37,40 LOOP_0: Inuse: 62 : Amps: 4 LOOP_0: Inuse: 52 : Amps: 2,3,14,15,21,27,32,33,38,45 LOOP_0: Inuse: 53 : Amps: 9,20,39,44 45 Chapter 4: AWT Monitor (awtmon) Usage Notes 46 Utilities CHAPTER 5 CheckTable (checktable) The CheckTable utility is a diagnostic tool that finds inconsistencies and data corruption in internal data structures, such as table headers, row identifiers, and secondary indexes. Teradata recommends running CheckTable on a regular schedule to detect problems that may occur. To repair problems identified by CheckTable, contact the Teradata Support Center, as required. Audience Users of CheckTable include the following: • Teradata Database system administrators • Teradata Database system programmers • Teradata Database operators User Interfaces CheckTable runs on the following platforms and interfaces. Platform Interfaces MP-RAS Database Window Windows Database Window Linux Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Usage Notes To start CheckTable, the following conditions are required: Utilities • The system must be online. • No more than one AMP per cluster can be down. • Logons can be enabled or disabled. 47 Chapter 5: CheckTable (checktable) Data Checking Data Checking CheckTable provides various levels of data checking. Higher-level checks are generally more thorough than lower-level checks, but require more system resources and time. Certain general table checks are performed at all levels. After CheckTable runs, it reports the total number of tables checked and bypassed. CheckTable only checks the table headers of base global temporary tables and their instances; data rows of instances are not checked during level-one checking. For detailed information on level-one checking, see “Level-One Checking” on page 63. Stored procedures, UDFs, and UDMs, store their text and object code internally as special tables that are not normally accessible to users. Join index rows, and hash index rows are also stored internally as tables. CheckTable checks all of these tables, in addition to checking ordinary data tables. Note: Some checks are not done for unhashed tables, and certain join indexes and hash indexes. For additional information on check completion, see “CheckTable Messages” on page 95. CheckTable does not include the DBC.ALL table when accounting for tables checked because it is not considered a conventional table. Note: CheckTable does not check tables whose rollback has been cancelled. CheckTable ensures that file system data structures are consistent. If CheckTable experiences any file corruption problem while checking the tables and databases, the table check in progress is aborted. A message similar to the following appears: 7495: <DbName>.<Table Name> was aborted at <date>/<time> due to error <error code>. Run SCANDISK. To find the error, run the SCANDISK command after CheckTable finishes checking the remaining tables. For information on messages, see “CheckTable Messages” on page 95. For information on SCANDISK, see Chapter 13: “Ferret Utility (ferret)” and Chapter 14: “Filer Utility (filer).” Referential Integrity Terminology The following table defines the Referential Integrity terminology that CheckTable uses. 48 Term Definition Child Table Where referential constraints are defined, a Child Table refers to a referencing table that references a parent table. Parent Table A Parent Table refers to a referenced table and is referenced by a Child table. Primary Key A Primary Key uniquely identifies a row of a table. Utilities Chapter 5: CheckTable (checktable) Recommendations for Running CheckTable Term Definition Foreign Key A Foreign Key references columns in the Child Table and can consist of up to 16 different columns. Referential Constraint Referential Constraint is defined on a column or on a table to ensure Referential Integrity. For example: CREATE TABLE A (A1 char(10) REFERENCES B (B1), A2 integer, FOREIGN KEY (A1,A2) REFERENCES C (C1,C2)) PRIMARY INDEX (A1); The CREATE TABLE statement with two referential constraints declares the following integrity constraints. Constraint … Is a level of … 1 column. Foreign Key A1 references the Parent Key B1 in table B. 2 table. Composite Foreign Key (A1, A2) references the unique primary index in Parent Table C. For more information on referential integrity, see “The Normalization Process” in Database Design. Recommendations for Running CheckTable Running on a Quiescent System You can run CheckTable on a quiescent system with all AMPs up for the following reasons: Utilities • The validation of table integrity by CheckTable depends on the table not changing while CheckTable performs its checks. Therefore, CheckTable places a READ lock on the table during the check. You cannot perform an INSERT while CheckTable verifies consistency between the primary and fallback rows of a table. • CheckTable places a READ lock on DBC.TVM momentarily to check for the existence of the table being checked. This lock might cause a problem when you create or modify tables, views, or macros, which require a WRITE lock on DBC.TVM. • In some cases, CheckTable cannot perform a complete validation of table integrity if one or more AMPs are down. 49 Chapter 5: CheckTable (checktable) Using Function Keys and Commands Running on a Non-Quiescent System You can also run CheckTable on a non-quiescent system by using the PRIORITY and CONCURRENT MODE RETRY LIMIT option of the CHECK command. To run CheckTable when users either are logged on or are expected to log on to the system, do the following: 1 Sometimes CheckTable places a substantial resource demand (CPU cycles, disk access, spool space, and so forth) on the system, degrading performance significantly for users accessing the system. By default, CheckTable performs table checking at MEDIUM priority. To control the job scheduling based on the expected system workload and to improve performance, use the PRIORITY option. 2 CONCURRENT MODE reduces lock contention by optimizing the locking protocol and checking tables serially. The CONCURRENT MODE RETRY LIMIT option skips all locked tables and retries these locked tables after CheckTable finishes checking all specified tables not locked by other sessions. The following applies. IF RETRY LIMIT is … THEN CheckTable … not specified keeps retrying the locked tables forever or until all tables are checked successfully. When trying to access a locked table, CheckTable waits a maximum of five minutes for the lock to be released. If the lock is not released in that time, CheckTable moves on to the next table. CheckTable will return to the locked table to try again. greater than 0 will continue to retry until the RETRY LIMIT is reached. equal to 0 will not retry skipped tables. negative displays an error message. Note: On non-quiescent systems and on quiescent systems with logons enabled, CheckTable defaults to CONCURRENT MODE with RETRY LIMIT set to one. Under these conditions, data dictionary checks are skipped. Using Function Keys and Commands You can use function keys and commands to do the following: 50 • View CheckTable help • Determine the status of a table check • Abort a table check Utilities Chapter 5: CheckTable (checktable) Viewing CheckTable Help • Abort the CHECK command Viewing CheckTable Help The following table shows how to view help, depending on your operating system. On … Use … Linux only commands. MP-RAS function keys or commands. Windows only commands. Accessing Help Using F7 (MP-RAS Only) To access the CheckTable help main menu, press F7. The following figure shows main menu. From the CheckTable help main menu, you can access other help information. The following table describes each function key and its topics. Utilities Press … To view … F2 general information about CheckTable. 51 Chapter 5: CheckTable (checktable) Determining the Status of a Table Check Press … To view … F3 information about naming objects in CheckTable. F4 the CHECK command syntax. Accessing Help Using the Command Line (Linux, MP-RAS, and Windows) To access the entire CheckTable help system at once, type the following in the Enter a command line: help; The following figure shows the beginning of the entire CheckTable help system. To view the rest of CheckTable help, use the scroll bar on the right-hand side. Determining the Status of a Table Check Assume that the table check in progress specifies database DB0 with tables t1, t10, t100, t1000, and t11. To determine the status of the table check, do the following. 52 Utilities Chapter 5: CheckTable (checktable) Stopping Table Checks Platform To Check Status of Table Check MP-RAS Press the F2 function key or type status at the command prompt. Windows Type status at the command prompt. Linux Type status at the command prompt. The following table shows the results for Parallel and Serial modes. Mode Result Example PARALLEL >>> STATUS: CheckTable running in PARALLEL mode. 5 CheckTable tasks started. 4 CheckTable tasks ACTIVE. 1 CheckTable tasks IDLE. 1000005 bytes spool space in use. 120 bytes spool space available. Task **** 1 2 3 4 Status ********************************** Checking data subtable ("DB0"."T1"). Checking data subtable ("DB0"."T10"). Checking data subtable ("DB0"."T100"). Waiting for a read lock on table ("DB0"."T1000"). 0 lock retry(s), total wait time of 0.0e+00 minute(s). These results indicate that CheckTable started five parallel checks: • Three CheckTable tasks are checking the data subtable of tables DB0.T1, DB0.T10, and DB0.T100. • One CheckTable task is waiting for a read lock on table DB0.T1000. • One CheckTable task is paused because of insufficient resources. SERIAL >>>> STATUS: Checking data subtable ("DB0"."T10"). This indicates that CheckTable is checking the data subtable of the table DB0.T10. Stopping Table Checks Stopping the Check of a Single Table To stop the check of the current table or tables and continue the check of the next table, do the following. Utilities On … Use … MP-RAS function key F3 or type Abort Table in the Enter a command line. 53 Chapter 5: CheckTable (checktable) Stopping Table Checks On … Use … Windows type Abort Table in the Enter a command line. Linux type Abort Table in the Enter a command line. The following table shows the results of Abort Table command for serial and parallel modes. IF you run CheckTable in… THEN CheckTable aborts the … SERIAL mode check in progress on the current table. The following message appears: Abort table request will be honored. Table check aborted by user. PARALLEL mode check in progress on all current tables. The following message appears: Abort table request will be honored. Stopping the All Table Checks To stop the CHECK command, do the following. On … Use … MP-RAS function key F4 or type Abort in the Enter a command line. Windows type Abort in the Enter a command line. Linux type Abort in the Enter a command line. The result and output are identical in both PARALLEL and SERIAL modes. The following message appears: Abort check request will be honored. Command aborted by user at 11:37:59 04/12/23. 158 table(s) checked. 155 fallback table(s) checked. 3 non-fallback table(s) checked. 13 table(s) bypassed due to being unhashed. 3 table(s) bypassed due to pending MultiLoad. 204 table(s) bypassed due to pending Table Rebuild. 0 table(s) failed the check. 0 Dictionary error(s) were found. Check completed at 11:37:59 04/12/23. 54 Utilities Chapter 5: CheckTable (checktable) CHECK CHECK The CHECK command allows you to specify the data structures you want to check in the system by including or excluding certain tables, subtables, or databases. Syntax CHECK A ALL TABLES , 30 dbname EXCLUDE dbname.tablename , 30 dbname dbname.tablename EXCLUDE tablename , 30 dbname dbname.tablename A B AT LEVEL , INDEX ID=nnn BUT ONLY BUT NOT UNIQUE INDEXES NONUNIQUE INDEXES REFERENCE ID=nnn REFERENCE INDEXES DATA LARGE OBJECT ID = nnn LOB ID = nnn LARGE OBJECTS LOBS B C PENDINGOP WITH ERROR LIMIT= ONE nnn TWO WITH NO ERROR LIMIT THREE C D SKIPLOCKS IN SERIAL IN PARALLEL TABLES = n D E PRIORITY= L M H R Performance Group Name E F CONCURRENT MODE RETRY LIMIT n F ; ERROR ONLY COMPRESSCHECK 1102F029 where: Utilities 55 Chapter 5: CheckTable (checktable) CHECK Syntax element Description ALL TABLES CheckTable checks all tables in all databases in the system. dbname CheckTable checks all tables in the specified database. You can use wildcard characters or wildcard syntax in specifying database names. For more information, see “Using Wildcard Characters in Names” on page 100 and “Rules for Using Wildcard Syntax” on page 102. EXCLUDE CheckTable excludes from the check the specified tables or databases. IF you use ... THEN you can ... CHECK ALL TABLES EXCLUDE exclude one or more databases or tables. CHECK dbname EXCLUDE exclude one or more tables in a particular database. If a specified object does not exist in the system, then the summary report lists the object in a message. If you do not specify this option, then CheckTable checks all data objects in the system. tablename CheckTable checks a specific table, including global temporary tables. dbname.tablename You can use wildcard characters or wildcard syntax in specifying database names. For more information, see “Using Wildcard Characters in Names” on page 100 and “Rules for Using Wildcard Syntax” on page 102. BUT ONLY Places constraints on what CheckTable checks: BUT NOT • BUT ONLY causes CheckTable to check only the subsequently specified objects. • BUT NOT causes CheckTable to skip checking of the subsequently specified objects. If you do not specify any selection constraints, CheckTable checks all data objects in the system. These options are ignored for level-pendingop checks. Example: The following command checks all tables limiting the check to only INDEX ID=nnn at level three: CHECK ALL TABLES BUT ONLY INDEX ID=nnn AT LEVEL THREE; INDEX ID = nnn Specifies a specific secondary index (specified by its index ID) when using a constraint with CheckTable. In general, specify this option only when you want to check a single table. UNIQUE INDEXES Specifies all unique secondary indexes when using a constraint with CheckTable. NONUNIQUE INDEXES Specifies all Nonunique Secondary indexes when using a constraint with CheckTable. REFERENCE ID = nnn Specifies a specific index (as specified by its index ID) when using a constraint with CheckTable. REFERENCE INDEXES Specifies all reference indexes when using a constraint with CheckTable. 56 Utilities Chapter 5: CheckTable (checktable) CHECK Syntax element Description DATA Specifies the data subtable when using a constraint with CheckTable. LARGE OBJECT ID = nnn Specifies a specific large object (as specified by its ID) when using a constraint with CheckTable. LOB ID = nnn Specifies a specific large object (as specified by its ID) when using a constraint with CheckTable. LARGE OBJECTS Specifies all large objects when using a constraint with CheckTable. LOBS Specifies all large objects when using a constraint with CheckTable. AT LEVEL Specifies the level checking CheckTable performs. Higher levels of checking yield more thorough information, but generally require more system resources and more time. You should choose the minimum level that will provide the information you require. • • • • PENDINGOP ONE TWO THREE Level Description PENDINGOP Provides a list of tables for which pending operations exist. ONE Isolates specific tables with errors. TWO Provides a detailed check of the following: • Consistency of row IDs • Checksum of primary and fallback rows • Hash codes THREE This level provides the most diagnostic information, but uses more system resources and requires more time. Use this level of check only when necessary. For more information, see “CheckTable Check Levels” on page 61. WITH ERROR LIMIT= nnn CheckTable stops checking a table if it finds nnn or more errors. If CheckTable was checking more than one table, it continues on to the next table. The default is 20 errors for each table checked. WITH NO ERROR LIMIT Utilities CheckTable reports all errors for each table. 57 Chapter 5: CheckTable (checktable) CHECK Syntax element Description SKIPLOCKS CheckTable skips all locked tables automatically. If a table is locked, and if CheckTable cannot obtain a lock, then CheckTable indicates the table check is skipped. The summary at the end of CheckTable processing includes the total number of tables skipped. Without this option, CheckTable waits indefinitely on the table to be checked until it is unlocked. The CheckTable Table Lock Retry Limit field in DBS Control specifies the duration, in minutes, that CheckTable, in non-concurrent mode, will retry a table check when the table is locked by another application. The default is 0, which indicates that in non-concurrent mode, CheckTable will retry a table check until CheckTable can access the table. If the CheckTable Table Lock Retry Entry field is greater than 0, then CheckTable will retry a table check within the specified limit. For more information, see “CheckTable Table Lock Retry Limit” on page 251. IN SERIAL Specifies the mode of checking CheckTable uses: IN PARALLEL • IN SERIAL means CheckTable checks a single table at a time. This is the default. • IN PARALLEL means CheckTable checks multiple tables simultaneously. Using PARALLEL mode saves time but is resource intensive. The number of tables that CheckTable can check simultaneously in parallel depends on resource availability. You can check the status of the number of parallel checks CheckTable performs at any time. For information on how to check the status, see “Determining the Status of a Table Check” on page 52. TABLES=n Optionally used with IN PARALLEL to specify the upper limit on the number of tables that will be checked simultaneously. The value of n can be any integer from two through eight. At level-one checking, the actual maximum number of tables that can be checked simultaneously is based on the maximum number of AMP work tasks (AWT) defined for the system. At all other levels, the maximum is based on the maximum number of AWT and on the available spool space. The TABLES=n option is used to decrease the number of tables checked in parallel to something less than the maximum. If there is insufficient spool space to check n tables in parallel, the number checked will be less than the number specified. 58 Utilities Chapter 5: CheckTable (checktable) CHECK Syntax element Description PRIORITY = Specifies a priority level at which CheckTable should run. This option can be used to control resource usage and improve performance. The available priority levels are: • L - Performance Group Low • M - Performance Group Medium This is the default, if the PRIORITY= option is not specified. • H - Performance Group High • R - Performance Group Rush • Performance Group Name - any other performance group that has been defined. If the performance group name contains any special characters, enclose the name in double quotes. CheckTable reports and error if the specified performance group has not been defined. For more information on performance groups, see “Priority Scheduler (schmon, xschmon)”in Utilities, Volume 2. CONCURRENT MODE Use when running on a non-quiescent system. CONCURRENT MODE reduces lock contention by optimizing the locking protocol and by automatically skipping the locked tables to retry them later. After CheckTable checks all tables, CheckTable automatically retries all tables that were skipped due to lock contention. When you specify the CONCURRENT MODE option, you cannot specify the IN PARALLEL option. CheckTable always checks tables serially in concurrent mode to reduce lock contention. CHECK ALL TABLES … CONCURRENT MODE does not check data dictionaries and the DBC database in concurrent mode. To check the DBC database and data dictionaries in concurrent mode, use CHECK DBC … CONCURRENT MODE. RETRY LIMIT n The duration in minutes that CheckTable waits before attempting to re-check a table that was skipped during CONCURRENT MODE operation. If n is zero, CheckTable will not attempt to check tables that were skipped. If RETRY LIMIT is not specified, CheckTable retries the locked tables indefinitely, or until all tables have been checked successfully. When trying to access a locked table, CheckTable waits a maximum of five minutes for the lock to be released. If the lock is not released in that time, CheckTable moves on to the next table. If the RETRY LIMIT has not been met, CheckTable will return to the locked table to try again. ERROR ONLY CheckTable displays only bypassed tables and tables that have errors or warnings. This option allows you to quickly identify and address problems that CheckTable finds. This option is ignored during level-pendingop checks. COMPRESSCHECK CheckTable compares the compress value list from Table Header field 5 against dbc.tvfield.compressvaluelist during the check. This option is ignored during level-pendingop checks. Utilities 59 Chapter 5: CheckTable (checktable) CHECK Usage Notes The CHECK command, including database or table names, cannot exceed 255 characters. Wildcard characters are counted as single characters. For more information see “Using Valid Characters in Names” on page 98 and “Using Wildcard Characters in Names” on page 100. The CHECK command is not case sensitive. You can specify the syntax elements in uppercase or lowercase or a mixture of both. This also applies to names specified in wildcard syntax. CheckTable can check an unlimited number of databases and tables, however the CHECK command accepts a maximum of 30 names on the command line. Names of the form dbname, tablename, and dbname.tablename are each considered to be a single name. However, wildcard expressions are also considered to be single names, and can resolve to any number of databases and tables. For more information on using wildcard expressions, see “Using Wildcard Characters in Names” on page 100. For information on CHECK command syntax errors, see “Syntax Error Messages” on page 95. CHECKTABLEB CHECKTABLEB is the non-interactive batch mode of the CheckTable utility. The syntax following the CHECKTABLEB command is the same as the syntax following the CHECK command. You can run CHECKTABLEB in batch mode by using the cnsrun utility. Once you start CHECKTABLEB, you cannot abort it. It runs until completed. For more information, see “CHECK” on page 55. For information on cnsrun, see Chapter 6: “CNS Run (cnsrun).” 60 Utilities Chapter 5: CheckTable (checktable) CheckTable Check Levels CheckTable Check Levels CheckTable provides four levels of internal data structure checking: • Level pendingop is the lowest level and checks for tables with pending operations. • Level one checks for specified system data structures, data subtables, large object (LOB) subtables, and unique and nonunique secondary indexes (USIs and NUSIs). • Level-two checking does the following: • • Determines whether row IDs on any given subtable are consistent with row IDs on other subtables by comparing lists of these IDs in those objects • Compares the checksum of primary and fallback rows. • Verifies that hash codes reflect correct row distribution in each subtable. Level-three checking provides the most detailed check and requires more system resources than the other checking levels. Each level performs most or all of the checks from the lower levels, and performs additional checks that are more thorough. For example, level-two checking performs checks similar to those from level-pendingop and level-one, and adds additional checks. Note: Level-three checking does not include any checking of large objects. LOB checks are performed exclusively at levels one and two. At each level of checking, CheckTable inspects specific internal data structures. If CheckTable detects errors during these checks, it displays error messages which describe the nature of the errors. The message may be followed by additional information indicating the AMP, subtable, index, or row that is in error. In the lists of errors described in this chapter, this additional information is surrounded by square brackets ([ ]) to indicate that the information is displayed only when applicable to the error detected. The square brackets themselves are not displayed in the error messages returned by CheckTable. Note: For more information on specific CheckTable error messages by number, see the Messages manual. The following table indicates the specific internal data structures that are checked by each type of level check. Subsequent tables describe the operations performed at each level. Utilities 61 Chapter 5: CheckTable (checktable) CheckTable Check Levels Check Level Internal Data Structures Checked When to use this level Pendingop • Data dictionary (if database DBC is checked) • Table dictionary • Table header Use pendingop checking to check for tables with the following pending operations: One • Data dictionary (if database DBC is checked) • Table dictionary • Table header • Obsolete subtables • Unique secondary indexes • Nonunique secondary indexes • ParentCount • ChildCount • Subtable of a given table • Base global temporary tables • Data subtables • Large object subtables • Reference indexes Use level-one checking only to isolate specific tables with errors. Then perform level-two or level-three checks on those specific tables. Two • • • • • Data subtables Large object subtables Unique secondary indexes Nonunique secondary indexes Reference indexes Use level-two checking when checks by level one fail, and you require a detailed checking of consistency of row IDs, the checksum of primary and fallback rows, and hash codes. Three • • • • Data subtables Unique secondary indexes Nonunique secondary indexes Reference indexes Use level-three checking rarely and only for specific diagnostic purposes, such as when an AMP is down. • • • • • • FastLoad Restore Reconfig Rebuild Replicate copy MultiLoad Note: Databases and tables in a database are checked in alphabetical order. 62 Utilities Chapter 5: CheckTable (checktable) Level-Pendingop Checking Level-Pendingop Checking Level-pendingop checking checks field 4 of a table header and warns you if the table is in any of the following states: • Pending FastLoad • Pending Restore • Pending Reconfig • Pending Rebuild • Pending Replicate copy • Pending MultiLoad Level-One Checking In addition to performing level-pendingop checks, level-one checking checks the following: • Specified system data structures • Data subtables • Large object subtables • Unique and nonunique secondary indexes The following table summarizes level-one checks. Further information about each type of check is provided in subsequent sections. Utilities In a check type of … CheckTable … table dictionary table header • checks the partitioning definition in the table header for a partitioned primary index for validity for this operating environment. • compares the compress value list from Table Header field 5 against dbc.tvfield.compressvaluelist, if the COMPRESSCHECK option is specified. obsolete subtables checks for extraneous subtables of a given table. reference indexes • checks whether any AMP has any reference index flagged as invalid. • if the index is hashed and the table is fallback, compares the primary row count with the fallback row count • compares the row count in the index subtable with the row count in the data subtable data subtables compares row count in the primary data subtable with row count in fallback data subtables per AMP in each cluster. This is done only if the table is fallback. 63 Chapter 5: CheckTable (checktable) Level-One Checking In a check type of … CheckTable … large object subtables • compares row counts in the LOB subtable • verifies that the primary copy of the LOB subtable matches the row count in the fallback subtables • verifies that the row count of the base data table matches that of each LOB subtable associated with the base table. Note that in cases where the associated LOB value i s NULL, there will be no LOB row in the LOB subtable. unique secondary indexes checks if any AMP has any unique secondary indexes flagged as invalid. CheckTable compares the following: • row counts between data subtables across all primary AMPs. • row counts in corresponding unique secondary index subtables across all primary AMPs. If the primary AMP is unavailable, and the table is fallback, then the appropriate fallback counts are used instead. If the AMP is unavailable and the table is not fallback, then this check is skipped. • compares row counts in the unique secondary index subtable, on each primary AMP, with the row count in the corresponding unique secondary index subtables of the other AMPs in the same cluster. However, this is done only if the table is fallback. For unique and nonunique secondary indexes, an invalid index is not an error. Unless the index is excluded explicitly from the check, CheckTable issues a warning. nonunique secondary indexes checks if any AMP has any nonunique secondary indexes flagged as invalid. CheckTable compares row counts of nonunique secondary subtables to row counts for the corresponding data subtable. You can run the NUSI check during level-one checking without all AMPs online. However, relationships between data and index subtables on unavailable AMPs are not checked. For unique and nonunique secondary indexes, an invalid index is not an error. Unless the index is excluded explicitly from the check, CheckTable issues a warning. The following sections describe specific types of checks in more detail. Checking Table Headers For a partitioned primary index, the partitioning definition in the table header is checked for validity for the operating environment, and checked for consistency and correctness. If the table headers for a table with a partitioned primary index are not valid, the following error is reported, and the table is skipped: 7535: Operation not allowed: database.table table header has invalid partitioning. 64 Utilities Chapter 5: CheckTable (checktable) Level-One Checking To correct the table header and/or the partitioning of rows for a table, use the ALTER TABLE statement with the REVALIDATE PRIMARY INDEX option. For more information on the ALTER TABLE statement, see SQL Reference: Data Definition Statements. Checking Data Subtables The data subtable check only checks for fallback tables. This check compares the row count in the primary data subtable on each AMP to the sum of the row counts in the corresponding fallback data subtables on other AMPs in the same cluster. If the row counts do not match, then the following message appears. Message number 2747 Message Primary and fallback data counts do not match. Primary AMP 00000 nnnn [too many|too few] fallback rows To complete this check, CheckTable must access all AMPs in a cluster. Therefore, any AMP in a cluster with an unavailable AMP is not checked. Checking Large Object Subtables In the case of LOB subtables, there is not a one-to-one correspondence in the row counts of the base data table and the LOB subtable, since LOBs may span multiple physical rows in the LOB subtable. For example if a base data table row points to a LOB that is 198,000 bytes in length, there will be four rows in the LOB subtable for this object (three rows containing 64,000 bytes and one row containing 6,000 bytes). When the counts are compared against the base data table, these four rows are counted by CheckTable as a single row. If the row counts do not match, one of the following messages appears. Message number Utilities Message 7517 Data count does not match the LOB count. AMP nnnnn, [Primary|Fallback] subtable LOB id nnn nnnn [too many | too few] LOB rows 7518 Primary and fallback LOB counts do not match Primary AMP nnnnn LOB id nnn nnnn [too many | too few] fallback rows 65 Chapter 5: CheckTable (checktable) Level-One Checking Checking Unique Secondary Indexes The first check compares the sum of rows in the primary (and if needed, fallback) data subtables across all AMPs to the sum of the rows in the corresponding primary (and if needed, fallback) unique secondary index subtables across all AMPs. If the sums of rows do not match, then the following message appears. Message number 2748 Message Data count does not match the USI count. USI id nnn [nnnn [too many|too few] USI rows] The row count of the data subtable should be greater than or equal to the row count of the reference index subtable. If data row count is less than reference index row count, then the system displays the following message: Data count is less then RI count. Reference Index ID nnn [nnnn [too many|too few] reference index rows] For no-fallback tables, if an AMP is unavailable, this entire check is bypassed. For fallback tables, if an AMP is down, the fallback subtables (both data and index) correspond to primary subtables. The second check is performed only for fallback tables. The sum of the row count for the primary unique secondary subtable on each AMP is compared to the sum of the row counts in the corresponding fallback unique secondary index subtables on other AMPs in the same cluster. If the sums of the row counts do not match, then the following message appears. Message number 2749 Message Primary and fallback USI counts do not match Primary AMP nnnnn USI id nnn [nnnn [too many|too few] fallback rows] To complete this check, CheckTable must access all AMPs in a cluster. Therefore, this check is bypassed on any AMP in a cluster that contains an unavailable AMP. Checking Nonunique Secondary Indexes The check of a nonunique secondary index compares the counts of the rows in each data subtable, in both primary and fallback where appropriate, to the count of rows indexed by the corresponding index subtable. If the counts of rows do not match, then the following message appears. 66 Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Message number 2750 Message Data subtable count does not match NUSI count. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn [nnnn [too many|too few] rows referenced by index] Because NUSI rows reside on the same AMP as the data rows, the index allows this check to complete without having all the AMPs available. Relationships between data and index subtables on the unavailable AMPs are not checked. Level-Two Checking In addition to performing level-pendingop and level-one checks, level-two checking does the following: • Determines whether row IDs on any given subtable are consistent with row IDs on other subtables by comparing lists of these IDs in those objects. • Compares the checksum of primary and fallback rows. • Verifies that hash codes reflect correct row distribution in each subtable. Critical to level-two and level-three checking is the amount of spool space available on the system. The following formulas determine the amount of spool space required to perform these two levels of checking: • RID = 32,020 * (# of rows / 3,200) • SIS = (52 * # of rows) + (3,000,000 * # of AMPs) To determine the number of rows, count the rows in the primary data table, which is the same as the primary index table. The following table shows the values and spool space required in the above formulas. The value … Is the spool space required … RID for the data subtable. SIS by the largest secondary index subtable, whether it is unique or nonunique. Therefore, to perform a level-two check for a nonfallback table that involves the secondary index, SIS requires a total spool space equal to the following: RID + (SIS*2) If the table contains fallbacks, then SIS requires a total spool space equal to the following: 2 *(RID + (SIS*2)) Utilities 67 Chapter 5: CheckTable (checktable) Level-Two Checking If you specify PARALLEL mode, then the total required spool space equals the sum of the spool space required for each of the tables being checked. The following table summarizes level-two checks. In a check type of … CheckTable … data subtable checks primary and fallback subtables for duplicate row IDs, out-of-order row IDs, and incorrectly distributed rows. For fallback tables, it checks primary against fallback. large object subtable checks for: • duplicate row id, out-of-order row id, and incorrectly distributed rows in the LOB subtables • missing primary or fallback row, where fallback exists for LOBs • checksum of the primary and fallback copies of the LOB row • stale locators/OIDs where the update tag of the OID in the base row does not match the update tag in the large LOB row • gaps in the LOB, for example, if the first and third portions of the LOB are present, but the second piece is missing from the subtable. unique secondary indexes • checks the list of row IDs indexed in the primary or fallback index subtable copy with row IDs in primary or fallback data subtable copy. For fallback tables, compares row IDs in fallback copy to row IDs in primary copy. • checks for duplicate, out-of-order, and incorrectly distributed row IDs. nonunique secondary indexes • checks index subtables for duplicate and out-of-order index rows. • checks index row for out-of-order data row IDs. • checks any indexed data row IDs that belong to another AMP or belong in another subtable. • checks lists of row IDs (indexed by index rows in the primary index subtable and each fallback index subtable) with the actual list of row IDs of data rows in the corresponding data subtables. reference index check checks specified reference index subtables for duplicate, out-of-order row IDs, and incorrectly distributed rows. Note: If the reference index subtable is fallback, Teradata Database uses the row IDs of the reference index rows from the primary copy of the subtables. Further information about each type of check is provided in subsequent sections. Note: If you run SCANDISK and correct any problems before using CheckTable, then it should not detect any duplicate or out-of-order rows during level-two checking. 68 Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Checking Data Subtables As CheckTable scans the data subtables, it performs checksum calculations for primary and corresponding fallback rows, and detects any duplicate, out-of-order, or incorrectly distributed rows in the primary and fallback data subtables. If CheckTable finds an error, it displays one of the following messages. Message number Message 2751 Data row out of order. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Row id nnnnH nnnnH nnnnH nnnnH nnnnH Previous row id nnnnH nnnnH nnnnH nnnnH nnnnH 2752 Data row has same row id as previous row. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Row id nnnnH nnnnH nnnnH nnnnH nnnnH 2753 Primary data row is on wrong AMP. AMP nnnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2754 Fallback data row is on wrong AMP. AMP nnnnn, Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] Expected primary AMP nnnnn 2755 Fallback data row is in wrong subtable. AMP nnnnn, Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback subtable nnnn Expected primary AMP nnnnn 2791 Primary and fallback data row checksums do not match. Primary AMP nnnnn Fallback AMP nnnnn Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. Utilities 69 Chapter 5: CheckTable (checktable) Level-Two Checking The level-two checks are performed on all primary and fallback data rows on all online AMPs. CheckTable does not check data on down AMPs. CheckTable performs the remaining checks, which detect primary or fallback rows without corresponding fallback rows or vice versa, only for fallback tables. If CheckTable detects extra or missing fallback data rows, then one of the following messages appears. Message number Message 2756 Fallback data row is missing. Primary AMP nnnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2757 Primary data row is missing. Fallback AMP nnnnn, Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn If an AMP is unavailable, then the primary-to-fallback data check bypasses rows whose alternate (primary or fallback) copy would be expected to be on the unavailable AMP. However, CheckTable still scans all subtables to check for exceptions other than primary-to-fallback inconsistencies. Checking Large Object Subtables CheckTable determines whether row IDs on any given subtable are consistent with row IDs on other subtables. It also compares the checksum of primary and fallback rows and verifies that hash codes reflect correct row distribution in each subtable. Message number 70 Message 7519 LOB row out of order. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Previous row id nnnnH nnnnH nnnnH nnnnH nnnnH 7520 LOB row has same row ID as previous row. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Message number Utilities Message 7521 Primary LOB row is on wrong AMP. AMP nnnnn LOB ID nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn Expected fallback AMP nnnnn Expected fallback subtable nnnn 7522 Fallback LOB row is on wrong AMP. AMP nnnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn Expected fallback AMP nnnnn Expected fallback subtable nnnn 7523 Fallback LOB row is in wrong subtable. [AMP nnnnn, Fallback subtable nnnn] LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback subtable nnnn Expected primary AMP nnnnn 7524 Data row contains invalid LOB oid. AMP nnnnn LOB id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH LOB oid nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 7525 Fallback LOB row is missing Primary AMP nnnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback AMP nnnnn Expected fallback subtable nnnn 7526 Primary LOB row is missing Fallback AMP nnnnn, Fallback subtable nnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn 7527 Base row OID update tag does not match LOB row OID udpate tag. [AMP nnnnn, Fallback subtable nnnn] LOB id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH 7528 Primary and fallback LOB row checksums do not match Primary AMP nnnnn Fallback AMP nnnnn, Fallback subtable nnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH 7529 Missing a piece of the large object AMP nnnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Prev LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH 71 Chapter 5: CheckTable (checktable) Level-Two Checking Message number Message 7530 LOB row references a non-existent data row AMP nnnnn LOB id nnn LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Prev LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH 7531 Data row references a non-existent LOB row AMP nnnnn LOB id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH LOB oid 7532 Data row references a LOB already referenced by another row AMP nnnnn LOB id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH LOB row id nnnnH nnnnH nnnnH nnnnH nnnnH Checking Unique Secondary Indexes If CheckTable performs a unique secondary index check without a preceding data or secondary index check on the same table, a scan of the primary (and fallback, if an AMP is unavailable) data subtables checks for duplicate, out-of-order, and incorrectly distributed data rows. IF an Amp is unavailable and the table is … THEN … no-fallback all unique secondary index checks are bypassed. fallback the fallback copies of index and data subtables are used in place of the primary copies, which are on the unavailable AMP. As CheckTable checks the index subtables, it performs checksum calculations for primary and corresponding fallback index rows, and it also detects duplicate, out-of-order, or incorrectly distributed index rows. If CheckTable detects one of these index rows, then CheckTable discards the offending row from the remainder of the checking process, and displays one of the following messages. Message number 2758 72 Message USI row out of order. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Previous row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Message number Message 2759 USI row has same row id as previous row [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH 2760 Primary USI row is on wrong AMP AMP nnnnn USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2761 Fallback USI row is on wrong AMP. AMP nnnnn, Fallback subtable nnnn USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2762 Fallback USI row is in wrong subtable. AMP nnnnn, Fallback subtable nnnn USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback subtable nnnn Expected primary AMP nnnnn 2792 Primary and fallback USI row checksums do not match. Primary AMP nnnnn Fallback AMP nnnnn Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. The first check made for unique secondary indexes compares the list of data row IDs, indexed by index rows in the primary (or if needed, fallback) copy of the index subtables to the data row IDs in the primary (or if needed, fallback) copy of the data subtable. Utilities 73 Chapter 5: CheckTable (checktable) Level-Two Checking During these checks, CheckTable detects non-indexed data rows, nonexistent indexed data rows, and multiple indexed data rows. In these cases, one of the following messages appears. Message number Message 2763 USI row indexes non existent data row. [USI AMP nnnnn, Primary USI subtable] [USI AMP nnnnn, Fallback USI subtable nnnn] USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH [Expected primary data AMP nnnnn] [Expected fallback data AMP nnnnn] [Expected fallback data subtable nnnn] [Expected fallback data subtable unknown] 2764 Data row not indexed by USI. [Data AMP nnnnn, Primary data subtable] [Data AMP nnnnn, Fallback data subtable nnnn] USI id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH 2765 Data row indexed multiple times by USI. [Data AMP nnnnn, Primary data subtable] [Data AMP nnnnn, Fallback data subtable nnnn] USI id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH [USI AMP #1 nnnnn, Primary USI subtable] [USI AMP #1 nnnnn, Fallback USI subtable nnnn] USI row id #1 nnnnH nnnnH nnnnH nnnnH nnnnH [USI AMP #2 nnnnn, Primary USI subtable] [USI AMP #2 nnnnn, Fallback USI subtable nnnn] USI row id #2 nnnnH nnnnH nnnnH nnnnH nnnnH CheckTable performs the remaining checks, which detect index rows in the primary copy of the index subtable without corresponding index rows in the fallback subtables or vice versa, only for fallback tables. CheckTable does not check rows whose primary or fallback copies are unavailable due to an unavailable AMP. If CheckTable detects extra or missing fallback unique secondary index rows, one of the following messages appears. Message number 2766 74 Message Fallback USI row is missing. Primary AMP nnnnn USI id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Message number 2767 Message Primary USI row is missing. Fallback AMP nnnnn, Fallback subtable nnnn USI id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn Checking Nonunique Secondary Indexes If CheckTable performs a NUSI check without a preceding data or secondary index check on the same table, it performs a scan of the primary and fallback data subtables to check for duplicate, out-of-order, or incorrectly distributed data rows. As CheckTable traverses the index subtables, it detects duplicate and out-of-order index rows. If CheckTable detects either of these problems, it discards the offending row from the checking process and displays one of the following messages. Message number Message 2768 NUSI row out of order. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn NUSI row id nnnnH nnnnH nnnnH nnnnH nnnnH Previous row id nnnnH nnnnH nnnnH nnnnH nnnnH 2769 NUSI [AMP [AMP NUSI NUSI row has same row id as previous row. nnnnn, Primary subtable] nnnnn, Fallback subtable nnnn] id nnn row id nnnnH nnnnH nnnnH nnnnH nnnnH Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. While traversing index subtables, CheckTable checks the list of data row IDs in each index row to verify that the list is in order. Although CheckTable does not discard out-of-order data row IDs, the following error message appears for each such data row ID. Utilities 75 Chapter 5: CheckTable (checktable) Level-Two Checking Message number 2786 Message NUSI [AMP [AMP NUSI NUSI data row ID out of order. nnnnn, Primary subtable] nnnnn, Fallback subtable nnnn] id nnn row id nnnnH nnnnH nnnnH nnnnH nnnnH While CheckTable traverses the index subtables, if it finds any indexed data row ID that belongs (according to its hash code) on another AMP or in another fallback subtable, CheckTable ignores that data row ID for the remainder of the check, and displays an error message. One of the following messages appears. Message number Message 2770 Data row id referenced by NUSI is on wrong AMP. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn NUSI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2771 Data row id referenced by fallback NUSI in wrong subtable. [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn NUSI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback subtable nnnn Expected primary AMP nnnnn The check for nonunique secondary indexes compares the list of row IDs indexed by index rows in the primary and each fallback index subtable with the actual list of row IDs of data rows in the corresponding data subtables. During this check, CheckTable detects non-indexed data rows, nonexistent indexed data rows, and multiple indexed data rows. In these cases, one of the following messages appears. Message number 2772 76 Message NUSI row indexes non existent data row. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn NUSI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Two Checking Message number Message 2773 Data row not indexed by NUSI. [Data AMP nnnnn, Primary subtable] [Data AMP nnnnn, Fallback subtable nnnn] NUSI id nnn Data row id nnnnH nnnnH nnnnH nnnnH nnnnH 2774 Data [AMP [AMP NUSI Data NUSI NUSI row indexed multiple times by NUSI. nnnnn, Primary subtable] nnnnn, Fallback subtable nnnn] id nnn row id nnnnH nnnnH nnnnH nnnnH nnnnH row id #1 nnnnH nnnnH nnnnH nnnnH nnnnH row id #2 nnnnH nnnnH nnnnH nnnnH nnnnH Checking Reference Indexes The system compares each reference index row from the subtables with the rows in the spool file created during the data subtable check. If an inconsistency occurs between the reference index subtables and the corresponding data subtable, then one of the following messages appears. Message number Utilities Message 2736 RI row out of order. [AMP nnnnn, Primary subtable] [AMP nnnnn, FallBack subtable nnnn] Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Previous reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH 2737 RI row has same row ID as previous row. [AMP nnnnn, Primary subtable] [AMP nnnnn, FallBack subtable nnnn] Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH 2820 Fallback reference index row is on the wrong AMP. AMP nnnnn, FallBack subtable nnnn Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2880 Reference index row indexes non existent data row. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Reference index row count exceeds data row by n,nnn,nnn,nnn 77 Chapter 5: CheckTable (checktable) Level-Two Checking Message number Message 2881 Foreign Key value is not found in any reference index row. [Data AMP nnnnn, Primary subtable] [Data AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Data row ID nnnnH nnnnH nnnnH nnnnH nnnnH 2882 Data row is not indexed by reference index row. [Data AMP nnnnn, Primary subtable] [Data AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Reference index row id nnnnH nnnnH nnnnH nnnnH nnnnH Data row count exceeds reference index row by n,nnn,nnn,nnn 2898 Fallback reference index row is in the wrong subtable. [AMP nnnnn, Fallback subtable nnnn] Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Expected fallback subtable nnnn Expected primary AMP nnnnn 2899 Reference index row contains non existent Foreign Key value. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH 2993 Primary reference index row is on the wrong AMP. AMP nnnnn Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] The remaining checks detect reference rows in the primary copy of the reference index subtable that do not have corresponding reference index rows in the fallback subtables or vice versa. If the system detects an error, then one of the following messages appears. Message number 2733 78 Message Primary and fallback RI row checksums do not match Primary AMP nnnnn Fallback AMP nnnnn, Fallback subtable nnnn Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Three Checking Message number Message 2883 Fallback reference index row is missing. Primary AMP nnnnn Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2884 Primary reference index row is missing Fallback AMP nnnnn, Fallback subtable nnnn Reference Index ID nnn Reference Index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Expected primary AMP nnnnn Level-Three Checking Level-three checking provides the most detailed check and requires more system resources than any of the other checking levels. Because of the cost in system resources, use this checking level rarely and only for specific diagnostic purposes. In addition to checks that are unique to this level, level-three checking includes most of the same checks that are performed at lower check levels. However, level-three checking does not perform the large object checking that occurs at levels one and two. If an AMP is unavailable and the table is no-fallback, then CheckTable bypasses all unique secondary index checks. If an AMP is unavailable and the table is fallback, then CheckTable uses the fallback copies of index and data subtables on the unavailable AMP in place of the primary copies on the unavailable AMP. The following table summarizes level-three checking. Utilities In a check type of … CheckTable … data subtable • checks the primary data subtable, comparing each row with corresponding fallback data row. Makes a byte-by-byte comparison at all levels. If the table is not fallback, then no fallback checks are done. • checks for duplicate rows and duplicate unique primary keys. • verifies the row hash. • verifies the internal partition numbers of a partitioned primary index, if it exists. 79 Chapter 5: CheckTable (checktable) Level-Three Checking In a check type of … CheckTable … unique secondary indexes • checks primary or fallback index subtables for out-of-order data rows, multiple data rows with same row ID, data rows on the wrong AMP, or data rows in the wrong fallback subtable. Makes a byte-by-byte comparison of primary and fallback index subtables if table is fallback, and verifies the row hash. • compares the key of each unique secondary index row to the expected key extracted from the data row. • verifies that every row is indexed only once. nonunique secondary indexes • checks that each data row on index subtables is indexed with the correct index key. • checks that the hash code for each nonunique secondary index row corresponds to the key value of the row. reference index subtables • checks for duplicate index values. • checks for incorrect hash code. second set of checks for reference index subtables checks reference index subtables against parent tables. Checking Data Subtables As CheckTable scans the data subtables, it verifies row hashes, performs a byte-by-byte comparison of primary and fallback tables, detects any duplicate, out-of-order, or incorrectly distributed rows, and verifies the internal partition number of each row if the table has a partitioned primary index. In addition to errors from the lower-level data subtable checks, level-three checking can return the following error messages. Message number 80 Message 2520 A variable field offset exceeds the next variable offset or the row length. AMP nnnnn Table id nnnnH nnnnH [Index id nnn Index Row id nnnnH nnnnH nnnnH nnnnH nnnnH] [Row id nnnnH nnnnH nnnnH nnnnH nnnnH] Var Field nnnn (0xnnnn) contains 0xnnnn. Row length 0xnnnn. 2775 Data row hash code is incorrect. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected hash code nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2778 Primary and fallback data rows do not match. Primary AMP nnnnn Fallback AMP nnnnn Fallback subtable nnnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Three Checking Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. If an AMP is unavailable, then the primary-to-fallback data check bypasses rows whose alternate (primary or fallback) copy would be expected to be on the unavailable AMP. However, CheckTable still scans all subtables to check for exceptions other than primary-to-fallback inconsistencies. If an internal partition number does not match the one calculated for the row from the partitioning expressions, the following error message appears. Message number 7534 Message Data row partitioning is AMP nnnnn Row id nnnnH nnnnH nnnnH External partition nnnnn Internal partition nnnnn incorrect. nnnnH nnnnH (nnnnH) but expected nnnnn (nnnnH) (nnnnH) but expected nnnnn (nnnnH) For multilevel partitioned primary indexes, the external partition number in the error message is the number resulting from the combined partition expression. For more information on partitioned primary indexes and on partitioning expressions, see Database Design. You might have to validate a partitioned primary index again if the following occurs: • CheckTable or queries indicate rows with incorrect Row IDs. • The table is restored or copied to another system. • A partitioning expression includes decimal rounding operations, floating point operations, or HASHROW or HASHBUCKET functions • The system is upgraded. • You change the Round Halfway Mag Up field in the DBS Control utility, causing changes in the calculation of a partitioning expression. To correct the partitioning of rows for a table, use the ALTER TABLE statement with the REVALIDATE PRIMARY INDEX WITH DELETE or INSERT option. For more information on the ALTER TABLE statement, “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. Utilities 81 Chapter 5: CheckTable (checktable) Level-Three Checking Checking Unique Secondary Indexes If CheckTable performs a unique secondary index check without a preceding data or secondary index check on the same table, a scan of the primary (and fallback, if an AMP is unavailable) data subtables checks for duplicate, out-of-order, and incorrectly distributed data rows. IF an Amp is unavailable and the table is … THEN … no-fallback all unique secondary index checks are bypassed. fallback the fallback copies of index and data subtables are used in place of the primary copies, which are on the unavailable AMP. As CheckTable checks the index subtables, it detects duplicate, out-of-order, or incorrectly distributed index rows. If CheckTable detects one of these index rows, then CheckTable discards the offending row from the remainder of the checking process, and displays an error message. Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. In addition to the error messages returned by lower-level checking, level-three USI checks can display the following error messages. Message number 82 Message 2779 USI row hash code is incorrect. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected hash code nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] 2780 USI row has duplicate key. AMP nnnnn [Primary subtable nnnn] [Fallback subtable nnnn] USI id nnn USI row id nnnnH nnnnH nnnnH nnnnH nnnnH Indexed data row id nnnnH nnnnH nnnnH nnnnH nnnnH Duplicated index value row id nnnnH nnnnH nnnnH nnnnH nnnnH Utilities Chapter 5: CheckTable (checktable) Level-Three Checking Message number Message 2781 Data row indexed by USI row with incorrect key. [Data AMP nnnnn, Primary subtable nnnn] [Data AMP nnnnn, Fallback subtable nnnn] Data row id nnnnH nnnnH nnnnH nnnnH nnnnH USI id nnn [USI AMP nnnnn, Primary subtable nnnn] [USI AMP nnnnn, Fallback subtable nnnn] USI row id nnnnH nnnnH nnnnH nnnnH nnnnH 2782 Primary and fallback USI rows do not match. Primary AMP nnnnn Fallback AMP nnnnn, Fallback subtable nnnn USI id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Checking Nonunique Secondary Indexes If CheckTable performs a NUSI check without a preceding data or secondary index check on the same table, then CheckTable performs a scan of the primary and fallback data subtables checks for duplicate, out-of-order, or incorrectly distributed data rows. As CheckTable traverses the index subtables, it detects duplicate and out-of-order index rows. If CheckTable detects either of these problems, then it discards the offending row from the checking process, and displays an error message. Note: CheckTable treats index rows that are out-of-order as if they do not exist, and continues looking for the next row in the sequence. This can cause CheckTable to report out-of-order errors for subsequent rows, even if only a single row was out of order. For example, given the sequence: 1, 2, 4, 6, 8, 20, 9, 10, 11, 12, 17, 18, 21, 25, CheckTable would see 9 as being out of ascending sequence. CheckTable would therefore ignore the 9, then continue looking for a row to follow 20. In this case, although 20 is likely the only row that is out of order, CheckTable would report errors for rows 9 through 18. In addition to the error messages returned by lower-level checking, level-three NUSI checks can display the following error messages. Message number Utilities Message 2784 NUSI row incorrectly has continuation flag clear. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH 2785 Data [AMP NUSI Data NUSI row indexed by NUSI row with incorrect key. nnnnn, Primary subtable nnnn] id nnn Row id nnnnH nnnnH nnnnH nnnnH nnnnH Row id nnnnH nnnnH nnnnH nnnnH nnnnH 83 Chapter 5: CheckTable (checktable) Level-Three Checking Message number 2790 Message NUSI row hash code is incorrect. [AMP nnnnn, Primary subtable nnnn] [AMP nnnnn, Fallback subtable nnnn] NUSI id nnn NUSI Row id nnnnH nnnnH nnnnH nnnnH nnnnH Expected hash code nnnnH nnnnH [It contains nn data row id(s) nnnnH nnnnH nnnnH nnnnH nnnnH (...) nnnnH nnnnH nnnnH nnnnH nnnnH] Checking Reference Index Subtables During level-three checking, CheckTable performs two sets of checks on reference index subtables. If CheckTable detects an error during the first set of checks, one of the following error messages appears. Message number Message 2885 Reference index row hash code is incorrect. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Expected hash code nnnnH nnnnH Expected primary AMP nnnnn [Expected fallback AMP nnnnn, Expected fallback subtable nnnn] [Expected fallback AMP nnnnn, Expected fallback subtable unknown] 2886 Reference index row has duplicate Foreign Key values. [AMP nnnnn, Primary subtable] [AMP nnnnn, Fallback subtable nnnn] Reference Index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH Duplicated foreign key value row ID nnnnH nnnnH nnnnH nnnnH nnnnH 2887 Primary and fallback reference index rows do not match. Primary AMP nnnnn Fallback AMP nnnnn, Fallback subtable nnnn Reference index ID nnn Reference index row ID nnnnH nnnnH nnnnH nnnnH nnnnH If CheckTable detects an error during the second set of checks, it places a read lock on the Parent table specified in the reference index. If the AMP cannot lock the Parent table, then the following message appears: Warning: Skipping parent key validation in level 3 checking. Reference Index ID nnn 84 Utilities Chapter 5: CheckTable (checktable) CheckTable General Checks CheckTable General Checks CheckTable checks certain aspects of tables regardless of the level of checking that is specified. These general checks include things like checking the table headers, checking for obsolete subtables, and checking the data dictionary. Check Type Description Data Dictionary This check detects tables that are not in the Teradata Database Data Dictionary. If CheckTable checks database DBC, it compares tables in DBC.TVM and DBC.temp with tables on AMPs. Table headers compares table header components on all AMPs with the table header from the AMP with the lowest virtual processor (vproc) number of all online AMPs. Table structure compares the table structure version stored in DBC.TVM to the table structure version stored in the header. Parent/Child count verifies if the ParentCount and ChildCount in DBC.TVM match the ParentCount and ChildCount in the table header. Pending operations checks the table header to determine if any table has any pending operations. This check works for global temporary tables as well as base tables. CheckTable can display the following error messages during general checking phases of all check levels. Message number Utilities Message 2729 Dictionary parent count does not match header parent count. Dictionary parent count nnnn Header parent count nnnn 2740 One or more rows found for table not in DBC.TVM. Table id nnnnH nnnnH [Rows for table found on all AMPs] [Rows for table found on following AMPs: nnnnn] 2741 Table header not found. Table id nnnnH nnnnH [Header missing on all AMPs] [Header missing on following AMPs: nnnnn] 2744 Dictionary version does not match header version. Dictionary version nnnn Header version nnnnn 2787 Table check bypassed due to pending operation. 85 Chapter 5: CheckTable (checktable) CheckTable General Checks Message number Message 2788 Table header not found for table. Table id nnnnH nnnnH [Header missing on all AMPs] [Header missing on following AMPs: nnnnn] 2890 Dictionary child count does not match header child count. Dictionary child count nnnn Header child count nnnn 2935 Table header format is invalid. Table id nnnnH on AMP nnnnn 6719 The dictionary object name or text string can not be translated. Table id nnnnH on AMP nnnnn Checking skipped due to bad TVMNAME 7436 One or more rows found for a temporary table not in DBC.TempTables. Temporary table ID nnnnH nnnnH [Rows for temporary table found on all AMPs] [Rows for temporary table found on following AMPs: nnnnn] 7437 Table header not found for a materialized temporary table. Temporary table ID nnnnH nnnnH [Header missing on all AMPs] [Header missing on following AMPs: nnnnn] [HostID nnnnH SessNo nnnnH nnnnH] [Row id nnnnH nnnnH nnnnH nnnnH nnnnH] [Table header not found on AMP] 7565 One or more rows found for table not in DBC.TVM. Deleted. Table id nnnnH nnnnH [Rows for table found on all AMPs. Deleted.] [Rows for table found on following AMPs and deleted: nnnnn] CheckTable can display the following error messages during general checking phases of levels one, two, and three checking. 86 Message number Message 2742 Extraneous subtable nnnn on AMP nnnnn. 2743 Mismatch on the following table header components: component(s) yielded a mismatch between the header on AMP nnnnn and the header on the following AMPs: nnnnn [nnnnn ...] 2745 Warning: USI flagged as invalid on one or more AMPs. USI id nnn Remaining checks for index bypassed. Utilities Chapter 5: CheckTable (checktable) CHECK Command Examples Message number Message 2889 Table header has incorrect parent count or child count. [Parent Count] [Child Count] did not agree with the counts from the reference index descriptors in the table header of the following AMPs: nnnnn [nnnnn ...] 5954 Internal error: Inconsistency in the PPI descriptor of the table header. 7590 If the COMPRESSCHECK option is specified, and the compress value from the dbc.tvfields.compressvaluelist does not match that of the Table Header field 5, or other problems are encountered during the check, CheckTable issues this warning: Warning: Skip Compress Value checking. Note: Tables with online archive active logs are checked by CheckTable, however their online archive log subtables are not checked. In these cases, CheckTable displays the following message: Table is online archive logging active, its log subtable will not be checked. CHECK Command Examples This section shows some examples using the options of the CHECK command. CHECK ALL TABLES EXCLUDE … To exclude one or more databases or tables from the check, use CHECK ALL TABLES EXCLUDE. If a specified object does not exist in the system, then the object appears in a message at the end of the summary report. CheckTable does the following: • Checks the dictionary and database DBC. (If database DBC is in the EXCLUDE list, it is not checked.) • Checks other non-excluded databases in database-name order The following table shows different CHECK ALL TABLES EXCLUDE … examples based on database DBC at level-one checking. IF you want to check … THEN type … the Data Dictionary and all databases except DBC, SalesDB1, and PurchaseDB1 CHECK ALL TABLES EXCLUDE DBC, SalesDB1, PurchaseDB1 AT LEVEL ONE; Utilities 87 Chapter 5: CheckTable (checktable) CHECK Command Examples IF you want to check … THEN type … only the Data Dictionary one of the following: • CHECK ALL TABLES EXCLUDE % AT LEVEL ONE; • CHECK ALL TABLES EXCLUDE %.% AT LEVEL ONE; 88 Utilities Chapter 5: CheckTable (checktable) CHECK Command Examples IF you want to check … THEN type … all tables except those in db1 and t2 and t4 of db2 CHECK ALL TABLES EXCLUDE db1,db2.t2, db2.t4 AT LEVEL THREE; all tables except those in database1 with tablenames beginning with Sales CHECK ALL TABLES EXCLUDE database1.Sales% AT LEVEL ONE; CHECK ALL TABLES AT LEVEL PENDINGOP To check all tables to determine if they have any pending operations, type the following: CHECK ALL TABLES AT LEVEL PENDINGOP; The following output appears: Check beginning at 11:13:31 02/06/26. Data dictionary check started at 11:13:31 02/06/26. ... "PROD"."CUSTOMERS" starting at 11:14:22 02/06/26. Table id 0000H 624BH, No fallback. Table check bypassed due to pending MultiLoad. "PROD"."SHIPMENT" starting at 11:14:24 02/06/26. Table id 0000H 04E1H, No fallback. Table check bypassed due to pending Table Rebuild. ... 1435 table(s) checked. 420 fallback table(s) checked. 1015 non-fallback table(s) checked. 1 1 0 0 table(s) bypassed due to pending MultiLoad. table(s) bypassed due to pending Table Rebuild. table(s) failed the check. Dictionary error(s) were found. Check completed at 11:14:58 02/06/26. CHECK dbname EXCLUDE … To check all tables in a specified database, except for those listed after EXCLUDE, use CHECK dbname EXCLUDE …. You can use wildcards in the EXCLUDE list. For example: check all tables exclude mydb% at level two will exclude database having names starting with mydb. The following table shows different CHECK dbname EXCLUDE examples at level-one checking. Utilities 89 Chapter 5: CheckTable (checktable) CHECK Command Examples IF you want to … THEN type … check database dbname1 except for tables t1, t2, t3 CHECK dbname1 EXCLUDE t1, t2, t3 AT LEVEL ONE; check database dbname2 except for tables beginning with the word table and followed by any single character as well as tables containing the string weekly CHECK dbname2 EXCLUDE table?, %weekly% AT LEVEL ONE; exclude any tables whose names either begin with week1 and end with any character or begin with the word month in the SalesDB database CHECK SalesDB EXCLUDE week1?, month% AT LEVEL ONE; For more information, see “Wildcard Syntax” on page 100 and “Rules for Using Wildcard Syntax” on page 102. If a specified table includes a dbname, then CheckTable only checks the table in that referenced database. NO ERROR LIMIT To perform level-two checking with no error limits on the MfgDb database, type the following: CHECK MfgDb AT LEVEL TWO WITH NO ERROR LIMIT; Output similar to the following appears. Check beginning at 13:08:03 00/04/26. "MFGDB"."INVENTORY" starting at 13:08:06 00/04/26. Table id 0000H 0C31H, Fallback. No errors reported. "MFGDB"."PARTS" starting at 13:08:07 00/04/26. Table id 0000H 0C33H, No fallback. 2753: Primary data row is on wrong AMP. AMP 00000 Row id 0000H 79B6H 9E37H 0000H 0001H Expected primary AMP 00001 1 error(s) reported. "MFGDB"."RETURNS_TEMP" starting at 13:08:08 00/04/26. Table id 0000H 0C32H, Fallback. No errors reported. 3 table(s) checked. 2 fallback table(s) checked. 1 non-fallback table(s) checked. 1 table(s) failed the check. 0 Dictionary error(s) were found. Check completed at 13:08:09 00/04/26. In the above output, the first line of the output is the header, which is displayed before the first table is checked. The header shows the exact time and date that you started the check in the following format: Check beginning at HH:MM:SS YY/MM/DD 90 Utilities Chapter 5: CheckTable (checktable) CHECK Command Examples If one or more AMPs are unavailable, then the following message appears: The following AMPs are not operational. not be complete: nnnnn nnnnn... ... As a result, certain checks will Unavailable AMPs are indicated by the format nnnnn. The next set of lines displayed indicates the database name, table name, internal ID, fallback status, and the date and time: “dbname”.“tablename” starting at YY/MM/DD HH:MM:SS [Table ID nnnnH nnnnH, Fallback] [Table ID nnnnH nnnnH, No fallback] Note: When the checking process begins and CheckTable detects inconsistencies, CheckTable displays specific messages that pertain to those inconsistencies. CheckTable checks tables in alphabetical order by database name and table name. If you specify to check DBC, then CheckTable always checks DBC before the named database and table. SKIPLOCKS CheckTable automatically skips any tables when it tries to lock them and finds that they are locked already. For example, suppose you type the following: CHECK fb3.t1 at level two SKIPLOCKS IN PARALLEL; If fb3.t1 is locked when you submit the command, then the following output appears: Check Beginning at 07:57:25 99/12/30 "FB3"."T1" skipped at 07:57:26 99/12/30 due to pending lock. Table id 0000H 3E9H. 0 table(s) checked. 0 fallback table(s) checked. 0 non-fallback table(s) checked. 1 table(s) skipped due to pending lock. 0 table(s) failed the check. 0 Dictionary error(s) were found. SERIAL/PARALLEL Serial mode allows CheckTable to check a single table at a time. Parallel mode allows CheckTable to check multiple tables simultaneously. The following tables shows examples of both modes. IF you want to check database DB0 with tables t1, t10, t100, t1000, and t11 at level TWO in … THEN type … SERIAL mode CHECK db0.t1% at level two IN SERIAL; PARALLEL mode CHECK db0.t1% at level two IN PARALLEL; Serial Mode Output When processing completes, the following termination message or summary of the check results appears: Utilities 91 Chapter 5: CheckTable (checktable) CHECK Command Examples 5 3 2 3 table(s) checked. fallback table(s) checked. non-fallback table(s) checked. tables failed check. 0 Dictionary error(s) were found. Check completed at 7:57:24 99/12/30. Note: The entire output is not shown. Parallel Mode Output The database name and the table name precede the report for each message to help you identify the table to which the output message belongs: Check beginning at 07:57:14 99/12/30. "DB0"."T1" starting at 07:57:15 99/12/30. Table id 0000H 3F92H, Fallback. "DB0"."T10" starting at 07:57:15 99/12/30. Table id 0000H 0D14H, Fallback. "DB0"."T100" starting at 07:57:15 99/12/30. Table id 0000H 0D6EH, Fallback. "DB0"."T1000" starting at 07:57:15 99/12/30. Table id 0000H 12E6H, Fallback. "DB0"."T10" checking at 07:57:15 99/12/30. Table id 0000H 0D6EH, Fallback. 2741: Table header not found. Table id 0000H 0D14H Header missing on following AMPs: 00000 Further checking skipped because of missing header(s). "DB0"."T10" ending at 07:57:15 99/12/30. Table id 0000H 0D6EH, Fallback. "DB0"."T1" checking at 07:57:15 99/12/30. Table id 0000H 3F92H, Fallback. 2757: Primary data row is missing. Fallback AMP 00001, Fallback subtable 2048 Row id 0000H 8C49H CDABH 0000H 0001H Expected primary AMP 00000 "DB0"."T111" starting at 07:57:16 99/12/30. Table id 0000H 12E8H, Fallback. "DB0"."T1" checking at 07:57:17 99/12/30. Table id 0000H 3F92H, Fallback. 2757: Primary data row is missing. Fallback AMP 00001, Fallback subtable 2048 Row id 0000H BD81H 0459H 0000H 0001H Expected primary AMP 00000 "DB0"."T100" checking at 07:57:17 99/12/30. Table id 0000H 0D6EH, Fallback. 2757: Primary data row is missing. Fallback AMP 00003, Fallback subtable 2048 Row id 0000H 1897H 9B57H 0000H 0001H Expected primary AMP 00002 "DB0"."T1000" ending at 07:57:18 99/12/30. Table id 0000H 12E6H, Fallback. No errors reported. "DB0"."T1" checking at 07:57:18 99/12/30. Table id 0000H 3F92H, Fallback. 2880: Reference index row indexes non existent data row. AMP 00000, Primary subtable 92 Utilities Chapter 5: CheckTable (checktable) CHECK Command Examples Reference index id 0 Reference index row id 0000H 8C49H CDABH 0000H 0001H Reference index row count exceeds data row count by 1 "DB0"."T1" checking at 07:57:18 99/12/30. Table id 0000H 3F92H, Fallback. 2888: Invalid reference index row. AMP 00002, Primary subtable Reference index id 0 Reference index row id 0000H 1897H 9B57H 0000H 0001H "DB0"."T100" checking at 07:57:18 99/12/30. Table id 0000H 0D6EH, Fallback. 2757: Primary data row is missing. Fallback AMP 00003, Fallback subtable 2048 Row id 0000H 3133H 36AEH 0000H 0001H Expected primary AMP 00002 "DB0"."T100" ending at 07:57:19 99/12/30. Table id 0000H 0D6EH, Fallback. 2 error(s) reported. "DB0"."T1" checking at 07:57:19 99/12/30. Table id 0000H 3F92H, Fallback. AMP 00002, Primary subtable Reference index id 0 Reference index row id 0000H 3133H 36AEH 0000H 0001H TABLES=n Clause The following example uses the TABLES=n clause option to specify the number of tables to check simultaneously in parallel mode. check all tables at level one in parallel tables=3; Check beginning at 10:55:23 05/01/06. Data dictionary check started at 10:55:23 05/01/06. F2 >>>> Status: CheckTable running in PARALLEL mode. 3 CheckTable tasks started. 3 CheckTable tasks ACTIVE. 0 CheckTable tasks IDLE. Task STATUS PRIORITY A priority level controls resource usage and improves performance. To run CheckTable in PARALLEL mode at the priority level corresponding to the performance group name $HMKTG, type the following: CHECK eb3, db3, fb3.t1 at level two IN PARALLEL PRIORITY='$HMKTG'; Assume the priority in the following example is invalid: CHECK eb3, db3, fb3.t1 at level two IN PARALLEL PRIORITY='$HMKG'; CheckTable displays an error message indicating that the priority is invalid and waits for the next input. Utilities 93 Chapter 5: CheckTable (checktable) CheckTable and Deadlocks CONCURRENT MODE To run CheckTable in CONCURRENT mode at level three on rfc66706.table_1, type the following: check rfc66706.table_1 at level three concurrent mode; The following appears: Check beginning at 15:38:01 05/03/17. "RFC66706"."TABLE_1" skipped at 15:38:16 05/03/17 due to pending lock. Table id 0000H 04D3H . "RFC66706"."TABLE_1" skipped again at 15:43:16 05/03/17 due to pending lock. Table id 0000H 04D3H . Remaining time to be retried is forever. "RFC66706"."TABLE_1" skipped again at 15:48:16 05/03/17 due to pending lock. Table id 0000H 04D3H . Remaining time to be retried is forever. CheckTable and Deadlocks Because the system does not detect deadlocks that exist between utility functions, CheckTable has a built-in timeout feature to prevent long-standing deadlocks. However, this feature makes it difficult for CheckTable to apply a lock on a table that has frequent lock requests. For non-concurrent mode, the first time a lock is requested, the time-out interval is one minute. Each subsequent retry adds one minute to the interval until the interval is five minutes. Then, all subsequent retries employ a five-minute time-out. The number of times CheckTable can attempt a lock request is not limited. If you specify the SKIPLOCKS option, then CheckTable requests a lock on a table only once. If CheckTable does not obtain the lock the first time, then CheckTable does not request any further locks and does not check the table. To determine the current status of CheckTable under MP-RAS, press F2 or type status at the command prompt. On other operating system platforms, type status at the CheckTable command prompt. To abort the current table check under MP-RAS, press F3 while CheckTable processes a command. On other operating system platforms, enter “abort table” to abort the current table check or “abort” to abort the current CHECK command. For more information, see “Using Function Keys and Commands” on page 50. For non-concurrent mode, when the CheckTable Table Lock Retry entry in the DBS Control General fields is set to a positive number, CheckTable will retry the lock request until this specified time in minutes is exhausted. CheckTable will display that the table is skipped due to 94 Utilities Chapter 5: CheckTable (checktable) CheckTable Messages pending lock and will continue to check the next table. For more information, see “CheckTable Table Lock Retry Limit” in Chapter 11: “DBS Control (dbscontrol).” For concurrent mode, the first time a table lock is requested, the timeout interval is 15 seconds. CheckTable will skip the locked table and continue to check the remaining tables. All subsequent retries employ a five-minute timeout interval per table. All skipped tables will be retried forever if RETRY LIMIT is not specified. If RETRY LIMIT is positive, all skipped tables will be retried until CheckTable reaches the RETRY LIMIT. CheckTable Messages CheckTable issues the following types of messages: • Syntax error • Check completion • Error Syntax Error Messages When a syntax error occurs, CheckTable does the following: • Displays the part of the input line where the error occurs • Prints a dollar sign ($) in the command input line beneath the character that caused the error • Displays an error message For example, assume the following command: CHECK db[2-] AT LEVEL ONE; The following error message appears: *** Syntax error *** CHECK db[2-] AT LEVEL ONE; $ Invalid range specified in dbname or dbname.tablename. Check Completion Messages After CheckTable completes a table check, you might see one of the following messages: Utilities • nnnnn error(s) reported. • No error(s) reported. • Table check aborted due to excessive error(s). • Table check aborted by fatal error. • Table check bypassed due to pending Fast Load. • Further checking skipped because of missing header(s). • Further checking skipped because of header inconsistencies. • Further checking skipped because table is unhashed. 95 Chapter 5: CheckTable (checktable) CheckTable Messages • Further checking skipped because of a value-ordered primary index. Note: A value-ordered primary index can occur with only a join index or a hash index. If you are concerned about the join index or hash index, then you can drop it and create it again. • Further checking skipped because of a Join or Hash Index with logical rows. Note: The above message displays if a join index or hash index is compressed, meaning that it contains multiple logical rows within a physical row. After CheckTable completes, you see a summary report similar to the following: nnnnn nnnnn nnnnn nnnnn nnnnn nnnnn nnnnn nnnnn nnnnn nnnnn Check table(s) checked. fallback table(s) checked. no fallback table(s) checked. table(s) bypassed due to pending Restore. table(s) bypassed due to pending Fast Load. table(s) bypassed due to Recovery Abort. table(s) bypassed due to being unhashed. table(s) skipped due to pending lock. table(s) had checking aborted before completion. table(s) failed the check. completed at HH:MM:SS YY/MM/DD. Error Messages CheckTable aborts when it encounters problems, depending on the severity and context of the problem. CheckTable crashes the Teradata Database rarely, such as when unable to clean up resources allocated by the Teradata Database. When CheckTable aborts, it does the following: • Displays an error message • Saves a snapshot dump for further analysis • Retains backtrace information The following table shows some possible error messages that might appear. Error Message Type Actual Error Messages Abort due to initialization 7492: CheckTable utility aborted at <date>/<time> in initialization phase due to error <error code>. Command abort 7493: CHECK code>. Table abort 7494: <DbName>.<Table Name> was aborted at <date>/<time> due to error <error code>. command aborted at <date>/<time> due to error <error 7495: <DbName>.<Table Name> was skipped at <date>/<time> due to error <error code>. Run SCANDISK. Unexpected error 96 7496: CheckTable utility aborted at <date>/<time> due to unexpected error <error code>. Utilities Chapter 5: CheckTable (checktable) Error Handling The following table shows the location of the backtrace information. On platform … The location of backtrace information is in … Linux event log file /var/log/messages. MP-RAS stream log file /var/adm/streams/*date. Windows Event Viewer. Note: For more information on specific CheckTable error messages by number, see the Messages manual. Auxiliary Information In auxiliary information included in messages, RowID output format includes the following: • The internal partition number consists of the first two bytes for both partitioned and nonpartitioned tables. For a nonpartitioned table, the internal partition number is zero. (This number is not actually stored in a row in this case.) • The hash value of the primary index consists of the next four bytes. • The uniqueness value consists of the last four bytes. Error Handling While CheckTable is processing, a system failure could occur for a variety of reasons, such as the following: • Programming errors • Hardware problems After a system failure, one of the following might occur: • The system resets. • The partition in which CheckTable is running resets. • CheckTable hangs. When crashing the system, CheckTable displays the following message, which is logged in the streams log. 10196: CheckTable utility is crashing the DBS because it has faced problems while aborting due to error code <ErrorNumber> If CheckTable hangs, verify the status using the status command. If you do not detect any problems, then try to stop and restart CheckTable. Utilities 97 Chapter 5: CheckTable (checktable) Using Valid Characters in Names Using Valid Characters in Names The names of databases, tables, other objects or performance groups specified in the CHECK command can consist of the following inclusive characters: 98 • Lowercase alphabet (a … z) • Uppercase alphabet (A … Z) • Digits (0 … 9) • The following special characters. Special characters … Include … Brackets • • • • { } (curly) ( ) (parentheses) [ ] (square) < > (angle) Punctuation marks • • • • • • • • ` (single quote) ! (exclamation point) ; (semicolon) : (colon) ' (apostrophe) ? (question mark) . (period) , (comma) Other • • • • • • • • • • • • • • • | (vertical line) ~ (tilde) @ (at sign) $ (dollar sign) = (equals sign) % (percent sign) + (plus) # (number sign) ^ (circumflex accent) & (ampersand) * (asterisk) - (hyphen-minus) _ (low line) / (forward slash) \ (backward slash) Utilities Chapter 5: CheckTable (checktable) Using Valid Characters in Names You must specify any name containing one or more special characters or blank spaces within single or double quotes, except for the following: • ? (question mark) • % (percent sign) • $ (dollar sign) • _ (low line) • [ ] (square brackets) • # (number sign) Note: A name cannot begin with a digit (0 … 9). The following demonstrate valid database or table names: • Table1 • MYTABLE10 • $$MyAccount • #Your_Account_$100 • %mydatabase? • % • ??? The following examples show irregular but acceptable names: • '123' • “First&Second table” • 'my db1' The following examples show unacceptable and non-valid names: • 123 • First&Second table • my db1 For more information on creating names, see “Basic SQL Syntax and Lexicon” in SQL Reference: Fundamentals. Utilities 99 Chapter 5: CheckTable (checktable) Using Wildcard Characters in Names Using Wildcard Characters in Names Use wildcard characters % and ? to specify a pattern for database names or table names. The following table shows how CheckTable interprets wildcard characters. Wildcard character … Matches any … % (percent sign) string of characters of any length, including the Null string. ? (question mark) single character. You can use wildcard characters in any combination. However, you cannot use wildcard characters in hexadecimal form. The following table shows the use of wildcard characters in names. Wildcard character … Matches any … % database name. %.% table name. %database% database name containing the string: database. SalesDB% database name beginning with the following: SalesDB. Wildcard Syntax CheckTable supports the use of wildcard syntax to represent a list of possible characters at a particular position in the names of databases or tables. Use the wildcard syntax to specify lists of tables and databases you want CheckTable to check or not check. The wildcard syntax begins with a left square bracket ([) and ends with a right square bracket (]). The following figure shows the syntax for a database name or a table name. Starting char [ Start range char Alphabet range ] Remaining chars [ Start range char Digit ] Hyphen range " Char " Char ' ' Char Char 100 YSCTB002 Utilities Chapter 5: CheckTable (checktable) Using Wildcard Characters in Names where: Syntax element … Specifies … Starting char one of the following: • alphabet (lowercase or uppercase) • ? (question mark) • % (percent sign) Start range char one of the following: • • • • Alphabet range alphabet (lowercase or uppercase) $ (dollar sign) _ (low line) # (number sign) two alphabets separated by a hyphen. The range can be in ascending or descending order. Both the alphabets should be the same type, either uppercase or lowercase. Remaining chars one of the following: • • • • • • • alphabet (uppercase or lowercase) digit between 0 and 9 ? (question mark) % (percent sign) $ ( dollar sign) _ (low line) # (number sign) Digit any digit between 0 and 9. Hyphen range two alphabets or two digits separated by a hyphen. The range can be in ascending or descending order. Both the characters should be the same type, uppercase or lowercase alphabet or digit. Char one of the following: • • • • alphabet (uppercase or lowercase) digit between 0 and 9 special character Kanji character Other special characters can appear in table or database names but not in wildcard syntax. If any syntax error occurs in the wildcard syntax, then CheckTable aborts, and an error message appears. For rules regarding use of Kanji and other Japanese characters in names, see “Basic SQL Syntax and Lexicon” in SQL Reference: Fundamentals. For information on syntax error messages, see “Syntax Error Messages” on page 95. Utilities 101 Chapter 5: CheckTable (checktable) Using Wildcard Characters in Names Example 1 CHECK DB[15] AT LEVEL ONE; The wildcard syntax defines two possible values (1 and 5) for the third character in the database name. CheckTable checks all the tables in databases DB1 and DB5 at level one. Example 2 CHECK D[BD]1.T[123] AT LEVEL ONE; You can use the wildcard syntax in any place in the database name or table name. CheckTable checks tables T1, T2, T3 in databases DB1 and DD1. Rules for Using Wildcard Syntax The following rules apply to the use of wildcard syntax in the CHECK command. Assume that the databases and tables in the examples exist in the system, unless stated otherwise. Rule You can specify the following valid ASCII characters in the wildcard syntax: Example Example 1: The following is a valid command: CHECK db1.t[#af_2r]1 AT LEVEL ONE; • A…Z • a…z • 0…9 • _ (low line) • $ (dollar sign) • # (number sign) You cannot use digits 0 … 9 as wildcards to describe the first character in the name. Example 2: The following is not a valid command: You must specify the wildcard characters within square brackets. The wildcard syntax begins with a left square bracket ([) and ends with a right square bracket (]). Example 1: Databases db1, db2, db3, db4, and db5 exist, and you want only the tables in db1 and db5 checked. Type the following: CHECK db[#,kA-d159]xy AT LEVEL ONE; The above command results in a syntax error because the wildcards specified for database name include the non-valid comma (,). For information on syntax error messages, see “Syntax Error Messages” on page 95. CHECK db[15] AT LEVEL ONE; CheckTable checks all the tables in databases db1 and db5 at level one. The wildcard syntax defines two possible values (1 and 5) for the third character in the database name. Example 2: Databases db1, dc1, dd1, and so on exist, and each database contains tables t1, t2, t3, and so on. Using the wildcard syntax in any place in the name, type the following: CHECK d[bd]1.t[123] AT LEVEL ONE; CheckTable checks tables t1, t2, t3 in databases db1 and dd1. Example 3: To specify wildcard syntax in multiple places in a name, type the following: CHECK db[12][pq] AT LEVEL TWO; CheckTable checks databases db1p, db2p, db1q, and db2q at level two. The wildcard syntax defines the possible values for the third and fourth characters of the database name. 102 Utilities Chapter 5: CheckTable (checktable) Using Wildcard Characters in Names Rule You cannot specify the special characters % and ? within wildcard syntax. However, you can use the special characters % and ? with any valid wildcard syntax. Example Example 1: Databases dba1, dba2, db11 and db12 exist, and you want to check databases dba1, dba2, db11, and db12. Type the following: CHECK db[a1]? at level one; This command is valid, because the ‘?’ is outside the wildcard syntax. Example 2: The following is not a valid command, because the ‘?’ is not allowed in wildcard syntax. CHECK db[a1?] at level one; You can use wildcard syntax to specify the names or lists of the databases and tables to check and the list of databases or tables not to check. Example 1: Databases db1, db2, db3 and db4 exist, and you type the following: CHECK db% exclude db[34] at level one; Databases db1 and db2 are checked. Example 2: Databases db1, db2, db3 and db4 exist, and all these databases have tables t1, t2, t3 and t4. You type the following: CHECK db[23] exclude t[14] at level one; CheckTable checks tables t2 and t3 in databases db2 and db3. You can use wildcard syntax to specify a range of characters by separating two characters with a hyphen (-). For example, C and J separated by the hyphen (C-J) represent any characters lexically between C and J inclusive. • The two characters should be of the same type: uppercase, lowercase, or digit. • The two characters can be in ascending or descending lexical order. For example, [A-D] and [D-A] both specify the same range of characters: A through D inclusive. Utilities Example 1: CHECK db1.t[1-35] AT LEVEL ONE; CheckTable checks the tables t1, t2, t3, and t5 in database db1 at level one. 1-3 is considered a range, and 5 is an additional value. Example 2: CHECK db[a-5] AT LEVEL ONE; The check does not take place. CheckTable reports a syntax error because the range specified in dbname is invalid. For information on syntax error messages, see “Syntax Error Messages” on page 95. 103 Chapter 5: CheckTable (checktable) Using Wildcard Characters in Names Rule Example Wildcard syntax can include characters that might not have any matching object names in the system. However, at least one character in the wildcard syntax must have at least one matching object. Consider the following: Example 1: Assume a system contains only databases db1 and db5 but not db2, db3, and so on. Type the following: CHECK db[125] AT LEVEL ONE; CheckTable checks all the tables in databases db1 and db5 at level one. Since database db2 does not exist, CheckTable ignores character 2 in the wildcard syntax. IF the … THEN CheckTable … Example 2: Assume a system contains the database db1 but not db2, db3, or db4. Type the following: syntax contains some characters that do not have a match at the position specified in any object names in the system checks (or excludes from checking) all the objects whose names match the specified wildcards. CheckTable also ignores the characters that do not have any matching objects. CHECK db[1-4] AT LEVEL ONE; This is true of any number of wildcards. CHECK db[1-3]AT LEVEL ONE; The command is valid because one of the characters specified in the wildcard syntax has a matching character at the position where the wildcard syntax is specified in one object name. CheckTable checks all the tables in the database db1 and ignores the remaining wildcard characters. Example 3: Assume a system that does not have databases db1, db2, and db3. Type the following: The following warning appears: >>>> WARNING: Database 'DB[1-3]' does not exist. system has no object name that matches any of the specified wildcard characters issues a warning message. Multiple occurrences of the same character in the wildcard syntax are valid. If you repeat the same character in the syntax for the same position, then CheckTable recognizes the first occurrence and ignores the repeated instances. Example 1: In the following command, character b is repeated in the same position. CHECK d[abb]1 AT LEVEL ONE; CheckTable checks all tables in the databases da1 and db1 at level one and ignores the second instance of character b. No warning appears. Example 2: In the following command, character 3 is specified as part of the hyphen range 1-5 and is repeated separately in the same position. CHECK db[1-53] AT LEVEL ONE; CheckTable checks all tables in the databases db1, db2, db3, db4, and db5 at level one. CheckTable ignores the repeated character 3. The wildcard syntax does not apply when enclosed between single quotes or double quotes. In the following command, character p is a wildcard enclosed in double quotes. CHECK db1."[p]" AT LEVEL ONE; CheckTable ignores the square brackets and checks only table “[p]”, if it exists in database db1. If table “[p]” does not exist in db1, then a warning appears. 104 Utilities CHAPTER 6 CNS Run (cnsrun) The CNS Run utility, cnsrun, provides the ability to start and run a database utility from a script. Audience Users of cnsrun include the following: • Teradata Database administrators • Teradata Database programmers Syntax CNS Run runs from the command line. To start CNS Run, use the following syntax: cnsrun -utility uname -file file_name -commands clist A -help -debug n A -ok -machine host_name -tool cns_tool_path -force GS02A006 where: Syntax element … Specifies … -utility uname the utility program to start. -file file_name a file that contains input commands to send to the utility program. -commands clist the commands to send to the utility. Each command is preceded by a single { character and is terminated by a single } character with one or more spaces between each command. -help Utilities information on how to use this program. 105 Chapter 6: CNS Run (cnsrun) Usage Notes Syntax element … Specifies … -debug n the output level required. A value of 0 (the default) shows no output if the utility runs successfully. A value of 1 shows the utility programs output and its state changes. Other larger values of n produce additional debugging output. All output, including error messages, appears in STDOUT. -ok that this utility is to be started even if logons are disabled. In the absence of this option or the -force option, the utility is not started if logons are not enabled. -force that this utility is to be started even if the database software is not running. -machine host_name the host name associated with the control node for the TPA instance on which to run the utility program. The default is localhost, which only works on SMP systems or when the program is actually running on the control node (which can move between TPA restarts) of an MPP system. To determine the name of the control node, type cnscim at the command prompt. -tool cns_tool_path the full path to the cnstool program. Usage Notes This program runs the utility uname with the input provided by either the -file or -commands option. The command is run by this program connecting to CNS on the node specified by the -machine option and starting the utility from the Supervisor subwindow of Database Window (DBW). When the utility issues a read, the commands specified are sent to it until all of the commands are exhausted or until the program exits. To use this command, the user running cnsrun must have access permission to run a DBW session on the machine. To set up a user to have CNS access, use the Get Permissions, Grant, and Revoke commands in DBW. For more information, see “DBW Supervisor Commands” in Graphical User Interfaces: Database Window and Teradata MultiTool. An error occurs if all of the interactive partitions are in use. By default, this command produces no output unless an error occurs. 106 Utilities Chapter 6: CNS Run (cnsrun) Usage Notes Example To run the utility updatespace with the input: update space for all databases; quit connecting to CNS on an SMP system, use the following command: cnsrun -utility updatespace -commands "{update space for all databases;} {quit}" Utilities 107 Chapter 6: CNS Run (cnsrun) Usage Notes 108 Utilities CHAPTER 7 Configuration Utility (config) The Configuration and Reconfiguration utilities, config and reconfig, are used to define the AMPs and PEs that operate together as a Teradata Database. (Reconfiguration is described in a later chapter of Utilities.) Use Configuration to define the system: the interrelationships among the AMPs, AMP clusters (logical groupings of AMPs), PEs, and hosts that are connected as a Teradata Database system. (The Reconfiguration utility uses information from Configuration to configure the Teradata Database components into an operational system.) You must access a system console to use either utility. Use the Configuration commands described in this chapter to add, delete, list, modify, move, or show AMPs and PEs. Audience Users of Configuration include the following: • Teradata system engineers • Field engineers • System developers User Interfaces config runs on the following platforms and interfaces: Platform Interfaces MP-RAS Database Window Windows Database Window Linux Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Utilities 109 Chapter 7: Configuration Utility (config) About the Configuration Utility About the Configuration Utility Vprocs Virtual processors (vprocs) are instances of AMP or PE software within the node. Vprocs allow the node to execute multiple instances of AMP or PE software, each instance behaving as though it is executing in a dedicated processor. Physical Processors The Configuration and Reconfiguration utilities are not responsible for the maintenance of the physical environment in which the Teradata Database configuration is defined. The AMPs and PEs exist within a previously defined physical configuration. Use the Parallel Upgrade Tool (PUT) to configure parts of the physical configuration, such as creating Logical Units (LUNs) on disk arrays. For more information, see Parallel Upgrade Tool (PUT) User Guide. Configuration Maps Although the Configuration and Reconfiguration utilities are functionally independent, normally they are used together to change the contents of working areas, called configuration maps, in the node. A configuration map does the following: • Stores the identification and status of each vproc in the Teradata Database • Identifies the AMPs that constitute each AMP cluster • Identifies each PE and its associated host The node contains these configuration maps: • The current configuration map, which describes the current arrangement and status of vprocs in the system • The new configuration map, which includes changes and additions to the configuration If you want to list or show information about or to delete a vproc, first you must have added it to the applicable (new or current) configuration map. If you want to add a vproc to the new configuration map, you must have defined the AMP or PE through the use of the PUT utility. These component types constitute a Teradata Database configuration: • Hosts (or clients) • PEs • AMPs The following sections describe these components. For more information, see Parallel Upgrade Tool (PUT) User Guide. 110 Utilities Chapter 7: Configuration Utility (config) About the Configuration Utility Hosts You can attach more than one host simultaneously to the Teradata Database. The hosts are identified in the configuration by the following: • A host number • A logical host ID • An associated host type designator You assign the host a number between 1 and 1023. The host type designator specifies the host data format. The system generates the16-bit logical host ID based on the assigned host number and the host type. The value is equal to the host number + the host type value, as shown in the following table: Host Type Designator Host Type Value Logical Host ID Range (Host Number + Host Type Value) IBM 370 (Mainframe) IBM 0 1-1023 Communications Processor COP 1024 1025-2047 Motorola 68000, RISC (Solaris, HP) ATT3B 2048 2049-3071 Honeywell 6000 (Mainframe) BULLHN 3072 3073-4095 Unisys OS1100 (Mainframe) OS1100 4096 4097-5119 Connection Type PEs You can associate PEs defined in a Teradata Database configuration with one or more host computers or local area networks that also are defined in the configuration. AMPs Typically, AMPs in a configuration are related to other AMPs through cluster assignments. The placement of AMPs and PEs in a configuration is critical to the overall performance of the Teradata Database. Caution: Utilities Consult your Teradata systems engineer before running the Configuration or the Reconfiguration utility to resolve any questions or issues. 111 Chapter 7: Configuration Utility (config) About the Configuration Utility Configuration Activities When the Teradata Database is initialized, System Initializer (sysinit) procedures build a default configuration map that describes the one target AMP involved in sysinit. This configuration is stored in both the current and new configuration maps. When the Teradata Database is operational, Configuration describes the complete system in the new configuration map area. As the system grows and changes, use Configuration to revise the new configuration map to reflect these types of changes to the system: Warning: • Addition and deletion of vprocs and hosts • Changes to cluster assignments When changing cluster assignments without adding AMPs, make sure that ample disk space is available on all AMPs. If the system determines that ample space is not available, the system stops. To recover, perform a SYSINIT on the Teradata Database, which results in loss of all data. Teradata recommends that currentperm space should be less than 53% of the total maxperm space before starting a change of clusters without adding AMPs. • Changes to host assignments Reconfiguration Activities After Configuration builds a new configuration map, the Reconfiguration utility redefines the system configuration according to the new map. Reconfiguration copies the new configuration map to the current configuration map. For more information, see “Reconfiguration Utility” in Utilities. Message Types The application window running Configuration can contain the types of messages displayed in the output subwindow, as shown in the following table. Message Description Information Indicates the status of a command or the result of an operation. OK indicates that a command has been accepted or an operation has completed successfully. Prompt Prompts for a response to a request or for confirmation of an action. Error Composed of a message code and text. To view all error messages issued by Configuration, see Messages. 112 Utilities Chapter 7: Configuration Utility (config) Configuration Utility Commands Configuration Utility Commands Command Types This section summarizes the functions performed by Configuration commands. Session Control Commands Session control functions begin and end Configuration sessions. The BEGIN CONFIG and END CONFIG commands perform these functions. You cannot type many Configuration commands unless you have entered the BEGIN CONFIG command first. System Attribute Commands The LIST commands can display the attributes of the following: • AMPs • AMP clusters • PEs • Hosts The SHOW commands can display the attributes of the following: • An individual vproc • A cluster • A host These commands do not require that you previously issued the BEGIN CONFIG command. The individual LIST and SHOW commands are described later in this chapter. AMP Commands Use the AMP commands for the following: • To add an AMP to the new configuration map • To delete an AMP from the new configuration map • To move an AMP from one cluster to another • To move all data rows from one AMP or group of AMPs to another AMP or group of AMPs The functions are accomplished with these commands: • ADD AMP • DEL AMP • MOD AMP • MOVE AMP Type ADD AMP, DEL AMP, MOD AMP, or MOVE AMP after the BEGIN CONFIG command. Utilities 113 Chapter 7: Configuration Utility (config) Configuration Utility Commands When an AMP operation conflicts with another AMP operation, Configuration reports the conflict when you type the END CONFIG command. PE Commands Use the PE commands to perform the following: • Add a PE to the new configuration map • Delete a PE from the new configuration map • Move a PE from one host to another • Move a PE or group of PEs to another PE or group of PEs The functions are accomplished with these commands: • ADD PE • DEL PE • MOD PE • MOVE PE Type ADD PE, DEL PE, MOD PE, or MOVE PE after the BEGIN CONFIG command. Host Commands Use host commands to add a host to the new configuration map, to delete a host from the new configuration map, or to change the host type in the new configuration map. The functions are accomplished through these commands: • ADD HOST • DEL HOST • MOD HOST Type ADD HOST, DEL HOST, or MOD HOST after the BEGIN CONFIG command. Command List The following table lists Configuration commands and functions based on activity. The following sections discuss the commands in detail. Activity Command Function AMP operations ADD AMP Adds an AMP to the configuration map. DEFAULT CLUSTER Allows Configuration to assign AMPs to clusters when a new configuration is defined. DEL AMP Deletes an AMP from the configuration map. MOD AMP Modifies the attributes of an AMP. MOVE AMP Moves an AMP or group of AMPs to another AMP or group of AMPs. 114 Utilities Chapter 7: Configuration Utility (config) Configuration Utility Commands Activity Command Function Displaying system attributes LIST Lists the vprocs and hosts described in the specified configuration. LIST AMP Lists the attributes of every AMP in the specified configuration. LIST CLUSTER Lists the attributes of every AMP in the specified configuration, ordered by cluster number. LIST HOST Lists all hosts in the specified configuration. LIST PE Lists the attributes of every PE in the specified configuration. SHOW CLUSTER Shows all AMPs in a specified cluster. SHOW VPROC Shows the attributes of a specified vproc. SHOW HOST Shows information about a specified host. ADD HOST Adds a host to the configuration map. DEL HOST Deletes a host from the configuration map. MOD HOST Modifies a host in the configuration map. ADD PE Adds a PE to the configuration map. DEL PE Deletes a PE from the configuration map. MOD PE Modifies the attributes of a PE in the configuration map. MOVE PE Moves a PE or group of PEs to another PE or group of PEs. BEGIN CONFIG Begins a configuration session. END CONFIG Ends a configuration session and stores the new configuration map. STOP Stops Configuration. Host operations PE operations Session control Note: You can access Help information on Configuration by pressing the F7 key. Utilities 115 Chapter 7: Configuration Utility (config) ADD AMP ADD AMP Purpose The ADD AMP command adds an AMP or a range of AMPs to the new configuration map. Syntax ADD AMP mmmlist AA , CN = nnnn GT05C001 where: Syntax element … Specifies … mmmlist the range of vproc numbers that is being added to the configuration. The AMP vproc number ranges from 0 to 16199. Note: The AMP vproc numbers start at the low end of the range and increase, and the PE vproc numbers start at the high end of the range and decrease. CN = nnnn the cluster number with which the AMP is to be associated. The cluster number ranges from 0 to 8099. If you do not specify a cluster number, the system assigns the number automatically after you type the END CONFIG command. Usage Notes You can add an AMP or a range of AMPs to the Teradata Database in a well-defined order. The AMP being added must have a vproc number equal to the number of AMPs currently entered in the new configuration map. That is, given a system with a new configuration map that describes n AMPs (whose vproc numbers are 0 through n-1), the only AMP that you can add to the system now is the AMP with vproc number n. Configuration verifies that the vproc number specified for the new AMP does not exist in the new configuration map. When the ADD AMP command is accepted, the specified AMP is added to the vproc list, and the system displays the following message: The AMP is added. If you type the ADD AMP command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and ADD AMP is ignored. 116 Utilities Chapter 7: Configuration Utility (config) ADD AMP Example 1 To add AMPs from vproc four to vproc seven in cluster three to the new configuration map, type the following: add amps 4 - 7, cn = 3 Note: The maximum number of AMPs that you can add to a cluster is 16. To have Configuration assign AMPs to clusters automatically, use “DEFAULT CLUSTER” on page 122. Example 2 To add an AMP as vproc eight in cluster three to the new configuration map, type the following: add amp 8, cn = 3 Utilities 117 Chapter 7: Configuration Utility (config) ADD HOST ADD HOST Purpose The ADD HOST command adds a host to the host list in the new configuration map. Syntax ADD HOST HN = nnnn , HT = A IBM AH COP ATT3B BULLHN OSII00 GT05B002 where: Syntax element … Specifies … HN = nnnn the host number to be added. Assign the host a number from 1 to 1023. HT = nnnn the host type to be added. Usage Notes This command creates the host group. When PEs are configured, they are assigned to a host number. This grouping provides a host number used to refer to all the PEs. After the command is accepted and the host is added to the new configuration map, the system displays the following message: The host is added. Configuration checks for a valid host number and host type. You must type this command before ADD PE commands that specify PEs to be associated with this host. BEGIN CONFIG is not entered, and ADD HOST is ignored. Example To add host four to the configuration, type the following: add host hn = 4, ht = ibm 118 Utilities Chapter 7: Configuration Utility (config) ADD PE ADD PE Purpose The ADD PE command adds a PE or a range of PEs to the new configuration map. Syntax ADD PE mmmlist, HN = nnnn AP GT05C003 where: Syntax element … Specifies … mmmlist the PE (or range of PEs) that is being added to the new configuration map. The PE vproc number ranges from 15360 to 16383. Note: The AMP vproc numbers start at the low end of the range and increase, and the PE vproc numbers start at the high end of the range and decrease. HN = nnnn the host number with which the PE (or PEs) is to be associated. The host number ranges from 1 to 1023. Usage Notes Configuration validates the vproc number and host number. You must add the host number to the new configuration map (through the ADD HOST command) before the PE associated with the host can be described in the new configuration map. After the ADD PE command is accepted, the specified PE is added to the vproc list, and the system displays the following message: The PE is added. If you type the ADD PE command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and ADD PE is ignored. Utilities 119 Chapter 7: Configuration Utility (config) ADD PE Example 1 To add PE 15363 to host 10, type the following: add PE 15363, hn = 10 Example 2 To add PEs from vproc 16344 to vproc 16351 in host 282, type the following: add PE 16344 - 16351, hn = 282 120 Utilities Chapter 7: Configuration Utility (config) BEGIN CONFIG BEGIN CONFIG Purpose The BEGIN CONFIG command begins the configuration session. Changes caused by subsequent commands are recorded in the new configuration map. Syntax BEGIN CONFIG BC GT05A004 Usage Notes When the BEGIN CONFIG command is accepted, you can type commands to describe the new configuration map. The new configuration map is copied from main memory to disk when a subsequent END CONFIG command is executed. If you type the BEGIN CONFIG command when a configuration session is in progress, the utility prompts whether to end the configuration session that is in progress: The previous BEGIN CONFIG has not been ended. Do you want to abort it? - Answer Y(es) or N(o): To abort the previous BEGIN CONFIG command, type Y. To continue the configuration session in progress, type N. The system displays the following message: BEGIN CONFIG is ignored. When a configuration session ends prematurely, the new configuration map is not updated, and all changes are lost. A configuration session ends prematurely if one of these events occurs: Utilities • The configuration session is aborted as described above. • A STOP command is executed before an END CONFIG command. • A Teradata Database restart occurs. 121 Chapter 7: Configuration Utility (config) DEFAULT CLUSTER DEFAULT CLUSTER Purpose The DEFAULT CLUSTER command indicates that Configuration is to assign AMPs to clusters automatically for the specified configuration. An AMP cluster is a collection of AMPs that are grouped together logically to provide fallback capability for each other for tables that are created with the FALLBACK option. Each AMP in a cluster contains a backup copy of a portion of the primary data for every other AMP in the cluster. Syntax DEFAULT CLUSTER DC c GT05A005 where: Syntax element … Specifies … c the default cluster size. The maximum value of c is 16. If you do not specify c, the default cluster size is dependent upon the number of cliques, number of AMPs, and/or the number of AMPs per clique. For details on the chosen cluster size, see “Usage Notes” on page 122. Usage Notes If you do not specify a default cluster size, the following rules determine the size. IF the number of cliques in the system is … THEN the number of AMP vprocs per cluster is … 1 2. 2 2. 122 Utilities Chapter 7: Configuration Utility (config) DEFAULT CLUSTER IF the number of cliques in the system is … THEN the number of AMP vprocs per cluster is … 3-4 based on the following: 5 or more IF the number of AMPs per clique is … THEN the number of AMP vprocs per cluster is … the same in all cliques the number of cliques (3 or 4) in the configuration. not the same one less than the number of cliques (2 or 3) in the configuration. based on the following: IF the number of AMPs per clique is … THEN the number of AMP vprocs per cluster is … the same in all cliques 5 if the number of AMPS in the configuration is a multiple of 5. Otherwise the number is 4. not the same 4. Typically, you type the DEFAULT CLUSTER command at the end of a session during which AMPs were added to the system. When the DEFAULT CLUSTER command is executed, AMPs are assigned to clusters automatically. In a system with n AMPs, each cluster contains c AMPs and n/c clusters. If n is not divisible by c, the last cluster will be no smaller than 50% less and not larger than 50% more than any other cluster. The number of clusters is adjusted accordingly. After the DEFAULT CLUSTER command is accepted, AMPs are assigned to clusters, and the system displays the following message: The cluster assignment is complete. Execution of the DEFAULT CLUSTER command overrides all previous cluster assignments. AMP cluster assignments should be defined with respect to the hardware configuration. Usually, AMP failures result from hardware-related problems. AMP clustering assignments should be defined as closely as possible to the following fault-tolerant strategy: Utilities • No two or more AMPs of a cluster reside in the same node cabinet. • No two or more AMPs of a cluster are serviced by the same disk array cabinet. • No two or more AMPs of a cluster are serviced by the same disk array controller. 123 Chapter 7: Configuration Utility (config) DEFAULT CLUSTER Example 1 Typing DEFAULT CLUSTER 4 for a system of 15 AMPs results in a cluster size of four. Two clusters are connected to four AMPs each, and one cluster is connected to seven AMPs. Example 2 Typing DEFAULT CLUSTER 3 for a system of 16 AMPs results in cluster size of three. Four clusters are connected to three AMPs each, and one cluster is connected to four AMPs. Example 3 Typing DEFAULT CLUSTER 16 for a system of 16 AMPs results in a cluster size of 16. One cluster is connected to 16 AMPs. 124 Utilities Chapter 7: Configuration Utility (config) DEL AMP DEL AMP Purpose The DEL AMP command specifies that an AMP or a range of AMPs is to be deleted from the new configuration map. Syntax DEL AMP mmmlist DA GT05C006 where: Syntax element … Specifies … mmmlist one or more vproc numbers to be removed from the configuration. The vproc number ranges from 0 to 16199. Usage Notes If you are deleting an AMP, the AMP being deleted must have a vproc number equal to the highest number for any AMP currently entered in the new configuration map. That is, given a system with a new configuration map that describes n AMPs (whose vproc numbers are 0 through n-1), the only AMP that you can remove from that configuration map is the AMP with vproc number n-1. Configuration verifies that the vproc number to be deleted exists in the new configuration map. After the DEL AMP command is accepted, the specified AMP is deleted from the vproc list in the new configuration map, and the system displays the following message: The AMP is deleted. If you type the DEL AMP command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and DEL AMP is ignored. Utilities 125 Chapter 7: Configuration Utility (config) DEL AMP Example 1 To delete an AMP that is vproc seven of the new configuration, type the following: da 7 Example 2 To delete AMPs that are vproc four to vproc six of the new configuration, type the following: da 4 - 6 126 Utilities Chapter 7: Configuration Utility (config) DEL HOST DEL HOST Purpose The DEL HOST command specifies that a host is to be deleted from the new configuration map. Syntax DEL HOST HN = nnnn D DH GT05B007 where: Syntax element … Specifies … HN = nnnn the host number to be deleted. The host number ranges from 1 to 1023. Usage Notes Configuration verifies that a host with the specified number exists. After the command is accepted, the specified host is deleted from the new configuration map, and the system displays the following message: The host is deleted from new configuration map. If you type the DEL HOST command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and DEL HOST is ignored. You cannot delete a host from a configuration unless the host is no longer associated with any PE that is defined in the configuration. For information, see “DEL PE” on page 128. Example To delete host 52, type the following: dh hn = 52 Utilities 127 Chapter 7: Configuration Utility (config) DEL PE DEL PE Purpose The DEL PE command specifies that a PE or a range of PEs is to be deleted from the new configuration map Syntax DEL PE mmmlist DP GT05C007 where: Syntax element … Specifies … mmmlist the PE (or PEs) to be deleted from the new configuration map. The PE vproc number ranges from 15360 to 16383. Usage Notes Configuration verifies that the vproc number (or numbers) to be deleted exists in the new configuration map. When all PEs that are associated with a host have been deleted from the new configuration map, you also must delete the host from the map. After the DEL PE command is accepted, the specified PE (or PEs) is deleted from the vproc list in the new configuration map, and the system displays the following message: The PE is deleted. If you type the DEL PE command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and DEL PE is ignored. 128 Utilities Chapter 7: Configuration Utility (config) DEL PE Example 1 To delete PE 16380, type the following: del pe 16380 Example 2 To delete PEs from vproc 16344 to 16351, type the following: del pe 16344 - 16351 Utilities 129 Chapter 7: Configuration Utility (config) END CONFIG END CONFIG Purpose The END CONFIG command validates and updates the new configuration map and terminates a configuration session. Syntax END CONFIG EC GT05A009 Usage Notes When the END CONFIG command is executed, Configuration validates the new configuration map. As a result, one of the these events can occur: • The session is terminated, the new configuration is accepted when the configuration changes are validated, and the new configuration map is updated on disk. The system displays the following message: The session is terminated and the new configuration is stored. The Teradata Database is ready for reconfiguration. • The END CONFIG command is ignored because one of the following occurred: • A BEGIN CONFIG command was not entered, and, therefore, no configuration session is in progress. • The Teradata Database has not completed startup. • The configuration changes were not valid; an error message that describes the problem is displayed. When the END CONFIG command is not executed successfully, the system displays the following message: The new configuration was not stored due to error(s) detected. Please update the configuration and try END CONFIG again. 130 Utilities Chapter 7: Configuration Utility (config) LIST LIST Purpose The LIST command lists the vprocs and hosts in the current or new configuration. Syntax LIST L SHORT FROM CURRENT LONG F C NEW N GT05R010 where: Syntax element … Specifies … SHORT the compact configuration map. This is the default. It displays the contents of the following commands: • LIST CLUSTER • LIST PE • LIST HOST LONG the detailed configuration map. FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify the FROM keyword, the default map type is CURRENT, and the current configuration map is displayed. NEW the proposed configuration map. Usage Notes When you type the LIST command without any options, the system displays the short form of the default (current) configuration map. When you type the FROM option, you must specify the map type. No default type is supplied for this form. Utilities 131 Chapter 7: Configuration Utility (config) LIST Example An example output generated by the LIST command is shown below: ------------AMP Array ------------Vproc-Id Range Status Cluster Vproc-Id Range Status Cluster --------------------- --------------------- -----------0, 16, 32, 48 Online 0 1, 17, 33, 49 Online 1 2, 18, 34, 50 Online 2 3, 19, 35, 51 Online 3 4, 20, 36, 52 Online 4 5, 21, 37, 53 Online 5 . . . 14, 30, 46, 62 Online 14 15, 31, 49, 63 Online 15 ----------------------------------------------------------------------------------PEs ARRAY ------------Vproc-Id Range Status --------------------16344-16354 Online 16355 Down 16356-16363 Online 16364 Down 16365-16377 Online 16378 Down 16379-16383 Online ------------------------------------HOSTs ARRAY ------------HostNo Logical HostID Type ------ ----------------52 1076 COP 282 282 IBM 286 286 IBM Connected PE Range -----------------16368-16383 16344-16351 16353, 16355, 16357, 16359 16361, 16363, 16365, 16367 16360, 16362, 16364, 16366 In response to the LIST command, Configuration lists all AMPs, PEs, and hosts that are included in the current configuration map. The following table lists the possible status of the vproc in the previous example. 132 Status Description Online The vproc is participating in the current configuration. Down The vproc is not participating in the current configuration. Hold The vproc was offline during the preceding system execution and is in the process of being recovered to the online state. Newready The vproc has been initialized but has not been added to the configuration. Utilities Chapter 7: Configuration Utility (config) LIST AMP LIST AMP Purpose The LIST AMP command displays the attributes of every AMP in the current or new configuration map. Syntax LIST AMP L LA SHORT FROM CURRENT LONG F C NEW N 1102A163 where: Syntax element … Specifies … SHORT the compact configuration map of the AMP vprocs. This is the default. This option contains only two fields: • vproc-id range • status LONG the detailed configuration map of the AMP vprocs. This option contains three fields: • vproc • status • cluster FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. The default map type is CURRENT. If you do not specify the map type, the AMP configuration is displayed from the current map. NEW the proposed configuration map. Usage Notes The LIST AMP command displays the AMP configuration map. Utilities 133 Chapter 7: Configuration Utility (config) LIST AMP Example 1 An example output generated by the LIST AMP command is shown below: AMPs ARRAY ____________________________ Vproc-Id Range ______________ 0-63 Status _______ Online Vproc-Id Range _______________ Status _______ Note: As indicated in the previous example, all the AMP vprocs are online, so the vproc-id is blocked from the beginning vproc 0 to the ending vproc 63. If the system displays AMP vprocs that have status other than online, the system lists their vproc-ids and status, as shown in the following example. AMPs ARRAY ____________________________ Vproc-Id Range ______________ 0 16-63 3-14 Status _______ Online Online Online Vproc-Id Range _______________ 1-2 15 Status _______ Fatal NewReady Example 2 An example output generated by the LIST AMP LONG command is shown below: AMPs ARRAY ____________________________ Vproc _____ 0 2 4 . . . 62 134 Status _______ Online Fatal Online Online Cluster _______ 0 2 4 14 Vproc _____ 1 3 5 63 Status _______ Fatal Online Online Online Cluster ________ 1 3 5 15 Utilities Chapter 7: Configuration Utility (config) LIST CLUSTER LIST CLUSTER Purpose The LIST CLUSTER command displays the attributes of every AMP in the current or new configuration map, ordered by cluster number. Usage Notes LIST CLUSTER L SHORT FROM CURRENT LC LONG F C NEW N GT05R012 where: Syntax element … Specifies … SHORT the compact display of the attributes of every AMP in the current or new configuration map, ordered by cluster number. This option contains three fields: • vproc-id range • status • CN This is the default. LONG the detailed display of the attributes of every AMP in the current or new configuration map, ordered by cluster number. This option contains three fields: • vproc • status • cluster FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify a map type, the current configuration map is displayed. NEW Utilities the proposed configuration map. 135 Chapter 7: Configuration Utility (config) LIST CLUSTER Usage Notes The LIST CLUSTER command displays the cluster configuration map. This map shows a list of AMPs ordered by cluster number. Example Example output generated by the LIST CLUSTER command is shown below: AMPs ARRAY _____________________ Vproc-Id Range ______________ 0, 16, 32, 48 2, 18, 34, 50 4, 20, 36, 54 . . . 14, 30, 46, 62 Status CN Vproc-Id Range Status Cluster _______ ________ _______________ ______ _______ Online 0 1, 17, 33, 49 Online 1 Online 2 3, 19, 35, 51 Online 3 Online 4 5, 21, 37, 53 Online 5 Online 14 15, 31, 49, 63 Online 15 AMPs ARRAY _____________________ Vproc ______ 0 2 4 . . . 62 136 Status ______ Online Online Online Cluster ________ 0 2 4 Online 14 Vproc _____ 1 3 5 63 Status ______ Online Online Online Online Cluster _______ 1 3 5 15 Utilities Chapter 7: Configuration Utility (config) LIST HOST LIST HOST Purpose The LIST HOST command displays all hosts in a current or new configuration. Syntax LIST HOST L SHORT FROM CURRENT LH LONG F C NEW N GT05R013 where: Syntax element … Specifies … SHORT the compact display of all hosts in a current or new configuration map. This is the default. This option contains these fields: • • • • LONG HostNo Logical HostID Type Connected PE range the detailed display of all hosts in a current or new configuration map. This option contains these fields: • • • • HostNo Logical HostID Type Connected PE FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify the map type, the current configuration map is displayed. NEW the proposed configuration map. Usage Notes The LIST HOST command displays the host configuration map. Utilities 137 Chapter 7: Configuration Utility (config) LIST HOST Example An example output generated by the LIST HOST command is shown below: HOSTs ARRAY _______________________ HostNo ______ 52 821 829 LogicalHostID _____________ 1076 821 829 Type ____ COP IBM IBM Connected PE Range __________________ 16379-16383 16377 16378 Type ____ COP Connected PE Range __________________ 16379 16380 16381 16382 16383 16377 16378 HOSTs ARRAY _______________________ HostNo ______ 52 821 829 LogicalHostID _____________ 1076 821 829 IBM IBM For information about the ranges of logical host IDs for all supported hosts, see “Hosts” on page 111. 138 Utilities Chapter 7: Configuration Utility (config) LIST PE LIST PE Purpose The LIST PE command displays the attributes of every PE in the current or new configuration map. Syntax LIST PE L LP SHORT FROM CURRENT LONG F C NEW N GT05R014 where: Syntax element … Specifies … SHORT the compact configuration map of the PE vprocs. This is the default. This option contains only two fields: • vproc-id range • status LONG the detailed configuration map of the PE vprocs. This option contains three fields: • vproc • status • hostno FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify the map type, the current PE configuration map is displayed. NEW the proposed configuration map. Usage Notes The LIST PE command displays the PE configuration map. Utilities 139 Chapter 7: Configuration Utility (config) LIST PE Example 1 An example output generated by the LIST PE command is shown below. PEs ARRAY _________________________ Vproc-Id Range _______________ 16343-16383 Status _______ Online Vproc-Id Range _______________ Status _______ Note: As indicated in the previous example, all the PE vprocs are online, so the vproc-id is blocked from the beginning vproc 16343 to the ending vproc 16383. If the system displays PE vprocs that have status other than online, the system lists their vproc-id and status, as shown in the following example. PEs ARRAY _________________________ Vproc-Id Range _______________ 16343-16354 16356-16363 16365-16377 16379-16383 Status _______ Online Online Online Online Vproc-ID Range ______________ 16355 16364 16378 Status _______ Down Down Down Example 2 An example output generated by the LIST PE LONG command is shown below. PEs ARRAY _________________________ Vproc Status HostNo ______ _______ _______ 16344 Online 282 16346 Online 282 16348 Online 282 . . . 16382 Online 52 140 Vproc ______ 16345 16347 16349 Status ______ Online Online Online HostNo _______ 282 282 282 16383 Online 282 Utilities Chapter 7: Configuration Utility (config) MOD AMP MOD AMP Purpose The MOD AMP command specifies that an AMP or a range of AMPs is to be moved from one cluster to another. Syntax MOD AMP mmmlist TO CN = nnnn MA GT05C015 where: Syntax element … Specifies … mmmlist one or more vproc numbers to be moved from one cluster to another. The vproc number ranges from 0 to 16199. TO the new cluster number entry. CN = nnnn new cluster number with which the AMP or AMPs are to be associated. The cluster number ranges from 0 to 8099. If you do not specify a cluster number, it remains unchanged. Usage Notes Configuration verifies the vproc number(s) and cluster number. After the MOD AMP command is accepted, the attributes of the specified AMP are modified, and the system displays the following message: The AMPs attribute is modified in the new configuration. If you type the MOD AMP command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and MOD AMP is ignored. Example 1 To modify the cluster assignment of AMP seven to be part of cluster three, type the following: ma 7 to cn = 3 Utilities 141 Chapter 7: Configuration Utility (config) MOD AMP Example 2 To modify the cluster assignment of AMP four to AMP eight to be part of cluster one, type the following: ma 4 - 8 to cn = 1 142 Utilities Chapter 7: Configuration Utility (config) MOD HOST MOD HOST Purpose The MOD HOST command changes the host type in the new configuration map. Syntax MOD HOST HN = nnnn M , HT = MH IBM COP ATT3B BULLHN OSII00 GT05R016 where: Syntax element … Specifies … HN = nnnn the host number whose type is to be changed. The host number ranges from 1 to 1023. HT = the host type. Usage Notes After the MOD HOST command is accepted, the type of the specified host is modified in the new configuration map, and the system displays the following message: The host is changed in the new configuration map. If you type the MOD HOST command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and MOD HOST is ignored. Example To change the host type for host 52 to cop, type the following: mh hn = 52, ht = cop Utilities 143 Chapter 7: Configuration Utility (config) MOD PE MOD PE Purpose The MOD PE command specifies that a PE or a range of PEs is to be moved from one host to another. Syntax MOD PE mmmlist TO HN = nnnn MP GT05C017 where: Syntax element … Specifies … mmmlist one or more vproc numbers to be assigned to a different host. The PE vproc number ranges from 15360 to 16383. HN = nnnn the new host number with which the PE (or PEs) is to be associated. The host number ranges from 1 to 1023. Usage Notes Configuration validates the vproc number (or numbers) assigned to the PE (or PEs) and the host number with which the PE (or PEs) is to be associated. After the command is accepted, the specified PE (or PEs) is modified in the vproc list in the new configuration map, and the system displays the following message: The PE attributes are modified in the new configuration map. If you type the MOD PE command before the BEGIN CONFIG command, the command is ignored, and the system displays the following message: BEGIN CONFIG is not entered, and MOD PE is ignored. Example 1 To move PE 16380 to host 10, type the following: mod PE 16380 to hn = 10 144 Utilities Chapter 7: Configuration Utility (config) MOD PE Example 2 To move PEs from vproc 16344 to vproc 16351 to host 286, type the following: mod PE 16344 - 16351 to hn = 286 Utilities 145 Chapter 7: Configuration Utility (config) MOVE AMP MOVE AMP Purpose The MOVE AMP command specifies that all data rows from an AMP or a group of AMPs are to be moved to another AMP or group of AMPs. Syntax MOVE AMP mmmlist TO nnnlist MVA GU01A015 where: Syntax element … Specifies … mmmlist the range of AMP vproc numbers being moved in the configuration. nnnlist the range of AMP vproc numbers that mmmlist is being moved to in the configuration. Usage Notes AMP numbers range from 0 to 16199 and must be in contiguous order. The number of AMPs specified in mmmlist and in nnnlist must be the same. The following applies. AMPs in the … Must be … mmmlist AMPs defined in the current configuration. nnnlist new AMPs only. After the MOVE AMP command is accepted, Configuration displays the following message: The AMP range is moved. If you type the MOVE AMP command before the BEGIN CONFIG command, the command is ignored. Configuration displays the following message: BEGIN CONFIG is not entered, and MOVE AMP is ignored. If you type the MOVE AMP command and the ADD AMP command, and if the MOVE AMP range of vproc numbers is before the ADD AMP range of vproc numbers, Configuration displays the following message: Moved AMPS must follow added AMPs. 146 Utilities Chapter 7: Configuration Utility (config) MOVE AMP If you type the MOVE AMP command and either the MODIFY AMP command or the DELETE AMP command, the commands are ignored. Configuration displays the following message: Addition, Deletion, and Moving of AMPS are mutually exclusive. Note: Run the Reconfig utility to do the following: • Redistribute all rows from the moved AMPs • Change the configuration so that the moved AMPs are properly associated with the correct nodes and/or disk arrays For more information on the MOVE AMP Reconfiguration process, see the “Reconfiguration Utility” in Utilities. Example 1 To move AMP 0 in an existing eight-AMP system (AMPs 0-7) to a new AMP (AMP 8), type the following: move amp 0 to 8 Example 2 To move AMPs 4-5 in an existing eight-AMP system (AMPs 0-7) to new AMPs (AMPs 8-9), type the following: move amp 4-5 to 8-9 Utilities 147 Chapter 7: Configuration Utility (config) MOVE PE MOVE PE Purpose The MOVE PE command specifies that a PE or group of PEs is to be moved to another PE or group of PEs. Syntax MOVE PE mmmlist TO MVP nnnlist GU01A014 where: Syntax element … Specifies … mmmlist the range of PE vproc numbers being moved in the configuration. nnnlist the range of PE vproc numbers that mmmlist is being moved to in the configuration. Usage Notes PE numbers range from 16383 downward in decreasing, contiguous order. The number of PEs specified in mmmlist and in must be the same. The following applies.nnnlist PEs in the … Must be … mmmlist PEs defined in the current configuration. nnnlist new PEs only. Note: You also can move PEs that are restricted to specific nodes, such as channel-connected PEs, to other nodes. After the MOVE PE command is accepted, Configuration displays the following message: The PE range is moved. If you type the MOVE PE command before the BEGIN CONFIG command, the command is ignored. Configuration displays the following message: BEGIN CONFIG is not entered, and MOVE PE is ignored. Note: Run the Reconfig utility to change the configuration so that the moved PEs are properly associated with the correct nodes and/or disk arrays. 148 Utilities Chapter 7: Configuration Utility (config) MOVE PE Example 1 To move PE 16383 in an existing eight-PE system (PEs 16376 - 16383) to a new PE (PE 16375), type the following: move pe 16383 to 16375 Example 2 To move PEs 16380 - 16381 in an existing eight-PE system (PEs 16376 - 16383) to new PEs (PEs 16374 - 16375), type the following: move pe 16380-16381 to 16374-16375 Utilities 149 Chapter 7: Configuration Utility (config) SHOW CLUSTER SHOW CLUSTER Purpose The SHOW CLUSTER command displays all AMPs in a specified cluster for a current or new configuration map. Syntax SHOW CLUSTER CN = nnnn SC FROM CURRENT F C NEW N GT05R021 where: Syntax element … Specifies … CN = nnnn the cluster number for which the appropriate AMPs are to be displayed. The cluster number ranges from 0 to 8099. FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify a map type, the current cluster configuration map is displayed. NEW the proposed configuration map. Usage Notes The SHOW CLUSTER command displays the cluster configuration map. Example To display the current configuration map for cluster three and its associated AMPs, type the following: show cluster cn = 3 An example output generated by the SHOW CLUSTER command is shown below. OK, AMPs of cluster 3 are listed. Vproc Status Cluster Vproc ______ _______ ________ ______ 3 Online 3 7 11 Online 3 15 150 Status _______ Online Online Cluster _________ 3 3 Utilities Chapter 7: Configuration Utility (config) SHOW HOST SHOW HOST Purpose The SHOW HOST command shows information for a specified host. Syntax SHOW HOST HN = nnnn SH FROM F CURRENT C GT05B019 NEW N where: Syntax element … Specifies … HN = nnnn the host number. The host number ranges from 1 to 1023. FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. If you do not specify a map type, the current configuration map is displayed. NEW the proposed configuration map. If you use FROM, you must specify a map type. Usage Notes The SHOW HOST command displays the host number, logical host ID, host type, and vproc numbers of connected PEs. Utilities 151 Chapter 7: Configuration Utility (config) SHOW HOST Example To display information from the current configuration map about host 10, type the following: show host hn = 10 An example output generated by the SHOW HOST command is shown below: HOSTs ARRAY ___________________ HostNo LogicalHostID Type Connected PE ___________________________________________________ 10 17 IBM 16383 10 17 IBM 16382 10 17 IBM 16381 152 Utilities Chapter 7: Configuration Utility (config) SHOW VPROC SHOW VPROC Purpose The SHOW VPROC command displays the attributes of a specified AMP or PE vproc in a current or new configuration. Syntax SHOW vproc SV mmmm FROM CURRENT F C NEW N GT05R020 where: Syntax element … Specifies … mmmm the vproc number of an AMP or PE. Note: The AMP vproc number ranges from 0 to 16199, and the PE vproc number ranges from 15360 to 16383. FROM that you will choose the type of configuration map to be displayed. CURRENT the configuration map that the Teradata Database is using currently. This is the default. The default map type is CURRENT. If you do not specify a map type, the current configuration map is displayed. NEW the proposed configuration map. Usage Notes The following table lists what the SHOW VPROC command displays. Utilities Type of vproc Information displayed PE • Vproc number • Status • Host number with which the PE is associated 153 Chapter 7: Configuration Utility (config) SHOW VPROC Type of vproc Information displayed AMP • Vproc number • Status • Cluster number Example 1 To display the attributes of PE vproc 16380 for the current configuration map, type the following: show vproc 16380 An example output generated by the SHOW VPROC command is shown below: Vproc ----16380 Status -----Online HostNo ---------821 Example 2 To display the attributes of AMP vproc six for the current configuration map, type the following: show vproc 6 An example output generated by the SHOW VPROC command is shown below: Vproc ----6 154 Status -----Online Cluster ------2 Utilities Chapter 7: Configuration Utility (config) STOP STOP Purpose The STOP command stops Configuration. Syntax STOP S GT05A021 Usage Notes When you type the STOP command, all AMP tasks created for Configuration are aborted, and all storage allocated for Configuration is released. Typing this command does not automatically update the new configuration map for the current session. The updating of the new configuration map is accomplished by the END CONFIG command. The STOP command displays the following message: Config is about to be stopped. Caution: Utilities The STOP command does not warn you if the END CONFIG command has not been executed. Be sure to type END CONFIG before using the STOP command. 155 Chapter 7: Configuration Utility (config) Configuration Utility Examples Configuration Utility Examples This section shows the process of adding vprocs to a Teradata Database. Current configuration New configuration Four AMPS: 0, 1, 2, 3 Eight AMPS: 0, 1, 2, 3, 4, 5, 6, 7 Two PEs: 16383, 16382 Four PEs: 16383, 16382, 16381, 16380 Cluster 0: (0, 1, 2, 3) Cluster 0: 0, 1, 4, 5 Cluster 1: 2, 3, 6, 7 Activities Performed The configuration procedure described below performs three activities: • Adds AMPs • Adds PEs • Changes cluster assignments For this demonstration, do the following in the Database window: 1 In the Database Window, select the Supervisor (Supvr) icon. The Supervisor window appears. Note: The PDE must be up and the Supvr window must display the status as “Reading” in order to enter commands in the command input line. 2 In the Enter a command subwindow of the Supervisor window, type the following and press Enter: start config The Supervisor window displays the following message: Started ‘config’ in window 1. The window number represents the application window in which Configuration is running. The Configuration window appears. 3 To begin the session, type the following in the Configuration window and press Enter: begin config 4 To add AMPs numbered four through seven, type the following: add amp 4 add amp 5 add amp 6 add amp 7 5 To add PEs numbered 16381 and 16380 to host number one, type the following: add pe 16381, hn = 1 add pe 16380, hn = 1 156 Utilities Chapter 7: Configuration Utility (config) Error Messages 6 To assign AMPs to clusters automatically, type the following: default cluster 4 7 To end the session, type the following: end config 8 To verify the new configuration, type the following: list 9 To stop configuration, type the following: stop You used Configuration to define the new system. Run the Reconfiguration utility next to configure the defined Teradata Database components into an operational system. For an example of how to run the Reconfiguration utility following the use of Configuration, see “Reconfiguration Utility” in Utilities. Error Messages For Configuration error messages, see Messages. Utilities 157 Chapter 7: Configuration Utility (config) Error Messages 158 Utilities CHAPTER 8 Control GDO Editor (ctl) The Control GDO Editor, ctl, sometimes called the PDE Control program, lets you display and modify PDE configuration settings. These settings affect how the PDE handles startup, crashes, and the normal operation of Teradata. Note: ctl is available only on Windows and Linux. The corresponding utility on MP-RAS is called xctl. For information on xctl, see “xctl Utility” in Utilities. Audience Users of ctl include the following: • Database administrators • System and application programmers • System operators User Interfaces ctl runs on the following platforms and interfaces: Platform Interfaces Windows Teradata MultiTool Command line (“Teradata Command Prompt”) Linux Teradata MultiTool Command line To start ctl from Teradata MultiTool, click Tools>Control GDO Editor (CTL). For more information on running ctl from Teradata MultiTool, see “Using ctl from Teradata MultiTool” on page 161. For more information on using Teradata MultiTool, see Graphical User Interfaces: Database Window and Teradata MultiTool. To start ctl from the command line, type ctl using the command syntax listed under “Syntax” on page 179. For more information on running ctl from the command line, see “Using ctl From the Command Line” on page 179. Utilities 159 Chapter 8: Control GDO Editor (ctl) ctl Screens (Tabs) and Commands ctl Screens (Tabs) and Commands The following table summarizes the ctl screens (tabs) and corresponding command-line ctl commands. • Access ctl screens from the Control GDO Editor tool in Teradata MultiTool. • Execute ctl commands from the ctl prompt after starting ctl from the command line. The table briefly describes the function of each command and screen. For more information on running the graphical user interface version of ctl from MultiTool, see “Using ctl from Teradata MultiTool” on page 161. For more information on running the non-graphical version of ctl from the command line, see “Using ctl From the Command Line” on page 179. Screen (Tab) Command Function Hardware Report hardware Displays read-only hardware information. DBS screen dbs Controls how the database software responds to unusual conditions Debug screen debug Controls debugging parameters for PDE and Teradata Database. RSS screen rss Permits the following: • Specification and changing of rates at which RSS data is collected and logged into the database • Enabling/disabling the writing of resource data to the specified ResUsage database table(s) Versions 160 screen version Provides the version numbers of the running software and input fields for automatic switching between installed versions of the PDE and Teradata Database software. Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Using ctl from Teradata MultiTool The following discusses how to use ctl from the Teradata MultiTool graphical user interface. To access ctl from Teradata MultiTool, do the following: ✔ In the Teradata MultiTool screen, select Tools -> Control GDO Editor (CTL). The ctl utility appears. Note: The Versions screen is the opening ctl screen. For more information on the Versions screen, see “Versions Screen” on page 176. Menu Bar The menu bar is located at the top of the ctl screen. The menu bar consists of the following items: • File • Screen • Help You can access these menus by using either the mouse or the keyboard. The menus and their options are described in the following paragraphs. Utilities 161 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool File Menu The following table describes the File menu options. Menu Item Description Apply to GDO Applies the current ctl settings to the PDE Control GDO. This button is enabled only if the current settings differ from the most recently read settings from the Control GDO. The settings are read at the following times: • Initially when you start Teradata MultiTool • Every time PDE transitions to an UP state • When you press the Refresh from GDO button Undo All Undoes all the changes made to the current settings since one of the following: • Initialization • The last Apply to GDO • The last Refresh from GDO This button is enabled only if you made changes to the current settings. Undo returns ctl to the previous ctl settings, but does not necessarily synchronize the ctl settings with the most current PDE Control GDO settings. Refresh from GDO Makes all of the current ctl settings reflect the current PDE Control GTO settings. The settings are read directly from the GDO, and may reflect configuration changes made by other users. Save Report Saves the current report shown in the Hardware Report screen. Exit save any changes and exit Control GDO Editor (CTL). Screen Menu Use the Screen menu to navigate between Control GDO Editor screens (tabs). You can also choose a screen by clicking directly on its tab. For information on the individual screens, see “Screens (Tabs)” on page 164. Help Menu The Help menu provides online help for ctl. The following table describes the Help menu options. 162 Menu Item Description Contents Displays the online help for Teradata MultiTool. About Displays the current version of Teradata MultiTool. Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Control Buttons The following table describes the Control GDO Editor buttons and their functions. Button Description Apply to GDO Applies the current ctl settings to the PDE Control GDO. This button is enabled only if the current settings differ from the most recently read settings from the GDO. The settings are read at the following times: • When Teradata MultiTool starts • When the PDE starts • When the Refresh from GDO button is clicked Refresh from GDO Makes all of the current ctl settings reflect the current PDE Control GTO settings. The settings are read directly from the GDO, and may reflect configuration changes made by other users. Undo All Undoes any the changes made to ctl settings since any of the following: • Initialization • The last Apply to GDO • The last Refresh from GDO Undo returns ctl to the previous ctl settings, but does not read directly from the PDE Control GDO. Consequently, Undo All does not cause the ctl settings to necessarily reflect the PDE configuration settings that are currently in effect. It just returs ctl settings to their state before changes were made. Utilities 163 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Screens (Tabs) The screens (tabs) of the Control GDO Editor are described on the following pages: 164 • “Hardware Report Screen” on page 165 • “DBS Screen” on page 166 • “Debug Screen” on page 170 • “RSS Screen” on page 174 • “Versions Screen” on page 176 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Hardware Report Screen Function The Hardware Report screen displays read-only hardware information. Screen To view the Hardware Report screen in Teradata MultiTool, do the following: ✔ From the Control GDO Editor (CTL) screen of MultiTool, select the Hardware Report tab. The Hardware Report screen is shown below. Usage Notes The Save Hardware Report button saves the hardware report to the default hardware.txt file or to a filename and location of your choice. Utilities 165 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool DBS Screen Function The DBS screen controls how the database software responds to unusual conditions. Screen To view the DBS screen in Teradata MultiTool, do the following: ✔ From the Control GDO Editor (CTL) screen of MultiTool, select the DBS tab. The DBS screen is shown below. 166 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Usage Notes The following table describes the DBS screen fields and controls. Setting Description Minimum Nodes Per Clique Specifies the number of nodes required for a clique to operate. If a clique contains fewer than this number of nodes (excluding hot standby nodes) when the database is started, the Minimum Node Action determines what action to take. Changes to this value do not take effect until Teradata Database is restarted. When the database restarts, Teradata calculates the minimum number of nodes required per clique based on the number of vprocs and memory per node per clique. If Minimum Nodes Per Clique is manually set to a value less than this calculated minimum, PDE replaces the manually set value with the calculated value. If Minimum Nodes Per Clique is set to a number greater than the total number of nodes in the clique, the effect is the same as if the value is set to the total number of nodes in the clique. When one or more nodes in a clique fail, the AMPs assigned to the failed nodes migrate to the remaining nodes in the clique. System performance can degrade when some nodes handle more vprocs than other nodes. This degradation could be even greater than if the whole clique were to become unavailable, depending on the system configuration, mix of jobs, and the number of nodes that are down. Setting a Minimum Nodes Per Clique value allows you to define at what point it is more efficient for your system to consider a partially disabled clique as entirely unavailable, allowing the fallback logic that is built in to Teradata to compensate for the problem. Note that running your system with fallback limits some functions, which should be a factor when choosing an appropriate value for this option. Minimum Node Action Utilities Determines what action to perform when a clique contains fewer than the Minimum Nodes Per Clique field. The following values apply: Value Action Clique Down That clique is not started, and the vprocs associated with the clique are marked OFFLINE. This is the default. DBS Down Do not start Teradata Database. All the vprocs are marked OFFLINE. 167 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Clique Failure Determines what to do when a clique is down. The following values apply: FSG Cache Percent Value Description Clique Down Attempt to start the Teradata Database without the down clique. This is the default. DBS Down The Teradata Database is not started if a clique is down. Specifies the percentage of available memory (after making allowance for memory needed to run utilities and the Teradata Database programs) to be used for the database file segment cache. The default is 100%. Changes to this value do not take effect until Teradata Database is restarted. Note: You cannot disable FSG Cache Percent. A setting of 0 sets the FSG Cache Percent to the default value. Cylinder Read Allows full-file scan operations to run efficiently by reading the cylinder-resident data blocks with a single I/O operation. The data block is a disk-resident structure that contains one or more rows from the same table and is the physical I/O unit for the Teradata Database file system. Data blocks are stored in physical disk space called sectors, which are grouped together in cylinders. The system incurs I/O overhead once per cylinder, as opposed to being charged once per data block when blocks are read individually. The system benefits from the reduction in I/O time for operations such as table-scans and joins, which process most or all of the data blocks of a table. Cylinder Read is supported only if the size of the FSG cache is at least 36 MB/AMP. At this size, only two Cylinder Slots/AMP are configured. The number of Cylinder Slots/AMP that is configured might differ from what you request if the FSG cache size is not big enough. You must restart Teradata Database before the new setting is effective. To optimize performance using this feature, see Performance Management. Note: The setting for Cylinder Read is related to the setting for Cylinder Slots/AMP. 168 Setting Description Default The Cylinder Read feature is enabled, using the default value for Cylinder Slots/AMP. Off The Cylinder Read feature is disabled. User The Cylinder Read feature is enabled, using a userspecified value for Cylinder Slots/AMP. LogOnly Cylinder Read is used only for scanning the WAL log. The Cylinder Slots/AMP field is ignored. Two cylinder slots are allocated per AMP. Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Cylinder Slots/AMP This setting is related to the Cylinder Read feature. This control displays and sets the number of cylinder memory slots per AMP that are reserved inside the FSG cache to host the loaded cylinders. The Cylinder Read feature is not effective if Cylinder Slots/AMP is set to 1. You must restart Teradata Database before a new setting takes effect. Note: This option is effective only if Cylinder Read is set to User. For more information, see the description of Cylinder Read. Restart After DAPowerFail Allows you to select whether or not to restart the Teradata Database after a disk array AC power failure. The following values apply: Utilities Value Description On The Teradata Database is restarted after a disk array AC power failure. This is the default. Off The Teradata Database is not restarted after a disk array AC power failure. 169 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Debug Screen Function The Debug screen controls internal debugging of PDE and the Teradata Database. Caution: Do not modify the debug values unless you are explicitly directed to do so by Teradata Support Center Personnel. Screen To view the Debug screen in Teradata MultiTool, do the following: ✔ From the Control GDO Editor (CTL) screen of MultiTool, select the Debug tab. The Debug screen is shown below. 170 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Usage Notes The following table describes the Debug screen fields and controls. Setting Description Start DBS Determines whether Teradata Database is started automatically when PDE starts. The following values apply: Break Stop Value Description Off Teradata Database is not started automatically when PDE is started. On Teradata Database is started automatically when PDE is started. This is the default. Controls whether the Teradata Database restarts automatically or stops for the system debugger when a fatal error occurs. The following values apply: Value Description Off If you are using the Teradata Command Prompt, or the command line, the Teradata Database is restarted automatically after performing a dump as specified by the DumpType option. If you are using Teradata MultiTool, the Teradata Database is restarted automatically after performing a dump. This is the default. On Enable Logons The Teradata Database will stop and wait for the system debugger to be attached so that the problem can be diagnosed interactively. Controls whether logons are enabled or not. The following values apply: Value Description None None of the users are allowed to log on to the system. All All of the users are allowed to log on to the system. This is the default. DBC Only new DBC users are allowed to log on to the system. Note: Changes to this setting take effect after the next Teradata Database restart. Enable Logons commands issued from the Supervisor window of Database Window have the same effect, but do not require a database restart. For more information, see Graphical User Interfaces: Database Window and Teradata MultiTool. Utilities 171 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Start with Debug Halts the database software startup until after the system debugger has been attached. The following values apply: Save Dumps Value Description Off The Teradata Database is started normally. This is the default. On The Teradata Database will not run until the system debugger is attached and used to continue operations. Specifies whether database dumps are loaded into the database. The following values apply: Snapshot Crash Value Description Off Database dumps are not loaded into the database. This is the default. On Database dumps are loaded into the database. Specifies whether a snapshot dump, which normally allows the Teradata Database to continue running after the dump is complete, should be treated as a fatal error. The following values apply: Maximum Dump Count Value Description Off Teradata Database continues running after a snapshot dump. This is the default. On A snapshot dump is accompanied by a full database restart. If Break Stop is also On, the system stops for debugging. Applies to a per-node basis and is meaningful only for database dumps. Controls the maximum number of crash dumps that will be saved. A value of -1 means the system will save as many dumps as can fit on the disk containing the dump directory. Default is 5. Maximum Dump Size (MB) This setting is ignored on Windows and Linux. Maximum FSG Area Dumped (MB) This setting is ignored on Windows and Linux. 172 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Start PrgTraces Allows you to save or not save prgtraces to files. The following applies: Mini Dump Type Value Description Off Prgtraces are not saved to files. This is the default. On Prgtraces are saved to files. Allows the Teradata Database System to perform a mini dump of one of the following types: Value Description No Dump No dumps are performed. This is the default. Stack Only Dump Stack only dumps are performed. Full Dump Full dumps are performed. Note: This option is meaningful only on the Windows platform. Utilities 173 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool RSS Screen Function Teradata Database resource usage (ResUsages) statistics are collected by the Resource Sampling Subsystem (RSS). These statistics are logged to special tables in the database. The ResUsage tables fall into two categories, based on the kind of data they store: • Node logging tables (SPMA, IPMA, and SCPU) store statistical data that applies to nodes. • Vproc logging tables store statistical data that applies to individual vprocs on each node. The RSS screen allows you to specify the rates and types of ResUsage data collection. Screen To view the RSS screen in Teradata MultiTool, do the following: ✔ From the Control GDO Editor (CTL) screen of MultiTool, select the RSS tab. The RSS screen is shown below. Usage Notes The following table describes the RSS screen fields and controls. Setting Description RSS Collection Rate The interval (in seconds) between collecting per-node and per-vproc statistics. The default is 600. 174 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Node Logging Rate The interval (in seconds) between writing per-node statistics to the database. It must be an integer multiple of the RSS Collection Rate. The default is 600. Vproc Logging Rate The interval (in seconds) between writing per-vproc statistics to the database. It must be an integer multiple of the RSS Collection Rate. The default is 600. RSS Table Logging Enable Controls whether logging is enabled to the various ResUsage tables. Note: For logging to occur, the RSS Collection Rate must be set to a non-zero value, and Node Logging and Vproc Logging rates must be set to integer multiples of the RSS Collection Rate. Only the SPMA table has logging enabled by default. Because writing rows to the ResUsage tables uses system resources, Teradata recommends that you leave logging to the other tables disabled until a specific need requires these statistics. RSS Summary Mode Enable When logging is enabled for certain ResUsage tables, multiple rows of resource usage data are written during each logging period. Summary mode reduces the amount of data collected per logging period by causing the RSS to store a single summary row per type per node, instead of one row per logging entity. For example, if regular logging is enabled for the SCPU table, separate rows storing statistics for every CPU are written during each logging period. If summary mode is enabled, only a single row is written for each node, regardless of the number of CPUs in that node. The single row includes summary data for all node CPUs. Similarly, if regular logging is enabled for the SVPR table, separate rows are written for every individual vproc. If summary mode is enabled for this table, one row is written for each vproc type (AMP, PE, and others). Note: RSS Summary Mode is effective for a table only if RSS Table Logging is also enabled. Utilities 175 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description RSS Active Row Filter Mode Enable Active Row Filter Mode limits the data rows that are logged to the database. For the tables for which this option is on, only those rows whose data has been modified during the current logging period will be logged. For the SPS table, there are a large number of possible rows, and most of them are not used at any one time. Logging the inactive rows would waste a large amount of resources, so it is highly recommended that Active Row Filter Mode remain enabled for this table. For tables that have both active row filter mode and summary mode enabled, the active row filtering is applied after the summarization. For data fields that have persistent data across logging periods, the summarized rows may combine the data from both active and inactive rows. In these cases, the active row filtering reports summarized rows that have at least one active row contribution. Note: RSS Active Row Filter Mode is effective for a table only if RSS Table Logging is also enabled. • You can retrieve data that is collected but not logged using Teradata Manager or Teradata Performance Monitor. However, if you want to run ResUsage reports, you must select the logging rate and enable the appropriate tables for logging. • Disabled fields cannot be modified. • RSS aligns the logging periods to the clock on the top of every hour. Therefore, log values must divide evenly into 3600 seconds (one hour). The following set of values are legal for RSS collection and logging rates: 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30, 36, 40, 45, 48, 50, 60, 72, 75, 80, 90, 100, 120, 144, 150, 180, 200, 225, 240, 300, 360, 400, 450, 600, 720, 900, 1200, 1800, 3600. • For more information on the ResUsage tables and the types of information each table stores, see Resource Usage Macros and Tables and Performance Management. Versions Screen Function The Versions screen displays the version numbers of the running PDE and Database System software. Input fields on this screen let you specify different versions of the software to be installed and run the next time the system is restarted. Screen To view the Versions screen in Teradata MultiTool, do the following: ✔ From the Control GDO Editor (CTL) screen of MultiTool, select the Versions tab. The Versions screen is shown below as it appears under Windows and Linux. 176 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Usage Notes The Screen Version command and Versions screen contain the following information. Utilities 177 Chapter 8: Control GDO Editor (ctl) Using ctl from Teradata MultiTool Setting Description Running PDE The currently running version of Teradata Parallel Database Extensions. Running DBS The currently running version of Teradata Database. Running TGTW The currently running versions of Teradata Gateway software. Running TCHN The currently running version of Teradata Channel software. Running RSG The currently running version of Teradata Relay Services Gateway software. Running TDGSS The currently running version of Teradata Database Generic Security Services software. Running PDEGPL (For Linux only) The currently running GNU general public license version of Teradata Parallel Database Extensions. Running TCHNGPL (For Linux only) The currently running GNU general public license version of Teradata Channel software. Desired PDE Changing this field to an installed PDE version causes that version to be run the next time Teradata Database restarts. Desired DBS Changing this field to an installed Teradata Database version causes that version to be run the next time Teradata Database restarts. Desired TGTW Changing this field to a an installed TGTW version causes that version to be run the next time Teradata Database restarts. Desired TCHN Changing this field to an installed TCHN version causes that version to be run the next time Teradata Database restarts. Desired RSG Changing this field to an installed RSG version causes that version to be run the next time Teradata Database restarts. Desired TDGSS Changing this field to an installed TDGSS version causes that version to be run the next time Teradata Database restarts. Desired PDEGPL (For Linux only) Indicates an installed PDEGPL version to be run the next time Teradata Database restarts. Note: Whenever a user sets the Desired PDE to a different version, the CTL tool automatically sets the Desired PDEGPL to the same version. 178 Utilities Chapter 8: Control GDO Editor (ctl) Using ctl From the Command Line Setting Description Desired TCHNGPL (For Linux only) Indicates an installed TCHNGPL version to be run the next time Teradata Database restarts. Note: Whenever a user sets the Desired TCHN to a different version, the CTL tool automatically sets the Desired TCHNGPL to the same version. Using ctl From the Command Line When run from the command line, ctl provides a display of control parameter fields and lets you modify the writable fields. Syntax To start ctl from the command line, use the following command syntax. ctl " command ; command " " command ; command " -first -last -help 1102B041 where: Utilities 179 Chapter 8: Control GDO Editor (ctl) Using ctl From the Command Line Setting Description -first command First command to execute before other processing. No default. The -first command and the -last command accept command lists, which are one or more commands separated by semicolons. The following is an example using the -first command: ctl -first “RSS Collection Rate = 600;Vproc Logging Rate = 600;Node Logging Rate = 600;screen rss; write; quit” Note: The quotation marks used in the example above are necessary because of the spaces in the commands. To set values, you should use the interactive ctl screens. -last command Last command to execute just before exiting. No default. The following is an example using the -last command: ctl -last screen The above command displays the current screen after you quit the interactive ctl screen. -help Provides information on ctl command-line options. Note: Some strictly internal and rarely-needed options have been omitted from this discussion. Those options are documented in the ctl command-line help. Usage Notes Starting ctl from the command line invokes the ctl command shell, recognized by the ctl command prompt, a right angle bracket (>). The ctl commands are described as follows: • “EXIT” on page 182 • “HARDWARE” on page 183 • “HELP” on page 185 • “PRINT group” on page 186 • “PRINT variable” on page 187 • “QUIT” on page 188 • “READ” on page 189 • “SCREEN” on page 190 • “variable = setting” on page 204 • “WRITE” on page 206 Note: The first two letters of each command can be used as a synonym for the command at the ctl command prompt. 180 Utilities Chapter 8: Control GDO Editor (ctl) DUMP DUMP Purpose The DUMP command is not meaningful on the Windows and Linux platforms. Utilities 181 Chapter 8: Control GDO Editor (ctl) EXIT EXIT Purpose The EXIT command exits ctl. Syntax EXIT EX WRITE 1102A157 Usage Notes If the -last option was used to specify a command when ctl was started, that command will be executed before ctl exits. If you modified values in xctl and specify the write option, xctl will write the changes to the GDO before exiting. If you modified values in xctl and do not specify the write option, xctl will ask if you want the changes written before xctl exits. 182 Utilities Chapter 8: Control GDO Editor (ctl) HARDWARE HARDWARE Purpose The HARDWARE command displays a screen containing the PDE hardware configuration information for this system. This information is recomputed every time Teradata Database is restarted, so it reflects the actual running configuration. The information is read only and cannot be directly modified by the user. Syntax HARDWARE HA 1102A147 Example The following example shows sample output from the hardware command. Node #nodes 4 min cpus/node 4 mips/cpu 248 segmem/vproc(mb) 149 VPROCS Type Name 1 AMP 2 PE 3 GTW 4 5 6 7 8 9 10 11 12 13 14 15 Utilities ## 32 12 4 0 0 0 0 0 0 0 0 0 0 0 0 vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node vprocs/node max 4 248 170 8 3 1 0 0 0 0 0 0 0 0 0 0 0 0 8 3 1 0 0 0 0 0 0 0 0 0 0 0 0 avg 4 nodes/clique 248 arrays/clique 165 8 3 1 0 0 0 0 0 0 0 0 0 0 0 0 ARRAYS: Rand. Reads/Sec 4k: 2535 2535 8k: 1845 1845 16k: 1383 1383 32k: 770 770 64k: 385 385 128k: 193 193 2535 1845 1383 770 385 193 Rand. Writes/Sec 4k: 624 624 8k: 567 567 16k: 458 458 32k: 306 306 32k: 153 153 32k: 77 77 624 567 458 306 153 77 DISKS: Rand. Reads/Sec 4k: 43 43 8k: 38 38 16k: 31 31 32k: 24 24 64k: 12 12 128k: 6 6 43 38 31 24 12 6 Rand. Writes/Sec 4k: 14 14 8k: 13 13 16k: 10 10 32k: 8 8 32k: 4 4 32k: 2 2 14 13 10 8 4 2 min 4 0 max 4 0 avg 4 0 kmem/vproc 125472 130336 128544 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 kmem/vproc 0 0 0 183 Chapter 8: Control GDO Editor (ctl) HARDWARE NETWORK: Monocast rates: Opers/Node/second 0 b: 5800 5800 5800 100 b: 5500 5500 5500 400 b: 4700 4700 4700 1600 b: 2850 2850 2850 6400 b: 1130 1130 1130 25600 b: 330 330 330 184 Multicast rates: Opers/Node/second 0 b: 18500 18500 18500 100 b: 14000 14000 14000 400 b: 10000 10000 10000 1600 b: 4300 4300 4300 6400 b: 1300 1300 1300 25600 b: 340 340 340 Utilities Chapter 8: Control GDO Editor (ctl) HELP HELP Purpose The HELP command displays the online help screen. Syntax HELP HE cmd TOPICS 1102A168 Usage Notes For help, type one of the following: IF you want … THEN type … help on a specific command help cmd where cmd is the name of the command you want help on. a list of all the help topics Utilities help topics 185 Chapter 8: Control GDO Editor (ctl) PRINT group PRINT group Purpose The PRINT group command displays groups of variables by variable types. Syntax PRINT PR ALL BUTTONS CHECKBOX DUMP LABELS SCALES TEXT TRACE 1102A172 Usage Notes 186 Group Description all All variables in the PDE Control GDO. This is the default. buttons Variables that take one value from a set of two or more possible values checkbox Variables that take binary values. dump All variables in all of the dump entries. labels Variables that are labels (not normally modified by users). scales Variables that are integer values. text Variables that are text strings. trace All trace entries. Utilities Chapter 8: Control GDO Editor (ctl) PRINT variable PRINT variable Purpose The PRINT variable command displays the value of a specified variable. Syntax PRINT PR ; variable 1102A173 Usage Notes The value is displayed in the form of an assignment command for that variable. Some variables that can be changed with ctl do not appear on any of the ctl output screens. To see a listing of all variable names, use the print all command. Example For example, if you type the following two variables > print minimum node action;fsg cache percent then the following might be displayed, depending on your system: Minimum Node Action=Clique-Down FSG cache Percent=80 Utilities 187 Chapter 8: Control GDO Editor (ctl) QUIT QUIT Purpose The QUIT command exits ctl. Syntax QUIT QU WRITE 1102A158 Usage Notes If the -last option was used to specify a command when ctl was started, that command will be executed before ctl quits. If you modified values in xctl and specify the write option, xctl will write the changes to the GDO before quitting. If you modified values in xctl and do not specify the write option, xctl will ask if you want the changes written before xctl exits. 188 Utilities Chapter 8: Control GDO Editor (ctl) READ READ Purpose The READ command re-reads the control GDO, resetting any changes. Syntax READ RE 1102A175 Usage Notes You can update the view manually. After you write to the GDO, the ctl view is updated to the actual GDO values automatically. Utilities 189 Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN Purpose The SCREEN command displays a screen of PDE configuration information from the PDE Control GDO. Some of this information can be modified using the variable = setting and WRITE commands. Syntax SCREEN SC DBS DEBUG DUMP n RSS VERSION 1102A176 Usage Notes • Each screen displays groups of related control fields. To change the values of modifiable fields, use the variable command, identifying the field either by the full field name or by the alphanumeric identifier that appears next to the field in the screen output. Fields lacking alphanumeric identifiers should not be modified. • Scripts that change field values should use the full variable names, rather than the alphanumeric identifiers. • Entering screen alone, without a screen name, redisplays the current screen (the one that was most recently displayed). The ctl screens are described as follows: 190 • “SCREEN DBS” on page 191 • “SCREEN DEBUG” on page 194 • “SCREEN DUMP n” on page 197 • “SCREEN RSS” on page 198 • “SCREEN VERSION” on page 201 Utilities Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN DBS Function The DBS screen displays parameters that control how the database software responds to unusual conditions. Example >screen dbs (0) (1) (3) (5) (7) Minimum Node Action: Minimum Nodes Per Clique: Clique Failure: Unused option Cylinder Slots/AMP: Clique-Down 1 Clique-Down 8 (2) (4) (6) (8) Unused option FSG cache Percent: 0 Cylinder Read: User Restart After DAPowerFail: Off Control Fields The DBS screen contains the following control fields. Setting Description Minimum Nodes Per Clique Specifies the number of nodes required for a clique to operate. If a clique contains fewer than this number of nodes (excluding hot standby nodes) when the database is started, the Minimum Node Action determines what action to take. Changes to this value do not take effect until Teradata Database is restarted. When the database restarts, Teradata calculates the minimum number of nodes required per clique based on the number of vprocs and memory per node per clique. If Minimum Nodes Per Clique is manually set to a value less than this calculated minimum, PDE replaces the manually set value with the calculated value. If Minimum Nodes Per Clique is set to a number greater than the total number of nodes in the clique, the effect is the same as if the value is set to the total number of nodes in the clique. When one or more nodes in a clique fail, the AMPs assigned to the failed nodes migrate to the remaining nodes in the clique. System performance can degrade when some nodes handle more vprocs than other nodes. This degradation could be even greater than if the whole clique were to become unavailable, depending on the system configuration, mix of jobs, and the number of nodes that are down. Setting a Minimum Nodes Per Clique value allows you to define at what point it is more efficient for your system to consider a partially disabled clique as entirely unavailable, allowing the fallback logic that is built in to Teradata to compensate for the problem. Note that running your system with fallback limits some functions, which should be a factor when choosing an appropriate value for this option. Minimum Node Action Utilities Determines what action to perform when a clique contains fewer than the Minimum Nodes Per Clique field. The following values apply: Value Action Clique Down That clique is not started, and the vprocs associated with the clique are marked OFFLINE. This is the default. DBS Down Do not start Teradata Database. All the vprocs are marked OFFLINE. 191 Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description Clique Failure Determines what to do when a clique is down. The following values apply: FSG Cache Percent Value Description Clique Down Attempt to start the Teradata Database without the down clique. This is the default. DBS Down The Teradata Database is not started if a clique is down. Specifies the percentage of available memory (after making allowance for memory needed to run utilities and the Teradata Database programs) to be used for the database file segment cache. The default is 100%. Changes to this value do not take effect until Teradata Database is restarted. Note: You cannot disable FSG Cache Percent. A setting of 0 sets the FSG Cache Percent to the default value. Cylinder Read Allows full-file scan operations to run efficiently by reading the cylinder-resident data blocks with a single I/O operation. The data block is a disk-resident structure that contains one or more rows from the same table and is the physical I/O unit for the Teradata Database file system. Data blocks are stored in physical disk space called sectors, which are grouped together in cylinders. The system incurs I/O overhead once per cylinder, as opposed to being charged once per data block when blocks are read individually. The system benefits from the reduction in I/O time for operations such as table-scans and joins, which process most or all of the data blocks of a table. Cylinder Read is supported only if the size of the FSG cache is at least 36 MB/AMP. At this size, only two Cylinder Slots/AMP are configured. The number of Cylinder Slots/AMP that is configured might differ from what you request if the FSG cache size is not big enough. You must restart Teradata Database before the new setting is effective. To optimize performance using this feature, see Performance Management. Note: The setting for Cylinder Read is related to the setting for Cylinder Slots/AMP. 192 Setting Description Default The Cylinder Read feature is enabled, using the default value for Cylinder Slots/AMP. Off The Cylinder Read feature is disabled. User The Cylinder Read feature is enabled, using a userspecified value for Cylinder Slots/AMP. LogOnly Cylinder Read is used only for scanning the WAL log. The Cylinder Slots/AMP field is ignored. Two cylinder slots are allocated per AMP. Utilities Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description Cylinder Slots/AMP This setting is related to the Cylinder Read feature. This control displays and sets the number of cylinder memory slots per AMP that are reserved inside the FSG cache to host the loaded cylinders. The Cylinder Read feature is not effective if Cylinder Slots/AMP is set to 1. You must restart Teradata Database before a new setting takes effect. Note: This option is effective only if Cylinder Read is set to User. For more information, see the description of Cylinder Read. Restart After DAPowerFail Allows you to select whether or not to restart the Teradata Database after a disk array AC power failure. The following values apply: Utilities Value Description On The Teradata Database is restarted after a disk array AC power failure This is the default. Off The Teradata Database is not restarted after a disk array AC power failure. 193 Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN DEBUG Function The Debug screen is used for internal debugging of PDE and the Teradata Database. Caution: Do not modify the debug values unless you are explicitly directed to do so by Teradata Support Center Personnel. Examples >screen debug (0) Start DBS: On (2) Enable Logons: All (4) Save Dumps: Off (6) Maximum Dumps: 5 (8) Maximum FSG Area Dumped: 10 (MB) (10)Mini Dump Type: No-Dump (1) (3) (5) (7) (9) Break Stop: Start with Debug: Snapshot Crash: Maximum Dump Size: Start PrgTraces: Off On Off 0 (MB) Off The following is an example of Screen Debug command output for Linux: >screen debug (0) (2) (4) (6) (8) Start DBS: On Enable Logons: All Save Dumps: Off Maximum Dumps: 5 Maximum FSG Area Dumped: 10 (MB) (1) (3) (5) (7) (9) Break Stop: Start with Debug: Snapshot Crash: Maximum Dump Size: Start PrgTraces: Off On Off 0 (MB) Off Control Fields The Debug screen contains the following control fields. Setting Description Start DBS Determines whether Teradata Database is started automatically when PDE starts. The following values apply: Break Stop Value Description Off Teradata Database is not started automatically when PDE is started. On Teradata Database is started automatically when PDE is started. This is the default. Controls whether the Teradata Database restarts automatically or stops for the system debugger when a fatal error occurs. The following values apply: 194 Value Description Off Teradata Database restarts automatically after performing a dump as specified by the DumpType option. This is the default. On Teradata Database stops and waits for the system debugger to be attached so that the problem can be diagnosed interactively. Utilities Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description Enable Logons Controls whether logons are enabled or not. The following values apply: Value Description None None of the users are allowed to log on to the system. All All of the users are allowed to log on to the system. DBC Only new DBC users are allowed to log on to the system. Note: Changes to this setting take effect after the next Teradata Database restart. Enable Logons commands issued from the Supervisor window of Database Window have the same effect, but do not require a database restart. For more information, see Graphical User Interfaces: Database Window and Teradata MultiTool. Start with Debug Halts the database software startup until after the system debugger has been attached. The following values apply: Save Dumps Value Description Off The Teradata Database is started normally. This is the default. On The Teradata Database will not run until the system debugger is attached and used to continue operations. Specifies whether database dumps are to be loaded into the database. The following values apply: Snapshot Crash Value Description Off Database dumps are not loaded into the database. This is the default. On Database dumps are loaded into the database. Specifies whether Teradata Database continues to run after a snapshot dump. The following values apply: Utilities Value Description Off Teradata Database continues to run after a snapshot dump. This is the default. On A snapshot dump is accompanied by a full database restart. If Break Stop is also On, the system stops for debugging. 195 Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description Maximum Dump Count Applies to a per-node basis and is meaningful only for database dumps. Controls the maximum number of crash dumps that will be saved. A value of -1 means the system will save as many dumps as can fit on the disk containing the dump directory. The default is 5. Setting this field to 0 disables database dumps. Maximum Dump Size (MB) This setting is ignored on Windows and Linux. Maximum FSG Area Dumped (MB) This setting is ignored on Windows and Linux. Start PrgTraces Allows you to save or not save prgtraces to files. The following applies: Mini Dump Type Value Description Off Prgtraces are not saved to files. This is the default. On Prgtraces are saved to files. Allows the Teradata Database System to perform a mini dump of one of the following types: Value Description No Dump No dumps are performed. This is the default. Stack Only Dump Stack only dumps are performed. Full Dump Full dumps are performed. Note: This option is meaningful only on the Windows platform. 196 Utilities Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN DUMP n Function Dump screens are not meaningful on the Windows and Linux platforms. Utilities 197 Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN RSS Function Teradata Database resource usage (ResUsages) statistics are collected by the Resource Sampling Subsystem (RSS). These statistics are logged to special tables in the database. The ResUsage tables fall into two categories, based on the kind of data they store: • Node logging tables (SPMA, IPMA, and SCPU) store statistical data that applies to nodes. • Vproc logging tables store statistical data that applies to individual vprocs on each node. The RSS screen allows you to specify the rates and types of ResUsage data collection. Example >screen RSS (0) RSS Collection Rate: (1) Node Logging Rate: 600 sec 600 sec (2) Vproc Logging Rate: 600 sec RSS Table Logging Enable (3) SPMA : On (6) SVPR : OFF (A) SPDSK: Off (4) IPMA : Off (7) IVPR : Off (B) SVDSK: Off (5) SCPU: Off (8) SLDV: Off (C) SAWT: Off (9) SHST: Off (D) SPS : Off RSS Summary Mode Enable Summarize SPMA: Off (F) Summarize SVPR: Off (I) Summarize SHST: Off (L) Summarize SAWT: Off Summarize IPMA : Off (G) Summarize IVPR : Off (J) Summarize SPDSK: Off (M) Summarize SPS : Off (E) Summarize SCPU : Off (H) Summarize SLDV : Off (K) Summarize SVDSK: Off RSS Active Row Filter Mode Enable Active Active Active (R) Active SPMA: SVPR: SHST: SAWT: Off Off Off On Active Active (N) Active (S) Active IPMA : IVPR : SPDSK: SPS : Off Off On On Active SCPU : Off Active SLDV : Off (O) Active SVDSK: On Control Fields The RSS screen contains the following control fields. Setting Description RSS Collection Rate The interval (in seconds) between collecting per-node and per-vproc statistics. The default is 600. Node Logging Rate The interval (in seconds) between writing per-node statistics to the database. It must be an integer multiple of the RSS Collection Rate. The default is 600. Vproc Logging Rate The interval (in seconds) between writing per-vproc statistics to the database. It must be an integer multiple of the RSS Collection Rate. The default is 600. 198 Utilities Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description RSS Table Logging Enable Controls whether logging is enabled to the various ResUsage tables. Note: For logging to occur, the RSS Collection Rate must be set to a non-zero value, and Node Logging and Vproc Logging rates must be set to integer multiples of the RSS Collection Rate. Only the SPMA table has logging enabled by default. Because writing rows to the ResUsage tables uses system resources, Teradata recommends that you leave logging to the other tables disabled until a specific need requires these statistics. RSS Summary Mode Enable When logging is enabled for certain ResUsage tables, multiple rows of resource usage data are written during each logging period. Summary mode reduces the amount of data collected per logging period by causing the RSS to store a single summary row per type per node, instead of one row per logging entity. For example, if regular logging is enabled for the SCPU table, separate rows storing statistics for every CPU are written during each logging period. If summary mode is enabled, only a single row is written for each node, regardless of the number of CPUs in that node. The single row includes summary data for all node CPUs. Similarly, if regular logging is enabled for the SVPR table, separate rows are written for every individual vproc. If summary mode is enabled for this table, one row is written for each vproc type (AMP, PE, and others). Note: RSS Summary Mode is effective for a table only if RSS Table Logging is also enabled. Utilities 199 Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description RSS Active Row Filter Mode Enable Active Row Filter Mode limits the data rows that are logged to the database. For the tables for which this option is on, only those rows whose data has been modified during the current logging period will be logged. For the SPS table, there are a large number of possible rows, and most of them are not used at any one time. Logging the inactive rows would waste a large amount of resources, so it is highly recommended that Active Row Filter Mode remain enabled for this table. For tables that have both active row filter mode and summary mode enabled, the active row filtering is applied after the summarization. For data fields that have persistent data across logging periods, the summarized rows may combine the data from both active and inactive rows. In these cases, the active row filtering reports summarized rows that have at least one active row contribution. Note: RSS Active Row Filter Mode is effective for a table only if RSS Table Logging is also enabled. Usage Notes 200 • You can retrieve data that is collected but not logged using Teradata Manager or Teradata Performance Monitor. However, if you want to run ResUsage reports, you must select the logging rate and enable the appropriate tables for logging. • Fields without an alphanumeric identifier preface should not be modified. • RSS aligns the logging periods to the clock on the top of every hour. Therefore, log values must divide evenly into 3600 seconds (one hour). The following set of values are legal for RSS collection and logging rates: 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30, 36, 40, 45, 48, 50, 60, 72, 75, 80, 90, 100, 120, 144, 150, 180, 200, 225, 240, 300, 360, 400, 450, 600, 720, 900, 1200, 1800, 3600. • For more information on the ResUsage tables and the types of information each table stores, see Resource Usage Macros and Tables and Performance Management. Utilities Chapter 8: Control GDO Editor (ctl) SCREEN SCREEN VERSION Function The Version screen displays the version numbers of the running PDE and Database System software. Input fields on this screen let you specify different versions of the software to be installed and run the next time the system is restarted. Examples The following is an example of Screen Version command output for Windows: >screen version (0) Running PDE: 06.02g.00.00 Desired PDE: (1) Running DBS: 06.02g.00.00 Desired DBS: (2) Running RSG: Desired RSG: (3) Running TGTW: 06.02g.00.00 Desired TGTW: (4) Running TCHN: 06.02g.00.00 Desired TCHN: (5) Running TDGSS: 06.02g.00.00 Desired TDGSS: The following is an example of Screen Version command output for Linux: (0) Running PDE: 06.02g.00.00 Desired PDE: (1) Running DBS: 06.02g.00.00 Desired DBS: (2) Running RSG: Desired RSG: (3) Running TGTW: 06.02g.00.00 Desired TGTW: (4) Running TCHN: Desired TCHN: (5) Running TDGSS: 06.02g.00.00 Desired TDGSS: Running PDEGPL: 06.02g.00.00 Desired PDEGPL: Running TCHNGPL: Desired TCHNGPL: Utilities 201 Chapter 8: Control GDO Editor (ctl) SCREEN Control Fields The Versions screen contains the following control fields. Setting Description Running PDE The currently running version of Teradata Parallel Database Extensions. Running DBS The currently running version of Teradata Database. Running TGTW The currently running versions of Teradata Gateway software. Running TCHN The currently running version of Teradata Channel software. Running RSG The currently running version of Teradata Relay Services Gateway software. Running TDGSS The currently running version of Teradata Database Generic Security Services software. Running PDEGPL (For Linux only) The currently running GNU general public license version of Teradata Parallel Database Extensions. Running TCHNGPL (For Linux only) The currently running GNU general public license version of Teradata Channel software. Desired PDE Changing this field to an installed PDE version causes that version to be run the next time Teradata Database restarts. Desired DBS Changing this field to an installed Teradata Database version causes that version to be run the next time Teradata Database restarts. Desired TGTW Changing this field to a an installed TGTW version causes that version to be run the next time Teradata Database restarts. Desired TCHN Changing this field to an installed TCHN version causes that version to be run the next time Teradata Database restarts. Desired RSG Changing this field to an installed RSG version causes that version to be run the next time Teradata Database restarts. Desired TDGSS Changing this field to an installed TDGSS version causes that version to be run the next time Teradata Database restarts. Desired PDEGPL (For Linux only) Indicates an installed PDEGPL version to be run the next time Teradata Database restarts. Note: Whenever a user sets the Desired PDE to a different version, the CTL tool automatically sets the Desired PDEGPL to the same version. 202 Utilities Chapter 8: Control GDO Editor (ctl) SCREEN Setting Description Desired TCHNGPL (For Linux only) Indicates an installed TCHNGPL version to be run the next time Teradata Database restarts. Note: Whenever a user sets the Desired TCHN to a different version, the CTL tool automatically sets the Desired TCHNGPL to the same version. Utilities 203 Chapter 8: Control GDO Editor (ctl) variable = setting variable = setting Purpose The variable=setting command changes the value of the specified variable to the value of setting. The setting must be an appropriate type for the variable being assigned, or an error is reported. Syntax variable = setting ? 1102A177 Usage Notes • If you have used the SCREEN command to display a group of related control fields, modifiable fields are prefaced by alphanumeric identifiers. You can use either those identifiers or the exact field names with the variable command to change the field values. • Entering the variable name or identifier followed by =? displays information on the valid values for that variable. • 1, yes, and true can be used as synonyms for on. 0, no, and false can be used as synonyms for off. • Entering an empty string for string variables can cause the current value to be replaced by an empty string. Examples > screen dbs (0) (1) (3) (5) (7) Minimum Node Action: Minimum Nodes Per Clique: Clique Failure: Unused option Cylinder Slots/AMP: Clique-Down 1 Clique-Down 8 (2) (4) (6) (8) Unused option FSG cache Percent: 0 Cylinder Read: User Restart After DAPowerFail: Off > minimum nodes per clique=? CTL: Minimum Nodes Per Clique Specifies the number of nodes required for a clique to operate normally. The legal value is `1' or more. > > minimum nodes per clique=3 > screen (0) (1) (3) (5) (7) Minimum Node Action: Minimum Nodes Per Clique: Clique Failure: Unused option Cylinder Slots/AMP: Clique-Down 3 Clique-Down 8 (2) (4) (6) (8) Unused option FSG cache Percent: 0 Cylinder Read: User Restart After DAPowerFail: Off > 1=2 204 Utilities Chapter 8: Control GDO Editor (ctl) variable = setting > screen (0) (1) (3) (5) (7) Utilities Minimum Node Action: Minimum Nodes Per Clique: Clique Failure: Unused option Cylinder Slots/AMP: Clique-Down 2 Clique-Down 8 (2) (4) (6) (8) Unused option FSG cache Percent: 0 Cylinder Read: User Restart After DAPowerFail: Off 205 Chapter 8: Control GDO Editor (ctl) WRITE WRITE Purpose The WRITE command saves any configuration changes made during the ctl session back to the source from which they were read. This is usually the PDE Control GDO, if ctl was started without the -file option. Syntax WRITE WR 1102A178 Usage Notes write does not cause ctl to exit. Because different users may be modifying the PDE control settings at the same time, ctl merges only the changed settings from the current ctl session to the PDE Control GDO. This minimizes the chances that concurrent users will overwrite each others’ changes. If no changes have been made during the current ctl session, issuing a write command does nothing. 206 Utilities CHAPTER 9 Cufconfig Utility (cufconfig) The Cufconfig utility, cufconfig, allows you to view and change configuration settings for the user-defined function and external stored procedure subsystem. These configuration settings are specified in the user-defined function globally distributed object (UDF GDO). Globally distributed objects store global configuration settings available to all nodes of a Teradata system. The Cufconfig utility is also known as the UDF GDO Configuration utility. For more information about UDFs, external stored procedures, or user-defined methods (UDMs), see SQL Reference: UDF, UDM, and External Stored Procedure Programming. Audience Users of cufconfig include Teradata Database system administrators. User Interfaces cufconfig runs on the following platforms and interfaces: Platform Interfaces MP-RAS Command line Database Window Windows Command line (“Teradata Command Prompt”) Database Window Linux Command line Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Utilities 207 Chapter 9: Cufconfig Utility (cufconfig) Syntax Syntax cufconfig -h -o -i -j -f filename 1102B101 where: Syntax element Description -h Displays the cufconfig help. -o Displays the contents of the UDF GDO. -i Initializes the UDF GDO field values to the default values of the shipped software version. -j Sets the value of the JREPath field to the value of the TD_JAVA_HOME environment variable. JREPath is used by the Java external stored procedures feature. Note: This option is available only on 64-bit Windows and Linux systems. Whenever TD_JAVA_HOME is changed to use a different JRE package, run cufconfig -j to update the UDF GDO. A database restart is required to make the change effective. Only JRE versions 1.5 and above are supported. -f filename Modifies the field values of the UDF GDO. The filename specifies the path to the file that is used to modify the GDO. The fields in the file should match those shown in the -o option. The file contains a line only for those fields that are to be changed. Note: This option does not modify the JREPath field. Use the -j option to modify the JREPath field. If multiple options are specified on the command line, they are processed in the following order: 208 • -i • -f • -j • -o Utilities Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields UDF GDO Fields The following table lists the fields of the UDF GDO. Field Name Description Version Specifies the version of the UDF GDO. The version only changes when new fields are added or modified. Note: This field should not be modified. ModTime Displays the timestamp of the last UDF GDO modification. Note: This field should not be modified. SWDistNodeID Displays the node ID of the software distribution node. The node ID is the location of the source or object code when using the server option of the EXTERNAL clause in a CREATE statement for a UDF, external stored procedure, or UDM. For example: SS!myudf!myudf.c Note: This field should only be changed by the Teradata Support Center. SourceDirectoryPath Specifies the default path of the UDF source directory when copying the UDF source code onto the server. The UDF source code is located on the software distribution node. Note: The default path is recommended by the Teradata Support Center. CompilerTempDirectory Specifies the path for the intermediate files used to compile or link the UDFs, external stored procedures, or UDMs. Note: This field should only be changed by the Teradata Support Center. UDFLibraryPath Specifies the root directory path of the UDF, external stored procedure, or UDM linked libraries. Note: This field should only be changed by the Teradata Support Center. CompilerPath Specifies the path to the C/C++ compiler. Note: This field should only be changed by the Teradata Support Center. LinkerPath Specifies the path to the linker. Note: This field should only be changed by the Teradata Support Center. UDFServerMemPath Specifies the path to the UDF, external stored procedure, or UDM shared memory files. Note: This field should only be changed by the Teradata Support Center. Utilities 209 Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description MaximumCompilations Specifies the maximum number of UDFs, external stored procedures, or UDMs compiled simultaneously, on different sessions, on any one node. Note: The default value is recommended by the Teradata Support Center. UDFServerTasks Determines the number of protected mode UDFs, external stored procedures, or UDMs that can be run simultaneously per vproc. Each instance is a separate process that runs as the built-in operating system user named tdatuser. The valid range of values is 0 to 20. Note: If the UDFServerTasks field is zero, you cannot run any protected mode UDFs, external stored procedures, or UDMs. SecureServerAMPs Specifies the maximum number of secure servers allowed to run simultaneously on an AMP vproc. The valid range of values is 0 to 120. The recommended value is between 15 and 30. ParallelUserServerAMPs Specifies the maximum number of secure servers allowed to run simultaneously using the same operating system user ID on an AMP vproc. The number of secure servers created must be a value between 1 and the SecureServerAMPs value. For example, a value of 2 allows two UDFs using identical operating system user IDs to run simultaneously. A third UDF would have to wait until one of the other UDFs finish. For information on the maximum number of secure servers allowed to run simultaneously using the same operating system user ID on a PE vproc, see ParallelUserServerPE. SecureServerPEs Specifies the maximum number of secure servers allowed to run simultaneously on a PE vproc. The required number of secure servers is limited to the value of the SecureServerPEs field. ParallelUserServerPEs Specifies the maximum number of secure servers allowed to run simultaneously using the same operating system user ID on a PE vproc. The ParallelUserServerPEs field must be a value between 1 and the SecureServerPEs value. For example, a value of 2 allows two external stored procedures using identical operating system user IDs to run simultaneously. A third external stored procedure would have to wait until one of the other external stored procedures finish. For information on the maximum number of secure servers allowed to run simultaneously using the same operating system user ID on an AMP vproc, see ParallelUserServerAMPs. TDSPLibBase Specifies the base library directory for stored procedures. Note: This field should only be changed by the Teradata Support Center. 210 Utilities Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description SecureGroupMembership Sets the default group membership required to run the secure server UDFs, external stored procedures, or UDMs. Note: The authorized operating system user must be a member of the group defined by the SecureGroupMembership field. However, this group does not have to be the primary group of the user. On Windows, the fully qualified group name, including the domain name, must be specified if the group is not a local group on the server. The group does not have to be defined on the server. It can be defined using the operating system user authentication mechanism used by the site. The default group tdatudf is always present on the server and is created when the database is installed. The tdatudf group is used for protected mode UDF servers and is independent of the SecureGroupMembership field setting. Change the SecureGroupMembership field if you want to use a different group name or a different authentication level for secure server UDFs, external stored procedures, or UDMs. An example is shown below. SecureGroupMembership: CorpSales/ UDFApplications UDFLibPath Specifies a library path in addition to the standard library path for use by UDFs, external stored procedures, or UDMs that specify a data access clause of NO SQL in the CREATE PROCEDURE or REPLACE PROCEDURE statement. The default value is a null string. UDFIncPath Specifies a header file path in addition to the standard path for use by UDFs, external stored procedures, or UDMs that specify a data access clause of NO SQL in the CREATE PROCEDURE or REPLACE PROCEDURE statement. The default value is a null string. UDFEnvFile Specifies the path and name of the file containing the environmental settings used by UDFs, external stored procedures, or UDMs that specify a data access clause of NO SQL in the CREATE PROCEDURE or REPLACE PROCEDURE statement. By default, this field has no initial value. If you specify an environment file using this field, a separate copy of the environment file must be on each node. The environment file contents can be the same on all nodes, or the contents may be different on each node. However, it is recommended that the contents be the same on all nodes. Utilities 211 Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description CLILibPath Specifies the path of the libraries required by CLI-based external stored procedures. The default path is shown below: For Windows systems: C:\Program Files\NCR\Teradata Client\cli\lib For MP-RAS systems: /usr/lib For Linux systems: /opt/teradata/client/lib For more information, see Teradata Tools and Utilities Installation Guide for Microsoft Windows and Teradata Tools and Utilities Installation Guide for UNIX and Linux. CLIIncPath Specifies the path of the header files required by CLI-based external stored procedures. The default path is shown below: For Windows systems: C:\Program Files\NCR\Teradata Client\cli\inc For MP-RAS systems: /usr/include For Linux systems: /opt/teradata/client/include For more information, see Teradata Tools and Utilities Installation Guide for Microsoft Windows and Teradata Tools and Utilities Installation Guide for UNIX and Linux. CLIEnvFile Specifies the path and name of the file containing the environmental settings used by CLI-based external stored procedures. By default, this field has no initial value. If you specify an environment file using this field, a separate copy of the environment file must be on each node. The environment file contents can be the same on all nodes, or the contents may be different on each node. However, it is recommended that the contents be the same on all nodes. JavaLibraryPath Specifies the root directory path where the JAR files are stored. These files are used by Java external stored procedures. Note: This field should only be changed by the Teradata Support Center. This field is available only on 64-bit Windows and Linux systems. 212 Utilities Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description JREPath Specifies the Java Runtime Environment (JRE) installation path. To run Java external stored procedures, the UDF server looks at the JREPath to find the required executable files and JVM library files. The JREPath is initialized to the value of the TD_JAVA_HOME environment variable. However, if one of the following conditions is true, then the JREPath is initialized as an empty string, which disables the Java external stored procedure feature. • The TD_JAVA_HOME variable does not exist. • The value of the TD_JAVA_HOME variable is an empty string. • The value of the TD_JAVA_HOME variable is not a JRE installation path. • The specified JRE has a version that is lower than required. To modify the value of JREPath, do the following: 1 Set up the TD_JAVA_HOME variable with the appropriate JRE installation path. 2 Run cufconfig with the -j option to set the JREPath to the value of the TD_JAVA_HOME variable. Note: If you run cufconfig -j and the TD_JAVA_HOME variable does not exist, no change is made to the JREPath. This field is available only on 64-bit Windows and Linux systems. JavaLogPath Specifies the location of the log files for Java external stored procedures. If JavaLogPath is specified and Java logging is enabled, the standard error and standard out of the Java server task are redirected to the files in the JavaLogPath directory for debugging purposes. Note: This field is available only on 64-bit Windows and Linux systems. JavaEnvFile Specifies the environment file for Java Virtual Machine (JVM) startup. Each line of the file is set as a JavaVMInitArgs option. This permits the Database Administrator to configure the JVM as needed for Java external stored procedures. By default, this field has no initial value. If you specify an environment file using this field, a separate copy of the environment file must be on each node. The environment file contents can be the same on all nodes, or the contents may be different on each node. However, it is recommended that the contents be the same on all nodes. Note: This field is available only on 64-bit Windows and Linux systems. Utilities 213 Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description JavaServerTasks Specifies the number of Java external stored procedure servers created when the system starts. This value determines the number of Java external stored procedures that can be run simultaneously. The valid range of values is 0 to 20. Note: If the JavaServerTasks field is zero, you cannot run any Java external stored procedures. This field is equivalent to the UDFServerTasks field used for native based UDFs, external stored procedures, or UDMs. This field is available only on 64-bit Windows and Linux systems. JavaVersion Specifies the JNI version used in the Java external stored procedure feature. This value is a hexadecimal number. Note: This field is available only on 64-bit Windows and Linux systems. 214 Utilities Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields Field Name Description JavaBaseDebugPort Specifies the port number for debugging a Java external stored procedure via a debugger. This port number is the value of JavaBaseDebugPort plus an offset. The offset is determined by the vproc number and the UDF server index. Each vproc has 10 debug ports for its exclusive use. The range of the offset is between 0 and 1999, where 0 to 999 are assigned to the first 100 PEs, and 1000 to 1999 are assigned to the first 100 AMPs. Specifically, the available offsets for each vproc are as follows: PE (#16383): 0-9 PE (#16382): 10-19 ... PE (#16284): 990-999 PE (< #16284): no debug port AMP (#0): 1000-1009 AMP (#1): 1010-1019 ... AMP (#99): 1990-1999 AMP (> #99): no debug port For example, if the value of JavaBaseDebugPort is 8000, then to debug the first UDF server on the PE with vproc ID 16383, you must connect to the debug port 8000. (8000 + 0 offset = 8000) To debug the second UDF server on PE 16383, connect to debug port 8001. (8000 + 1 offset = 8001) Similarly, to debug the first UDF server on the AMP with vproc ID 0, connect to debug port 9000. (8000 + 1000 offset = 9000) To debug the second UDF server on the AMP with vproc ID 1, connect to debug port 9011. (8000 + 1011 offset = 9011) The JavaBaseDebugPort should be chosen so that the JavaBaseDebugPort+offset does not conflict with an existing TCP/IP port. Note: This field is available only on 64-bit Windows and Linux systems. The Cufconfig utility allows you to modify the following UDF GDO fields: Utilities • UDFServerTasks • SecureServerAMPS • ParallelUserServerAMPs • SecureServerPEs • ParallelUserServerPEs • SecureGroupMembership • UDFLibPath 215 Chapter 9: Cufconfig Utility (cufconfig) UDF GDO Fields • UDFIncPath • UDFEnvFile • CLILibPath • CLIIncPath • CLIEnvFile • JREPath • JavaLogPath • JavaEnvFile • JavaServerTasks • JavaVersion • JavaBaseDebugPort For instructions on modifying these fields, see “Example 3” on page 219 and “Example 4” on page 220. The environment file specified by the UDFEnvFile or CLIEnvFile fields should contain a list of the required environment variables formatted using the standard shell script semantics. There is no support for shell-like parameter substitution. The following shows sample content for the environment file. COPLIB=/usr/lib; COPERR=/usr/lib; The JavaEnvFile field specifies the environment file for Java Virtual Machine (JVM) startup. The environment file should be formatted with each line set as a JavaVMInitArgs option. For example, on a Windows system, the contents of the environment file may be similar to the following: -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=8 -Xms512m -Xmx512m 216 Utilities Chapter 9: Cufconfig Utility (cufconfig) Examples Examples Example 1 To display the cufconfig help, type the following: start cufconfig -h The following appears: _______ | | ___ | / | --| \___ |/ | | __ \ ____ ____| / | \____| | | ____| / | \____| ____ ____| / | \____| | __|__ | | |__ ____ ____| / | \____| Release 12.00.00.00 Version 12.00.00.00 UDF GDO Configuration Utility (Mar 2006) cufconfig may be used from the dbw or from the command line valid options from the command line: -o outputs the gdo to the screen. -i initializes the gdo to the defaults. -f filename modifies the gdo fields identified in filename. Fields not specified in filename will not be set or reset by this tool. -j set JREPath for Java XSP/UDF based on environment variable TD_JAVA_HOME. Note that if several options are specified they are analyzed in the following order: -i -f -j -o If only a few fields need to be set differently than the defaults, specify the -i option with the -f and/or -j option. Use the -o option to verify the settings. Exiting cufconfig... Example 2 To display the contents of the UDF GDO, type the following: start cufconfig -o On a Windows system, the output is similar to the following: Version: 5 ModTime: 1166031558 SWDistNodeID: 33 SourceDirectoryPath: C:\Program Files\NCR\Tdat\tdconfig\Teradata\tdbs_udf\usr\ CompilerTempDirectory: C:\Program Files\NCR\Tdat\TdTemp\UDFTemp\ UDFLibraryPath: C:\Program Files\NCR\Tdat\tdconfig\udflib\ CompilerPath: C:\Program Files\Microsoft Visual Studio 8\VC\bin\CL.EXE LinkerPath: C:\Program Files\Microsoft Visual Studio 8\VC\bin\LINK.EXE UDFServerMemPath: C:\Program Files\NCR\Tdat\TdTemp\udfsrv\ MaximumCompilations: 10 UDFServerTasks: 2 SecureServerAMPs: 20 ParallelUserServerAMPs: 2 SecureServerPEs: 20 ParallelUserServerPEs: 2 TDSPLibBase: C:\Program Files\NCR\Tdat\tdconfig\tdsplib\ SecureGroupMembership: tdatudf Utilities 217 Chapter 9: Cufconfig Utility (cufconfig) Examples UDFLibPath: UDFIncPath: UDFEnvFile: CLILibPath: C:\Program Files\NCR\Teradata Client\cli\lib CLIIncPath: C:\Program Files\NCR\Teradata Client\cli\inc CLIEnvFile: JavaLibraryPath: C:\Program Files\NCR\Tdat\tdconfig\jarlib\ JREPath: C:\Program Files\Teradata\java\jre1.5.0_06\ JavaLogPath: c:\Temp\ JavaEnvFile: JavaServerTasks: 20 JavaVersion: 0x10004 JavaBaseDebugPort: 0 On a Linux system, the output is similar to the following: Version: 5 ModTime: 1170221940 SWDistNodeID: 33 SourceDirectoryPath: /etc/opt/teradata/tdconfig/Teradata/tdbs_udf/usr/ CompilerTempDirectory: /var/opt/teradata/tdtemp/UDFTemp/ UDFLibraryPath: /etc/opt/teradata/tdconfig/udflib/ CompilerPath: /usr/bin/gcc LinkerPath: /usr/bin/ld UDFServerMemPath: /var/opt/teradata/tdtemp/udfsrv/ MaximumCompilations: 10 UDFServerTasks: 2 SecureServerAMPs: 20 ParallelUserServerAMPs: 2 SecureServerPEs: 20 ParallelUserServerPEs: 2 TDSPLibBase: /etc/opt/teradata/tdconfig/tdsplib/ SecureGroupMembership: tdatudf UDFLibPath: UDFIncPath: UDFEnvFile: CLILibPath: /opt/teradata/client/lib CLIIncPath: /opt/teradata/client/include CLIEnvFile: JavaLibraryPath: /etc/opt/teradata/tdconfig/jarlib/ JREPath: /opt/teradata/java/jre1.5.0_06/ JavaLogPath: /tmp/ JavaEnvFile: JavaServerTasks: 20 JavaVersion: 0x10004 JavaBaseDebugPort: 0 On an MP-RAS system, the output is similar to the following: Version: 5 ModTime: 1169261103 SWDistNodeID: 36 SourceDirectoryPath: /Teradata/tdbs_udf/usr/ CompilerTempDirectory: /tmp/UDFTemp/ UDFLibraryPath: /ntos/udflib/ CompilerPath: /usr/bin/cc LinkerPath: /usr/bin/ld UDFServerMemPath: /tmp/udfsrv/ MaximumCompilations: 10 UDFServerTasks: 2 SecureServerAMPs: 20 ParallelUserServerAMPs: 2 SecureServerPEs: 20 218 Utilities Chapter 9: Cufconfig Utility (cufconfig) Examples ParallelUserServerPEs: 2 TDSPLibBase: /ntos/tdsplib/ SecureGroupMembership: tdatudf UDFLibPath: UDFIncPath: UDFEnvFile: CLILibPath: /usr/lib CLIIncPath: /usr/include CLIEnvFile: Example 3 Note: Before you begin, make sure your computer has a minimum of 256 KB of free disk space to run the protected or secure mode server process. Each server process requires 256 KB of space. Do the following steps to modify the fields of the UDF GDO, except for the JREPath field. To modify the JREPath field, see “Example 4” on page 220. 1 Open a new text file, or open an existing UDF configuration file. 2 In a text editor, type the fields and field values you want to modify. For example: UDFServerTasks:10 SecureServerAMPs:16 ParallelUserServerAMPs:4 SecureServerPEs:16 ParallelUserServerPEs:4 SecureGroupMembership:abc.corp\udf.users UDFEnvFile: C:\Documents and Settings\sally\My Documents\standard\UDFEnvFile.txt CLILibPath: CLIIncPath: CLIEnvFile: C:\Documents and Settings\sally\My Documents\CLI\CLIEnvFile.txt JavaBaseDebugPort: 8000 JavaLogPath: C:\Temp\ JavaEnvFile: C:\Temp\jvmenv.txt JavaServerTasks: 10 Note: The field names are case sensitive and must follow the same format as the output from the -o option. The UDF configuration file should contain only the fields you want to modify, with each field on a separate line as shown above. 3 Save the UDF configuration file as a text file on the server you are logged on to. For example, save the file as: C:\temp\gdosetting.txt Note: The name of the file must follow the same format as shown in the -f filename option and must be appropriate to the current platform. 4 Use the -f option to modify the UDF GDO with the field values specified in the UDF configuration file, and use the -o option to display the updated contents of the UDF GDO. For example: cufconfig -f C:\temp\gdosetting.txt -o Note: The path specified is case sensitive. Using the UDF GDO contents in “Example 2,” if you apply the field changes from this example, the new output of the UDF GDO would be the following: Version: 5 ModTime: 1166138619 SWDistNodeID: 33 SourceDirectoryPath: C:\Program Files\NCR\Tdat\tdconfig\Teradata\tdbs_udf\usr\ CompilerTempDirectory: C:\Program Files\NCR\Tdat\TdTemp\UDFTemp\ Utilities 219 Chapter 9: Cufconfig Utility (cufconfig) Examples UDFLibraryPath: C:\Program Files\NCR\Tdat\tdconfig\udflib\ CompilerPath: C:\Program Files\Microsoft Visual Studio 8\VC\bin\CL.EXE LinkerPath: C:\Program Files\Microsoft Visual Studio 8\VC\bin\LINK.EXE UDFServerMemPath: C:\Program Files\NCR\Tdat\TdTemp\udfsrv\ MaximumCompilations: 10 UDFServerTasks: 10 SecureServerAMPs: 16 ParallelUserServerAMPs: 4 SecureServerPEs: 16 ParallelUserServerPEs: 4 TDSPLibBase: C:\Program Files\NCR\Tdat\tdconfig\tdsplib\ SecureGroupMembership: abc.corp\udf.users UDFLibPath: UDFIncPath: UDFEnvFile: C:\Documents and Settings\sally\My Documents\standard\UDFEnvFile.txt CLILibPath: CLIIncPath: CLIEnvFile: C:\Documents and Settings\sally\My Documents\CLI\CLIEnvFile.txt JavaLibraryPath: C:\Program Files\NCR\Tdat\tdconfig\jarlib\ JREPath: C:\Program Files\Teradata\java\jre1.5.0_06\ JavaLogPath: C:\Temp\ JavaEnvFile: C:\Temp\jvmenv.txt JavaServerTasks: 10 JavaVersion: 0x10004 JavaBaseDebugPort: 8000 Exiting cufconfig... Example 4 To modify the JREPath for the Java external stored procedure feature, do the following: 1 Set up the TD_JAVA_HOME environment variable with the appropriate path to the Java executable files and the JVM library files. 2 Run cufconfig with the -j option to set the JREPath to the value of the TD_JAVA_HOME variable. On a Windows system, you can set the TD_JAVA_HOME variable from the Control Panel as follows: 1 Select Start>Settings>Control Panel>System. 2 In the System Properties window, click the Advanced tab. 3 Click the Environment Variables button. 4 Under the System Variables section, select the TD_JAVA_HOME system variable, and click Edit to define a new path for the variable. If the TD_JAVA_HOME system variable does not exist, click New to create the variable. For example, you can set the variable to the following: TD_JAVA_HOME=C:\Program Files\Java\jre1.5.0_10 After setting the variable, run cufconfig -j at the Teradata Command Prompt to set the JREPath. The output will be similar to the following: _______ | | ___ | / | --| \___ __ |/ | | \ ____ ____| / | \____| | | ____| / | \____| ____ ____| / | \____| | __|__ | | |__ ____ ____| / | \____| Release 12.00.00.00 Version 12.00.00.00 UDF GDO Configuration Utility (Mar 2006) 220 Utilities Chapter 9: Cufconfig Utility (cufconfig) Examples JREPath is set to C:\Program Files\Java\jre1.5.0_10\. JRE version is 1.5.0_10. On a Linux system, you can set the variable using the export command from the command line. For example: export TD_JAVA_HOME=/usr/java/jre1.5.0_06 After setting the variable, run cufconfig -j at the command line to set the JREPath. The output will be similar to the following: _______ | | ___ | / | --| \___ __ |/ | | \ ____ ____| / | \____| | | ____| / | \____| ____ ____| / | \____| | __|__ | | |__ ____ ____| / | \____| Release 12l.00.00.00 Version 12.00.00.00 UDF GDO Configuration Utility (Mar 2006) JREPath is set to /usr/java/jre1.5.0_06/. JRE version is 1.5.0_10. Utilities 221 Chapter 9: Cufconfig Utility (cufconfig) Examples Example 5 This example illustrates a use of the JavaEnvFile environment file. By default, a DBS Java external stored procedure uses the tdgssconfig.jar file located in the TDBMS\bin directory when connecting to the DBS session. If you want the DBS to use nondefault values for the tdgssconfig.jar file, you should copy, modify and place the file in the tdconfig directory on each node. Similarly, you would then create a JavaEnvFile to configure the JVM to use the copy of the tdgssconfig.jar file. Note: You must make a copy of the tdgssconfig.jar file when modifying it because the file may be overwritten when the DBS package is re-installed. In this case, the contents of the JavaEnvFile on a Windows system would be as follows: -Djava.class.path=C:\\Program Files\\NCR\\Tdat\\LTDBMS\\bin\\javFnc.jar;C:\\Program Files\\NCR\\Tdat\\LTDBMS\\bin\\terajdbc4.jar;C:\\Program Files\\NCR\\Tdat\\LTDBMS\\bin\\tdgssjava.jar;C:\\Program Files\\NCR\\Tdat\\tdconfig\\tdgssconfig.jar; On a Linux system, the contents of the JavaEnvFile would be as follows: -Djava.class.path=/usr/tdbms/bin/javFnc.jar;/usr/tdbms/bin/ terajdbc4.jar;/usr/tdbms/bin/tdgssjava.jar;/etc/opt/teradata/tdconfig/ tdgssconfig.jar; This configures the JVM to use the standard javFnc.jar, terajdbc4.jar, and tdgssjava.jar files, but use the alternate tdgssconfig.jar file. For more information about the terajdbc4.jar, tdgssjava.jar, and the tdgssconfig.jar files, see Teradata Driver for the JDBC Interface User Guide. For more information about the javFnc.jar file, see SQL Reference: UDF, UDM, and External Stored Procedure Programming. 222 Utilities CHAPTER 10 Database Initialization Program (DIP) The Database Initialization Program, DIP, is a series of executable script files packaged with Teradata Database. Each file creates one or more system users, databases, macros, tables, and views, for use by the following: • • Teradata Database: • To implement a feature, such as security access logging, client character sets, calendar arithmetic, and so forth • To store system information, such as PDE crashdumps, resource usage, query text, error message text, and so forth Users: • To view the contents of the Data Dictionary (system catalog) tables • To generate system reports, such as resource usage statistics DIP allows you to execute one, several, or all script files, which create a variety of database objects. All the DIP scripts you need are executed during Teradata Database installation, but you can run the DIP utility at any time to add optional features. Note: In Teradata MultiTool, DIP is known also as a tool. Audience Users of DIP include the following: Utilities • Teradata Database developers • Teradata Database system test and verification personnel • Field engineers • Teradata Database system administrators 223 Chapter 10: Database Initialization Program (DIP) User Interfaces User Interfaces DIP runs on the following platforms and interfaces: Platform Interfaces MP-RAS Database Window Windows Teradata MultiTool Database Window Linux Teradata MultiTool Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” To start DIP from Teradata MultiTool, click Tools>Database Initialization Program (DIP). For more information on using Teradata MultiTool, see Graphical User Interfaces: Database Window and Teradata MultiTool. Running DIP from DBW DIP runs from Database Window on MP-RAS, Windows, and Linux. After starting DIP and entering the password for user DBC on your system, type the number of the script you want to execute, and press Enter. Depending on what script you selected, a message similar to the following appears: Executing DIPERR at Tue Feb 20 13:04:29 2001 Please wait... DIPERR is complete at Tue Feb 20 13:04:46 2001 Please review the results in /tmp/dip1.txt on node 1- 4 Note: The results of the script are saved into a text file, which is named using DIP and the number of the script. To run another script, type Y and press Enter, then continue as above. To exit DIP, type N and press Enter. Running DIP from Teradata MultiTool Teradata MultiTool provides a graphical user interface to DIP on the Windows and Linux platforms. To start DIP from MultiTool, click Tools>Database Initialization Program (DIP). After entering the password for user DBC on your system, click the script you want to execute, then click the Execute Script button. 224 Utilities Chapter 10: Database Initialization Program (DIP) DIP Scripts A message similar to the following appears: Executing DIPERR at Tue Feb 20 13:04:29 2001 Please wait... When the script finishes, a message similar to the following appears: DIPERR is complete at Tue Feb 20 13:04:46 2001 Please review the results in /tmp/dip1.txt on node 1- 4 Note: The results of the script are saved into a text file, which is named using DIP and the number of the script. DIP Scripts The following table provides a summary of the script files, the objects they create, and their purpose. SQL Script File Items Created Purpose DIPACC DBC.AccLogRule macro. • Runs the access logging script. • Enables a user who has the EXECUTE privilege on this macro to submit: • GRANT LOGON/REVOKE LOGON statements, used to grant the WITH NULL PASSWORD privilege. (On Windows, this privilege is required to implement external authentication. On channelconnected mainframes, null passwords also require TDP exits.) • BEGIN LOGGING/END LOGGING statements, used to enable access rights checking and logging. Execute this script only if you want to: • Enable null passwords • Implement and log accesschecking activities DIPACR Access rights. Loads and initializes data access rights. DIPALL Runs all scripts listed in the DIP screen above its own entry. Runs all DIP scripts except the following: DIPCAL • Sys_Calendar database • CalDates table • Calendar view Loads the calendar tables and views. Used for date arithmetic in OLAP and other functions. DIPCCS Client character sets • Loads client character set definitions. • Creates pre-defined translation tables for non-English languages, including Japanese, Unicode, and various European languages. • For more information on character sets, see International Character Set Support. DIPCRASH Crashdumps database and table in database DBC • Loads the crashdumps database. • Default location for storing PDE crashdumps. Utilities • DIPACC • DIPPATCH 225 Chapter 10: Database Initialization Program (DIP) DIP Scripts SQL Script File DIPDEM Items Created Purpose • The system database, SYSLIB, if SYSLIB does not already exist • The following items in the SYSLIB database: Tables Loads tables, stored procedures, and a UDF that enable propagation, backup, and recovery of database extensibility mechanisms (DEMs). DEMs include stored procedures, UDFs, and UDTs that are distributed as packages, which can be used to extend the capabilities of Teradata Database. • dem • demddl • dempart Stored Procedures • installsp • savepkg • loadpkg External Stored Procedures Also loads UDFs and external stored procedures for use with Query Banding and Workload Management. For more information on these UDFs and external stored procedures, see Workload Management API: PM/API and Open API. Note: Successful creation of the stored procedures, external stored procedures, and UDFs requires a C compiler to be available on the Teradata server. • Procedures for use with Query Banding User-Defined Functions (UDFs) • installpkg • UDFs for use with Query Banding and Workload Management • A release-dependent number of Teradata DEM objects DIPERR Error message logs Loads error message files for storing the text of messages generated by Teradata Database components, software, and client connections. DIPOLH Online help Loads online help text messages. DIPOCES • Dictionary table with standard cost profile data • View definitions • Macro definitions Initializes OCES metadata with standard cost profile definitions, which include the following: Stand-alone patches Loads stand-alone patches. DIPPATCH 226 • V2R4 - Legacy Type 1 costing with original (V2R1) CPU coefficients • V2R5/V2R6 - Type 1 costing with updated (V2R5) CPU coefficients • Teradata12/T2_32Bit - Type 2 costing with new cost formulas and coefficients for 32 bit platforms • T2_Linux64 - Type 2 costing with cost formulas and coefficients for 64 bit Linux platforms • T2_Win64 - Type 2 costing with cost formulas and coefficients for 64 bit Windows platforms Note: Reverting to earlier versions of cost profiles should only be done under direction of Teradata Support Center personnel. Utilities Chapter 10: Database Initialization Program (DIP) DIP Scripts SQL Script File Items Created DIPPWD Purpose Allows system administrators to create a list of restricted words that are prohibited from use in new or modified passwords. Initializes table DBC.PasswordRestrictions (which is created automatically during system initialization). DIPRSS ResUsage tables Loads stored sample Resource Usage table data. DIPRUM ResUsage macros and views Loads Resource Usage views and macros and enables you to look at and generate reports from the data stored in the ResUsage system tables. Note: If your Teradata server platform has co-existence nodes, during tpa installation or upgrade the identifiers for each node group should be defined in the CASE clauses of the appropriate view definitions in the diprum.bteq file. • SQLJ system database • The following external stored procedures in the SQLJ database: • INSTALL_JAR • REPLACE_JAR • REMOVE_JAR • ALTER_JAVA_PATH • SQLJ.REDISTRIBUTE_JAR • The following views in the SQLJ database: • SQLJ.JAR_JAR_USAGE • SQLJ.JARS • SQLJ.ROUTINE_JAR_USAGE Enables Java-based external stored procedures. DIPSYSFE • SytemFE macros • Macros and tables used with Target Level Emulation • Loads SystemFE macros and Target Level Emulation-related tables. • Generates diagnostic reports used by Teradata support personnel. • Enables implementation of Target Level Emulation for analyzing the performance of your SQL applications. DIPUDT • The SYSUDTLIB database with 0 PERM space • The following macros in the SYSUDTLIB database: • HelpDependencies • HelpUdtCastMacro • HelpUdtCastMacro_Src • HelpUdtCastMacro_Dst • ShowUdtCastMacro Creates SYSUDTLIB, the system database for all User Defined Types (UDTs), User Defined Methods (UDMs), and the User Defined Functions (UDFs) that are used by UDTs as Cast, Ordering, or Transform routines. DIPSQLJ Utilities For more information on programming and administration of Java classes and JAR files for Java external stored procedures, see SQL Reference: UDF, UDM, and External Stored Procedure Programming. For more information on defining Java external stored procedures using CREATE and REPLACE PROCEDURE, see SQL Reference: Data Definition Statements. The new views are based on tables in the Data Dictionary. For more details on these views, see Data Dictionary. Note: Successful creation of the external stored procedures requires a C compiler to be available on the Teradata server. 227 Chapter 10: Database Initialization Program (DIP) DIP Scripts SQL Script File DIPVIEW 228 Items Created Purpose • The SYSLIB database with 0 PERM space • User-accessible views defined on the Teradata Database system tables • Special DBQL objects, including the control macro, the query log tables, and views into the logs • Creates the system database SYSLIB for User Defined Functions. • Loads system views which let you investigate the contents of the system tables in the Teradata Database data dictionary. (System views are created in database DBC; thus, a fully-qualified reference, required by users other than DBC, is DBC.viewname.) • Creates DBQL objects in database DBC. Utilities Chapter 10: Database Initialization Program (DIP) Examples Examples Example 1 The following is an example of running the DIPERR (Error Messages) script from the Database Window on MP-RAS. ______________ | | ___ __ ____ | ____ __|__ ____ | / |/ \ ____| ____| ____| | ____| | --| / | / | / | | / | | \___ | \____| \____| \____| |__ \____| Release 12.00.00.00 Version 12.00.00.00 DIP Utility (Jul 95) Type the password for user DBC or press the Enter key to quit: *** *** Logon successfully completed. Select one of the following DIP SQL scripts to execute or press the Enter key to quit: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. DIPERR DIPDEM DIPRSS DIPVIEW DIPOLH DIPSYSFE DIPACR DIPCRASH DIPRUM DIPCAL DIPCCS DIPOCES DIPUDT DIPSQLJ DIPPWD DIPALL DIPACC DIPPATCH - Error Messages - UDF/UDT/XSP/SPL Macros - ResUsage Tables - System Views - Online Help - System FE Macros - Access Rights - CrashDumps Database - ResUsage Views/Macros - Calendar Tables/Views - Client Character Sets - Cost Profiles - UDT Macros - SQLJ Views/Procedures - Password Restrictions - All of the above - Access Logging - Stand-alone patches 1 Executing DIPERR at Wed Apr 19 13:40:47 2006 Please wait... DIPERR is complete at Wed Apr 19 13:42:47 2006 Please review the results in /tmp/dip1.txt on node 1- 4 Would you like to execute another DIP script (Y/N)? n Exiting DIP... Utilities 229 Chapter 10: Database Initialization Program (DIP) Examples Example 2 The following is the output of the DIPACC (Access Logging) script from the Database Window on Windows. Executing DIPACC at Tue Aug 01 18:06:52 2006 Please wait... DIPACC is complete at Tue Aug 01 18:06:55 2006 Please review the results in D:\Program Files\NCR\Tdat\TdTemp\dip15.txt on node 1- 1 Would you like to execute another DIP script (Y/N)? n Exiting DIP... The following is the script session output stored in the text file dip15.txt. TSTSQL here. Enter your logon or TSTSQL command: logon dbc,***; *** Logon successfully completed. *** Time was 1 second. TSTSQL -- Enter DBC/SQL request or TSTSQL command: run file = "D:\Program Files\NCR\TDAT\TDBMS\12.00.00.00\ETC\dipacc.bteq"; TSTSQL -- Enter DBC/SQL request or TSTSQL command: database dbc; database dbc; *** New default database accepted. *** Time was 0 seconds. TSTSQL -- Enter DBC/SQL request or TSTSQL command: /* Added 11-09-92 to test Deadlock problem : DDT 1863 */ *********************************************************** * D I P A C C G0_00 * * * * D I P I N P U T S C R I P T Supplement * * * * History: * * * * G0_00 88Oct10 TAW DCR4661 Created * * * * Notes: This DIP script contains the macro which, * * when installed, enables the access logging * * function of the DBC (BEGIN/END LOGGING). * * If this macro is not installed, the feature * * will not operate. * * * * *** To install the feature, two steps are required.* * 1) Execute this script to define the macro. * * 2) RESTART the DBC so that it can figure out * * that the feature is installed. * * * * *** For those sites who used to use the SecurityLog* * facility and wish to continue to do so, this * * feature must be installed. Following * * installation, the following command will cause * * the new feature to log the same statements as * * the SecurityLog feature used to: * * BEGIN LOGGING WITH TEXT * * ON EACH USER, DATABASE, GRANT; * * Of course if more or less logging is desired, * * the full function of BEGIN and END LOGGING * * statements may be used. * * * * *** It is strongly recommended that the site NOT * * install the macro unless they intend to use * * the access logging function. There is a * * performance penalty for having the feature * * installed even if little or no logging is * * actually being performed. * ** * *********************************************************** 230 Utilities Chapter 10: Database Initialization Program (DIP) Examples ***************************************************** * * * The AccLogRule macro exists to allow the system * * administrator to control the use of the * * BEGIN/END LOGGING statements. The statements * * will only be allowed if the user has EXEC * * privilege on this macro. * * * * It also serves as a switch for the access logging* * facility. If this macro is not installed, the * * feature will not operate. * * * ***************************************************** REPLACE MACRO DBC.AccLogRule AS (;); REPLACE MACRO DBC.AccLogRule AS (;); *** Macro has been replaced. *** Time was 0 seconds. TSTSQL -- Enter DBC/SQL request or TSTSQL command: COMMENT ON MACRO DBC.AccLogRule AS 'The AccLogRule macro exists to allow the DBA to grant execute Warning - Request not complete due to unterminated quote string. privilege for the BEGIN/END LOGGING statements.'; COMMENT ON MACRO DBC.AccLogRule AS 'The AccLogRule macro exists to allow the DBA to grant execute privilege for the BEGIN/END LOGGING statements.'; *** Comment has been set. *** Time was 0 seconds. TSTSQL -- Enter DBC/SQL request or TSTSQL command: TSTSQL -- Enter DBC/SQL request or TSTSQL command: quit; *** You are now logged off from the DBC. TSTSQL exiting Utilities 231 Chapter 10: Database Initialization Program (DIP) Examples 232 Utilities CHAPTER 11 DBS Control (dbscontrol) The DBS Control utility, dbscontrol, displays and modifies various configuration settings which are stored as DBS Control Record fields in the DBS Control Globally Distributed Object (GDO). GDOs are binary files that store Teradata Database configuration settings, and are distributed to and used by every node in the system. Use DBS Control to perform the following: • Display the values of the DBS Control Record fields • Modify the values of the writable DBS Control Record fields You can use DBS Control whether or not the Teradata Database is running. DBS Control requires only that PDE and the Database Window are operational. You cannot run DBS Control before the System Initializer utility has initially created the DBS GDO. Audience Users of DBS Control include the following: • Teradata Database developers • Teradata Database system test and verification personnel • Teradata Support Center personnel • Field engineers • Teradata Database system architects Teradata assumes that you are familiar with the basic operations of Teradata Database. Utilities 233 Chapter 11: DBS Control (dbscontrol) User Interfaces User Interfaces dbscontrol runs on the following platforms and interfaces: Platform Interfaces MP-RAS Database Window Windows Database Window Command line (“Teradata Command Prompt”) Linux Database Window Command line For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” DBS Control Record The DBS Control Record stores various fields used by the Teradata Database for the following: • Debugging/diagnostic purposes • Establishing known global system values • Performance tuning The DBS Control Record resides on the system in a Globally Distributed Object (GDO). Parallel database extensions (PDE) guarantees that a GDO is consistent across all virtual processors on the system and provides a basic set of services to access and update this GDO. For detailed information on setting DBS Control fields to help ensure that the Teradata Database operates at peak performance based on your applications and processing needs, see Performance Management. 234 Utilities Chapter 11: DBS Control (dbscontrol) DBS Control Commands Group Names The DBS Control Record fields are grouped logically based on their use by the Teradata Database, as shown in the following table. The group … Contains fields that are … General used for various purposes throughout the Teradata Database. File System of specific interest to the Teradata Database file system. Performance of specific interest to the Teradata Database performance features. Checksum used to set and to define the meanings of the checksum levels based on specific table types. DBS Control Commands The following table summarizes DBS Control commands. The commands are detailed in this section and are presented in alphabetical order. Utilities Command Description DISPLAY Displays the current values of the DBS Control Record fields associated with a particular group. HELP Provides general help for DBS Control or detailed help if you specify an option. MODIFY Modifies the value of the writable DBS Control Record fields. QUIT Causes DBS Control to exit. WRITE Writes DBS Control Record to its system GDO counterpart. 235 Chapter 11: DBS Control (dbscontrol) DISPLAY DISPLAY Purpose The DISPLAY command displays the current values for the fields of each of the DBS Control Record groups: GENERAL, FILESYS, PERFORMANCE, and CHECKSUM. Syntax DISPLAY D GroupName GS03C019 where: Syntax element … Specifies … GroupName which of the following groups the DISPLAY command is directed towards: • GENERAL (for General fields) • FILESYS (for File System fields) • PERFORMANCE (for Performance fields) • CHECKSUM (for Checksum fields) Also, you can type the first character of each GroupName rather than the entire name. Usage Notes If GroupName is provided, only the fields associated with the specified group are displayed. If GroupName is omitted, the values of all fields are displayed. Example The following example shows default values for the listed fields. Note: Actual field numbers may be different from those shown in the example. Enter a command, HELP, or QUIT: DISPLAY DBS Control Record - General Fields: 1. 2. 3. 4. 5. 6. 7. 8. 236 Version = 7 SysInit = TRUE (2007-01-20 10:09) DeadLockTimeout = 240 (Reserved for future use) HashFuncDBC = 5 (Universal) (Reserved for future use) (Reserved for future use) SessionMode = 0 (Teradata) Utilities Chapter 11: DBS Control (dbscontrol) DISPLAY 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. LockLogger = FALSE RollbackPriority = FALSE MaxLoadTasks = 5 RollForwardLock = FALSE MaxDecimal = 15 Century Break = 0 DateForm = 0 (IntegerDate) System TimeZone Hour = 0 System TimeZone Minute = 0 RollbackRSTransaction = FALSE RSDeadLockInterval = 0 (240) RoundHalfwayMagUp = FALSE (Reserved for future use) Target Level Emulation = FALSE Export Width Table ID = 0 (Expected Defaults) DBQL Log Last Resp = FALSE DBQL Options = 0(No special options) ExternalAuthentication = 0 (On) IdCol Batch Size = 100000 (Expected Defaults) LockLogger Delay Filter = FALSE LockLogger Delay Filter Time = 0 ObjectUseCountCollectRate = 0 minutes (Disabled) LockLogSegmentSize = 64 KB (Expected Defaults) CostProfileId = 0 DBQLFlushRate = 600 (seconds) Memory Limit Per Transaction = 2 pages Client Reset Timeout = 300 seconds Temporary Storage Page Size = 4K bytes Spill File Path = /var/tdrsg MDS Is Enabled = FALSE Checktable Table Lock Retry Limit = 0 (Retry Forever) EnableCostProfileTLE = FALSE EnableSetCostProfile = 0(==0 => disabled, >0 => enabled) UseVirtualSysDefault = 0 (==0 => use static, >0 => use virtual) DisableUDTImplCastForSysFuncOp = FALSE CurHashBucketSize = 20 bits. NewHashBucketSize = 20 bits. MaxLoadAWT = 0 MonSesCPUNormalization = FALSE MPS_IncludePEOnlyNodes = FALSE MLoadDiscardDupRowUPI = FALSE DBS Control Record - File System Fields: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Utilities FreeSpacePercent MiniCylPackLowCylProd PermDBSize JournalDBSize DefragLowCylProd PermDBAllocUnit Cylinders Saved for PERM DisableWALforDBs DisableWAL WAL Buffers MaxSyncWALWrites SmallDepotCylsPerPdisk LargeDepotCylsPerPdisk WAL Checkpoint Interval = = = = = = = = = = = = = = 0% 10 (free cylinders) 127 (sectors) 12 (sectors) 100 (free cylinders) 1 (sectors) 10 (cylinders) FALSE FALSE 20 (WAL log buffers) 40 (MaxSyncWalWrites) 2 (cylinders) 1 (cylinders) 60 (seconds) 237 Chapter 11: DBS Control (dbscontrol) DISPLAY DBS Control Record - Performance Fields: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. DictionaryCacheSize = 1024 (kilobytes) DBSCacheCtrl = TRUE DBSCacheThr = 10% MaxParseTreeSegs = 1000 ReadAhead = TRUE StepsSegmentSize = 1024 (kilobytes) RedistBufSize = 4 (kilobytes) *defaulted* (amp-level buffering only) DisableSyncScan = FALSE SyncScanCacheThr = 10% HTMemAlloc = 2% SkewAllowance = 75% Read Ahead Count = 1 PPICacheThrP = 10 ReadLockOnly = FALSE IAMaxWorkloadCache = 32 (megabytes) MaxRequestsSaved = 600 * default * UtilityReadAheadCount = 10 StandAloneReadAheadCount = 20 DisablePeekUsing = FALSE IVMaxWorkloadCache = 1 (megabytes) DBS Control Record - Disk I/O Integrity Fields: CHECKSUM LEVELS 1. 2. 3. 4. 5. 6. System Tables System Journal Tables System Logging Tables User Tables Permanent Journal Tables Temporary Tables = = = = = = NONE NONE NONE NONE NONE NONE CHECKSUM LEVEL DEFINITIONS 7. 8. 9. 238 NONE LOW MEDIUM HIGH ALL = 0% = 2% = 33% = 67% = 100% Sampling Sampling Sampling Sampling Sampling Utilities Chapter 11: DBS Control (dbscontrol) HELP HELP Purpose The HELP command provides general help for DBS Control or detailed help if an option is specified. Syntax HELP H ALL A keyword GS03C020 where: Syntax element … Specifies … ALL a composite of the other options and is used to display the entire DBS Control help text. keyword either a command name or a group name. A command name entry indicates which user-level command the HELP command is directed towards. A group name entry indicates which group (GENERAL, FILESYS, PERFORMANCE, or CHECKSUM) the HELP command is directed towards. Also, you can type the first character of each keyword rather than the entire word. Usage Notes If the options are omitted (that is, only HELP is specified), a brief introduction to DBS Control is displayed. If a keyword is specified, a detailed help display is provided. Example 1 The following example shows basic help: Enter a command, HELP, or QUIT: HELP The DBS Control utility program provides a means to display and modify the fields of the DBS Control Record which is stored on the system as a Globally Distributed Object (GDO). The general command syntax is: <Command> [ <GroupName> ] That is, a command followed by a group name (if any). Valid commands are: Utilities 239 Chapter 11: DBS Control (dbscontrol) HELP DISPLAY, MODIFY, WRITE, HELP, and QUIT Valid group names are: GENERAL, FILESYS, PERFORMANCE, and CHECKSUM Note that all commands and groups may be abbreviated to their first unique character. Enter "HELP <Command>" or "HELP <GroupName>" for detailed information on each command or group, respectively. Enter "HELP ALL" for the help text in its entirety. Example 2 The following example shows detailed help using the DISPLAY command: Enter a command, HELP, or QUIT: HELP DISPLAY DISPLAY [ <GroupName> ] o This command will display the values of the DBS Control Record fields. If a GroupName is provided, only the fields associated with the specified group will be displayed. If GroupName is omitted, the values of all fields will be displayed. o Valid GroupNames are GENERAL, FILESYS, PERFORMANCE, and CHECKSUM. Enter "HELP <GroupName>" for additional information. 240 Utilities Chapter 11: DBS Control (dbscontrol) MODIFY MODIFY Purpose The MODIFY command modifies the value of the writable DBS Control Record fields. Syntax MODIFY M GroupName field# = value 1102A164 where: Syntax element … Description GroupName Indicates which of the following groups the MODIFY command is directed towards: • GENERAL (for General fields) • FILESYS (for File System fields) • PERFORMANCE (for Performance fields) • CHECKSUM (for Checksum fields) Also, you can type the first character of each GroupName rather than the entire name. field#=value Specifies the new value of the specified field. Note: Use the DISPLAY GroupName command to return the field numbers for a particular group. In most cases, this is a decimal value. For Boolean fields, use TRUE or T and FALSE or F. All values are checked against the valid range of values of the respective field. Usage Notes If you omit the options, DBS Control explicitly prompts for the group name, field number, and the new value of the field. Note: Use of the MODIFY command alone does not affect the current system GDO. The MODIFY command indicates when any changes made will become effective, either after the next Teradata Database restart or after the DBS Control Record has been written. Utilities 241 Chapter 11: DBS Control (dbscontrol) MODIFY Example The following example shows how to modify the Deadlock Timeout field: Enter a command, HELP, or QUIT: MODIFY GENERAL 3 = 600 The DeadlockTimeout field has been modified from 240 to 600. NOTE: This change will become effective after the next DBS restart. 242 Utilities Chapter 11: DBS Control (dbscontrol) QUIT QUIT Purpose The QUIT command causes DBS Control to exit. Syntax QUIT Q GS03C022 Usage Notes If the DBS Control Record has been modified, but you did not issue a WRITE command, you are asked to write the changes in the system GDO or terminate without saving them. Example 1 The following example shows how to exit DBS Control and issue a WRITE command after modifying the DBS Control Record: Enter a command, HELP, or QUIT: QUIT The DBS Control Record has been modified. Enter 'W' to write to the DBS Control GDO or 'Q' to terminate with no update: W Locking the DBS Control GDO... Updating the DBS Control GDO... Exiting DBSControl... Example 2 The following example shows how to exit DBS Control normally: Enter a command, HELP, or QUIT: q Exiting DBS Control Utility... Utilities 243 Chapter 11: DBS Control (dbscontrol) WRITE WRITE Purpose The WRITE command forces the DBS Control Record to be written out to its system GDO counterpart. Syntax WRITE W GS03C023 Usage Notes A system-wide lock is placed on the DBS Control GDO, and then the record is written. If the DBS Control GDO has been modified by someone else, you are asked whether to override those changes in the system GDO or terminate without saving them. Example 1 The following example shows how to write the GDO without exiting DBS Control: Enter a command, HELP, or QUIT: write Locking the DBS Control GDO ... Updating the DBS Control GDO ... Enter a command, HELP, or QUIT: 244 Utilities Chapter 11: DBS Control (dbscontrol) WRITE Example 1 The following example shows how to use the WRITE command to modify the DBS Control Record that has been modified by someone else: Enter a command, HELP, or QUIT: WRITE The DBS Control Record has been modified by someone else. Do you want to override those changes? Enter 'W' to overwrite the DBS Control GDO or 'Q' to terminate with no update: W Locking the DBS Control GDO... Updating the DBS Control GDO... Exiting DBSControl... Utilities 245 Chapter 11: DBS Control (dbscontrol) General Fields General Fields The following table lists the General DBS Control Record fields that are used for various purposes throughout the Teradata Database. 246 Field Description Century Break Defines how to interpret character-format Teradata Database date input when the input format only has two digits representing the year. CheckTable Table Lock Retry Limit Specifies that in nonconcurrent mode, CheckTable will retry a table check for a specified limit when the table is locked by another application. Client Reset Timeout Specifies how long the Relay Services Gateway (RSG) should wait for an intermediary to reconnect before taking action. CostProfileId Contains the system standard cost profile ID number, which defines the cost profile that the system will use. CurHashBucketSize Indicates the number of bits used to identify a hash bucket in the current system configuration. DateForm Defines whether Integer Date or ANSI Date formatting is used for a session. DBQLFlushRate Controls the length of time between flushing the Database Query Log (DBQL) cache. DBQL Log Last Resp Determines whether DBQL logs a pseudo step labeled “RESP” after the last response of a DBQL logged request completes.. DBQL Options This field is unused, but reserved for future DBQL use. It should not be reset. DeadlockTimeOut Used by the Dispatcher to determine the interval (in seconds) between deadlock timeout detection cycles. DisableUDTImplCastForSysFuncOp Disables/enables implicit cast/conversion of UDT expressions passed to built-in system operators/functions. EnableCostProfileTLE Determines whether Optimizer Cost Estimation Subsystem (OCES) diagnostics are enabled in combination with Target Level Emulation (TLE). EnableSetCostProfile Controls use of DIAGNOSTIC SET PROFILE statements, to dynamically change cost profiles, which are used for query planning. Export Width Table ID Controls the export width of a character in bytes. Utilities Chapter 11: DBS Control (dbscontrol) General Fields Utilities Field Description ExternalAuthentication Controls whether Teradata Database users can be authenticated outside (external) of the Teradata Database software authentication system. HashFuncDBC Defines the hashing function that Teradata Database uses. IdCol Batch Size Indicates the size of a pool of numbers reserved for generating numbers for rows to be inserted into a table with an identity column. LockLogger Defines the system default for the locking logger. LockLogger Delay Filter Controls whether or not to filter out blocked lock requests based on delay time. LockLogger Delay Filter Time Indicates the value at which blocked lock requests with a delay time greater than this value are logged. LockLogSegmentSize Specifies the size of the Locking Logger segment. MaxDecimal Defines the maximum number of Decimal Digits in the default maximum value used in expression typing. MaxLoadAWT Works together with MaxLoadTasks to limit the number of load utility jobs that can run concurrently on the system. MaxLoadTasks Works together with MaxLoadAWT to limit the number of load utility jobs that can run concurrently on the system. MDS Is Enabled Specifies whether the Relay Services Gateway (RSG) component of Metadata Services (MDS) should start when the RSG starts. Memory Limit Per Transaction Specifies the maximum amount of in-memory, temporary storage that the Relay Services Gateway (RSG) can use to store the records for one transaction. MLoadDiscardDupRowUPI Determines whether the DBS MultiLoad protocol should silently discard rows with UPI violations or log these rows to the application error table. MonSesCPUNormalization Determines whether CPU data in workload management (PM/API and Open API) calls is normalized. This affects workload rules defined in Teradata Dynamic Workload Manager. MPS_IncludePEOnlyNodes Excludes PE-only nodes from MONITOR PHYSICAL SUMMARY Workload Management API statistics calculations. NewHashBucketSize Specifies the number of bits that will be used to identify hash buckets on the system after the next sysinit or reconfig. ObjectUseCountCollectRate Specifies the amount of time between collections of object use-count data. 247 Chapter 11: DBS Control (dbscontrol) General Fields Field Description RollbackPriority Defines the system default for the rollback performance group. RollbackRSTransaction Used when a subscriber-replicated transaction and a user transaction are involved in a deadlock. RollForwardLock Defines the system default for the RollForward using Row Hash Locks option. RoundHalfwayMagUp Indicates how rounding should be performed when computing values of DECIMAL types. RSDeadLockInterval Used to check for deadlocks between subscriber- replicated transactions and user transactions. SessionMode Defines the system default transaction mode, case sensitivity, and character truncation rule for a session. Spill File Path Specifies a directory that the Relay Services Gateway (RSG) can use for spill files. SysInit Used to ensure the system has been initialized properly using the System Initializer utility. System TimeZone Hour Defines the System Time Zone Hour offset from Universal Coordinated Time (UTC). System TimeZone Minute Defines the System Time Zone Minute offset from Universal Coordinated Time (UTC). Target Level Emulation Allows a test engineer to set the costing parameters considered by the optimizer. Temporary Storage Page Size Specifies the memory allocation granule for Relay Services Gateway (RSG) temporary storage. UseVirtualSysDefault This field is no longer used. For cost profiling information, see “CostProfileId” on page 253. Version Indicates the version number of the DBS Control Record. The fields are discussed in detail in the following sections. 248 Utilities Chapter 11: DBS Control (dbscontrol) Century Break Century Break Purpose The Century Break field defines how to interpret character data when converting to date. The data only has two digits representing the year, and the applicable format only has two digits representing the year. Century Break specifies which two-digit years, if any, are to be interpreted as 20th-century years and which two-digit years, if any, are to be interpreted as 21st-century years. Usage Notes You can set Century Break to any positive value from 0 to 100. The default is 0. The following two-year digit rules apply: IF a two-digit year yy is … THEN the year is … less than Century Break 20yy and is considered to be in the 21st century. greater than or equal to Century Break 19yy and is considered to be in the 20th century The following Century Break value rules apply: IF Century Break is … THEN all years yy are … 0 19yy. 100 20yy. Century Break does not affect four-digit years. The Century Break setting has no effect on Teradata Database dates input in numeric (as opposed to character) format. If the character data specifies a four-digit year, and the format specifies a two-digit year, Century Break does not affect the conversion. The four digits in the character data are used as the year. Teradata recommends you convert to four-digit years and corresponding four-digit-year formats. However, Century Break provides a transitional facility while you use two-digit years. The new setting becomes effective for already logged on sessions only after the next Teradata Database restart. Utilities 249 Chapter 11: DBS Control (dbscontrol) Century Break Example 1 If Century Break = 25, strings such as '00/01/01' and '24/01/01' are interpreted as years 2000 and 2024, respectively. A string inserted as '25/01/01' is interpreted as year 1925. Note: The choice of 25 for Century Break indicates that the installation wants a cushion of up to 25 years to handle input dates into the 21st century and does not have historic input data prior to the year 1925. Example 2 If Century Break = 100, two-digit years are inserted as years in the 21st century (that is, 2000, 2001, and so forth). 250 Utilities Chapter 11: DBS Control (dbscontrol) CheckTable Table Lock Retry Limit CheckTable Table Lock Retry Limit Purpose The CheckTable Table Lock Retry Limit field specifies the duration, in minutes, that CheckTable, in nonconcurrent mode, will retry a table check when the table is locked by another application. Usage Notes The valid range of values is 0 to 32767 minutes. The default is 0, which indicates that in nonconcurrent mode, CheckTable will retry a table check until CheckTable can access the table. If the CheckTable Table Lock Retry Limit field is greater than 0, then CheckTable will retry a table check within the specified limit. The new setting becomes effective immediately. Utilities 251 Chapter 11: DBS Control (dbscontrol) Client Reset Timeout Client Reset Timeout Purpose The Client Reset Timeout field specifies how long the Relay Services Gateway (RSG) should wait for an intermediary to reconnect after one of the following before taking action: • Communication failure • Intermediary reset • Server reset Usage Notes The valid range of values is 0 to 65535 seconds. The default is 300 seconds. The new setting becomes effective after the next Teradata Database restart. 252 Utilities Chapter 11: DBS Control (dbscontrol) CostProfileId CostProfileId Warning: Do not change this value except under the direction of the Teradata Support Center. Purpose The CostProfileId field contains the system standard cost profile ID number and defines the cost profile the Teradata Database system will use as its default. Usage Notes The valid range of values is 0 to 32760. When CostProfileID is 0, the system automatically chooses the appropriate profile to use as a default from the following, based on the operating system: • Teradata12 (id = 36) - All 32 bit platforms • T2_Linux64 (id = 21) - 64 bit Linux platforms • T2_Win64 (id = 37) - 64 bit Windows platforms This selection is made during the first session logon that occurs after CostProfileId is set to 0. When the system selects its default cost profile, it changes CostProfileId to that profile's id value. For example, on a 64 bit Linux platform, once the selection is made, you will see: CostProfileId = 21 This will not cause any running session to change the cost profile it is currently using. If the CostProfileId field contains a value greater than 0, the standard default cost profile is defined by DBC.CostProfiles.CostProfileId = N, where N is the CostProfileId value. The non-zero value N for CostProfileId implies that the system will use the cost profile values in DBC.ConstantValues where DBC.ConstantValues.ProfileId = N. Note: The set of constant values in DBC.ConstantValues for a particular cost profile consists of the values to be used instead of what the system uses by default. In nearly all cases, this set represents only a part of the full set of cost profile constant definitions. The new setting becomes effective for new sessions after the DBS Control Record has been written or applied. Utilities 253 Chapter 11: DBS Control (dbscontrol) CostProfileId Example 1 To return the list of cost profiles defined for the system, type the following: SELECT * FROM DBC.CostProfiles_v; The following appears: *** Query completed. 38 rows found. 5 columns returned. *** Total elapsed time was 3 seconds. Type Name --------------Type2 Legacy Legacy Legacy Legacy Type2 Type2 Legacy Type2 Legacy Type2 Type2 Legacy Type2 Legacy Legacy Legacy Legacy Legacy Type2 Type2 Legacy Type2 Legacy Legacy Type2 Legacy Type2 Legacy Legacy Type2 Type2 Type2 Legacy Legacy Legacy Type2 Type2 254 Profile Name ProfileId Cat Description ------------------------------ --------- --- -------------T2_emc 26 F EMC cost value lsi6285_40 17 F Disk array cos symbios_half 7 F Disk array cos SysDefault 0 F SysDefault DBS V2R5_Bynet_V1 5 F Bynet V1 cost T2_lsi6285_40 34 F LSI 6285 array T2_Bynet_V1 22 F Bynet V1 cost V2R5_Array 19 F Disk array cos T2_symbios_half 24 F Half Populated lsi6840_28 13 F Disk array cos T2_Win64 37 F Default Type 2 Teradata12 36 F Standard cost V2R5_Solaris 3 F V2R5 DBS cost T2_lsi6840_56 32 F LSI 6840 array V2R6 35 F Generic standa lsi6840_56 15 F Disk array cos V2R4 1 F V2R4 DBS cost lsi6288_40 11 F Disk array cos lsi6288_52 12 F Disk array cos T2_lsi6840_28 30 F LSI 6840 array T2_32Bit 20 F Default Type 2 emc 9 F Disk array cos T2_lsi6283 27 F LSI 6283 array lsi6840_40 14 F Disk array cos V2R4_Array 18 F Disk array cos T2_lsi6288_40 28 F LSI 6288 array V2R4_Bynet 4 F Bynet cost val T2_lsi6840_40 31 F LSI 6840 array symbios_full 8 F Disk array cos lsi6285_20 16 F Disk array cos T2_lsi6288_52 29 F LSI 6288 array T2_symbios_full 25 F Fully Populate T2_lsi6285_20 33 F LSI 6285 array V2R5_Bynet_V2 6 F Bynet V2 cost V2R5 2 F V2R5 DBS cost lsi6283 10 F Disk array cos T2_Bynet_V2 23 F Bynet V2 cost T2_Linux64 21 F Default Type 2 Utilities Chapter 11: DBS Control (dbscontrol) CostProfileId Example 2 To return the list of constant values defined for a specific profile, for example ProfileId = 36, type the following: SELECT * FROM DBC.CostProfileValues_v WHERE ProfileId = 36; The following is a portion of the output: *** Query completed. 177 rows found. 7 columns returned. *** Total elapsed time was 2 seconds. Profile Name P-Id Constant Name C-Id Cat --------------- ------ ------------------------------ ------ --Teradata12 36 OptIndexBlockSize 10002 I Teradata12 36 OptMaxBldKeySize 10003 I Teradata12 36 OptMaxRowIdSIndex 10004 I Teradata12 36 OptRowidSize 10005 I Teradata12 36 OptSpoolBlockSize 10006 I Teradata12 36 OptTableBlockSize 10007 I Teradata12 36 OptBitInst 10060 I Teradata12 36 OptBMAndRowInst 10061 I Teradata12 36 OptCharFieldInst 10062 I Teradata12 36 OptNumFieldInst 10063 I Teradata12 36 OptOutputRowInst 10064 I Teradata12 36 OptOvhdOfRowCompInst 10065 I Teradata12 36 OptRedistributeInst 10066 I Teradata12 36 OptRowAccessInst 10067 I Teradata12 36 OptRowIdInst 10068 I Teradata12 36 OptSynonymInst 10069 I Teradata12 36 InitBlockProcessOv 10100 I Teradata12 36 InitBlockProcessCf 10101 I Teradata12 36 InitAccessRowOv1 10102 I Teradata12 36 InitAccessRowCf1 10103 I Utilities 255 Chapter 11: DBS Control (dbscontrol) CurHashBucketSize CurHashBucketSize Purpose The CurHashBucketSize field indicates the number of bits used to identify hash buckets in the current system configuration. Usage Notes The value of this field can be 16 or 20. This field is informational only. It cannot be changed. See also “NewHashBucketSize” on page 294. 256 Utilities Chapter 11: DBS Control (dbscontrol) DateForm DateForm Purpose The DateForm field defines whether IntegerDate or ANSIDate formatting is used for a session. Usage Notes The default setting is 0, meaning IntegerDate. A setting of 1 means ANSIDate. IntegerDate means that date columns use the format specified in the SDF file. The default format is ‘YY/MM/DD’, however the SDF file can be customized by a system administrator to change this date format. ANSIDate means date columns are formatted as 'YYYY-MM-DD'. DateForm can be overridden at the user level and at the session level (at logon or during the session). The new setting takes effect for new sessions begun after the DBS Control Record has been written. Existing sessions are not affected. For more information on the SDF file, see Tdlocaledef in Utilities. For more information on DateForm, see “Date time and Interval Data Types” in SQL Reference: Data Types and Literals. Utilities 257 Chapter 11: DBS Control (dbscontrol) DBQLFlushRate DBQLFlushRate Purpose The DBQLFlushRate field defines the interval in seconds between flushings of the DBQL caches to the DBQL dictionary tables. Usage Notes The valid range of values is 1 to 3600 seconds. The default is 600. Note: Teradata does not recommend values less than 600, and DBS Control issues a warning if you set the value below 600. The new setting becomes effective after the DBS Control Record has been written or applied. However, DBQL will not become aware of the new setting until the current timer expires (or 10 minutes passes). Therefore, the change could take up to 10 minutes to become effective. If an END QUERY LOGGING statement is issued, all the caches (except the DBQLSummary cache, which is flushed at the selected Flush Rate) are flushed as part of the END QUERY LOGGING statement. For information on BEGIN QUERY LOGGING and END QUERY LOGGING statements, refer to SQL Reference: Data Definition Statements. For information on tracking processing behavior with the DBQL, refer to Database Administration. Example Assume that the DBQLFlushRate is 300 seconds. This means that the cache entries are written to the DBQL dictionary tables at least every five minutes. If a cache is filled up after three minutes, entries are written at three minutes and then again at the five-minute interval. 258 Utilities Chapter 11: DBS Control (dbscontrol) DBQL Log Last Resp DBQL Log Last Resp Purpose Determines whether DBQL logs a pseudo step labeled “RESP” in the DBQLStepTbl table when the last response to a DBQL logged request is completed. This can be used together with the FirstRespTime log entry in the DBQLogTbl to calculate the approximate response time experienced by the client. Field Group General Valid Settings Setting Description TRUE DBQL logs a pseudo step labeled RESP to the DBQLStepTbl when the last response of a DBQL logged request is complete. FALSE DBQL does not log a RESP pseudo step for completed requests. Default FALSE Changes Take Effect After the DBS Control Record has been written or applied. Usage Notes This setting is effective only when DBQL logging is enabled. The RESP pseudo step entry is logged for every query that is logged to the DBQL default table, regardless of whether STEPINFO or other DBQL options are requested. When enabled, the RESP pseudo step is logged even if the request aborts or experiences an error. It indicates when the logged request ends for any reason. Utilities 259 Chapter 11: DBS Control (dbscontrol) DBQL Log Last Resp Related Topics 260 For more information on… See… BEGIN QUERY LOGGING and END QUERY LOGGING statements SQL Data Definition Language tracking processing behavior with the DBQL Database Administration Utilities Chapter 11: DBS Control (dbscontrol) DeadlockTimeOut DeadlockTimeOut Purpose The DeadlockTimeOut field is used by the Dispatcher to determine the interval (in seconds) between deadlock timeout detection cycles. Usage Notes The valid range of values is 0 to 3600 seconds. The default is 240 seconds. The new setting becomes effective after the next Teradata Database restart. Utilities 261 Chapter 11: DBS Control (dbscontrol) DisableUDTImplCastForSysFuncOp DisableUDTImplCastForSysFuncOp Purpose The DisableUDTImplCastForSysFuncOp field disables/enables implicit cast/conversion of UDT expressions passed to built-in system operators/functions. Usage Notes The system implicitly converts a UDT expression to a compatible pre-defined type when there is a CAST...AS ASSIGNMENT definition whose target is a compatible data type. Setting the DisableUDTImplCastForSysFuncOp field to TRUE disables implicit conversions. Setting the field to FALSE enables implicit conversions. The default is FALSE. Note: The DisableUDTImplCastForSysFuncOp flag only affects built-in system operators and functions. The system always invokes implicit casts for INSERT, UPDATE, and parameter passing (UDF, UDM, Stored Procedure) operations. 262 Utilities Chapter 11: DBS Control (dbscontrol) EnableCostProfileTLE EnableCostProfileTLE Warning: Do not change this value except under the direction of the Teradata Support Center. Purpose The EnableCostProfileTLE field enables/disables Optimizer Cost Estimation Subsystem (OCES) diagnostics for use in combination with Target Level Emulation (TLE). Usage Notes A value of FALSE disables combined OCES/TLE diagnostics. The default is FALSE. A value of TRUE enables OCES diagnostics to be used in combination with Target Level Emulation. When set to TRUE, all TLE diagnostics are also processed by the OCES logic. The new setting becomes effective for new sessions after the DBS Control Record has been written or applied. Note: If the value of the EnableSetCostProfile field is equal to 0, the EnableCostProfileTLE field is set to FALSE. For additional information, see “EnableSetCostProfile” on page 265. Example When EnableCostProfileTLE is set to FALSE, the following syntax for the DIAGNOSTIC SET COSTS statement is valid. DIAGNOSTIC SET COSTS target_system_name A TPA ON FOR A NOT REQUEST SESSION IFP ; SYSTEM 1101A242 Utilities 263 Chapter 11: DBS Control (dbscontrol) EnableCostProfileTLE When EnableCostProfileTLE is set to TRUE, the following syntax for the DIAGNOSTIC SET COSTS statement is valid. DIAGNOSTIC SET COSTS target_system_name TPA ON FOR A NOT A ,PROFILE profile_name REQUEST SESSION IFP ; SYSTEM 1101B242 See SQL Reference: Data Definition Statements for information about the DIAGNOSTIC SET COSTS statement. See SQL Reference: Statement and Transaction Processing for information on using TLE and OCES diagnostics. 264 Utilities Chapter 11: DBS Control (dbscontrol) EnableSetCostProfile EnableSetCostProfile Warning: Do not change this value except under the direction of the Teradata Support Center. Purpose The EnableSetCostProfile field controls usage of DIAGNOSTIC SET PROFILE statements to dynamically change cost profiles, which are used for query planning. Usage Notes The default value is 0, which disables the usage of DIAGNOSTIC SET PROFILE statements. The value can be one of the following: 0, the default, disables the usage of DIAGNOSTIC SET PROFILE statements. 1 enables DIAGNOSTIC SET PROFILE statements for SESSION and REQUEST levels. 2 enables DIAGNOSTIC SET PROFILE statements at all levels. The new setting becomes effective for new sessions after the DBS Control Record has been written or applied. See SQL Reference: Data Definition Statements for information on using the DIAGNOSTIC SET PROFILE statement. For more information about cost profiles, see SQL Reference: Statement and Transaction Processing. Utilities 265 Chapter 11: DBS Control (dbscontrol) Export Width Table ID Export Width Table ID Purpose The Export Width Table ID field allows you to set the system default for the export width of a character in bytes. Usage Notes The following settings are available. Export Width Setting Description 0 - Expected defaults Provides reasonable default widths for the character data type and client form of use. 1 - Compatibility defaults Allows Unicode columns to work in a way compatible with applications that were written to use Latin or Kanji1 columns. 2 - Maximum defaults Provides maximum default width of the character data type and client form of use. The default is 0 (Expected defaults). Changes take effect after the next Teradata Database restart. The following sections describe the Export Width settings. Expected Default Export Widths The following table illustrates the number of bytes exported from the various server character sets to the various client character sets for the Expected Default export width table (Export Width Table ID = 0). IF the client character set is… any single-byte character set AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • n LATIN UNICODE KANJISJIS KANJI1 Note: GRAPHIC is not supported. 266 Utilities Chapter 11: DBS Control (dbscontrol) Export Width Table ID IF the client character set is… KANJIEUC_0U KANJIEBCDIC5026_0I KANJIEBCDIC5035_0I KATAKANAEBCDIC KANJISJIS_0S KANJI932_1S0 UTF8 AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • LATIN • KANJISJIS • KANJI1 n • UNICODE • GRAPHIC 2n • LATIN • KANJISJIS • KANJI n UNICODE 2n+2 GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) • LATIN • KANJISJIS • KANJI n • UNICODE • GRAPHIC 2n LATIN 2n • UNICODE 3n • KANJISJIS • KANJI n Note: GRAPHIC is not supported. UTF16 Utilities • • • • • LATIN UNICODE KANJISJIS KANJI1 GRAPHIC 2n 267 Chapter 11: DBS Control (dbscontrol) Export Width Table ID IF the client character set is… AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • • • • • • • HANGUL949_7R0 HANGULKSC5601_2R4 SCHGB2312_1T0 SCHINESE936_6R0 SDHANGULKSC5601_4R4 SDTCHBIG5_3R0 SDSCHGB2312_2T0 TCHBIG5_1R0 TCHINESE950_8R0 Extended site-defined multibyte client character sets that use one of the following encoding forms: • Single-byte characters in the range 0x00-0x81, first byte of double-byte characters in the range 0x82-0xFF • LATIN • KANJISJIS • KANJI1 n • UNICODE • GRAPHIC 2n • • • • • • HANGULEBCDIC933_1II SCHEBCDIC935_21J SDHANGULEBCDIC933_5II SDSCHEBCDIC935_6IJ SDTCHEBCDIC937_7IB TCHEBCDIC937_3IB • LATIN • KANJISJIS • KANJI1 n UNICODE 2n+2 GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) Compatibility Default Export Widths The following table illustrates the number of bytes exported from the various server character sets to the various client character sets for the Compatibility Default export width table (Export Width Table ID = 1). IF the client character set is… any single-byte character set AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • n LATIN UNICODE KANJISJIS KANJI1 Note: GRAPHIC is not supported. 268 Utilities Chapter 11: DBS Control (dbscontrol) Export Width Table ID IF the client character set is… • KANJIEUC_0U • KANJISJIS_0S • KANJI932_1S0 KANJIEBCDIC5026_0I KANJIEBCDIC5035_0I KATAKANAEBCDIC UTF8 AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • n LATIN UNICODE KANJISJIS KANJI GRAPHIC 2n • • • • n LATIN UNICODE KANJISJIS KANJI GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) LATIN 2n • UNICODE 3n • KANJISJIS • KANJI n Note: GRAPHIC is not supported. UTF16 Utilities • • • • • LATIN UNICODE KANJISJIS KANJI1 GRAPHIC 2n 269 Chapter 11: DBS Control (dbscontrol) Export Width Table ID IF the client character set is… • • • • • • • • • • • • • • • • HANGUL949_7R0 HANGULKSC5601_2R4 SCHGB2312_1T0 SCHINESE936_6R0 SDHANGULKSC5601_4R4 SDTCHBIG5_3R0 SDSCHGB2312_2T0 TCHBIG5_1R0 TCHINESE950_8R0 Extended site-defined multibyte client character sets that use one of the following encoding forms: • Single-byte characters in the range 0x00-0x81, first byte of double-byte characters in the range 0x82-0xFF HANGULEBCDIC933_1II SCHEBCDIC935_21J SDHANGULEBCDIC933_5II SDSCHEBCDIC935_6IJ SDTCHEBCDIC937_7IB TCHEBCDIC937_3IB AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • n LATIN UNICODE KANJISJIS KANJI1 • GRAPHIC 2n • • • • n LATIN UNICODE KANJISJIS KANJI1 GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) Maximum Default Export Widths The following table illustrates the number of bytes exported from the various server character sets to the various client character sets for the Maximum Default export width table (Export Width Table ID = 2). IF the client character set is… any single-byte character set AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • n LATIN UNICODE KANJISJIS KANJI1 Note: GRAPHIC is not supported. 270 Utilities Chapter 11: DBS Control (dbscontrol) Export Width Table ID AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • LATIN • UNICODE • GRAPHIC 3n • KANJISJIS • KANJI n n KANJIEBCDIC5035_0I • LATIN • KANJI KATAKANAEBCDIC UNICODE 3n+1 KANJISJIS 2n GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) • LATIN • UNICODE • GRAPHIC 2n • KANJISJIS • KANJI n • LATIN • UNICODE • KANJISJIS 3n KANJI n IF the client character set is… KANJIEUC_0U KANJIEBCDIC5026_0I KANJISJIS_0S KANJI932_1S0 UTF8 Note: GRAPHIC is not supported. UTF16 Utilities • • • • • LATIN UNICODE KANJISJIS KANJI1 GRAPHIC 2n 271 Chapter 11: DBS Control (dbscontrol) Export Width Table ID IF the client character set is… 272 AND the server character set is… THEN the number of bytes exported for a CHARACTER(n) column is… • • • • • • • • • • HANGUL949_7R0 HANGULKSC5601_2R4 SCHGB2312_1T0 SCHINESE936_6R0 SDHANGULKSC5601_4R4 SDTCHBIG5_3R0 SDSCHGB2312_2T0 TCHBIG5_1R0 TCHINESE950_8R0 Extended site-defined multibyte client character sets that use one of the following encoding forms: • Single-byte characters in the range 0x00-0x81, first byte of double-byte characters in the range 0x82-0xFF • LATIN • UNICODE • GRAPHIC 2n • KANJISJIS • KANJI1 n • • • • • • HANGULEBCDIC933_1II SCHEBCDIC935_21J SDHANGULEBCDIC933_5II SDSCHEBCDIC935_6IJ SDTCHEBCDIC937_7IB TCHEBCDIC937_3IB • KANJISJIS • KANJI1 n UNICODE 3n+1 LATIN 2n GRAPHIC • 2n (record and indicator modes) • 2n+2 (field mode) Utilities Chapter 11: DBS Control (dbscontrol) ExternalAuthentication ExternalAuthentication Purpose The ExternalAuthentication field controls whether Teradata Database users can be authenticated outside (external) of the Teradata Database software authentication system. External authentication may eliminate the need for your application to declare or store a password on your client system. Usage Notes You should modify ExternalAuthentication before the Teradata Database or PDE starts. The following values apply to the Microsoft Windows gateway only and to channel connects to Microsoft Windows or MP-RAS-based servers. Value Description 0 (ON) External authentication sessions and traditional logons are accepted. 1 (OFF) External authentication sessions are rejected; traditional logons are accepted. 2 (ONLY) External authentication sessions are accepted; traditional logons are rejected. The default is 0 (On). The new setting becomes effective after the DBS Control Record has been written or applied. To define whether your application can use external authentication mode to allow a more automatic logon to eliminate the need for your application to declare or store a password on your client system, use the SET EXTAUTH command. For more information on the SET EXTAUTH command, see Graphical User Interfaces: Database Window and Teradata MultiTool. To configure how the network allows or disallows traditional and new external authentication logons, see the Gateway Control utility in Utilities. Utilities 273 Chapter 11: DBS Control (dbscontrol) HashFuncDBC HashFuncDBC Caution: You must use the System Initializer utility to modify this field. Using the System Initializer utility program destroys all user and dictionary data. Purpose The HashFuncDBC field defines the hashing function that the Teradata Database uses. Usage Notes The HashFuncDBC field assumes a value of 3, 4, or 5. The value 3 indicates Kanji, the value 4 indicates International, and the value 5 indicates Universal. The default is 5 (Universal). The Universal hash is the preferred hash. System Initializer automatically chooses the hash. 274 Utilities Chapter 11: DBS Control (dbscontrol) IdCol Batch Size IdCol Batch Size Purpose The IdCol Batch Size field indicates the size of a pool of numbers reserved by a vproc for generating numbers for a batch of rows to be bulk-inserted into a table with an identity column. Usage Notes When the initial batch of rows for a bulk insert arrives on a PE/AMP vproc, the following occurs: • First, a range of numbers is reserved before processing the rows. • Then, each PE/AMP retrieves the next available value for the identity column from the IdCol table. • Finally, each PE/AMP immediately updates this value with an increment equal to the IdCol Batch Size setting. The valid range of values is 1 to 1 million. The default is 100,000. The new setting becomes effective after the DBS Control Record has been written or applied. Note: The IdCol Batch Size field settings survive system restarts. Determining an Optimal Batch Size The IdCol Batch Size setting makes a trade-off between performance and numbering gaps that can occur in a restart. A larger setting might improve the performance of bulk-inserts into an identity column table, since there will be less updates of DBC.IdCol in reserving batches of numbers for a load. However, since the reserved numbers are kept in memory, unused numbers will be lost if a restart occurs. When setting the IdCol Batch Size, consider the following: • The data type of the identity column • The number of vprocs serving the bulk insert. Note: INSERT-SELECTs should base the IdCol Batch Size setting on the number of AMPS, while the other bulk inserts should base the IdCol Batch Size setting on the number of PEs. Utilities 275 Chapter 11: DBS Control (dbscontrol) IdCol Batch Size Example Assume an INTEGER identity column and a 100 AMP system. An INSERT SELECT application that can tolerate a loss of 1% of the total possible numbers of an INTEGER column should set the IdCol Batch Size setting at the following: 0.01 [risk tolerance] * (2 billion [range of INTEGER] / 100 [number of AMPs] ) = 200,000 Note: If the result of your calculation exceeds the maximum setting of 1 million, then select the maximum setting. 276 Utilities Chapter 11: DBS Control (dbscontrol) LockLogger LockLogger Purpose The LockLogger field defines the system default for the Locking Logger. Usage Notes This field allows you to log the delays caused by database locks to help identify lock conflicts. To enable this feature, set the field to TRUE. To disable the feature, set the field to FALSE. The default is FALSE. Note: If the LockLogger field is set to FALSE, then the settings for the LockLogger Delay Filter field, the LockLogger Delay Filter Time field, and the LockLogSegmentSize field are ignored. The new setting becomes effective after the next Teradata Database restart. For more information, see “Locking Logger Utility” in Utilities. Utilities 277 Chapter 11: DBS Control (dbscontrol) LockLogger Delay Filter LockLogger Delay Filter Purpose The LockLogger Delay Filter field controls whether or not to filter out blocked lock requests based on delay time. Usage Notes To enable this feature, set the field to TRUE. To disable the feature, set the field to FALSE. The default is FALSE. The new setting becomes effective after the DBS Control Record has been written or applied. Note: If the LockLogger field is set to FALSE, then the settings for the LockLogger Delay Filter field and the LockLogger Delay Filter Time field are ineffective. For more information, see “LockLogger” on page 277 and “LockLogger Delay Filter Time” on page 279 and “Locking Logger Utility” in Utilities. 278 Utilities Chapter 11: DBS Control (dbscontrol) LockLogger Delay Filter Time LockLogger Delay Filter Time Purpose The LockLogger Delay Filter Time field indicates the value at which blocked lock requests with a delay time greater than this value are logged. Usage Notes The valid range of values is 0 to 1,000,000 seconds. The default is 0 seconds. IF you set LockLogger Delay Filter Time to … THEN blocked lock requests with a delay of … 0 seconds 0 seconds would not be logged. 10 seconds 10 seconds or less would not be logged. 1,000,000 seconds 1,000,000 seconds or less would not be logged. The new setting becomes effective after the DBS Control Record has been written or applied. Note: The LockLogger Delay Filter Time field has a dependency on the Lock Logger Delay field and the LockLogger field. IF the LockLogger field is … THEN LockLogger Delay Filter Time field is … FALSE, and the LockLogger Delay Filter field is TRUE ineffective. TRUE, and the LockLogger Delay Filter field is FALSE ineffective. TRUE, and the LockLogger Delay Filter field is TRUE effective. For more information, see “LockLogger” on page 277, “LockLogger Delay Filter” on page 278, and “Locking Logger Utility” in Utilities. Utilities 279 Chapter 11: DBS Control (dbscontrol) LockLogSegmentSize LockLogSegmentSize Purpose The LockLogSegmentSize field specifies the size of the Locking Logger segment. Usage Notes This field allows you to control the size of the buffer that is used to store lock information. The valid range of values is 64 to 1024 KB. The default is 64 KB. The new setting becomes effective after the next Teradata Database restart. Note: If the LockLogger field is set to FALSE, then the setting for the LockLogSegmentSize field is ineffective. For more information, see “LockLogger” on page 277 and “Locking Logger Utility” in Utilities. 280 Utilities Chapter 11: DBS Control (dbscontrol) MaxDecimal MaxDecimal Purpose The MaxDecimal field defines the maximum number of decimal digits in the default maximum value used in expression typing. Usage Notes The default is 15 decimal digits. This value for MaxDecimal … Sets a default DECIMAL maximum size for expression evaluation to … 0 15. 15 15. 18 18. 38 38. The new setting becomes effective after the next Teradata Database restart. Note: After you perform a SYSINIT where SYSINIT re-initializes DBS Control, MaxDecimal is set to zero. For more information on DECIMAL, see “Decimal/Numeric Data Types” in SQL Reference: Data Types and Literals. Utilities 281 Chapter 11: DBS Control (dbscontrol) MaxLoadAWT MaxLoadAWT Purpose The MaxLoadAWT field specifies the combined number of AMP Worker Tasks (AWTs) that can be used by FastLoad and MultiLoad at any time. It allows more FastLoad, MultiLoad, and FastExport tasks (jobs) to run concurrently, and sets a limit on AWT usage to prevent excessive consumption or exhaustion of AWT resources. This field also acts as a “switch” on the function of MaxLoadTasks field: • When MaxLoadAWT set to zero, the number of load utilities that can run concurrently is controlled entirely by the MaxLoadTasks field. In this case, MaxLoadTasks specifies the maximum number of combined FastLoad, MutiLoad, and FastExport jobs that can run concurrently. • When MaxLoadAWT is set to an integer greater than zero, MaxLoadTasks applies only to the combined number of FastLoad and MultiLoad jobs, which are also limited by the MaxLoadAWT setting. In this case, the number of FastExport jobs that can run is always 60 minus the number of combined FastLoad and MultiLoad jobs currently running. Note: Throttle rules for load utility concurrency set by Teradata Dynamic Workload Manager override the MaxLoadAWT setting. For more information, see Teradata Dynamic Workload Manager User Guide. Usage Notes The default setting is zero. If MaxLoadAWT is set to a non-zero value, it should be a value greater than or equal to five, which allows at least one FastLoad and one MultiLoad job to run concurrently. The maximum allowable value is 60% of the total AWTs per AMP. By default, the maximum number of AWTs started for each AMP vproc is 80, so the default maximum value for MaxLoadAWT is 48. Consider using MultiLoad, rather than FastLoad, especially in cases of many small load jobs. MultiLoad generally consumes fewer AWTs per job than FastLoad. The MaxLoadAWT field works together with the MaxLoadTasks field to limit the number of concurrent load utilities allowed to run: • 282 If MaxLoadAWT is zero (the default): • MaxLoadTasks can be an integer from zero through 15. • The MaxLoadTasks field specifies the maximum number of combined FastLoad, MultiLoad, and FastExport jobs that can run concurrently. • The system does not consider the number of available AWTs when limiting the number of load utilities that can run concurrently. Utilities Chapter 11: DBS Control (dbscontrol) MaxLoadAWT • If MaxLoadAWT is greater than zero: • MaxLoadTasks can an integer from zero through 30. • The MaxLoadTasks field sets the maximum number of combined FastLoad and MultiLoad jobs that can run concurrently. MaxLoadTasks does not directly limit the number of FastExport jobs that can run. • The number of combined FastLoad and MultiLoad jobs that can run concurrently is limited by the values of both the MaxLoadTasks field and the MaxLoadAWT field. When either limit is met, no further FastLoad or MultiLoad jobs are allowed to start until the limiting factor is reduced. See “About AWTs” on page 283. • The maximum number of load utility jobs of any type—FastLoad, MultiLoad, or FastExport—that can run concurrently is 60. Consequently, the number of FastExport jobs allowed to run at any time is 60 minus the number of combined FastLoad and MultiLoad jobs that are running. For example, if the sum of currently running FastLoad and MultiLoad jobs is 29, the number of FastExport jobs that can be started is 31 (60 minus 29), regardless of the MaxLoadAWT and MaxLoadTasks settings. • If MaxLoadAWT is set to anything greater than zero, it can only be reset to zero if MaxLoadTasks is 15 or less. Because load utilities share system resources with other system work, such as tactical and DSS queries, limiting the number of load utility jobs can help ensure sufficient system resources are available for other work. New settings become effective after the DBS Control Record has been written. A system restart is not required. About AWTs AWTs are processes (threads on some platforms) dedicated to servicing the Teradata Database work requests. A fixed number of AWTs are pre-allocated during Teradata Database system initialization for each AMP vproc. Each AWT looks for a work request to arrive in the Teradata Database system, services the request, and then looks for another. An AWT can process requests of any work type. The number of AWTs required by FastLoad and MultiLoad changes as their jobs run. More AWTs are required in the early phases of the jobs than in the later phases. Teradata Database dynamically calculates the total AWTs required by active jobs, and allows more jobs to start as AWTs become available. If MaxLoadAWT is greater than zero, new FastLoad and MultiLoad jobs are rejected when the MaxLoadAWT limit is reached, regardless of the MaxLoadTasks setting. Therefore, FastLoad and MultiLoad jobs may be rejected before MaxLoadTasks limit is reached. Utilities 283 Chapter 11: DBS Control (dbscontrol) MaxLoadAWT Example FastLoad and MultiLoad require different numbers of AWTs at different phases of execution. The following table shows how many AWTs are used at each phase. Load Utility and Phase Number of AWTs Required FastLoad: Loading 3 FastLoad: End Loading 1 MultiLoad: Acquisition 2 MultiLoad: Application 1 per target table Assume that MaxLoadAWT = 48 and MaxLoadTasks = 30. The list below shows some permitted combinations of load utility jobs. The limiting condition(s) for each combination is shown in bold: 284 • 16 FastLoads in Loading phase 16 concurrent load tasks 48 AWTs in use: (16 x 3) • 9 FastLoads in Loading phase and 21 FastLoads in End Loading phase 30 concurrent load tasks 48 AWTs in use: (9 x 3) + (21 x 1) • 24 MultiLoads in Acquisition phase 24 concurrent load tasks 48 AWTs in use: 24 x 2 • 5 MultiLoads in Acquisition phase and 25 MultiLoads in Application phase 30 concurrent load tasks 35 AWTs in use: (5 X 2) + (25 x 1) • 6 FastLoads in Loading phase and 15 MultiLoads in Acquisition phase 21 concurrent load tasks 48 AWTs in use: (6 x 3) + (15 x 2) Utilities Chapter 11: DBS Control (dbscontrol) MaxLoadTasks MaxLoadTasks Purpose The MaxLoadTasks field specifies the combined number of FastLoad, MultiLoad, and FastExport tasks (jobs) that are allowed to run concurrently on Teradata Database. Note: Throttle rules for load utility concurrency set by Teradata Dynamic Workload Manager override the MaxLoadTasks setting. For more information, see Teradata Dynamic Workload Manager User Guide. Usage Notes The default is 5 tasks. If MaxLoadTasks is set to zero, no load utilities can be started. The MaxLoadTasks field works together with the MaxLoadAWT field to limit the number of concurrent load utilities allowed to run: • • If MaxLoadAWT is zero (the default): • MaxLoadTasks can be an integer from zero through 15. • The MaxLoadTasks field specifies the maximum number of combined FastLoad, MultiLoad, and FastExport jobs that can run concurrently. • The system does not consider the number of available AWTs when limiting the number of load utilities that can run concurrently. If MaxLoadAWT is greater than zero: • MaxLoadTasks is an integer from zero through 30. • The MaxLoadTasks field sets the maximum number of combined FastLoad and MultiLoad jobs that can run concurrently. MaxLoadTasks does not directly limit the number of FastExport jobs that can run. • The number of combined FastLoad and MultiLoad jobs that can run concurrently is limited by the values of both the MaxLoadTasks field and the MaxLoadAWT field. When either limit is met, no further FastLoad or MultiLoad jobs are allowed to start until the limiting factor is reduced. See “About AWTs” on page 283. • The maximum number of load utility jobs of any type—FastLoad, MultiLoad, or FastExport—that can run concurrently is 60. Consequently, the number of FastExport jobs allowed to run at any time is 60 minus the number of combined FastLoad and MultiLoad jobs that are running. For example, if the sum of currently running FastLoad and MultiLoad jobs is 29, the number of FastExport jobs that can be started is 31 (60 minus 29), regardless of the MaxLoadAWT and MaxLoadTasks settings. • Utilities If MaxLoadAWT is set to anything greater than zero, it can only be reset to zero if MaxLoadTasks is 15 or less. 285 Chapter 11: DBS Control (dbscontrol) MaxLoadTasks New settings become effective after the DBS Control Record has been written. A system restart is not required. About AWTs AMP Worker Tasks (AWTs) are processes (threads on some platforms) dedicated to servicing the Teradata Database work requests. A fixed number of AWTs are pre-allocated during Teradata Database system initialization for each AMP vproc. Each AWT looks for a work request to arrive in the Teradata Database system, services the request, and then looks for another. An AWT can process requests of any work type. The number of AWTs required by FastLoad and MultiLoad changes as their jobs run. More AWTs are required in the early phases of the jobs than in the later phases. Teradata Database dynamically calculates the total AWTs required by active jobs, and allows more jobs to start as AWTs become available. If MaxLoadAWT is greater than zero, new FastLoad and MultiLoad jobs are rejected when the MaxLoadAWT limit is reached, regardless of the MaxLoadTasks setting. Therefore, FastLoad and MultiLoad jobs may be rejected before MaxLoadTasks limit is reached. Example FastLoad and MultiLoad require different numbers of AWTs at different phases of execution. The following table shows how many AWTs are used at each phase. Load Utility and Phase Number of AWTs Required FastLoad: Loading 3 FastLoad: End Loading 1 MultiLoad: Acquisition 2 MultiLoad: Application 1 per target table Assume that MaxLoadAWT = 48 and MaxLoadTasks = 30. The list below shows some permitted combinations of load utility jobs. The limiting condition for each combination is shown in bold: 286 • 16 FastLoads in Loading phase 16 concurrent load tasks 48 AWTs in use: (16 x 3) • 9 FastLoads in Loading phase and 21 FastLoads in End Loading phase 30 concurrent load tasks 48 AWTs in use: (9 x 3) + (21 x 1) • 24 MultiLoads in Acquisition phase 24 concurrent load tasks 48 AWTs in use: 24 x 2 Utilities Chapter 11: DBS Control (dbscontrol) MaxLoadTasks Utilities • 5 MultiLoads in Acquisition phase and 25 MultiLoads in Application phase 30 concurrent load tasks 35 AWTs in use: (5 X 2) + (25 x 1) • 6 FastLoads in Loading phase and 15 MultiLoads in Acquisition phase 21 concurrent load tasks 48 AWTs in use: (6 x 3) + (15 x 2) 287 Chapter 11: DBS Control (dbscontrol) MDS Is Enabled MDS Is Enabled Purpose The MDS Is Enabled field specifies the following: • Whether or not the Relay Services Gateway (RSG) component of Metadata Services (MDS) should start when the RSG starts. • Whether or not logging database names to the DBC.MDSRecoveryTbl is needed when MDS is down. Usage Notes The default is FALSE. The following rules apply: IF this field is enabled on … THEN the executable file named rsgmain must exist in the … Linux /usr/rsg/bin directory. MP-RAS /rsg/bin directory. Windows \Program Files\NCR\Tdat\LRSG\bin directory. Note: If the rsgmain executable file does not exist, and the MDS is Enabled field is set to TRUE, then the RSG component of MDS will not start. After you install MDS, set the MDS Is Enabled field to TRUE, and MDS is running on a system, you should not disable the MDS Is Enabled field unless you want to stop MDS and do not want to use it any longer. If you only want to temporarily disable MDS by shutting it down and bringing it back up, then run the following commands: On … Run the … MP-RAS /etc/init.d/mdsgwy stop command. Windows stop the DDL Gateway service. The new setting becomes effective after the next Teradata Database restart. Note: This functionality is not available on Linux. For more details on how the MDS Is Enabled field is used, please refer to the Metadata Services documentation. 288 Utilities Chapter 11: DBS Control (dbscontrol) Memory Limit Per Transaction Memory Limit Per Transaction Purpose The Memory Limit Per Transaction field specifies the maximum amount of in-memory, temporary storage that the Relay Services Gateway (RSG) can use to store the records for one transaction. Usage Notes If the transaction exhausts this amount, the transaction data moves to a disk (or spill) file. This limit prevents a few, large transaction from swamping the memory pool. The valid range of values is 0 to 127 pages. The default is two pages. The new setting becomes effective after the next Teradata Database restart. Utilities 289 Chapter 11: DBS Control (dbscontrol) MLoadDiscardDupRowUPI MLoadDiscardDupRowUPI Purpose Determines whether the DBS MultiLoad protocol will silently discard rows with UPI violations, or log these rows to the MultiLoad application error table. Field Group General Valid Settings Setting Effect TRUE MultiLoad logs rows with UPI violations to the application error table. FALSE MultiLoad silently discards rows with UPI violations, and does not log these rows to the application error table. Default FALSE Changes Take Effect When the DBS Control changes are written or applied. Usage Notes This setting is effective only when IGNORE DUPLICATE ROWS is specified for the MultiLoad DML LABEL command. The MultiLoad application error table normally receives information about errors detected during the application phase of the MultiLoad import or delete task. It provides information about: • Uniqueness violations • Field overflow on columns other than primary index fields • Constraint errors. Related Topics For more information about Teradata MultiLoad, see Teradata MultiLoad Reference. 290 Utilities Chapter 11: DBS Control (dbscontrol) MonSesCPUNormalization MonSesCPUNormalization Purpose The MonSesCPUNormalization field controls whether normalized or non-normalized statistical CPU data is reported in the responses to workload management API calls. API calls that return CPU data include MONITOR SESSION (PM/API), MonitorSession (open API), and MonitorMySessions (open API). “Coexistent” Teradata Database systems combine different types of node hardware that might use different types of CPUs running at different speeds. CPU normalization adjusts for these differences when calculating statistics across the system. Although normalized CPU data is used in other areas of the system, such as DBQL and AMPusage, the MonSesCPUNormalization field affects only the CPU data reported by PM/API and open API calls. Usage Notes The default for this field is FALSE, meaning CPU statistical data in the responses to workload management API calls is not normalized. Changes to this field take effect when DBS Control changes are written to the DBS Control GDO. Use the following procedure to change the MonSesCPUNormalization setting: 1 Disable Teradata Dynamic Workload Manager workload rules. 2 Teradata Dynamic Workload Manager Category 3 rules (workloads) use MONITOR SESSION to obtain CPU information. Adjust any CPU-related exception thresholds associated with the workloads to account for the change in CPU data normalization. 3 Disable session monitoring either from Database Window, using the SET SESSION COLLECTION command, or from Teradata Manager. 4 Change the MonSesCPUNormalization field in DBS Control. 5 Re-enable session monitoring. 6 Re-enable workload rules again in Teradata Dynamic Workload Manger. The AMPCPUSec field in the response to workload management API calls contains accumulated CPU seconds for all requests in the session. If the value of MonSesCPUNormalization changes in the middle of a session, AMPCPUSec will no longer be valid during the current session, and will return -1 in record mode, or NULL in indicator mode. All other CPU fields are valid, even if MonSesCPUNormalization changes in the middle of a session. Utilities 291 Chapter 11: DBS Control (dbscontrol) MonSesCPUNormalization For more information about Teradata Dynamic Workload Manager and Teradata Database APIs, see Teradata Dynamic Workload Manager User Guide, Workload Management API: PM/ API and Open API, and Performance Management. 292 Utilities Chapter 11: DBS Control (dbscontrol) MPS_IncludePEOnlyNodes MPS_IncludePEOnlyNodes Purpose Excludes PE-only (AMP-less) nodes from MONITOR PHYSICAL SUMMARY Workload Management API statistics calculations. Field Group General Valid Settings Setting Effect FALSE PE-only nodes are excluded from calculations. TRUE PE-only nodes are included in calculations. Default FALSE Changes Take Effect When DBS Control changes are written to the DBS Control GDO Related Topics MONITOR PHYSICAL SUMMARY collects statistical system information which includes average, high, and low CPU and disk usage per node. It can be used to determine node level system skew. Some sites use PE-only nodes to aid in balancing the AMP workload. Because PE-only nodes are likely to experience substantially lower CPU and disk usage than nodes running AMPs, they can cause the node statistics to appear as if there is a data skew condition when no such condition exists. In these cases, excluding PE-only nodes provides statistics that more accurately represent the true system workload conditions. For more information about Teradata Database APIs, see Workload Management API: PM/API and Open API. Utilities 293 Chapter 11: DBS Control (dbscontrol) NewHashBucketSize NewHashBucketSize Purpose The NewHashBucketSize field specifies the number of bits that will be used by the system to identify hash buckets after the next system initialization or reconfiguration. This setting determines how many hash buckets the system can create. A setting of 16 bits gives Teradata Database 65,536 hash buckets; a setting of 20 bits gives Teradata Database 1,048,576 hash buckets. One goal of the Teradata Database parallel system is to distribute work evenly among the system resources (nodes, virtual processes, and storage). The number of hash buckets an AMP vproc uses is directly related to the amount of work an AMP must do. AMPs with more hash buckets manage more data, and therefore do more work than those with fewer hash buckets. On many systems, the number of AMPs is not evenly divisible into the number of available hash buckets. Consequently, some AMPs have one more hash bucket than other AMPs. If the number of hash buckets per AMP is relatively high, the imbalance is proportionately low, and the difference in the amount of work the AMPs must do is relatively small. However, as the number of AMPs is increased on the system, the hash buckets available to each AMP decreases. With fewer hash buckets per AMP, the effect of any imbalance in the number of hash buckets per AMP becomes proportionately greater. This results in the system operating less efficiently. For example, an AMP using 656 hash buckets must do 1/656 or 0.15% more work than an AMP using 655 hash buckets, but an AMP using only 66 hash buckets must do 1/66 or 1.52% more work than an AMP using 65 hash buckets. Making more hash buckets available to the system and to each AMP reduces the effects of the imbalance when some AMPs have one more hash bucket than others. Usage Notes Valid values for NewHashBucketSize are 16 and 20 bits. New installations of Teradata Database 12.0 default to 20 bits. Systems upgraded from earlier versions of Teradata Database default to 16 bits. The new setting becomes effective after the next sysinit or reconfig. See also “CurHashBucketSize” on page 256. 294 Utilities Chapter 11: DBS Control (dbscontrol) ObjectUseCountCollectRate ObjectUseCountCollectRate Warning: Do not enable this feature if you are performing a Dump/Restore on the Data Dictionary. Purpose The ObjectUseCountCollectRate field specifies the amount of time (in minutes) between collections of object use-count data. The system updates the AccessCount and LastAccessTimeStamp columns of the Data Dictionary with this data. Usage Notes This field allows you to find the use count and last access timestamps of any of the following database objects: • Columns • Databases • Indexes • Macros • Stored Procedures • Tables • Triggers • UDFs • Users • Views Note: Object use-count data is not recorded for EXPLAIN, INSERT EXPLAIN, or DUMP EXPLAIN. Utilities 295 Chapter 11: DBS Control (dbscontrol) ObjectUseCountCollectRate The following table lists the value options and effects. IF you set the ObjectUseCountCollectRate field to... THEN... a negative value an error message is displayed. 0 object use-count data collection is disabled. This is the default. an integer between 1 and 32767 object use-count data collection is enabled, and the Data Dictionary fields AccessCount and LastAccessTimeStamp are updated based on that set value. Note: If you specify a decimal value, DBS Control ignores the fractional part and uses only the integer part. For example, if you specify 12.34, DBS Control uses 12 for the field value and ignores .34. Warning: The recommended minimum value is 10 minutes. Any rate below 10 minutes severely impacts performance. a value higher than 32767 DBS Control displays a warning message. The default is zero (minutes), which means that the feature is disabled. The new setting becomes effective after the DBS Control Record has been written or applied. 296 For information on … See … the AccessCount and LastAccessTimeStamp Data Dictionary columns “Systems Views” in Data Dictionary. resetting the AccessCount and LastAccessTimeStamp Data Dictionary columns “Tools for Managing Resources” in Database Administration. Utilities Chapter 11: DBS Control (dbscontrol) RollbackPriority RollbackPriority Caution: This feature affects all users on the system. Purpose The RollbackPriority field determines the priority given to rollback operations. For more information on how Teradata Database determines job priorities, see the Priority Scheduler chapter in Utilities. Usage Notes The following settings are available. Setting Effect TRUE Rollback is at original job’s priority. Note: Teradata recommends RollbackPriority be set to TRUE for most situations. Rollback processing for any job (SQL statement) has the same priority and is controlled by the same Performance Group as the original job had. The rollback does not affect system performance (CPU and I/O allocation). However, because the rollback maintains the same locks on the tables that were placed by the original job that is being rolled back, the rollback operation may cause other jobs to wait until the locks are released, depending on the lock level requested for those jobs. If the rollback is executing under a CPU limit, a potential for the rollback to exceed the CPU limit exists. In this case, the rollback will run at the priority of the Allocation Group but will not be capped in its CPU usage whether the CPU limit is at the Allocation Group, Resource Partition, or System level. Other work that is not undergoing a rollback will still be capped in CPU usage. Utilities 297 Chapter 11: DBS Control (dbscontrol) RollbackPriority Setting Effect FALSE Rollback is at system priority, a super-high priority that is reserved for critical internal work. This is the default. Note: Teradata recommends RollbackPriority be set to TRUE for most situations. As a result, faster rollbacks occur at the expense of other online performance. With the typical Priority Scheduler configuration, rollbacks execute at the highest priority. However, rollbacks also will put more work in the default partition, contending with other work executing there. Set RollbackPriority to FALSE only if the system has many applications that operate in read consistency mode (READ LOCKS) with many concurrent, short update processes and the locks on the tables need to be released as soon as possible. The new setting becomes effective after the next Teradata Database restart. Note: RollbackPriority only affects individual rollbacks resulting from aborted sessions. It does not affect rollbacks resulting from a Teradata Database restart. The rollback priority of a complete transient journal (TJ) rollback resulting from a restart is based on a setting in the Recovery Manager (rcvmanager) utility. You can change this setting from rcvmanager at any time, even if there is no system rollback underway. You can also change the priority from rcvmanager while a complete TJ rollback is underway, in which case the tasks working on the rollback will have their priorities changed immediately. For more information see the Recovery Manager chapter of Utilities. RollbackPriority … Rollbacks resulting from … affects individual aborted sessions by: • a user • the database administrator • Teradata Database does not affect a Teradata Database restart. Rollbacks A rollback is a reversal of an incomplete database transaction. If a transaction fails to complete because the database restarts or the transaction job is aborted, any partially completed database updates must be removed from the affected user tables to ensure data integrity. Teradata Database maintains transaction integrity via the transient journal (TJ), the table dbc.transientjournal. The TJ contains data about incomplete transactions. If an SQL command is updating 1000 rows and is aborted after only 500 rows are updated, Teradata Database uses information from the TJ to undo the 500 row updates that were written to the 298 Utilities Chapter 11: DBS Control (dbscontrol) RollbackPriority database. This is called a rollback. At the end of the rollback, the database is returned to the state it was in before the transaction. Rollback Priority and Performance Because a rollback conceivably can involve millions or billions of rows, a rollback can affect the performance and availability of resources in the Teradata Database while the rollback is in progress. The rollback will impact the performance of the system because the rollback competes for CPU resources with other users. In addition, a rollback can keep locks on affected tables for hours or days until the rollback is complete. During a rollback, a trade-off occurs between overall system performance versus table availability. How RollbackPriority affects performance is not always straightforward and is related to the Priority Scheduler configuration, job mix, and other processing dynamics. For more information on Priority Scheduler, see the Priority Scheduler chapter of Utilities. Utilities 299 Chapter 11: DBS Control (dbscontrol) RollbackRSTransaction RollbackRSTransaction Purpose The RollbackRSTransaction field is used when a subscriber-replicated transaction and a user transaction are involved in a deadlock. Usage Notes To enable this feature, set the field to TRUE, which means to rollback the subscriber-replicated transaction. To disable this feature, set the field to FALSE, which means rollback the user transaction. The default is FALSE. The new setting becomes effective after the next Teradata Database restart. 300 Utilities Chapter 11: DBS Control (dbscontrol) RollForwardLock RollForwardLock Caution: This feature affects all users on the system. Purpose The RollForwardLock field defines the system default for the RollForward using Row Hash Locks option. Usage Notes This allows the database administrator to specify that Row Hash Locks should be used to lock the target table rows during a RollForward. To enable this feature, set the field to TRUE. To disable the feature, set the field to FALSE. The default is FALSE. The new setting becomes effective after the next Teradata Database restart. Utilities 301 Chapter 11: DBS Control (dbscontrol) RoundHalfwayMagUp RoundHalfwayMagUp Purpose The RoundHalfwayMagUp field indicates how rounding should be performed when computing values of DECIMAL type. A halfway value is exactly halfway between representable decimal values. Usage Notes The rounding behavior is different depending upon the setting of the RoundHalfwayMagUp field. IF you set the field to … THEN the Teradata Database system uses the rounding semantics … TRUE appropriate for many business applications: The magnitudes of halfway values are rounded up. Halfway values are rounded away from zero so that positive halfway values are rounded up and negative halfway values are rounded down (toward negative infinity). For example, a value of 2.5 is rounded to 3. FALSE traditional for Teradata Database: A halfway value is rounded up or down so that the least significant digit is even. For example, a value of 2.5 is rounded to 2. The default is FALSE. The new setting becomes effective after the next Teradata Database restart. 302 Utilities Chapter 11: DBS Control (dbscontrol) RSDeadLockInterval RSDeadLockInterval Purpose The RSDeadLockInterval field is used to check for deadlocks between subscriber-replicated transactions and user transactions. Usage Notes Deadlock checking between subscriber-replicated transactions and user transactions only occurs if the system is configured with RSG vprocs and if Relay Services Gateway is up. If the interval is set to 0, then the DeadlockTimeOut value is used. The valid range of values is 0 to 3600 seconds. The default is 0 (240). Note: The deadlock detection interval is in seconds. Utilities On … The new setting becomes effective after the … Linux DBS Control Record has been applied. MP-RAS next Teradata Database restart. Windows DBS Control Record has been applied. 303 Chapter 11: DBS Control (dbscontrol) SessionMode SessionMode Purpose The SessionMode field defines the Teradata Database system default transaction mode, case sensitivity, and character truncation rule for a session. Usage Notes The setting is either 0 (Teradata) or 1 (ANSI): The setting … Defaults SQL sessions to … 0 Teradata Database transaction semantics, case insensitive data, and no error reporting on truncation of character data. 1 ANSI transaction semantics, case sensitive data, and error reporting on truncation of character data. The default is 0. The default can be overridden at the user or session level (at logon). The new setting becomes effective after the next Teradata Database restart. 304 Utilities Chapter 11: DBS Control (dbscontrol) Spill File Path Spill File Path Purpose The Spill File Path field specifies a directory that the Relay Services Gateway (RSG) can use for spill files. Usage Notes The valid range of values is any existing path. The defaults are as follows: IF your platform is … THEN your default directory is … Linux /opt/teradata/tdat/temp/tdrsg. MP-RAS /var/tdrsg. Windows tdrsg, which is a relative path. You can specify a relative path, which is interpreted as relative to the tdtemp directory. The new setting becomes effective after the next Teradata Database restart. Utilities 305 Chapter 11: DBS Control (dbscontrol) SysInit SysInit Purpose Caution: You must use the System Initializer utility to modify this field. Using the System Initializer utility program destroys all user and dictionary data. The SysInit field is used to ensure the system has been initialized properly using the System Initializer utility. Usage Notes The default is FALSE. Upon successful completion, the System Initializer utility sets this field to TRUE. This flag must be TRUE for Teradata Database startup to begin. When SysInit is TRUE, the SysInit timestamp displays the year, month, day, hour and minute in a yyyy-mm-dd hh:mi format, if available. The following table describes when the timestamp will appear. 306 For a Teradata Database system that is upgraded … The SysInit field displays … without SysInit SysInit = TRUE (time unknown). with an unsuccessful SysInit SysInit = FALSE. with a successful SysInit SysInit = TRUE (2003-09-12 10:22). Utilities Chapter 11: DBS Control (dbscontrol) System TimeZone Hour System TimeZone Hour Purpose The System TimeZone Hour field defines the System Time Zone Hour offset from Universal Coordinated Time (UTC). Usage Notes The range is -12 to 13. The default is 0. The new setting takes effect for new sessions begun after the DBS Control Record has been written. Existing sessions are not affected. Utilities 307 Chapter 11: DBS Control (dbscontrol) System TimeZone Minute System TimeZone Minute Purpose The System TimeZone Minute field defines the System Time Zone Minute offset from Universal Coordinated Time (UTC). Usage Notes The range is -59 to 59. The default is 0. The new setting takes effect for new sessions begun after the DBS Control Record has been written. Existing sessions are not affected. 308 Utilities Chapter 11: DBS Control (dbscontrol) Target Level Emulation Target Level Emulation Note: Teradata does not recommend enabling Target Level Emulation on a production system. Purpose The Target Level Emulation feature is a set of DIAGNOSTIC SQL statements in the database server to set cost information. The Target Level Emulation field allows field test engineers to set the costing parameters considered by the optimizer for the system. Usage Notes To enable this feature, set the field to TRUE. To disable the feature, set the field to FALSE. The default is FALSE. When Target Level Emulation is disabled, the DIAGNOSTIC SET COSTS statement will not be accepted. (An error is reported.) The DIAGNOSTIC DUMP COSTS statement can be executed when the feature is disabled. The new setting becomes effective after the DBS Control Record has been written or applied. For more information, see “Target Level Emulation” in SQL Reference: Fundamentals. Utilities 309 Chapter 11: DBS Control (dbscontrol) Temporary Storage Page Size Temporary Storage Page Size Purpose The Temporary storage page size field specifies the memory allocation granule for RSG temporary storage. Usage Notes If a transaction contains any record that exceeds the page size, then the entire transaction is spilled to disk. Pages are not shared between transactions, so if you increase the page size, you may cause a decrease in storage utilization efficiency. The valid range of values is 1 to 1024KB. The default is 4KB (4096). The new setting becomes effective after the next Teradata Database restart. 310 Utilities Chapter 11: DBS Control (dbscontrol) UseVirtualSysDefault UseVirtualSysDefault Note: This field is no longer used, and no longer influences system cost profile selection. Please refer to “CostProfileId” on page 253. Utilities 311 Chapter 11: DBS Control (dbscontrol) Version Version Caution: You must use the System Initializer utility to modify this field. Using the System Initializer utility program destroys all user and dictionary data. Purpose The Version field indicates the version number of the DBS Control Record. Usage Notes The Version field is incremented by one when the DBS Control Record must be migrated to a new format. The valid range of values is 1 ... MAXLONGINT. The default is 4. File System Fields The following table lists the DBS Control Record fields that are specific to the File System. 312 Field Description Cylinders Saved for PERM Saves some number of cylinders for permanent data only. DefragLowCylProd Determines the number of free cylinders below which cylinder defragmentation can begin. DisableWAL Forces the writing of data blocks and cylinder indexes directly to disk rather than writing the changes to the WAL log. DisableWALforDBs Forces data blocks to be written directly to disk rather than having the changes written to the WAL log. FreeSpacePercent Determines the percentage of free space reserved on cylinders during bulk load operations. JournalDBSize Determines the maximum size of transient journal and permanent journal table multi-row data blocks in 512-byte sectors. LargeDepotCylsPerPdisk Determines the number of depot cylinders the file system allocates per pdisk (storage device) to contain large slots (512 KB). MaxSyncWALWrites Determines the maximum number of outstanding WAL log writes to allow before tasks requiring synchronous writes are delayed to achieve better buffering. Utilities Chapter 11: DBS Control (dbscontrol) File System Fields Field Description MiniCylPackLowCylProd Determines the number of free cylinders below which the File System will start to perform the MiniCylPacks operation in anticipation of the need for additional free cylinders. PermDBAllocUnit Determines the allocation unit for multi-row data blocks in units of 512-byte sectors for permanent tables. PermDBSize Determines the maximum size, in consecutive 512-byte sectors, of the multi-row data blocks of a permanent table. SmallDepotCylsPerPdisk Determines the number of depot cylinders the file system allocates per pdisk (storage device) to contain small slots (128 KB).. WAL Buffers Determines the number of WAL append buffers to allocate. WAL Checkpoint Interval Determines the amount of time that elapses between WAL checkpoints. The fields are discussed in detail in the following sections. Utilities 313 Chapter 11: DBS Control (dbscontrol) Cylinders Saved for PERM Cylinders Saved for PERM Purpose The Cylinders Saved for PERM field is used to save X number of cylinders for permanent data only. Usage Notes Cylinders are one of the following: • Free • Perm • Spool • Temp Requests for a new perm cylinder compete with requests for a new spool or temp cylinder. These requests are satisfied from the pool of free cylinders. If no cylinders are free when a request for either a new spool or temp or perm cylinder is issued, the request fails with a disk full error. The Save for Perm GDO reserves X cylinders for perm only. If X is 10, requests for a new spool or temp cylinder will fail unless the number of free cylinders is greater than 10. Requests for a new perm cylinder will not fail until the number of free cylinders is less than one. As a result, requests requiring more spool or temp space fail sooner than requests requiring more perm space. IF requests requiring more … THEN … spool or temp space fail usually very little rollback is needed. perm space fail often a lengthy rollback can occur, which can have a negative effect on overall system performance. If the number of free cylinders falls below this value, any allocation of cylinders for spool or temp data results in an abort of the requesting transaction. The valid range of values is 1 to 65535 cylinders. The default is 10 cylinders. The new setting becomes effective after the DBS Control Record has been written or applied. 314 Utilities Chapter 11: DBS Control (dbscontrol) DefragLowCylProd DefragLowCylProd Purpose The DefragLowCylProd field is used to determine the number of free cylinders below which cylinder defragmentation can begin. Usage Notes A cylinder becomes fragmented when its free sector list contains many groups of small numbers of consecutive sectors. In this case, a large number of free sectors can exist, but not enough consecutive sectors exist to allocate a new data block. Defragmentation groups all the free sectors on an individual cylinder into a single consecutive block of sectors. This requires the packing of data blocks from the fragmented cylinder onto a new cylinder. To keep costs to a minimum, defragmentation is enabled only when the free cylinder count falls below the current value in the DefragLowCylProd field. A low value in this field reduces the performance impact of defragmentation. However, setting the value extremely low might cause cylinders to be consumed more quickly, which could cause more minicylpacks to run. Setting this field to a value of 0 (zero) disables defragmentation. In this case, the lack of enough adjacent sectors to allocate a data block causes a new cylinder to be allocated. The disadvantage of this approach is that free cylinders are a critical resource, and when no free cylinders remain, minicylpacks begin. The valid range of values is 0 to 100 free cylinders. The default is 100 free cylinders. The operation is performed in the background. The new setting becomes effective after the DBS Control Record has been written or applied. Utilities 315 Chapter 11: DBS Control (dbscontrol) DisableWAL DisableWAL Purpose The DisableWAL field is used to force data blocks and cylinder indexes to be written directly to disk rather than to the Write Ahead Logging (WAL) log. Usage Notes The default value is FALSE. If set to FALSE, changes to the file system data are written to the WAL log and cached in memory, or are written to disk, depending on the specific operation. If set to TRUE, the changed file system blocks are always written directly to disk. This includes writing changed cylinder index blocks to disk. Data blocks inserted by the MultiLoad utility are always written to disk regardless of the DisableWAL field setting. The DisableWAL field writes both data blocks and cylinder index changes to disk, whereas the DisableWALforDBs field writes only the data blocks to disk. For more information, see “DisableWALforDBs” on page 317. The new setting becomes effective after the DBS Control Record has been written or applied. For more information on DisableWAL, see “ctl Utility” and “xctl Utility” in Utilities. 316 Utilities Chapter 11: DBS Control (dbscontrol) DisableWALforDBs DisableWALforDBs Purpose The DisableWALforDBs field is used to force data blocks to be written directly to disk rather than to the Write Ahead Logging (WAL) log. Usage Notes The default value is FALSE. If set to FALSE, changes to user table data blocks are written to the WAL log and cached in memory, or are written to disk, depending on the specific operation. If set to TRUE, the changed user table data blocks are always written directly to disk. The DisableWALforDBs field writes only the data blocks to disk, whereas the DisableWAL field writes both data blocks and cylinder index changes to disk. For more information, see “DisableWAL” on page 316. The new setting becomes effective after the DBS Control Record has been written or applied. Utilities 317 Chapter 11: DBS Control (dbscontrol) FreeSpacePercent FreeSpacePercent Purpose The value in the FreeSpacePercent (FSP) field specifies the amount of space on each cylinder that is to be left unused during the following operations: • • Utility operations: • FastLoad and MultiLoad • Archive/Recovery RESTORE • Table Rebuild • Reconfiguration • Ferret PACKDISK Teradata SQL operations: • An ALTER TABLE that adds fallback protection. • A CREATE INDEX that defines or redefines any type of secondary index on a populated table. • Fallback creation during an INSERT...SELECT into an empty table that is defined with fallback protection. • Index creation during an INSERT...SELECT into an empty table that is defined with any type of secondary index. The reserved free space allows table data to expand on current table cylinders, preventing or delaying the need for additional table cylinders to be allocated and associated data migration operations. Keeping new table data physically close to existing table data, and avoiding data migrations, can improve overall system performance. Usage Notes The valid range of values is 0 to 75 percent. The default is 0 percent. A new setting becomes effective after the DBS Control Record has been written or applied, and during the next data load operation. Any operations in progress are not affected. Note: After setting a non-zero value for the free space percentage, all subsequent operations listed above will respect that setting, and will continue to reserve free space beyond what table data requires. In order to have Teradata Database utilize the reserved free space for data storage and avoid data migrations, the free space percentage must be reduced after the initial data is loaded. Free space percentage also can be specified for individual tables by using the FREESPACE option to the CREATE TABLE and ALTER TABLE SQL statements. The free space percent specified for individual tables takes precedence over the setting in the FreeSpacePercent field. Changes to the FreeSpacePercent field will not affect these tables. To change the free space 318 Utilities Chapter 11: DBS Control (dbscontrol) FreeSpacePercent percentage of these tables, use ALTER TABLE. For more information on CREATE TABLE and ALTER TABLE, see SQL Reference: Data Definition Statements. Carefully consider the performance impact of long-term growth against short-term needs before changing the global default value. Evaluating a Higher Global FSP Free space is allocated dynamically when a table expands as a result of UPDATE operations or during INSERT operations. If some space is left free during the initial load, the need for subsequent migrations is reduced. If most of your tables will grow extensively, use a higher FSP value to achieve the best performance. However, if the percentage is too high, additional cylinders might be required to store the data. For example, if you specify an FSP of 25%, a table that would otherwise fit on 100 cylinders would require 134 cylinders. If you specify an FSP of 75%, the same table would require 400 cylinders. Make sure that the requisite cylinders are available. If they are not, minicylinder packs might run, which can result in some performance degradation. Evaluating a Lower Global FSP If little or no table expansion is expected, the lowest value (0%) should remain as the global default. Any non-zero value for FreeSpacePercent causes tables to occupy more cylinders than are absolutely necessary for table data. The extra space cannot be reclaimed until one of the following occurs: • The Ferret utility is used to initiate PACKDISK on a table. • Minicylinder packs are performed due to a lack of available cylinders. • Operations that do not honor the FreeSpacePercent setting are used to modify the table. Evaluating Global Versus Table-Level FSP If many tables benefit from one FSP value and a few tables benefit from a different value, consider setting the FSP at the table level for the exceptions. For more information on the CREATE TABLE and ALTER TABLE statements, see “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. Utilities 319 Chapter 11: DBS Control (dbscontrol) JournalDBSize JournalDBSize Purpose The JournalDBSize field is used to determine the maximum size of permanent journal table multi-row data blocks in 512-byte sectors. Rows are written to this journal during INSERT, UPDATE, and DELETE processing. Usage Notes The valid range of values is 12 to 255 sectors. The default is 12 sectors. Changing this setting may affect system performance. The new setting becomes effective after the DBS Control Record has been written or applied. Note: The PermDBSize and JournalDBSize fields set the maximum multi-row block size. A row that exceeds the current default size of a multi-row data block is put into a block of its own. 320 Utilities Chapter 11: DBS Control (dbscontrol) LargeDepotCylsPerPdisk LargeDepotCylsPerPdisk Purpose Determines the number of depot cylinders the file system allocates per pdisk (storage device) to contain large slots (512 KB). A large slot can hold several data blocks (DBs) during depot operations. The actual number of large-depot cylinders used per AMP is this value multiplied by the number of pdisks per AMP. Field Group File System Valid Range 0 through 10 Default 1 cylinder Changes Take Effect After the next Teradata Database restart Usage Notes The Depot is a set of transitional storage locations (a number of cylinders) used by the file system for performing in-place writes of DBs or WAL DBs (WDBs). An in-place write means that the changed DB is written back to exactly the same place on disk from which it was originally read. In-place writes are only performed for modifications to DBs that do not change the size of table rows, and therefore do not require any reallocation of space. Writing the changed DB directly back to its original disk location could leave the data vulnerable to various hardware and system problems that can occur during system resets, such as a disk controller malfunctions or power failures. If such a problem occurred during the write operation, the data could be irretrievably lost. The Depot protects against such data loss by allowing the file system to perform disk writes in two stages. First the changed DB (or WDB) is written to the Depot. After the data has been completely written to the Depot, it is written to its permanent location on the disk. If there is a problem while the data is being written to the Depot, the original data is still safe in its permanent disk location. If there is a problem while the data is being written to its permanent location, the changed data is still safe in the Depot. During database startup, the Depot is Utilities 321 Chapter 11: DBS Control (dbscontrol) LargeDepotCylsPerPdisk examined to determine if any of the DBs or WDBs should be rewritten from the Depot to their permanent disk locations. 322 Utilities Chapter 11: DBS Control (dbscontrol) MaxSyncWALWrites MaxSyncWALWrites Purpose The MaxSyncWALWrites field determines the maximum number of outstanding WAL log writes to allow before tasks requiring synchronous writes are delayed to achieve better buffering. Usage Notes The default value is 5. The minimum allowable value is 1, the maximum is 40. If the number of outstanding WAL log writes is less than or equal to the MaxSyncWALWrites value, requests for synchronous operations will append the record to the current buffer, force a new buffer, and issue a synchronous write on the current buffer. If the number of outstanding writes is greater than the MaxSyncWALWrites value, the record will be appended, but the write will be delayed until one of the outstanding write requests is completed. The new setting becomes effective after the next Teradata Database restart. Utilities 323 Chapter 11: DBS Control (dbscontrol) MiniCylPackLowCylProd MiniCylPackLowCylProd Purpose The MiniCylPackLowCylProd field is used to determine the number of free cylinders below which the File System will start to perform a MiniCylPacks operation in anticipation of the need for additional free cylinders. Usage Notes A MiniCylPacks operation attempts to free additional cylinders by packing cylinders that are currently in use. The default is 10 free cylinders. The valid range of values is 0 to 65535. Setting this field to 0 indicates that MiniCylPacks will be performed only when no free cylinders exist. The new setting becomes effective after the DBS Control Record has been written or applied. 324 Utilities Chapter 11: DBS Control (dbscontrol) PermDBAllocUnit PermDBAllocUnit Purpose The PermDBAllocUnit field is used to determine the allocation unit for multi-row data blocks in units of 512-byte sectors for permanent tables. Usage Notes The PermDBAllocUnit field is used in conjunction with the PermDBSize field. If a permanent table data block contains multiple rows, the size of the data block will be a multiple of the PermDBAllocUnit. If PermDBAllocUnit is not an integer factor of 127 (the absolute largest data block), then multi-row data blocks always are smaller than 127. For example, if PermDBAllocUnit is set to 4 (even if PermDBSize is set to 127), the largest multi-row data block is 124 sectors. If PermDBAllocUnit is set to 16, the largest multi-row data block is 112 sectors. The advantage of setting PermDBAllocUnit to a value larger than one is to allow for future growth (such as added or modified rows to the data block). Updating is less expensive if it can be done within the sectors currently allocated to the data block. The disadvantage of setting PermDBAllocUnit to a value larger than one is that many user table data blocks are larger than they need to be, making disk space usage less efficient. However, for full-file scans, make the data blocks as large as possible to minimize I/O activity. Note: The PermDBAllocUnit field does not affect the Transient Journal (TJ) data blocks. The valid range of values is 1 to 63 sectors. The default is 1 sector. The new setting becomes effective after the DBS Control Record has been written or applied. Utilities 325 Chapter 11: DBS Control (dbscontrol) PermDBSize PermDBSize Purpose The PermDBSize field is used to determine the maximum size of the multi-row data blocks of a permanent table in consecutive 512-byte sectors. Usage Notes The valid range of values is 14 to 255 sectors. The default is 127 sectors. A large block size should be used if main applications, such as full-file scans, involve largescale decision support. Depending on the length of the table rows, a block size as small as 14 sectors should improve performance when the majority of applications involve many data manipulation operations, such as online transaction processing (OLTP). If your applications are mixed, you can use the DATABLOCKSIZE option of the CREATE/ ALTER TABLE statement to adjust the block sizes of the tables involved in one of those activities. Then, let the other tables use the PermDBSize default. For example, defining a data block size of 63 sectors for the few large tables involved in decision support and setting PermDBSize to 14 to serve as the default for the smaller and more plentiful OLTP tables might improve throughput as much as 50%. (In this case, also use the smallest JournalDBSize to expedite UPDATE operations.) Note: The PermDBSize and JournalDBSize fields set the maximum multi-row block size. A row that exceeds the current default size of a multi-row data block is put into a block of its own. On MP-RAS, changing the cylinder size requires you to run PUT and perform a system initialization. The new setting becomes effective after the DBS Control Record has been written or applied. 326 Utilities Chapter 11: DBS Control (dbscontrol) SmallDepotCylsPerPdisk SmallDepotCylsPerPdisk Purpose Determines the number of depot cylinders the file system allocates per pdisk (storage device) to contain small slots (128 KB). A small slot can hold a single data block during depot operations. The actual number of small-depot cylinders used per AMP is this value multiplied by the number of pdisks per AMP. Field Group File System Valid Range 1 through 10 cylinders Default 2 Changes Take Effect After the next Teradata Database restart Usage Notes The Depot is a set of transitional storage locations (a number of cylinders) used by the file system for performing in-place writes of DBs or WAL DBs (WDBs). An in-place write means that the changed DB is written back to exactly the same place on disk from which it was originally read. In-place writes are only performed for modifications to DBs that do not change the size of table rows, and therefore do not require any reallocation of space. Writing the changed DB directly back to its original disk location could leave the data vulnerable to various hardware and system problems that can occur during system resets, such as a disk controller malfunctions or power failures. If such a problem occurred during the write operation, the data could be irretrievably lost. The Depot protects against such data loss by allowing the file system to perform disk writes in two stages. First the changed DB (or WDB) is written to the Depot. After the data has been completely written to the Depot, it is written to its permanent location on the disk. If there is a problem while the data is being written to the Depot, the original data is still safe in its permanent disk location. If there is a problem while the data is being written to its permanent location, the changed data is still safe in the Depot. During database startup, the Depot is Utilities 327 Chapter 11: DBS Control (dbscontrol) SmallDepotCylsPerPdisk examined to determine if any of the DBs or WDBs should be rewritten from the Depot to their permanent disk locations. 328 Utilities Chapter 11: DBS Control (dbscontrol) WAL Buffers WAL Buffers Purpose The WAL Buffers field determines the number of WAL append buffers allocated by the File System. Usage Notes The default value is 20. The minimum allowable value is 5, the maximum is 40. A larger number of buffers increases the chance that there will be an available buffer to hold a row when a task needs to append a WAL log record. A smaller number of buffers risks that buffers may be unavailable because they are full and writes are pending. The new setting becomes effective after the next Teradata Database restart. Utilities 329 Chapter 11: DBS Control (dbscontrol) WAL Checkpoint Interval WAL Checkpoint Interval Purpose The WAL Checkpoint Interval field determines the amount of time that elapses between WAL checkpoints. Usage Notes The default value is 60 (seconds). The minimum allowable value is 1, the maximum is 240. A WAL checkpoint is used to indicate the oldest part of the WAL log that must be scanned when recovering from a system crash. It differentiates the WAL log records that have been written to disk from the records that must be applied during system recovery. The checkpoint is used as the starting point for the Redo forward scan of the WAL log during recovery. . Performance Fields The following table lists the DBS Control Record fields that are specific to the performance features: 330 Field Description DBSCacheCtrl Enables or disables the performance enhancements associated with the Cache Control Page-Release Interface associated with the DBSCacheThr field. DBSCacheThr Specifies the percentage value to use for calculating the cache threshold when the DBSCacheCtrl field is enabled. DictionaryCacheSize Defines the size of the dictionary cache for each PE on the system. DisablePeekUsing Enables or disables the performance enhancements associated with exposed USING values in parameterized queries. DisableSyncScan Enables or disables the performance enhancements associated with synchronized full table scans. HTMemAlloc Specifies the percentage of memory to be allocated to a hash table for a hash join. IAMaxWorkloadCache Defines the maximum size of the Index Wizard workload cache when performing analysis operations. Utilities Chapter 11: DBS Control (dbscontrol) Performance Fields Field Description IVMaxWorkloadCache Defines the maximum size of the Index Wizard workload cache when performing validation operations. MaxParseTreeSegs Defines the maximum number of 64 KB tree segments that the parser allocates while parsing a request. MaxRequestsSaved Specifies the number of request-to-step cache entries allowed on each PE on a Teradata Database system. PPICacheThrP The PPICacheThrP field is used to specify the percentage of cache memory that is available (per query) for multiple-context operations (such as joins and aggregations) on PPI tables and join indexes. ReadAhead Enables or disables the performance enhancements associated with the Read-Ahead Sequential File Access Workload operation. Read Ahead Count Specifies the number of data blocks that will be preloaded in advance of the current file position while performing sequential scans. ReadLockOnly Enables or disables the special read-or-access lock protocol on the DBC.AccessRights table during access rights validation and on other dictionary tables accessed by read-only queries during request parsing. RedistBufSize Determines the size (in kilobytes) of units of hashed row redistribution buffers for use by load utilities. SkewAllowance Specifies a percentage factor used by the optimizer in deciding the size of each hash join partition. StandAloneReadAheadCount Specifies the number of data blocks the Teradata utilities will preload when the utilities or File System startup run as standalone tasks. StepsSegmentSize Defines the maximum size (in kilobytes) of the plastic steps segment (also known as OptSeg). SyncScanCacheThr Specifies the percentage of File Segment (FSG) cache that is expected to be available for all synchronized full-file scans occurring simultaneously. UtilityReadAheadCount Specifies the number of data blocks the Teradata utilities will preload when performing sequential scans. The fields are discussed in detail in the following sections. Utilities 331 Chapter 11: DBS Control (dbscontrol) DBSCacheCtrl DBSCacheCtrl Purpose The DBSCacheCtrl field is used to enable or disable the performance enhancements associated with the Cache Control Page-Release Interface associated with the DBSCacheThr field. Usage Notes To enable this feature, set the field to TRUE. To disable the feature, set the field to FALSE. The default is TRUE. Setting this field to TRUE enables the use of DBSCacheThr to control the caching of File System blocks. Setting this field to FALSE causes the following default caching rules to be used: • Data blocks read when performing sort operations are not cached. • All other data blocks read or written are cached using the least recently used algorithm. The new setting becomes effective after the DBS Control Record has been written or applied and during the next Page-Release operation. Any operations in progress are not affected. For additional information, see “DBSCacheThr” on page 333. 332 Utilities Chapter 11: DBS Control (dbscontrol) DBSCacheThr DBSCacheThr Purpose The DBSCacheThr field specifies the percentage value to use for calculating the cache threshold when the DBSCacheCtrl field is enabled (set to TRUE). Usage Notes On Linux, MP-RAS, and Windows, the optimizer calculates the cache threshold as follows: Cache Threshold = DBSCacheThr X MemoryPerAMPVproc 100 MemoryPerAMPVproc is calculated automatically by PDE. For any node in the system, the amount of MemoryPerAMPVproc is the amount of free (or available) memory divided by the total number of AMP vprocs on that node. The valid range of values is 0 to 100 percent. The default is 10 percent. The new setting becomes effective after the DBS Control Record has been written or applied and during the next full-file scan or spool-file creation operation. Any operations in progress are not affected. Full-File Scan Workload If a full-file scan is performed on a spool or permanent table, and the subtable size per AMP is greater than or equal to the Cache Threshold, scanning tasks request that data blocks be discarded immediately upon release. This full-file scan can be overridden by other, simultaneously occurring operations on the same subtable that are not full-file scans. Otherwise, data blocks are cached in memory when released. Synchronized Full-File scans If a full-file scan is performed on a permanent table, and the size of the subtable is greater than or equal to Cache Threshold, then the scan qualifies for synchronized full-file scan. For synchronized full-file scans, the decision to cache data blocks or not is determined differently than for non-synchronized scans. For additional information, see “DisableSyncScan” on page 337 and “SyncScanCacheThr” on page 353. Utilities 333 Chapter 11: DBS Control (dbscontrol) DBSCacheThr Creating a Spool File If the estimated spool file size is greater than or equal to Cache Threshold when a spool file is created, data blocks are discarded immediately upon release. Otherwise, data blocks are cached in memory. Sort Worktables Data blocks read while sorts are performed are never cached. Data blocks created by FastLoad and CREATE INDEX are not cached. Data blocks created for all other sort operations use the cache threshold to determine whether they are cached. For additional information, see “DBSCacheCtrl” on page 332. 334 Utilities Chapter 11: DBS Control (dbscontrol) DictionaryCacheSize DictionaryCacheSize Purpose The DictionaryCacheSize field defines the size of the dictionary cache for each PE on the system. Usage Notes You can increase the size of the dictionary cache to allow the parser to cache additional data dictionary and table header information for improved performance. The valid range of values is 64 to 1024 KB. The default is 1024 KB. The new setting becomes effective after the next Teradata Database restart. Utilities 335 Chapter 11: DBS Control (dbscontrol) DisablePeekUsing DisablePeekUsing Purpose The DisablePeekUsing field enables or disables the performance enhancements associated with exposed USING values in parameterized queries. The Teradata Database Query Optimizer determines the most efficient way to execute an SQL request in the Teradata parallel environment. It generates several possible plans of action, which involve alternate methods of accessing and joining database tables to satisfy the request. The Optimizer evaluates the relative costs of each plan in terms of resource usage and speed of execution, then chooses the plan with the lowest cost. Plans that are sufficiently generic, are cached for fast reuse by the Optimizer in similar situations. For some parameterized queries, the Optimizer can generate better plans by “peeking” at the specific USING values (data parcels) in the queries. Because the plans are specific for the USING values, they are not cached, which in rare cases may have an adverse affect on performance. The DisablePeekUsing field allows you to disable this feature of the Optimizer if you suspect it is a problem. Note: Do not change the value of this field except under the direction of Teradata Support Center personnel. For more information on query optimization, see SQL Reference: Statement and Transaction Processing. Usage Notes The default is FALSE, which means these optimizer performance enhancements are enabled. If set to TRUE, these optimizer enhancements are disabled. The new setting becomes effective as soon as the request cache is purged. For more information on the request cache, see SQL Reference: Statement and Transaction Processing. 336 Utilities Chapter 11: DBS Control (dbscontrol) DisableSyncScan DisableSyncScan Purpose The DisableSyncScan field enables or disables the performance enhancements associated with synchronized full table scans. Usage Notes The synchronized full-table scan feature allows multiple scanners of the same table to share I/Os. This feature applies only to tables that are too large to be completely cached in memory. DisableSyncScan synchronizes scans by starting new scan requests at the point in a table where an existing scan already is positioned. If set to TRUE, then the feature is disabled, but DBSCacheThr can still be used for other purposes. If set to FALSE, then the feature is enabled, and values set in DBSCacheThr and SyncScanCacheThr are used when performing synchronized full-file scans. The default is FALSE. The new setting becomes effective after the next Teradata Database restart. Utilities 337 Chapter 11: DBS Control (dbscontrol) HTMemAlloc HTMemAlloc Purpose The HTMemAlloc field specifies the percentage of memory to be allocated to a hash table for a hash join. Usage Notes The optimizer uses the value for HTMemAlloc to determine the size of the hash table as follows: Hash Table Size = (HTMemAlloc/100) * the memory set aside for hash joins The memory set aside for hash joins is 10MB for 32-bit systems and 20MB for 64-bit systems. The valid range of values is 0 to 10. The default value is 2 for 32-bit systems and 10 for 64-bit systems. The value of 0 turns off hash join as an option for the optimizer, so to provide the optimizer with the capability of using hash join, specify an integer value larger than 0. Teradata recommends using the default values for HTMemAlloc. The larger the value specified, the larger the table to which hash join can be applied. For 32-bit systems, the only time that higher settings should be considered is when a system is always lightly loaded. This means that very few, if any, concurrent operations are performed using the system. In this case, you might want to increase HTMemAlloc to a value in the range of 3-5. Note: For 32-bit systems, values in the 6-10 range can improve hash join performance in some single-user situations but should not be specified on production systems. Do not use these values when more than one user is logged on. Most end users never have a need to use settings in these ranges. The maximum Hash Table Size allowed for a hash join is 1MB for a32-bit systems and 2MB for 64-bit systems. A request for more than the maximum will default to the maximum. The new setting becomes effective after the DBS Control Record has been written or applied. For related information, see “SkewAllowance” on page 350. Example This following MP-RAS example modifies performance flag 10 (HTMemAlloc) to 3 percent. m p 10=3 338 Utilities Chapter 11: DBS Control (dbscontrol) IAMaxWorkloadCache IAMaxWorkloadCache Purpose The IAMaxWorkloadCache field defines the maximum size of the Index Wizard workload cache when performing analysis operations. This parameter is applicable to both the INITIATE INDEX ANALYSIS and INITIATE PARTITION ANALYSIS statements. Usage Notes The valid range of values is 32 to 187 (megabytes). The default is 32 (megabytes). The new setting becomes effective after the DBS Control Record has been written or applied. For more information on Index Wizard, see Teradata Index Wizard User Guide. Utilities 339 Chapter 11: DBS Control (dbscontrol) IVMaxWorkloadCache IVMaxWorkloadCache Purpose The IVMaxWorkloadCache field defines the maximum size of the Index Wizard workload cache when performing validation operations. This parameter is applicable to all SQL statements issued within a session when DIAGNOSTIC “VALIDATE INDEX” has been enabled. Usage Notes The valid range of values is 1 to 32 (megabytes). The default is 1. The new setting becomes effective after the DBS Control Record has been written or applied. For more information on Index Wizard, see Teradata Index Wizard User Guide. 340 Utilities Chapter 11: DBS Control (dbscontrol) MaxParseTreeSegs MaxParseTreeSegs Purpose The MaxParseTreeSegs field defines the maximum number of 64 KB tree segments that the parser allocates while parsing a request. Usage Notes The number of tree segments can be increased to provide additional memory needed for EVL code generation. The default is 1000 (64 KB segments). The valid range of values is 12 to 6000 (64 KB segments). The new setting becomes effective for new sessions after the DBS Control Record has been written or applied. Any sessions in progress are not affected. Note: For 64-bit systems, the default is 2000, and the range of values is 12 to 6000. Utilities 341 Chapter 11: DBS Control (dbscontrol) MaxRequestsSaved MaxRequestsSaved Purpose The MaxRequestsSaved field specifies the number of request-to-step cache entries allowed on each PE on a Teradata Database system. Usage Notes The valid range of values is 300 through 2000. The value must be a multiple of 10. The value indicates the number of request-to-step cache entries that can be saved per PE. If MaxRequestsSaved is 1000, a maximum of 1000 request-to-step cache entries can be saved per PE. The default is 600. The new setting becomes effective after the next Teradata Database restart. 342 Utilities Chapter 11: DBS Control (dbscontrol) PPICacheThrP PPICacheThrP Purpose The PPICacheThrP field is used to specify the percentage of cache memory which is available (per query) for multiple-context operations (such as joins and aggregations) on partitioned primary index (PPI) tables and join indexes. For more information on partitioned primary indexes, see Database Design and SQL Reference: Data Definition Statements. Usage Notes For PPI operations, Teradata Database processes a subset of the non-empty and noneliminated partitions together, rather than processing one partition at a time. A context is kept for each partition to be processed. The context defines the current position within the corresponding partition. The current data block for the corresponding partition is associated with each context. The current set of data blocks (one for each context) are kept in memory, if possible, to improve the performance of processing the set of partitions at the same time. If there is a shortage of memory, these data blocks may need to be swapped to disk. Excessive swapping, however, can degrade system performance. The PPICacheThrP value can be used to reduce or avoid swapping by limiting the amount of memory used for these data blocks during PPI operations. Larger values for PPICacheThrP may improve the performance of these PPI operations, provided the following also occurs: • Data blocks for each context can be kept in memory. (When they can no longer be kept in memory and must be swapped to disk, performance may degrade.) • The number of contexts does not exceed the number of non-empty and non-eliminated partitions for PPI operations. (If they do, performance will not improve because each partition can have a context, and additional contexts would be unused.) You should decrease the value if memory contention occurs for PPI operations. For a multilevel PPI, a context is associated with a combined partition. In the following discussion, partition means combined partition. The value is specified in units of 1/10th of a percentage. The valid range of values is 0 to 500. The default is 10 (1%). This default is probably adequate for most sites. If memory contention occurs, this value should be lowered. It is not usually expected that increasing this value would provide significant performance improvement, due to the potential for increased memory contention. If you plan to change the value, be sure to measure pre- and post-change performance and degree of memory contention to evaluate the effects of the change. Utilities 343 Chapter 11: DBS Control (dbscontrol) PPICacheThrP The new setting becomes effective after the DBS Control Record has been written or applied. PPI Cache Threshold (PCT) PCT is the amount of memory to be made available for PPI operations and is defined as follows: On 32-bit platforms, or if file system cache per amp is less than 100 megabytes: PCT = Total size of file system cache per AMP x PPICacheThrP 1000 On 64-bit platforms where file system cache per amp is greater than 100 megabytes: PCT = 100MB x PPICacheThrP 1000 Note: On 64-bit systems, the output of the DISPLAY command includes some additional information for PPICacheThrP (under Performance fields). This information can help DBA’s determine the actual amount of memory available for multiple-context operations on PPI tables. The value PCT is used in the following operations for a partitioned table, as the amount of memory to use for data blocks associated with the multiple contexts: • Join • Aggregation The following equations define the maximum number of partitions and contexts to process at a time, based on the amount of memory (PCT) determined from PPICacheThrP. If there are fewer non-empty and non-eliminated partitions, only the actual number will be processed at one time. This means that all the partitions of the table will be processed simultaneously. Join for a Partitioned Table In a primary index join, if one table or spool is partitioned and the other is not, then the maximum number (P) of partitions processed at one time from the partitioned table or spool is equal to the following: P = PCT (maximum (minimum(estimated average data block size + 12K , 256) , 8 )) In a primary index join, if both tables or spools are partitioned, then the maximum number of partitions processed at one time from the tables or spools is equal to the following: P 344 = (maximum (minimum (f1, 256) + minimum (f2, 256), 16)) Utilities Chapter 11: DBS Control (dbscontrol) PPICacheThrP where: (f1 x db1) + (f2 x db2) <_ PCT 2 Formula element … Is the … f1 number of partitions to be processed at one time from the left table/ spool, as determined by the optimizer. f2 number of partitions to be processed at one time from the right table/ spool, as determined by the optimizer. db1 estimated average data block size of the left table/spool. db2 estimated average data block size of the right table/spool. Note: For each partition being processed, one data block remains in memory, if possible. Aggregation for a Partitioned Table If an aggregation is performed on the primary index of a partitioned table, the maximum number of partitions processed at one time from the table is equal to the following: P= PCT (maximum (minimum(estimated average data block size + 12K , 256) , 8 )) Note: For each partition being processed, one data block remains in memory, if possible. Utilities 345 Chapter 11: DBS Control (dbscontrol) ReadAhead ReadAhead Purpose The ReadAhead field is used to enable or disable the performance enhancements associated with the Read-Ahead Sequential File Access Workload operation. Usage Notes For sequential file access workloads, if the ReadAhead field is set to TRUE, the File System issues a read-ahead I/O to bring the next data block into memory whenever it tries to read a data block from the file. ReadAhead Count controls the number of blocks read. For additional information, see “Read Ahead Count” on page 347. If set to FALSE, no read-ahead is issued. The default is TRUE (enabled). The new setting becomes effective after the DBS Control Record has been written or applied and during the next Sequential File Access Workload operation. Any operations in progress are not affected. 346 Utilities Chapter 11: DBS Control (dbscontrol) Read Ahead Count Read Ahead Count Purpose If you set the ReadAhead field to TRUE, use the Read Ahead Count field to specify the number of data blocks that will be pre-loaded in advance of the current file position while performing sequential scans. Usage Notes The valid range of values is 1 to 100 data blocks. The default is 1 data block. The new setting becomes effective after the DBS Control Record has been written or applied. For additional information, see “ReadAhead” on page 346. Utilities 347 Chapter 11: DBS Control (dbscontrol) ReadLockOnly ReadLockOnly Purpose The ReadLockOnly field is used to enable or disable the special read-or-access lock protocol on the DBC.AccessRights table during access rights validation and on other dictionary tables accessed by read-only queries during request parsing. Usage Notes To enable the read-or-access lock protocol, set the field to FALSE. To disable the read-or-access lock protocol, set the field to TRUE. The default is FALSE. 348 Utilities Chapter 11: DBS Control (dbscontrol) RedistBufSize RedistBufSize Purpose The RedistBufSize field determines the size (in kilobytes) of hashed row redistribution buffers used by load utilities (MultiLoad and FastLoad), and Archive/Restore operations. This field also determines the size of the buffer used to redistribute USI rows when creating an index on a populated table with the CREATE UNIQUE INDEX SQL statement. Usage Notes If a system has only a few AMPs, a larger buffer size usually has a positive effect on load performance. However, a large buffer size on systems with many AMPs consumes excessive memory, especially if many load jobs are run concurrently. The range of valid values is 1 to 63KB. The default is 4 kilobytes. The new setting becomes effective after the DBS Control Record has been written or applied. Utilities 349 Chapter 11: DBS Control (dbscontrol) SkewAllowance SkewAllowance Purpose The SkewAllowance field specifies a percentage factor used by the optimizer in determining the size of each hash join partition. Usage Notes The setting defines the percentage of skew allowance. The range of valid values is 20 to 80. The default is 75 (percent), which is the recommended setting, and most sites should use that. A setting higher than 75 might improve hash join performance for some situations in which the data is severely skewed. In this case, the value for SkewAllowance could be increased to 80. Values in the 20-74 range can improve hash join performance in some single-user situations but should not be used on production systems. Do not use these values whenever more than one user is logged on. Most end users never have a need to use settings in these ranges. For example, a setting of 75 sets the partition size to 25% of the hash table. This allows the actual partition to be four times greater than the estimate provided by the optimizer before the partition is too large to fit into the hash table. The new setting becomes effective after the DBS Control Record has been written or applied. For additional information, see “HTMemAlloc” on page 338. Example The following MP-RAS example modifies performance flag 11 (SkewAllowance) to 75 percent. m p 11=75 350 Utilities Chapter 11: DBS Control (dbscontrol) StandAloneReadAheadCount StandAloneReadAheadCount Purpose The StandAloneReadAheadCount field specifies the number of data blocks the Teradata utilities will preload when the utilities or File System startup run as standalone tasks. Usage Notes The valid range of values is 1 to 100. The default value is 20 (blocks). If the Teradata database is down, then utilities such as SCANDISK and the purge task, and WAL log processing during File System startup, will use the StandAloneReadAheadCount field value which preloads 20 data blocks at a time by default. If the Teradata database is up, then the utilities will use the UtilityReadAheadCount field value which preloads 10 data blocks at a time by default. For more information, see “UtilityReadAheadCount” on page 354. Utilities 351 Chapter 11: DBS Control (dbscontrol) StepsSegmentSize StepsSegmentSize Purpose The StepsSegmentSize field defines the maximum size (in KB) of the plastic steps segment (also known as OptSeg). Usage Notes You can increase the steps segment size to accommodate the additional EVL code generated by the EVL performance features. The valid range of values is 64 to 1024 (KB). The default is 1024 (KB). The new setting becomes effective for new plastic step generation operations after the DBS Control Record has been written or applied. Any operations in progress are not affected. 352 Utilities Chapter 11: DBS Control (dbscontrol) SyncScanCacheThr SyncScanCacheThr Purpose The SyncScanCacheThr field specifies the percentage of File Segment (FSG) cache that is expected to be available for all synchronized full-file scans occurring simultaneously. Synchronized Full-File Scans A scan of a permanent table qualifies for synchronized full-file scan if the subtable is larger than the Teradata Database cache threshold value calculated by the optimizer. If so, the scan starting position is synchronized with the current position of an existing scan in order to use the same I/Os. Although initially synchronized, qualifying scans are not tied to each other and might diverge over time. The File System monitors qualifying scans to determine which are synchronized. The File System computes a second cache threshold value (shown above) using SyncScanCacheThr. The second cache threshold value determines the amount of memory assumed to be available on an AMP for all synchronized full-file scans of any table. The File System then divides this memory equally among all qualifying subtables scanned by more than one task. Two scans are considered synchronized if extra I/Os can be avoided by caching data blocks in the portion of memory assumed to be available to that subtable. If a task diverges too much, the task is no longer considered synchronized, and the task requests that data blocks be discarded immediately upon release. The blocks still can be cached if they are requested by other simultaneously occurring operations on the same subtable which are not full-file scans. Note: No cache is reserved for this purpose. Instead, SynchScanCacheThr specifies the maximum amount of permanent data that the File System should cache in memory at any one time for all tables that qualify for the synchronized full-file scan feature. For additional information, see “DBSCacheThr” on page 333. Usage Notes This feature is used to determine whether multiple scanners of a table are synchronized or not. Note: This only applies when the DisableSyncScan field is set to FALSE. The valid range of values is 0 to 100 (percent). The default is 10 (percent). If the value is 0, the default value is used. Utilities 353 Chapter 11: DBS Control (dbscontrol) UtilityReadAheadCount UtilityReadAheadCount Purpose The UtilityReadAheadCount field specifies the number of data blocks the Teradata utilities will preload when performing sequential scans. Usage Notes The valid range of values is 1 to 100. The default value is 10 (blocks). If the Teradata database is up, then utilities such as SCANDISK and the purge task, and WAL log processing during File System startup, will use the UtilityReadAheadCount field value which preloads 10 data blocks at a time by default. If the Teradata database is down, then the utilities will use the StandAloneReadAheadCount field value which preloads 20 data blocks at a time by default. For more information, see “StandAloneReadAheadCount” on page 351. The utilities use the UtilityReadAheadCount field instead of the ReadAhead and Read Ahead Count fields. For more information, see “ReadAhead” on page 346 and “Read Ahead Count” on page 347. Checksum Fields Checksum Levels The checksum levels are selectable based on table types. You can select different checksum levels for the following types of tables: • System • System Journal • System Logging • User • Permanent Journal • Temporary The tables fields are discussed in detail later in this chapter. 354 Utilities Chapter 11: DBS Control (dbscontrol) Checksum Fields Checksum Levels Definitions The following table defines the checksum levels. Checksum Level … Samples … NONE 0% of the disk block to generate a checksum. Does not calculate checksums. You cannot modify this percentage. LOW a low percentage of the disk block to generate a checksum. The default is 2%. The valid range is 1 - 100%. MEDIUM a medium percentage of the disk block to generate a checksum. The default is 33%. The valid range is 1 - 100%. HIGH a high percentage of the disk block. The default is 67%. The valid range is 1 - 100%. ALL the entire disk block. You cannot modify this percentage. Enabling Checking on Individual Tables To enable checking on an individual table, use the CHECKSUM option in the following Teradata SQL commands: • CREATE TABLE • CREATE JOIN INDEX • CREATE HASH INDEX • ALTER TABLE • SHOW TABLE • SHOW JOIN INDEX • SHOW HASH INDEX For detailed information on each command, see “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. Modifying Checksum Levels If you modify field number 0 of the Checksum group to a new checksum level, all six table types (fields 1 through 6) are set to that level. For example, if you want to change the checksum level to LOW for all table types simultaneously, type the following: m c 0 = LOW Utilities 355 Chapter 11: DBS Control (dbscontrol) Checksum Fields The following appears: The System Tables field has been modified to LOW. The System Journal Tables field has been modified to The System Logging Tables field has been modified to The User Tables field has been modified to LOW. The Permanent Journal Tables field has been modified The Temporary Tables field has been modified to LOW. NOTE: This change will become effective after the DBS been written. 356 LOW. LOW. to LOW. Control Record has Utilities Chapter 11: DBS Control (dbscontrol) System Tables System Tables Purpose The System Tables field sets the checksum level of the system tables. Usage Notes The System Tables field includes all system table types (data dictionaries, session information, and so forth) and table unique IDs 0, 1 through 0, 999. The following System Journal tables are excluded: • DBC.TransientJournal • DBC.ChangedRowJournal • DBC.LocalTransactionStatusTable • DBC.UtilityLockJournalTable • DBC.LocalSessionStatusTable • DBC.SysRcvStatJournal • DBC.SavedTransactionStatusTable • DBC.OrdSysChngTable • DBC.RecoveryLockTable • DBC.RecoveryPJTable The following System Logging tables are excluded: • DBC.AccLogTbl • DBC.Acctg • DBC.EventLog • DBC.RCEvent • DBC.SW_Event_Log The following Resource Usage (RSS) tables are excluded: Utilities • DBC.ResCPUByAMP • DBC.ResCPUByAMPOneNode • DBC.ResCPUByNode • DBC.ResCPUByPE • DBC.ResCPUByPEOneNode • DBC.ResCPUOneNode • DBC.ResCPUUsageByAMPView • DBC.ResCPUUsageByPEView • DBC.ResGeneralInfoView 357 Chapter 11: DBS Control (dbscontrol) System Tables • DBC.ResHostByLink • DBC.ResHostOneNode • DBC.ResLdvByNode • DBC.ResLdvOneNode • DBC.ResMemMgmtByNode • DBC.ResMemMgmtOneNode • DBC.ResNetByNode • DBC.ResNetOneNode • DBC.ResNode • DBC.ResNodeByNode • DBC.ResOneNode • DBC.ResUsageIpma • DBC.ResUsageIvpr • DBC.ResUsageSawt • DBC.ResUsageScpu • DBC.ResUsageShst • DBC.ResUsageSldv • DBC.ResUsageSpma • DBC.ResUsageSps • DBC.ResUsageSvdsk • DBC.ResUsageSvpr The default checksum level is NONE. 358 Utilities Chapter 11: DBS Control (dbscontrol) System Journal Tables System Journal Tables Purpose The System Journal Tables field sets the checksum level of system journal tables. Usage Notes The System Journal Tables field includes transient journals, change tables, and recovery journals. System journal tables include the following: • DBC.TransientJournal • DBC.ChangedRowJournal • DBC.LocalTransactionStatusTable • DBC.UtilityLockJournalTable • DBC.LocalSessionStatusTable • DBC.SysRcvStatJournal (System Recovery Status Journal) • DBC.SavedTransactionStatusTable • DBC.OrdSysChngTable (Ordered System Change Table) • DBC.RecoveryLockTable • DBC.RecoveryPJTable (Recovery Permanent Journal Table) The default checksum level is NONE. Utilities 359 Chapter 11: DBS Control (dbscontrol) System Logging Tables System Logging Tables Purpose The System Logging Tables field sets the checksum level of system logging tables. Usage Notes The System Logging Tables field includes the following types: • System tables • Resource Usage (RSS) tables System logging tables include the following: Table Description DBC.AccLogTbl Logging activity controlled by DBC.AccLogRuleTbl DBC.Acctg Log of each account a user owns on each AMP DBC.EventLog Log of session events DBC.RCEvent Log of storage media for events DBC.SW_Event_Log Log of software system errors The following Resource Usage (RSS) Tables are included: 360 • DBC.ResCPUByAMP • DBC.ResCPUByAMPOneNode • DBC.ResCPUByNode • DBC.ResCPUByPE • DBC.ResCPUByPEOneNode • DBC.ResCPUOneNode • DBC.ResCPUUsageByAMPView • DBC.ResCPUUsageByPEView • DBC.ResGeneralInfoView • DBC.ResHostByLink • DBC.ResHostOneNode • DBC.ResLdvByNode • DBC.ResLdvOneNode • DBC.ResMemMgmtByNode • DBC.ResMemMgmtOneNode Utilities Chapter 11: DBS Control (dbscontrol) System Logging Tables • DBC.ResNetByNode • DBC.ResNetOneNode • DBC.ResNode • DBC.ResNodeByNode • DBC.ResOneNode • DBC.ResUsageIpma • DBC.ResUsageIvpr • DBC.ResUsageScpu • DBC.ResUsageSawt • DBC.ResUsageShst • DBC.ResUsageSldv • DBC.ResUsageSpma • DBC.ResUsageSps • DBC.ResUsageSvdsk • DBC.ResUsageSvpr The default checksum level is NONE. Utilities 361 Chapter 11: DBS Control (dbscontrol) User Tables User Tables Purpose The User Tables field sets the checksum level of user tables. Usage Notes The User Tables field includes all user tables (table unit IDs 0, 1001 through 16383, 65535), which includes the following: • Stored procedures • User-defined functions • User-defined methods • Join indexes • Hash indexes This also includes fallback for these and secondary indexes for tables and join indexes. The default checksum level is NONE. 362 Utilities Chapter 11: DBS Control (dbscontrol) Permanent Journal Tables Permanent Journal Tables Purpose The Permanent Journal Tables field sets the checksum level of permanent journal tables. Usage Notes The Permanent Journal Tables field includes all permanent journal tables (table uniq[0] IDs 16384 through 32767). The default checksum level is NONE. Utilities 363 Chapter 11: DBS Control (dbscontrol) Temporary Tables Temporary Tables Purpose The Temporary Tables field sets the checksum level of temporary and spool tables. Usage Notes The Temporary Tables field includes all temporary and spool tables (table uniq[0] IDs 32768 through 65535), which includes the following: • Global temporary tables • Volatile tables • Intermediate result spool tables • Response spool tables The default checksum level is NONE. 364 Utilities CHAPTER 12 Dump Unload/Load Utility (dul, dultape) The Dump Unload/Load utilities, dul and dultape save or restore system dump tables. The information in these tables is used to determine the cause of a system failure. Whenever a failure occurs for the Teradata Database, the system automatically saves the contents of the AMP involved in the failure and its associated PE, as appropriate, in a system-generated table. After you save the system dump, you can use dul and dultape to load the dump information onto tape or disk. You must install the dul and dultape packages before you can use dul and dultape. The first part of this chapter describes how to use the Dump Unload/Load utilities; the second part lists and describes dul commands. Note: The latest information on handling crashdumps is located in the Teradata Database Knowledge Repositories available through Teradata @ Your Service. Sign up for an account at www.teradataatyourservice.com. Search for “MP-RAS Crashdumps” or “Windows Teradata Crashdump” to access links to crashdump related articles. Audience Users of the Dump Unload/Load utilities include the following: Utilities • Field service representatives • Network administrators • Teradata Database system administrators 365 Chapter 12: Dump Unload/Load Utility (dul, dultape) User Interfaces User Interfaces dul and dultape run on the following platforms and interfaces: Platform Interfaces MP-RAS Command line Windows Command line (“Teradata Command Prompt”) Linux Command line MVS Batch mode VM Batch mode Command line (“CMS Command Prompt”) What DUL Does The dul utility performs the following: dul transfers dump information … To … from the system files on a host or to tape. The unload operation is normally performed at the customer site, where the system dump information can be copied to tape and shipped to the Teradata Support Center for analysis. stored on a host file or removable medium tables on another system. These tables are used to determine the cause of the failure. Typically, this operation is not performed at a customer site and is usually handled by Teradata Support Center personnel. You can use dul to drop tables and obtain summary information about dumps without performing a load or unload operation. The name of the table that contains dump information is identified using the following syntax: CrashDumps. Crash_yyyymmdd_hhmmss_nn HZ01B003 where: 366 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) What DUL Does Syntax element … Is the … yyyymmdd year, month, and day. hhmmss hour, minute, and second. nn sequence number, which is increased by one for each dump saved. dul on VM/MVS requires access to three data sets. The data sets and their ddname assignments are shown below: • SYSIN - Input command data sets • SYSPRINT - Output responses data sets • TAPE1 -Rows of data that were saved on the dump table in the Teradata Database Crashdumps database dul can unload dump tables having any name. Note: On MP-RAS, Windows, and Linux, dul automatically saves crashdumps in a compressed, gzip file format. After the crashdump is finished unloading, you must manually add the .gz file extension to the file. Before uploading a crashdump file from these platforms to the Teradata Support Center, name the file according to the format: crashdump.incident_number.gz. What DULTAPE Does dultape provides the same functionality as dul; however, dultape offloads tables to tape, rather than to disk. If a crashdump was unloaded with dultape 07.00.00, use dultape 06.01.00 or higher to load the crashdump. The following table shows the tape drives that dultape supports. Utilities On … dultape supports … Linux 4mm DAT tape drives. MP-RAS • • • • Windows • 4mm DAT tape drives. • Exabyte Mammoth 8900 tape drives. 4mm DAT tape drives. 8mm Exabyte tape drives. Exabyte Mammoth 8900 tape drives. Quarter-Inch Cartridge (QIC) tape drives. 367 Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE Starting and Running DUL/DULTAPE Because dul and dultape are used to move large amounts of data, these operations are usually performed in batch mode. • On MP-RAS, dul and dultape run in either batch or interactive mode, providing the same functionality in the following environments: • UNIX SVR4 version 02.03.01 • UNIX SVR4 version 3.0 (SYNC 5) • UNIX SVR4 version 3.1 (SYNC 6) • The Windows versions of dul or dultape run in either batch or interactive mode using MSDOS batch commands. • On Linux, dul and dultape run in either batch or interactive mode in the following environments: • • SUSE Linux Enterprise 9 (i386) • SUSE Linux Enterprise 9 (EM64T) On MVS or VM/CMS BATCH, dul runs in batch mode, and under TSO or VM/CMS it runs in interactive mode. Both dul running on mainframe VM, MVS, and dul/dultape running on UNIX version 02.03.01, 3.0 or 3.1 can access Teradata Database. Starting DUL and DULTAPE on MP-RAS Note: The default password for the crashdumps logon is crashdumps. Verify whether your System Administrator has changed the password or is still using the default. You can start and exit dul and dultape interactively from the command line. To start dul interactively, do the following: 1 At the command prompt, type the following and press Enter: dul dul prompts you for your logon: Dump Unload/Load - Enter your logon: 2 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. To start dultape interactively, do the following: 1 At the command prompt, type the following and press Enter: dultape dultape prompts you for the tape drive path: Dump Unload/Load to Tape - Please insert tape and input tape device name: 368 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE 2 Insert the tape, type the tape drive path, and press Enter. For example: /dev/rmt/c0t3d0s0 dultape prompts you for your logon: Dump Unload/Load to Tape - Enter your logon: 3 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. To log off the Teradata Database and exit dul or dultape, do the following: ✔ At the command prompt, type one of the following and press Enter: • LOGOFF; • END; • QUIT; Starting DUL and DULTAPE on Windows Note: The default password for the crashdumps logon is crashdumps. Verify whether your System Administrator has changed the password or is still using the default. You can start and exit dul and dultape interactively from the Start menu. To start dul interactively, do the following: 1 Select Start >Programs>Teradata Database>Teradata Command Prompt. The Teradata Command Prompt window opens. 2 At the command prompt, type the following and press Enter: dul 3 dul prompts you for your logon: Dump Unload/Load Version 05.02.02 - Enter your logon: 4 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. The following message appears: *** *** *** *** *** Utilities Logon successfully completed. Transaction Semantics are BTET. Character Set Name is 'ASCII'. Changing current database to crashdumps. New default database accepted. 369 Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE To log off the Teradata Database and exit dul, do the following: ✔ At the command prompt, type one of the following and press Enter: • LOGOFF; • END; • QUIT; To start dultape interactively, do the following: 1 Select Start >Programs>Teradata Database>Teradata Command Prompt. The Teradata Command Prompt window opens. 2 At the command prompt, type the following and press Enter: dultape 3 dultape prompts you: Dump Unload/Load to Tape Version 07.02.02 Please insert tape and input tape device name: 4 Insert a tape into the drive. 5 In the MS-DOS window, type the tape drive path as follows and press Enter: \\.\TapeX where X is the number of the tape. IF the node has … THEN name the … a single drive single drive Tape0. more than one drive the first drive Tape0 and increment each succeeding drive by one, such as Tape1, Tape2, and so on. To determine the drive name, do the following: 1 Use REGEDIT to find the data string called TapePeripheral located in \HKEY_LOCAL_MACHINE. 2 Then right-click your mouse and select Find. 3 Press F3 to find all occurrences of TapePeripheral. For more information, see your Microsoft user documentation. For example: \\.\Tape0 The following appears: Tape device is \\.\Tape0 Dump Unload/Load to Tape - Enter your logon: 6 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. The following appears: 370 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE *** Logon successfully completed. *** Transaction Semantics are BTET. *** Character Set Name is 'ASCII'. *** Changing current database to crashdumps. *** New default database accepted. Dump Unload/Load to Tape - Enter your command: To log off Teradata Database and exit dultape, do the following: ✔ At the command prompt, type the following and press Enter: quit; Starting DUL and DULTAPE on Linux Note: The default password for the crashdumps logon is crashdumps. Verify whether your System Administrator has changed the password or is still using the default. You can start and exit dul and dultape interactively from the command line. To start dul interactively, do the following: 1 At the command prompt, type the following and press Enter: dul dul prompts you for your logon: Dump Unload/Load - Enter your logon: 2 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. To start dultape interactively, do the following: 1 At the command prompt, type the following and press Enter: dultape dultape prompts you for the tape drive path: Dump Unload/Load to Tape - Please insert tape and input tape device name: 2 Insert the tape, type the tape drive path, and press Enter. For example: /dev/rmt/c0t3d0s0 dultape prompts you for your logon: Dump Unload/Load to Tape - Enter your logon: 3 Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. Utilities 371 Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE To log off the Teradata Database and exit dul or dultape, do the following: ✔ At the command prompt, type one of the following and press Enter: • LOGOFF; • END; • QUIT; Starting DUL and DULTAPE on MVS Note: The default password for the crashdumps logon is crashdumps. Verify whether your System Administrator has changed the password or is still using the default. The program TSDUL12 is a Teradata-supplied procedure for executing DUL under MVS. You can modify this procedure to accommodate the specific needs of your site. For more information on TSDUL12, see “Sample Procedures” on page 412. You can start and exit DUL in batch mode. To invoke DUL in batch mode, use standard MVS JCL control commands. The MVS JCL command to invoke DUL is shown below: //DULUNLD JOB //* //* //* //FIRST //DUL.SYSIN DD * LOGON ........; UNLOAD CRASHDUMPS.CRASH_........; LOGOFF ; //SECOND //DUL.SYSIN DD * LOGON ........; UNLOAD CRASHDUMPS.CRASH_........: LOGOFF ; Starting DUL on VM Note: The default password for the crashdumps logon is crashdumps. Verify whether your System Administrator has changed the password or is still using the default. You can start and exit DUL from the following: • Batch mode • Interactive mode from the CMS command prompt In Batch Mode To start DUL in batch mode, use the VM FILEDEF commands and EXEC. The VM EXEC command to state DUL is shown below: 372 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Starting and Running DUL/DULTAPE ”FILEDEF SYSIN DISK filename filetype filemode” ”FILEDEF SYSPRINT TERMINAL (RECFM F LRECL 120” ”FILEDEF SYSABEND TERMINAL (RECFM F LRECL 120” /*EXAMPLE of tape load/unload ”LABELDEF TAPE1 VOLID 0000335” ”DUL” ”TAPE RUN” exit Where filename filetype filemode defines the job control file, such as in the following: LOGON ........; UNLOAD CRASHDUMPS.CRASH_........; LOGOFF ; In Interactive Mode To start DUL interactively, do the following: 1 At the CMS command prompt, type the following: DUL DUL prompts you for your logon: Dump Unload/Load Here. 2 Enter your logon: Type: .logon crashdumps and press Enter. The password for the crashdumps logon is crashdumps. To log off the Teradata Database and exit DUL, do the following: ✔ At the CMS command prompt, type one the following and press Enter: • LOGOFF ; • END ; • QUIT ; Space Requirements The following sections discuss the space requirements for the Teradata Database and hosts. Crashdumps Database The Crashdumps database is used to store system dumps. Because system dumps take up disk space, you should periodically clear old or unwanted dump tables from the Crashdumps database. If the space available in the Crashdumps database is exceeded, a message is displayed on the system console every hour until you make space available for the dump to be saved. To make more room for new dumps, examine the existing dumps and delete the ones that you no longer need. If you still need the existing dumps, then copy them to removable media. Once the Teradata Support Center has received and evaluated a dump, you can delete the tables. Utilities 373 Chapter 12: Dump Unload/Load Utility (dul, dultape) Saving Dumps to Tape Database Space Allocation The proper size for the Crashdumps database depends on the following configuration information: • Number of nodes on the system • Number of dumps you want to have available online at any one time (minimum of one dump) The size of the dump for any given node depends on several unpredictable variables. To calculate the approximate size of the Crashdumps database that you need for your system, use the following formula: number of DBS nodes x number of dumps x 100 MB At least 100 MB of space should be allowed per dump, although Teradata recommends larger multiples. Privileges For Dump/Unload Operations Before you can perform a dump/unload operation, your username specified in the logon ID must have the following: • CREATE, DROP, and SELECT privileges on the tables in the Crashdumps database • SELECT privileges on the DBC.SW_EVENT_LOG system table For Load Operations Before you can perform a load operation, your username specified in the logon ID must have CREATE, DROP, and SELECT privileges on the DataBase Computer (DBC) tables of the Teradata Database. If the username you specify when you invoke dul does not have the appropriate privileges, then the Teradata Database returns an error message, and the operation is cancelled. For detailed information on privileges, see “Controlling and Tracking Access” in Database Administration or consult your system administrator. Saving Dumps to Tape Saving MP-RAS Dumps to Tape Only the first node in a cabinet has a tape drive. Use the MP-RAS commands below to save the dumps to tape. See the man pages for descriptions of the commands. Each site is different, so the exact commands, file names, and device names will vary. To save the dump from one node to another that has an internal tape drive, do the following: 374 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Saving Dumps to Tape 1 After the node where the dump occurred has been recovered and is up and running, do a dumpsave. For example: dumpsave -o dumpfile1=size, dumpfile2=size, dumpfile3=size, dumpfile4 -O unixfile where dumpfilen is the name of the dump files you want the to save to disk. The amount of system memory determines how many dump files are required to save the dump. The size of each dump file is limited to a 4K. A dump file without a size will copy the remaining data into that file. unixfile is the file you want to contain the UNIX kernel. Sufficient disk space should be available on the internal disk drives to save each section of the dumpfile and kernel. 2 After the files have been written to disk, FTP each dumpfile and unixfile to the node with the tape drive. If a system has the OpenSSH package installed for security, use the secure commands of sftp (instead of ftp) or scp (instead of the remote copy command, rcp). Refer to the UNIX Man pages for more information. 3 After you have FTPed the dumpfiles to the node with the tape drive, copy the files to tape: dd if=<dumpfile> of=<devicename> bs=<block_size> If necessary, perform step 3 again until all of the dump files are on the tape. Then remember to use the “no rewind on open” and “no rewind on close” tape device options, that is /dev/rmt/c100t6d0s0nn. Saving Linux Dumps to Tape Use the Linux commands below to save a dump to tape. Each site is different, so the exact commands, file names, and device names will vary. To save the dump from one node to another that has an internal tape drive, do the following: 1 After the node where the dump occurred has been recovered and is up and running, save the dump to a disk file. For example: csp -mode save -target stream Note: For a description of the csp command, see the pdehelp for the command. 2 After the file is written to disk, FTP the dumpfile to the node with the tape drive. 3 After you have FTPed the dumpfile to the node with the tape drive, copy the file to tape: dd if=<dumpfile> of=<devicename> bs=<block_size> Note: For a description of the dd command, see the UNIX man page for the command. 4 Utilities If necessary, perform step 3 again until all of the dump files are on the tape. Then remember to use the “no rewind on open” and “no rewind on close” tape device options, that is /dev/rmt/c100t6d0s0nn. 375 Chapter 12: Dump Unload/Load Utility (dul, dultape) Transferring Windows Dump Files Transferring Windows Dump Files Tapes are rarely used for transferring dump files from Windows systems to the Teradata Support Center. The center has a virtual private network (VPN) dump server, which has a network-type connection to most major Windows sites. This connection allows dump files to be brought back from those systems. For multi-node systems, the center might have a connection to the system AWS and to some of the nodes in that system. If you do not have a tape drive and can FTP to Teradata, do the following: 1 Copy the dump file to the node to which the Teradata Database has access. This is usually C:\lnetpub\ftproot directory or a directory below that on the AWS. 2 Map to a network where both nodes reside to copy the files over. 3 FTP the file from that node to the dump server. You can usually log in as Anonymous. 4 Copy the directory where you put the file and use the “get” or “mget” command to transfer the file. You can enter the “hash” command, before starting the transfer, to get feedback that the transfer is in progress. If Teradata has no access to your node, the following procedure could be used for moving the dump files to tape: 1 If the tape drive is not on the same node as the dump files, map drives to both nodes and copy the dump files over to the node with the tape drive. 2 Use a tape backup utility to copy it from its location to the “C” partition on the tape. You can use Windows’s “Backup” utility for this task. Mailing Dump Tapes to the Teradata Support Center To mail a dump tape, do the following: 1 Teradata Support Center service will be faster if you label every cartridge with the following: • The incident number • The Teradata Database version number (for example, 12.01.00.00 or 12.1.0.0) • A Teradata Database crashdump or a UNIX system dump If you are sending multiple tapes or cartridges, write a volume number, such as 1 of 4, 2 of 4, and so on, on each cartridge. 376 2 Write the Incident number on the outside of the package. 3 Include your name or some other person to contact as part of your return business address. Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Restarting DUL 4 Address the package to the following address: Teradata Corporation Dump Administrator Teradata Customer Support Engineering Ref.: Incident # 17095 Via del Campo San Diego, CA 92127 Note: The version, incident number, and volume number are necessary in order for the Teradata Support Center tester to know which installation the dump is reporting and how to load the tape properly. Restarting DUL Restarting During a Load Operation If your system fails during a load operation, dul must be restarted. You must resubmit the LOAD command. To restart dul during a load operation, type the following commands. Command Description LOGON ZZ/Admin, abc ; The LOGON command logs user Admin onto the Teradata Database. HELP DATABASE crashdumps ; The HELP DATABASE command lists any dump tables that might have been created during a load operation. DROP crashdumps.crash_20000606_142500_01 ; The DROP command ensures that any partially created tables are deleted prior to submitting a new load operation. SELECT ERROR ; The SELECT command sets the selection criteria that determines the dump data that is loaded into tables on your Teradata Database. In the example above, only processors that contain error codes are selected. LOAD The LOAD command can then be used to resubmit the operation. For a detailed explanation of loading dump files into tables, see “LOAD” on page 391. • VM/MVS: LOAD CL200, FALLBACK • Linux, MP-RAS, and Windows: LOAD CL200, FALLBACK FILE = FILEPATH; Restarting During an Unload Operation If your system fails during an unload operation, dul must be restarted. You must resubmit the UNLOAD command. To restart dul during an unload operation, include the following commands. Utilities 377 Chapter 12: Dump Unload/Load Utility (dul, dultape) Return Codes Command Description LOGON ZZ/Admin, abc ; The LOGON command logs user Admin onto the Teradata Database. SELECT ERROR ; The SELECT command sets the selection criteria that determines the dump data that is unloaded onto your host system. In the previous example, only processors that contain error codes are selected. UNLOAD The UNLOAD command can then be used to resubmit the unload operation. For a detailed explanation, see “UNLOAD” on page 408. • VM/MVS: UNLOAD crashdumps.crash_20000606_142500_01 ; • Linux, MP-RAS, and Windows: UNLOAD crashdumps.crash_20000606_142500_01 FILE=filepath; Return Codes dul issues return codes to report processing success or failure: On … dul and dultape support return codes via … Linux shell commands ($?). MP-RAS shell commands ($?). Windows normal batch commands (%errorlevel%). A return code of “0” indicates that dul processing was successful; a nonzero return code indicates that processing failed. In order of severity, dul return codes are 02, 04, 08, and 12. These codes are defined as shown below: • 02 - Special warning • 04 - Warning • 08 - User error • 12 - Severe internal error A 02 code is returned if you attempt a Teradata Database operation without logging onto the system. The following table shows messages resulting in dul Return Code 04. 378 Return Code Error Code Description 04 3747 No startup string defined for this user. 04 3803 Table “%VSTR” already exists. Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Return Codes Return Code Error Code Description 04 3804 View “%VSTR” already exists. 04 3805 Macro “%VSTR” already exists. The following table shows messages resulting in dul Return Code 08. Utilities Return Code Error Code Description 08 2538 A disk read error occurred in the tables area. 08 2541 End of Hash Code range reached. 08 2631 Transaction ABORTED due to %VSTR. 08 2632 All AMPs own sessions for this Fast/MultiLoad. 08 2639 Too many simultaneous transactions. 08 2641 %DBID.%TVMID was restructured. Resubmit. 08 2644 No more room in database %DBID. 08 2654 Operation not allowed: %DBID.%TVMID is being Restored. 08 2805 Maximum row length exceeded in %TVMID. 08 2809 Invalid recovery sequence detected. 08 2815 Apparent invalid restart of a restore. 08 2818 Invalid lock to dump table without after-image journaling. 08 2825 No record of the last request was found after Teradata Database restart. 08 2826 Request completed but all output was lost due to Teradata Database restart. 08 2827 Request was aborted by user or due to command error. 08 2828 Request was rolled back during system recovery. 08 2830 Unique secondary index must be dropped before restoring table. 08 2835 A unique index has been invalidated; resubmit request. 08 2837 Table being FastLoaded; no data dumped. 08 2838 Table is unhashed; no data dumped. 08 2840 Data rows discarded due to inconsistent hash codes. 08 2843 No more room in the database. 08 2866 Table was Recovery Aborted; no data dumped. 379 Chapter 12: Dump Unload/Load Utility (dul, dultape) Return Codes 380 Return Code Error Code Description 08 2868 This permanent journal table is damaged; no data dumped. 08 2920 Delete journal and AMP down without dual. 08 2921 No saved subtable for journal %DBID.%TVMID. 08 2926 No more room in %DBID.%TVMID. 08 3001 Session is already logged on. 08 3111 The dispatcher has timed out the transaction. 08 3116 Response buffer size is insufficient to hold one record. 08 3119 Continue request submitted but no response to return. 08 3120 The request is aborted because of a Teradata Database recovery. 08 3523 %FSTR does not have %VSTR access to %DBID.%TVMID. 08 3524 %FSTR does not have %VSTR access to database %DBID. 08 3566 Teradata Database does not have a PERMANENT journal. 08 3596 RESTORE Teradata Database invalid if table, view, or macro exists outside of Teradata Database. 08 3598 Concurrent change conflict on Teradata Database. Please try again. 08 3603 Concurrent change conflict on table. Please try again. 08 3613 Dump/Restore, no hashed nonfallback tables found. 08 3656 Journal table specified no longer exists. 08 3658 ROLLBACK/ROLLFORWARD table specifications are invalid. 08 3705 Teradata Database/SQL request is longer than the Simulator maximum. 08 3737 Name is longer than 30 characters. 08 3802 Database “%VSTR” does not exist. 08 3807 Table/view “%VSTR” does not exist. Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Return Codes The following table shows messages resulting in dul Return Code 12. Return Code Error Code Description 12 CLI0001 Parameter list invalid or missing. 12 CLI0002 Invalid number of parameters received. 12 CLI0003 Error validating HSIRCB. 12 CLI0004 Error validating HSICB. 12 CLI0005 Error validating HSISPB. 12 CLI0006 Invalid destination HSICB detected. 12 CLI0007 Invalid destination RCB detected. 12 CLI0008 DBCFRC unable to free RCB/HSICB control blocks because they are not contiguous in storage. 12 CLI0009 Invalid DBCAREA pointer or id. 12 CLI0010 ECB already waiting. 12 CLI0530 Character Set Name or Code unknown. 12 2123 A segment could not be read successfully. 12 2971 The AMP Lock table has overflowed. 12 2972 No table header exists for table. For details on error messages, see Messages. Utilities 381 Chapter 12: Dump Unload/Load Utility (dul, dultape) DUL Commands DUL Commands DUL Command Syntax The following table describes how to enter dul and dultape commands. IF you are using … THEN … MVS or VM dul commands must be terminated with a semicolon. For example: SHOW VERSIONS ; Linux, MP-RAS or Windows dul and dultape commands must either begin with a period or be terminated with a semicolon. They also can use both, as shown below: .SHOW VERSIONS SHOW VERSIONS ; .SHOW VERSIONS ; DUL Command Categories dul commands are divided into the following two categories: • Session Control • Data Handling The following table summarizes the functions of each dul command. Activity Command Function Operating System Session Control ABORT Aborts a LOAD or UNLOAD command All .CMS Submits a request to a VM host running CMS. VM only DATABASE Changes the default database. All HELP Displays information about dul commands and dump databases. All LOGOFF END QUIT Ends a Teradata Database session and exits the dul utility. The END and QUIT commands are synonyms of LOGOFF. All LOGON Begins a Teradata Database session. All .OS Submits a command to your host operating system. All SHOW TAPE Lists the files on the tape. All SHOW VERSIONS Displays dul software module release versions All .TSO Submits a request to an MVS host operating system. MVS only 382 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) DUL Commands Activity Command Function Operating System Data Handling DROP Removes a dump table from the Teradata Database. All LOAD Moves dump data from removable media to a Teradata Database system. All SEE Reports statistics about the contents of a dump. All SELECT Sets selection criteria. All UNLOAD Moves dump data from a table on the Teradata Database to a file on the host. All The following sections describe each dul command in alphabetical order. Utilities 383 Chapter 12: Dump Unload/Load Utility (dul, dultape) ABORT ABORT Purpose The ABORT command aborts a LOAD or UNLOAD request. Syntax ABORT GT14A029 Usage Notes 384 IF you are working under … THEN … TSO press the PA1 key twice before you can execute either ABORT or HX. CMS use the CMS command HX to unconditionally terminate dul. Linux press the Ctrl+C keys prior to typing the ABORT command. MP-RAS press the Esc key prior to typing the ABORT command. Windows press the Ctrl+C keys prior to typing the ABORT command. Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) .CMS (VM Only) .CMS (VM Only) Purpose The .CMS command submits a CMS command to a VM host running CMS. Syntax ; .CMS cmscommand GT14A030 where: Syntax element … Is the … cmscommand CMS command you want to execute on your VM host. Example 1 To list files on your minidisk under CMS, type the following: .CMS filelist . . . DUL Unload/Load - Enter your command: The files on your minidisk are listed, and you are returned to DUL. Example 2 To edit files on your CMS minidisk, type the following command: .CMS $xedit myfile.one $return DUL Unload/Load - Enter your command: The CMS prompt appears. You can edit your files and then press Enter to return to DUL. Utilities 385 Chapter 12: Dump Unload/Load Utility (dul, dultape) DATABASE DATABASE Purpose The DATABASE command changes the default database for the current Teradata Database session. Syntax ; DATABASE database 1102B031 where: Syntax element … Is the … database name of the new default database. Usage Notes When you invoke dul and log onto the Teradata Database, the Crashdumps database automatically becomes your default database. The Teradata Database uses the database specified in the DATABASE command as the default database until the end of the session, or until you type a subsequent DATABASE command. To use the DATABASE command, you must have SELECT privileges on the specified database. Example To make the Personnel database the default database for the current session, type the following: DATABASE Personnel ; The following appears: *** Sending database Personnel to Teradata Database. *** New default database accepted. 386 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) DROP DROP Purpose The DROP command removes an existing table (created as a result of a system dump) and all of its rows from the specified database on the Teradata Database. Syntax table DROP ; database. 1102B033 where: Syntax element … Is the … database name of the database in which the table resides. If the database is not specified, the currently set database is assumed. Use a period (.) to separate the database name from the table name. table name of the table to be dropped. Usage Notes The DROP command removes the specified table and any tables with the same name that end with a _C, _L, or _M suffix. In general, enter a DROP command before performing a load operation to remove any existing tables that might have the same name as the table specified on the next LOAD command. To use the DROP command, you must have the DROP privilege on the specified table. Example Assume that Crash_20000407_1013_02, Crash_20000407_1013_02_C, Crash_20000407_1013_02_L, and Crash_20000407_1013_02_M tables were produced as an result of the previous load operation. To drop all four tables from the Crashdumps database, type the following: DROP Crash_20000407_1013_02; Utilities 387 Chapter 12: Dump Unload/Load Utility (dul, dultape) DROP The following appears: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Dropping table Crash_20000407_1013_02; Table has been dropped. Dropping table Crash_20000407_1013_02_1; Failure 3807 Table/view 'Crash_20000407_1013_02_1' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_2; Failure 3807 Table/view 'Crash_20000407_1013_02_2' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_C; Table has been dropped. Dropping table Crash_20000407_1013_02_C_1; Failure 3807 Table/view 'Crash_20000407_1013_02_C_1' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_C_2; Failure 3807 Table/view 'Crash_20000407_1013_02_C_2' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_L; Table has been dropped. Dropping table Crash_20000407_1013_02_L_1; Failure 3807 Table/view 'Crash_20000407_1013_02_L_1' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_L_2; Failure 3807 Table/view 'Crash_20000407_1013_02_L_2' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_M; Table has been dropped. Dropping table Crash_20000407_1013_02_M_1; Failure 3807 Table/view 'Crash_20000407_1013_02_M_1' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_M_2; Failure 3807 Table/view 'Crash_20000407_1013_02_M_2' does not exist. Statement# 1, Info =0 Dropping table Crash_20000407_1013_02_S; Failure 3807 Table/view 'Crash_20000407_1013_02_S' does not exist. Statement# 1, Info =0 dul displays additional messages if you abort the load operation because it tries to dump tables used by the FastLoad utility even if they do not exist. 388 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) END END Purpose The END command terminates a Teradata Database session and exits the dul utility. Syntax END ; GT14A034 Usage Notes The LOGOFF and QUIT commands are synonyms for the END command. Example To terminate a Teradata Database session and exit dul, type the following: END ; The following appears: *** DUL Terminated *** Highest return code = <n> where n is the highest return code by dul. Utilities 389 Chapter 12: Dump Unload/Load Utility (dul, dultape) HELP HELP Purpose The HELP command returns syntax information about dul commands and lists the tables, views, and macros stored in a database. Syntax HELP ; DATABASE database DUL 1102B035 where: Syntax element … Returns a … DATABASE database list of tables, views, and macros stored in the specified database. DUL syntax summary of all the commands available with the dul utility. Example To list all tables, views, and macros on the Crashdumps database, type the following: HELP DATABASE Crashdumps ; The following appears: *** Sending HELP DATABASE crashdumps; to Teradata Database. *** Help information returned. 10 rows. Crash_20000526_134503_01 Crash_20000526_154702_01 Crash_20000526_154925_01 Crash_20001120_103233_01 Crash_20001225_163434_01 If the database does not exist, the following appears: help database non_exist; *** Sending HELP DATABASE non_exist; to Teradata Database. *** Failure 3802 Data base 'non_exist' does not exist. Statement# 1, Info =0 390 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) LOAD LOAD Purpose The LOAD command moves dump data from files (dul) or tape (dultape) created by an unload operation into tables on a Teradata Database. Syntax MVS and VM ; table LOAD database. FALLBACK FILE=filepath 1102B038 Linux, MP-RAS, and Windows table LOAD database. FILE = filepath ; FALLBACK 1102B039 where: Syntax element … Is the … database name of the database in which the table resides. Use a period (.) to separate the database name from the table name. table name of the table to receive dump data. The table cannot already exist. However, the database in which the table will reside must already exist. FALLBACK option that creates a fallback copy of the table specified in the LOAD command as well as the tables with the same name ending in _L, _C, and _M. FILE = filepath the path of the file created in a previous unload operation. The filepath specification is required for the Linux, MP-RAS, and Windows versions of dul. On Windows, you can include an optional drive: specifier for FILE = filepath. The filepath is specified as directory/filename. Utilities 391 Chapter 12: Dump Unload/Load Utility (dul, dultape) LOAD Usage Notes Before you can perform a load operation, your username specified in the logon ID must have CREATE, DROP, and SELECT privileges on the DataBase Computer (DBC) tables of the Teradata Database. If the username you specify when you invoke dul does not have the appropriate privileges, then the Teradata Database returns an error message, and the operation is cancelled. The following table shows the tape drives that dultape supports. On … dultape supports … Linux 4mm DAT tape drives. MP-RAS • • • • Windows • 4mm DAT tape drives. • Exabyte Mammoth 8900 tape drives. 4mm DAT tape drives. 8mm Exabyte tape drives. Exabyte Mammoth 8900 tape drives. Quarter-Inch Cartridge (QIC) tape drives. Before you can perform a load operation, dul displays summary information, such as which processors are selected, error dates, and so forth, about the selection criteria that is set. After the load operation, dul displays event codes, if any exist, for the specified processors. For information on setting selection criteria, see “SELECT” on page 402. As a general rule, type a DROP command before performing a load operation. This removes any existing tables that might have the same name as the name specified on the current LOAD command. For more information, see “DROP” on page 387. Note: dul uses the FastLoad utility to improve transfer speed. However, you can still transfer dump files on your host to a Teradata Database using BTEQ. In most instances, a load operation is not performed at a customer site. For detailed information on privileges, see Database Administration or consult your system administrator. For more information about the FastLoad utility, see Teradata FastLoad Reference. For information about BTEQ, see Basic Teradata Query Reference. Example 1 To check whether tables with the same name exist in the Crashdumps database, type the following: HELP DATABASE crashdumps ; 392 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) LOAD The following list of all the tables in the Crashdumps database appears: *** Sending HELP DATABASE crashdumps to Teradata Database. *** Help information returned. 4 rows. CL100 CL100_C CL100_L CL100_M Since no tables have the same name, you can type the LOAD command next. If tables with the same name already exist, verify that they are not needed and then use the DROP command to delete them from the Crashdumps database. Example 2 To transfer dump information from tape or host disk files to tables on the Teradata Database for MVS or VM, type the following: LOAD CL200, FALLBACK ; The following appears: *** *** *** *** *** *** Creating table ’CL200’ Table has been created. Loading data into ’CL200’ for all processors. Starting Row 100 on Thu Jun 06 09:22:14 1996 Starting Row 200 on Thu Jun 06 09:22:18 1996 Starting Row 300 on Thu Jun 06 09:22:22 1996 . . . *** *** *** *** *** *** *** Number of rows = 978. Creating table ’CL200_C’ Table has been created. Loading data into ’CL200_C’ Starting Row 100 on Thu Jun 06 09:26:14 1996 Starting Row 200 on Thu Jun 06 09:26:18 1996 Starting Row 300 on Thu Jun 06 09:26:22 1996 . . . *** *** *** *** *** *** *** Number of rows = 599. Creating table ’CL200_L’ Table has been created. Loading data into ’CL200_L’ Starting Row 100 on Thu Jun 06 09:28:14 1996 Starting Row 200 on Thu Jun 06 09:28:18 1996 Starting Row 300 on Thu Jun 06 09:28:22 1996 . . . *** *** *** *** *** *** *** Number of rows = 720. Creating table ’CL200_M’ Table has been created. Loading data into ’CL200_M’ Starting Row 100 on Thu Jun 06 09:31:10 1996 Starting Row 200 on Thu Jun 06 09:31:18 1996 Starting Row 300 on Thu Jun 06 09:31:22 1996 . Utilities 393 Chapter 12: Dump Unload/Load Utility (dul, dultape) LOAD . . *** Number of rows = 423. In this example, dul searched all processors for dump information and created four tables. Example 3 To transfer dump information from tape or host disk files to tables on the Teradata Database for Linux, MP-RAS, or Windows, type the following: load crashdumptable1 file=TPFILE; The following appears: load crashdumptable1 file=TPFILE; *** Opening tape file TPFILE *** Creating table 'crashdumptable1'. *** Table has been created. *** Loading data into 'crashdumptable1' . *** Logging on Amp sessions. *** Growing Buffer to 4114 *** Starting Row 100 at Wed Jan 16 15:54:46 2002 *** Starting Row 200 at Wed Jan 16 15:54:46 2002 *** Starting Row 300 at Wed Jan 16 15:54:46 2002 . . . *** Starting Row 377600 at Wed Jan 16 16:07:10 2002 *** Starting Row 377700 at Wed Jan 16 16:07:10 2002 *** Starting Row 377800 at Wed Jan 16 16:07:10 2002 *** Starting Row 377900 at Wed Jan 16 16:07:10 2002 *** END LOADING phase...Please stand by... Loading data into crashdumptable1 completes successfully. *** Opening tape file TPFILE.log *** End of Tape *** Closing Tape file (and rewinding tape) Dump Unload/Load to Tape - Enter your command: 394 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) LOGOFF LOGOFF Purpose The LOGOFF command exits the dul utility and terminates the Teradata Database session. Syntax LOGOFF ; GT14A041 Usage Notes The END and QUIT commands are synonyms for the LOGOFF command. Example To terminate a Teradata Database session and exit the dul utility, type the following command: LOGOFF ; The following appears: *** DUL Terminated *** Highest return code = <n> where n is the highest return code by dul. Utilities 395 Chapter 12: Dump Unload/Load Utility (dul, dultape) LOGON LOGON Purpose The LOGON command establishes a Teradata Database session. Syntax Batch Mode username ,password .LOGON ; ,'acctid ' tdpid/ 1102B042 Interactive Mode username .LOGON ; tdpid/ 1102B043 where: Syntax element … Is the … tdpid identifier which is associated with a particular Teradata Database. The default identifier is TDP0. username ID of the user on the corresponding Teradata Database. The maximum length of username is 30 characters. password password associated with the username. The maximum length of a password is 30 characters. Note: In interactive mode, the password is accepted on the next line in a protected area. acctid account identifier associated with the username. The acctid can contain up to 30 characters. Each doubled apostrophe, if any, counts as one character of the 30 characters. Note: This describes the standard TD 2 (Teradata authentication) logon format. For more information about other logon formats and types of authentication see Security Administration. 396 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) LOGON Usage Notes The LOGON command is the first command you type in a dul session. The command establishes a session on a Teradata Database and identifies you and the account that is charged for system resources used during a dul operation. You must have CREATE, DROP, and SELECT privileges on DBC.SW_EVENT_LOG for Teradata Database, as well as on the dump table on the Teradata Database, to perform a load or unload operation. After you log onto the Teradata Database, dul changes the default database to Crashdumps. The Crashdumps database is where the Teradata Database initially saves a dump. However, you can change the default database with the DATABASE command. When you use dul interactively, the system prompts you for your password. To ensure system security, the password is not displayed when entered. For additional information on granting privileges, see “Controlling and Tracking Access” in Database Administration. For more information on the Crashdumps database, see “DATABASE” on page 386. Example 1 - Batch Mode To log onto a Teradata Database with a tdpid of TDP0, a username of Admin, and a password of abc, type the following: LOGON TDP0/Admin,abc ; The following appears: *** *** *** *** Logon successfully completed. Changing current database to crashdumps. New default database accepted. Dump Unload/Load - Enter your command: Example 2 - Interactive Mode On VM/CMS, Linux, MP-RAS, and Windows, to log onto a Teradata Database with a tpid of crashdumps, a username of crashdumps, and a password of crashdumps, type the following: 1 Type your logon and press Enter. For example: .logon crashdumps Your logon is repeated, and you are prompted for your password: .logon crashdumps Password: 2 Type your password and press Enter. For example: crashdumps Your password will not appear on screen. The following appears: *** Logon successfully completed. *** Transaction Semantics are BTET. *** Character Set Name is 'ASCII'. Utilities 397 Chapter 12: Dump Unload/Load Utility (dul, dultape) LOGON *** Changing current database to crashdumps. *** New default database accepted. Dump Unload/Load to Tape - Enter your command: 398 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) .OS .OS Purpose The .OS command submits an operating system command to your host during a dul session. Syntax .OS oscommand ; GT14A045 where: Syntax element … Is the … oscommand command that is legal on your host operating system. Usage Notes At the prompt below, type one of the following, depending on your system: Dump Unload/Load to Tape - Enter your command: On… Type … Linux .os date The following appears: .os date Mon Aug 5 13:00:24 EDT 2002 MP-RAS .os date The following appears: .os date Mon Aug 5 13:00:24 EDT 2002 Windows .os date /T The following appears: .os date /T Mon 08/05/2002 Utilities 399 Chapter 12: Dump Unload/Load Utility (dul, dultape) QUIT QUIT Purpose The QUIT command exits the dul utility and terminates the Teradata Database session. Syntax QUIT ; GT14A046 Usage Notes The LOGOFF and END commands are synonyms for the QUIT command. Example To terminate a Teradata Database session and exit the dul utility, type the following command: QUIT ; The following appears: *** DUL Terminated *** Highest return code = <n> where n is the highest return code by dul. 400 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) SEE SEE Purpose The SEE command provides a summary of the processors and error codes captured in a dump. The information is retrieved from the dump table. Syntax ; table SEE database. 1102B047 where: Syntax element … Is the name of the … database database in which the table resides. table table that contains dump information. Usage Notes The SEE command returns information that helps you confirm system failure information forwarded to the Teradata Support Center. Information about tables with the _L, _C, and _M suffixes is not returned. Example To access a specific dump table, type the following: see crashdumps.Crash_20000412_194517_02; The following appears: *** Looking at crashdumps.Crash_20000412_194517_02. *** Query completed. One row found. 7 columns returned. the node number is 1024 the instigating node is 1024 the time the error occurred is Wed April 12 19:45:17 2000 the event is 12140, severity is 40 and category 10 Severity = UserError Category = User Utilities 401 Chapter 12: Dump Unload/Load Utility (dul, dultape) SELECT SELECT Purpose The SELECT command sets criteria determining the dump data selected for a load or unload operation. Syntax SELECT ; ALL ERRORDATE ERROR PROC NOD-NUM RESET 'yymmdd' 'yyyymmdd' 1102A040 where: Syntax element … Is the … ERROR load or unload operation. Only processors with an error code are selected. RESET same as ERROR. PROC NOD-NUM unload operation. NOD-NUM specifies the number of the virtual processor to be selected. Dump data will be loaded or unloaded only from this node. Valid values for NOD-NUM are16384 and greater. ALL load or unload operation select dump data from all processors. This is the default. ERRORDATE ‘yymmdd’ or error date to be selected from the DBC.SW_EVENT_LOG table. ‘yyyymmdd’ The ‘yymmdd’ or ‘yyyymmdd’ represents the year, month, and day, respectively. dul retrieves all error records with a date equal or later than the yymmdd or yyyymmdd specification. Note: You can type the date in either single or double quotes. Usage Notes You must always type the SELECT command before you type an UNLOAD command. If you do not specify a SELECT command, the entire dump is selected. Negative processor numbers are used for special record types. When RESET is specified, dul and dultape retrieve dump data with negative processor numbers. 402 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) SELECT Example To select dump data, type the following: select proc 16384; The following appears: *** Processor selection set to list of processors. Utilities 403 Chapter 12: Dump Unload/Load Utility (dul, dultape) SHOW TAPE SHOW TAPE Purpose The SHOW TAPE command allows you to retrieve a list of files residing on a tape. Syntax ; SHOW TAPE GT14A062 Example To display the files on a tape, type the following: SHOW TAPE ; On MVS, VM, and MP-RAS, the following appears: The files on filename filename filename the tape: is dr123 volume1 is dr123.cor volume 1 is dr123.log volume 1 On Windows, the following appears: The files on the tape: filename is TPFILE volume 1 ***End of tape ***Closing Tape file (and rewinding tape) 404 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) SHOW VERSIONS SHOW VERSIONS Purpose The SHOW VERSIONS command displays the current level of all dul utility software modules. Syntax SHOW VERSIONS ; SHOW VERSION 1102B054 Usage Notes The SHOW VERSIONS command is helpful in reporting software problems. Example 1 To display the current versions of software modules for MVS or VM used at your site, type the following: SHOW VERSIONS ; The following appears: Dump Unload/Load Version m.m DULMain : m.m CapAAVutl : m.m CapCLUtl : m.m CapIOUtl : m.m MOSIBM : m.m Example 2 To display the current versions of software modules for MP-RAS used at your site, type the following: SHOW VERSIONS ; The following appears: Dump Unload/Load Version 05.00.00 for UNIX 5.4 running Streams TCP/IP DULMain : 05.00.00.03 CapAAUtl : H3_04 CapCLUtl : H5_04 CapIOUtl : H5_06 CapERUtl : H5_01 OSIDEP : 04.06.01.04 CLIV2 : 04.06.01.13 Utilities 405 Chapter 12: Dump Unload/Load Utility (dul, dultape) SHOW VERSIONS MTDP OSENCRYPT OSERR MOSIos : : : : 04.06.01.08 N/A 04.06.01.00 04.06.01.05 Example 3 To display the current versions of software modules for Windows used at your site, type the following: SHOW VERSIONS ; The following appears: Dump Unload/Load Version 05.00.01 for Win 32 running Windows Sockets DULMain : 05.00.01.00 CapAAUtl : 06.01.00.00 CapCLUtl : 06.01.00.02 CapIOUtl : 06.00.00.00 CapERUtl : H5_03 CLIV2 : 04.06.01.03 MTDP : 04.06.01.01 MOSIos : 04.06.00.05 MOSIDEP : 04.06.01.00 OSENCRYPT : N/A OSERR : 04.06.01.00 406 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) .TSO (MVS Only) .TSO (MVS Only) Purpose The .TSO command submits a TSO command to an MVS host running TSO. Syntax ; .TSO tsocommand GT14A056 where: Syntax element … Is the … tsocommand TSO command you want to execute on your MVS host. Usage Notes Use the following command only for interactive TSO sessions. It does not apply to MVS batch sessions. Example To invoke BTEQ directly from an interactive TSO DULsession, type the following: .TSO CALL ’datasetname(BTQMAIN)’ where: Utilities Syntax element … Is the … 'datasetname' name of the load library that contains the BTEQ program named (BTQMAIN). 407 Chapter 12: Dump Unload/Load Utility (dul, dultape) UNLOAD UNLOAD Purpose The UNLOAD command moves dump data from a system-generated table on the Teradata Database to a file on a host or directly to removable media. Syntax VM/MVS ; table UNLOAD database. FILE = name DUMP 1102B057 Linux, MP-RAS, and Windows table UNLOAD ; FILE = filepath f database. 1102B060 where: Syntax element … Is … database the name of the database in which the table resides and the separator between the database name and table name. Use a period (.) to separate the database name from the table name. The default database is Crashdumps. table 408 the name of the table that contains the dump data. Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) UNLOAD Syntax element … Is … FILE = one of the following: IF FILE = . . . THEN . . . name a set of specific DD files on MVS or VM is specified. DUMP the output is written to DUMP1 (the dump data), and the error log table is written to DUMP3 on MVS or VM. is omitted the default is FILE = TAPE on MVS or VM. filepath the path of the file into which the dump data is unloaded on Linux, MP-RAS, and Windows is specified. The filepath is specified as directory/filename. f an option for unloading dumps from a foreign Teradata Database. Usage Notes Before you can perform a dump/unload operation, your username specified in the logon ID must have the following: • CREATE, DROP, and SELECT privileges on the tables in the Crashdumps database • SELECT privileges on the DBC.SW_EVENT_LOG system table The UNLOAD command selects dump data according to the selection criteria specified in a previous SELECT command. If you do not specify a SELECT command, the entire dump table is searched. You should always type a SELECT command before an UNLOAD command. Before you perform an unload operation, dul displays summary information, such as which processors are selected, error dates, and so forth, about the selection criteria that is set. After the load operation, dul displays event codes, if any exist, for the specified processors. For information on setting selection criteria, see “SELECT” on page 402. In moving dump data, the _C, _L, and _M files are always included. If the _C or _L table is not found, it is generated. If you load the unloaded data back into some other Teradata Database system, the table created by the LOAD command is called dump data in a foreign Teradata Database and will be one of the following tables: • tname_C • tname_L • tname_M When you enter the UNLOAD command without the F option, dul or dultape unloads the data specified in tname from the DBC.SW_EVENT_LOG table. Utilities 409 Chapter 12: Dump Unload/Load Utility (dul, dultape) UNLOAD The F option is required to unload the dump data from the foreign Teradata Database. dul or dultape will unload data from the table specified in the UNLOAD command and the corresponding tname_C, tname_L, and tname_M tables. dul uses the FastExport utility to improve transfer speed for unloading crashdumps. However, you can still unload crashdumps using BTEQ. To use the UNLOAD command, you must have CREATE, DROP, and SELECT privileges on the following: • Dump table (Crashdumps.Crash_YYYYMMDD_HHMMSS_NN) • System table DBC.SW_EVENT_LOG For more information about the FastExport utility, see Teradata FastExport Reference. For information about BTEQ, see Basic Teradata Query Reference. For additional information on privileges, see “Controlling and Tracking Access” in Database Administration. Example 1 The following example assumes that a system failure occurred on 6/6/00 at 2:36 p.m. To confirm that a dump table has been created, you would examine the Crashdumps databases using the following command: HELP DATABASE Crashdumps ; Since dump tables are named according to the date and time that the system failure occurred, you should be able to find the correct dump table. In this example, the table named crash_200000606_143623_01 contains the dump information. To display the contents of the dump table, use the SEE command: SEE crash_20000606_143623_01 ; The SEE command displays summary information about all of the processors and error codes that were captured in the dump. Some of the processors might not contain any information. Generally, only processors that contain errors are needed for an unload operation. By typing a SELECT command next, you can choose the processors for the unload operation. To select only the processors that contain error codes, type the following command: SELECT ERROR ; dul responds with this message: *** Processor selection set to list of processors. 410 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) UNLOAD Example 2 Now you are ready to unload the dump data from table crash_20000606_143623_01 on the Crashdumps database onto your host using the following command: UNLOAD crash_20000606_143623_01 ; For VM/MVS UNLOAD crash_20000606_143623_01 file=filepath; For UNIX dul responds with these messages: *** Unloading data from crash_20000606_143623_01 for processor(s) 1-6. *** Query completed. 263 rows found. 3 columns returned. *** Processor 1-6 *** *** *** *** Number of rows = 263 Unloading Procedure Information Query completed. 200 rows found. 4 columns returned. Number of rows = 200 *** Unloading Errorlog Information *** Query completed. 413 rows found. 6 columns returned. *** Number of rows = 413 *** Unloading Memo Information *** Query completed. 123 rows found. 5 columns returned. *** Number of rows = 123 Event = 2490: On 6/6/96 at 09:26:27 in processor 1-6, partition 14, task SEMTSK. Severity = UserError Category = User HostEvent = None *** Number of rows = 263 dul creates two files when accessing Teradata Database on the tape. The tape can then be sent to the Teradata Support Center for analysis. Note: If the dump data is copied to the local hard disk on your host, you must copy the data to a removable medium for shipment. Utilities 411 Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures Sample Procedures Teradata supplies sample procedures on the software release tape for invoking dul. Use these procedures in their existing form to invoke dul or modify them to meet the requirements of your site. The release tape contains an MVS DUL sample procedure called TSDUL12. This section also provides sample procedures for executing MVS DUL and DUL EXEC on VM. MVS DUL Sample Procedure The following sample procedure is used to execute DUL on MVS client for Teradata Database: //TSDUL12 JOB //********************************************************************** //* * //* SAMPLE JCL PROCEDURE FOR EXECUTING DULMAIN * //* AGAINST V2 DBS * //* * //* THIS JCL REPLACE THE OLD DULMAIN JOBS: * //* TDSDUL DBCDMP DULUNLD * //* * //*--------------------------------------------------------------------* //* * //* -DATE-- III DR/DCR- CHNG# ---------------COMMENTS----------------- * //* * //* 30Aug95 TWB 33381 52.01 ALTERED DDs and DCBs for V2 systems * //* 16Aug95 TWB 33942 52.00 INCORRECT DCB INFO TAPE3 * //* SPACE ALLOCATION FOR TAPE1 * //* 02JAN95 WGC 29335 51.00 INCORRECT DCB INFO FOR TAPE3 & TAPE4 * //* 12SEP91 WGC 23131 41.03 ADDED SYSTERM DD STATEMENT * //* 21FEB91 WGC 41.02 CREATE FOR NEW DUL * //* * //********************************************************************** //TSDUL12 PROC RUNPARM='=HCSIG',DSP=',KEEP',S1=' ',S3=' ' //DULSTEP EXEC PGM=DULMAIN,PARM='&RUNPARM' //STEPLIB DD DISP=SHR,DSN=&DBCPFX..APPLOAD // DD DISP=SHR,DSN=&DBCPFX..TRLOAD //TAPE1 DD DSN=&DULDMP,UNIT=&TU1, // &S1.SPACE=(CYL,(10,1),RLSE), // DISP=(&DSP),VOL=SER=&TVOL1, // DCB=(RECFM=FB,LRECL=4114,BLKSIZE=4114) //TAPE3 DD DSN=&ERRLOG, // UNIT=&TU3,&S3.SPACE=(CYL,(2,1),RLSE), // DISP=(&DSP),VOL=SER=&TVOL3, // DCB=(RECFM=FB,LRECL=958,BLKSIZE=1916) //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=* //SYSABEND DD SYSOUT=* // PEND //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* //* TAILOR THE FOLLOWING FOR YOUR ENVIRONMENT AND JOB NEED: * 412 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures //* SYMBOLIC USE * //* ======== === * //* DBCPFX = HIGH LEVEL QUALIFIER FOR TERADATA LOAD LIBRARIES * //* DSP = DATASET DISPOSITION FOR ALL DUMP DATASETS * //* RUNPARM = SAS/C RUNTIME OPTION; DEFAULT IS '=HCSIG' * //* FOR OTHER OPTIONS PLEASE REFER TO SAS/C COMPILER * //* AND LIBRARY USER'S GUIDE. * //* * //* DULDMP = DATASET NAME FOR DUL CRASHDUMP FILE - TAPE1 * //* TU1 = DEVICE GENERIC UNIT NAME FOR TAPE1 * //* TVOL1 = VOLUME SERIAL NUMBER FOR TAPE1 * //* S1 = IF TU1 IS DASD, SPECIFY "S1=" FOR SPACE ALLOCATION * //* * //* ERRLOG = DATASET NAME FOR SYSTEM ERROR LOG, (DBC.ERRLOG) * //* - TAPE3 * //* TU3 = DEVICE GENERIC UNIT NAME FOR TAPE3 * //* TVOL3 = VOLUME SERIAL NUMBER FOR TAPE3 * //* S3 = IF TU3 IS DASD, SPECIFY "S3=" FOR SPACE ALLOCATION * //* * //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* //* UNCOMMENT STATEMENT #1 AND/OR #2 //DULSTEP EXEC TSDUL12, DEPENDING ON YOUR JOB NEEDS: //* DSP=OLD, <== #1) FOR A LOAD FUNCTION //* S1=,S3=, <== #2) TAPE1 and 3 ON DASD DEVICE //* TAILOR THE FOLLOWING: // DBCPFX='DBC', <== HI-LEV. QUAL. FOR TDAT LOADLIB // DULDMP='DBC.DUMP.DATA', <== CRASHDUMP DSN FOR TAPE1 // TU1=TAPE,TVOL1=DMPTPE, <== UNIT AND VOLSER FOR TAPE1 // ERRLOG='DBC.LOG.DATA', <== ERRLOG FILE DSN FOR TAPE3 // TU3=TAPE,TVOL3=LOGVOL <== UNIT AND VOLSER FOR TAPE3 //SYSIN DD * LOGON USER, PASSWORD; UNLOAD CRASHDUMPS.CRASH_20000606_142000_01; QUIT; LOGOFF; /* VM DUL EXEC Sample Procedure DUL EXEC, which is executed on VM, is used to run DULMAIN for tape only. The DUL EXEC sample procedure is shown below: /***********************************************************************/ /** FILE ID: DUL EXEC VERSION H2.06 **/ /** **/ /** ABSTRACT: EXEC TO INVOKE THE DBC HOST APPLICATION DUMP, **/ /** UNLOAD AND LOAD (DUL) FACILITY. **/ /** **/ /** SITE CHANGES: NONE. **/ /** **/ /** PREREQUISITE: DUL USER INTERFACE FILE, 'DULXQT EXEC', DEFINES **/ /** THE INITIALIZATION REQUIREMENTS. **/ /** **/ /** RETURN CODE: 0 NORMAL. **/ /** ELSE SEE ACCOMPANYING ERROR MESSAGE. **/ /** **/ /** NOTE: IF DUL TERMINATES ABNORMALLY, THE USER'S **/ /** TXTLIB STRING MAY NOT HAVE BEEN RESTORED. **/ Utilities 413 Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures /** **/ /** EXTERNAL CALL: GETLINKT EXEC. **/ /** TERAPARM EXEC. **/ /** **/ /** CHANGE HISTORY: **/ /** D.01 850916 SN DR5273. STANDARDIZE EXECS. **/ /** D.02 851017 SN DCR2451. ELIMINATE IN-HOUSE CODE. **/ /** F.01 870427 WEL DCR2840. DUL PIECES OF DUMPS. **/ /** F.02 880613 SN DR11126. DUL DBC DUMP TO DISK. **/ /** G.00 901106 SN DCR5767. CHANGE PASCAL DUL TO SAS/C. **/ /** G.01 910123 SN DCR5767. CHANGE NAME FROM CDUL TO DUL. **/ /** G.02 910812 SN DR22932. CDULMAIN SHOULD BE DULMAIN. **/ /** G.03 911023 SN DR23444. NOTAPE OPTION ABENDS. **/ /** H0.04 950117 SN DR31886. CORRECT FILEDEF FOR TAPE3. **/ /** H2.05 950825 TWB DR33381 CHANGE FILEDEFs FOR V2; **/ /** ADD DBS VERSION OPTION. **/ /** H2.06 950829 SN DR33381 CHANGE COMMENTS. **/ /** H2.07 980630 SN DR42944 FOR V2, REMOVE TAPE2 AND TAPE4.**/ /** **/ /***********************************************************************/ beginuserhelp: /** DUL creates the application environment and invokes the Dump, **/ /** Unload and Load (DUL) facility, DULMAIN MODULE. The DUL utility **/ /** dumps partial, complete or multiple data bases and transfers the **/ /** dump to another DBC. DUL is used to move crash dumps from one **/ /** DBC to another. **/ /** **/ /** Syntax: DUL { runtime_options } { NOtape | DIsk } { V1 | V2 } **/ /** **/ /** where 'runtime_options' are the SAS/C runtime options; ie. **/ /** =nohcsig - specifies that the runtime environment will not **/ /** intercept program interrupts. **/ /** **/ /** DUL application parameters not passed to DULMAIN MODULE are: **/ /** NOtape - indicates that crash dump tapes are not desired. **/ /** DIsk - indicates that crash dump are on disk, not tape. **/ /** V1 - indicates that crash dump is from a V1 DBS (default).**/ /** V2 - indicates that crash dump is from a V2 DBS. **/ /** **/ /** NOTE: Is is not possible to LOAD crash dumps onto a V2 DBS **/ /** that were taken from a V1 DBS and visa-versa. **/ /** **/ /** See the 'DBC Data Base Computer Reference Manual' for a complete **/ /** list and description of DUL commands. See 'DULXQT EXEC' for **/ /** other examples of the CMS FILEDEF command. **/ /***********************************************************************/ enduserhelp: address command parse arg DulParms if DulParms = "?" | translate(DulParms) = "HELP" then call help /** Create DUL environment: /** - parse input parameters. /** - link host application /** software. /** if TapOpt then call attach_tape /** - attach and define tape. /** - define default ddnames. call parseparms "EXEC GETLINKT DULMAIN" if rc ^= 0 then call termit rc 414 **/ **/ **/ **/ **/ **/ **/ Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures "FILEDEF SYSIN TERMINAL (LRECL 84 RECFM V NOCHANGE" "FILEDEF SYSPRINT TERMINAL (LRECL 137 RECFM VBA NOCHANGE" "FILEDEF SYSABEND TERMINAL (LRECL 137 RECFM VBA NOCHANGE" "DULMAIN" RunTimOption DulRc = rc if TapOpt then call detach_tape "FILEDEF SYSIN CLEAR" "FILEDEF SYSPRINT CLEAR" "FILEDEF SYSABEND CLEAR" call termit DulRc termit: arg RetCod . "EXEC GETLINKT DETACH" exit RetCod /** Invoke SAS/C DULMAIN (DUL). **/ /** Restore user's environment: /** - detach tape. /** - clear default ddnames. /** /** /** /** /** /** /** - detach host software. **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ /*********************** PARSE INPUT PARAMETERS ************************/ /** THE NOTAPE AND DISK PARAMETERS ARE USED ONLY BY THE EXEC AND DOES **/ /** NOT GET PASSED TO THE APPLICATION: THE NOTAPE PARAMETER WILL **/ /** BYPASS ALL TAPE OPERATIONS AND THE DISK PARAMETER WILL DUMP TO **/ /** DISK. **/ /** **/ /** ALL INPUT PARAMETERS, EXCEPT NOTAPE, DISK, V1 and V2 ARE PASSED **/ /** TO THE APPLICATION MODULE. **/ /***********************************************************************/ parseparms: DBSVersion = "V1" TapOpt = 1 RunTimOption = "" if DulParms ^= "" then do do i = 1 to words(DulParms) DOpt = translate(word(DulParms,i)) if abbrev("NOTAPE",DOpt,2) | abbrev("DISK",DOpt,2) then TapOpt = 0 else if abbrev("V1",DOpt,2) then DBSVersion ="V1" else if abbrev("V2",DOpt,2) then DBSVersion ="V2" else RunTimOption = RunTimOption word(DulParms,i) end i end return /************************** ATTACH TAPE DRIVE **************************/ /** ENSURE TAPE DRIVE IS ATTACHED TO USER AS 181 AND DEFINE DUL TAPE **/ /** DDNAMES. **/ /***********************************************************************/ attach_tape: TapErrMsg = 0 do forever "EXECIO 0 CP (STRING QUERY VIRTUAL 181" if rc = 0 then leave else do if TapErrMsg then do say "-ERROR- Tape drive is not attached to" userid() "as 181" end call attach_tape_msg TapErrMsg = 1 end end /** forever **/ Utilities 415 Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures if DBSVersion = "V2" then do "FILEDEF TAPE1 TAP1 SL 1 (BLKSIZE /** "FILEDEF TAPE2 TAP1 SL 2 (BLKSIZE "FILEDEF TAPE3 TAP1 SL 2 (BLKSIZE /** "FILEDEF TAPE4 TAP1 SL 4 (BLKSIZE end if DBSVersion = "V1" then do "FILEDEF TAPE1 TAP1 SL 1 (BLKSIZE "FILEDEF TAPE2 TAP1 SL 2 (BLKSIZE "FILEDEF TAPE3 TAP1 SL 3 (BLKSIZE "FILEDEF TAPE4 TAP1 SL 4 (BLKSIZE end return 4114 7200 1916 2340 RECFM RECFM RECFM RECFM FB FB FB FB LRECL 4114" LRECL 24"DR42944 */ LRECL 958" LRECL 78"DR42944 */ 8200 7200 5280 2340 RECFM RECFM RECFM RECFM FB FB FB FB LRECL 8200" LRECL 24" LRECL 528" LRECL 78" attach_tape_msg: do forever say "" say "Press the <ENTER> key after the tape drive has been attached" , "to" userid() "as 181 or type QUIT to exit DUL" pull UsrResp . if UsrResp = "" then leave if abbrev("QUIT",UsrResp,2) then call termit 2 say "-ERROR- User input '"UsrResp"' invalid; retry" end /** forever **/ return /************************** DETACH TAPE DRIVE **************************/ /** QUERY USER TO DETACH TAPE DRIVE, THEN CLEAR DUL TAPE DDNAMES. **/ /***********************************************************************/ detach_tape: do forever say "" say "Would you like to detach the tape drive from" userid()"? Yes/No" pull UsrResp . if abbrev("YES",UsrResp,1) then do "EXECIO 0 CP (STRING DETACH 181" leave end if abbrev("NO",UsrResp,1) then leave say "-ERROR- User input '"UsrResp"' invalid; retry" end /** forever **/ "FILEDEF TAPE1 CLEAR" "FILEDEF TAPE2 CLEAR" "FILEDEF TAPE3 CLEAR" "FILEDEF TAPE4 CLEAR" return /***********************************************************************/ /** DISPLAY USER HELP MESSAGE AND EXEC VERSION NUMBER. **/ /***********************************************************************/ help: PrintFlag = 0 GetVersion = 1 do i = 1 to sourceline() HelpLine = translate(sourceline(i)) if GetVersion then do VersionLoc = find(HelpLine,"VERSION") if VersionLoc ^= 0 then do GetVersion = 0 416 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures VersionStr = subword(HelpLine,VersionLoc,2) end end if find(HelpLine,"ENDUSERHELP:") ^= 0 then leave i if PrintFlag then say sourceline(i) if find(HelpLine,"BEGINUSERHELP:") ^= 0 then do PrintFlag = 1 VersionLen = length(VersionStr) say "/"copies("*",55) VersionStr copies("*",73-59-VersionLen)"/" end end i exit 1 VM DUL EXEC Sample Procedure The following VM EXEC (DULXQT) sample procedure invokes the previously listed DUL EXEC after doing some preliminary setup (defining FILEDEFs). /****************************************************** VERSION H2.00 /** /** D B C V M / S P /** /** SAMPLE DRIVER TO INVOKE /** DUMP UNLOAD AND LOAD /** (DUL) /** /** DULXQT defines the ddnames before invoking the Dump, Unload and /** Load (DUL) utility, DULMAIN MODULE. The DUL utility dumps /** partial, complete or multiple data bases and transfers the dump /** to another DBC. DUL is used to move crash dumps from one DBC to /** another. /** /** Syntax: DULXQT { V1 | V2 } /** where V1 or V2 indicate the DBS version accessed. /** /** NOTE: Is is not possible to LOAD crash dumps onto a V2 DBS /** that were taken from a V1 DBS and visa-versa. /** /** The user must ensure that all FILEDEF's are properly linked and /** defined. DULXQT lists example FILEDEF's for DUL; all, but the /** first example, are commented out. The ddnames for DUL are: /** /** o SYSIN - defines the terminal or DUL input control file /** containing DBC statements. /** o SYSPRINT - defines the DUL output job log. /** o SYSABEND - defines the system abend message file. /** /** When the crash dumps are dumped to tape or disk, the ddnames /** are shown below and are defined in 'DUL EXEC': /** /** o TAPE1 - defines media written to first; dump dataset. /** o TAPE2 - defines media written to second; correspondence /** table (dbc.lib). /** o TAPE3 - defines media written to third; error log /** (dbc.errorlog). /** o TAPE4 - defines media written to last; memo table created /** by the coroner. /** Utilities **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ **/ 417 Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures /** The ddname parameters the user may wish to change are: **/ /** **/ /** FILEDEF SYSIN DISK 'input_fname ftype fmode' **/ /** FILEDEF SYSPRINT DISK 'log_fname ftype fmode' (LRECL 137 ... **/ /** RECFM VBA **/ /** FILEDEF SYSABEND DISK 'abend_fname ftype fmode' (LRECL 137 ... **/ /** RECFM VBA **/ /** **/ /** where user changes are identified by the lower case characters **/ /** within the single quotes. **/ /***********************************************************************/ address command arg InParms if InParms = "?" | InParms = "HELP" then call help DBSVersion = "V1" if InParms = "V2" then DBSVersion = "V2" /***********************************************************************/ /** EXAMPLE: This example runs DUL against the sample programs. **/ /** **/ /** The defined ddnames are: **/ /** o SYSIN - execute the DBC statements from the **/ /** sample input file 'DUL CNTL'. **/ /** o SYSPRINT - route the DUL job log to the terminal. **/ /** o SYSABEND - route the DUL system abend messages to **/ /** the terminal. **/ /** **/ /** When the crash dumps are dumped to tape, the ddnames **/ /** TAPE1, TAPE2, TAPE3 and TAPE4 are defined in 'DUL EXEC'.**/ /** **/ "FILEDEF SYSIN DISK DUL CNTL *" "FILEDEF SYSPRINT TERMINAL (RECFM VBA LRECL 137" "FILEDEF SYSABEND TERMINAL (RECFM VBA LRECL 137" "LABELDEF TAPE1 VOLID 000001" "EXEC DUL" DBSVersion DulRc = rc "TAPE RUN" "FILEDEF SYSIN CLEAR" "FILEDEF SYSPRINT CLEAR" "FILEDEF SYSABEND CLEAR" "LABELDEF TAPE1 CLEAR" exit DulRc /** reset user environment **/ /***********************************************************************/ /** EXAMPLE: This example runs DUL against the sample programs **/ /** without tape operations. **/ /** **/ /** The defined ddnames are: **/ /** o SYSIN - execute the DBC statements from the **/ /** sample input file 'DUL CNTL'. **/ /** o SYSPRINT - route the DUL job log to a file called **/ /** 'DUL SYSPRINT'. **/ /** o SYSABEND - route the DUL system abend messages to **/ /** a file called 'DUL SYSABEND'. **/ /** **/ /** "FILEDEF SYSIN DISK DUL CNTL *" **/ /** "FILEDEF SYSPRINT DISK DUL SYSPRINT A (LRECL 137 RECFM VBA" **/ /** "FILEDEF SYSABEND DISK DUL SYSABEND A (LRECL 137 RECFM VBA" **/ 418 Utilities Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures /** "EXEC DUL" DBSVersion "NOTAPE" **/ /** DulRc = rc **/ /** "PRINT DUL SYSPRINT A" **/ /** **/ /** "FILEDEF SYSIN CLEAR" /** reset user environment **/ **/ /** "FILEDEF SYSPRINT CLEAR" **/ /** "FILEDEF SYSABEND CLEAR" **/ /** exit DulRc **/ /** **/ /***********************************************************************/ /***********************************************************************/ /** EXAMPLE: This example runs DUL against the sample programs **/ /** will dump the DBC crash dumps to disk. **/ /** **/ /** The defined ddnames are: **/ /** o SYSIN - execute the DBC statements from the **/ /** sample input file 'DUL CNTL'. **/ /** o SYSPRINT - route the DUL job log to a file called **/ /** 'DUL SYSPRINT'. **/ /** o SYSABEND - route the DUL system abend messages to **/ /** a file called 'DUL SYSABEND'. **/ /** o TAPEn - DUL crash dump output, where 'n' **/ /** equals 1 to 4. **/ /** **/ /** "FILEDEF SYSIN DISK DUL CNTL *" **/ /** "FILEDEF SYSPRINT DISK DUL SYSPRINT A (LRECL 137 RECFM VBA" **/ /** "FILEDEF SYSABEND DISK DUL SYSABEND A (LRECL 137 RECFM VBA" **/ /** if DBSVersion = "V1" then do **/ /** "FILEDEF TAPE1 DISK DUL1 OUTPUT A (LRECL 8200" , **/ /** "BLKSIZE 8200 RECFM FB" **/ /** "FILEDEF TAPE2 DISK DUL2 OUTPUT A (LRECL 24" , **/ /** "BLKSIZE 7200 RECFM FB" **/ /** "FILEDEF TAPE3 DISK DUL3 OUTPUT A (LRECL 528" , **/ /** "BLKSIZE 5280 RECFM FB" **/ /** "FILEDEF TAPE4 DISK DUL4 OUTPUT A (LRECL 78" , **/ /** "BLKSIZE 2340 RECFM FB" **/ /** end **/ /** if DBSVersion = "V2" then do **/ /** "FILEDEF TAPE1 DISK DUL1 OUTPUT A (LRECL 4114" , **/ /** "BLKSIZE 4114 RECFM FB" **/ /** "FILEDEF TAPE2 DISK DUL2 OUTPUT A (LRECL 24" , **/ /** "BLKSIZE 7200 RECFM FB" **/ /** "FILEDEF TAPE3 DISK DUL3 OUTPUT A (LRECL 958" , **/ /** "BLKSIZE 1916 RECFM FB" **/ /** "FILEDEF TAPE4 DISK DUL4 OUTPUT A (LRECL 78" , **/ /** "BLKSIZE 2340 RECFM FB" **/ /** end **/ /** "EXEC DUL" DBSVersion "DISK" **/ /** DulRc = rc **/ /** "PRINT DUL SYSPRINT A" **/ /** **/ /** "FILEDEF SYSIN CLEAR" /** reset user environment **/ **/ /** "FILEDEF SYSPRINT CLEAR" **/ /** "FILEDEF SYSABEND CLEAR" **/ /** "FILEDEF TAPE1 CLEAR" **/ /** "FILEDEF TAPE2 CLEAR" **/ /** "FILEDEF TAPE3 CLEAR" **/ /** "FILEDEF TAPE4 CLEAR" **/ Utilities 419 Chapter 12: Dump Unload/Load Utility (dul, dultape) Sample Procedures /** exit DulRc **/ /** **/ /***********************************************************************/ /******************************** HELP *********************************/ help: do i = 1 to sourceline() if word(translate(sourceline(i)),1) = "ADDRESS" then leave i say sourceline(i) end i exit 1 /** **/ /** CHANGE HISTORY: **/ /** D.01 851201 SN DR5273. STANDARDIZE EXECS. **/ /** F.02 880613 SN DR11126. DUL DBC DUMP TO DISK. **/ /** G.00 901106 SN DCR5767. CHANGE PASCAL DUL TO SAS/C. **/ /** G.01 910123 SN DCR5767. CHANGE NAME FROM CDUL TO DUL. **/ /** H0.02 950117 SN DR31886. CORRECT FILEDEF FOR TAPE3. **/ /** H2.03 950825 TWB DR33381 V2 VERSION DCB'S ADDED; **/ /** DBS VERSION ADDED. **/ /** H2.04 950829 SN DR33381 FIX COMMENTS. **/ 420 Utilities CHAPTER 13 Ferret Utility (ferret) The Ferret utility, ferret, lets you display and set disk space utilization attributes of the Teradata Database. Ferret dynamically reconfigures the data in the Teradata file system while maintaining data integrity during changes. Ferret works on various data levels as necessary: vproc, table, subtable, WAL log, disk, and cylinder. Audience Users of Ferret include the following: • Field engineers • Teradata Database system engineers • Teradata Database developers Users should have an understanding of the basic storage structures of the Teradata Database file system. User Interfaces Ferret runs on the following platforms and interfaces: Platform Interfaces MP-RAS Database Window Windows Database Window Linux Database Window For general information on starting the utilities from different platforms and interfaces, see Appendix B: “Starting the Utilities.” Note: You must use Ferret while the Teradata Database is running and in the Logons Enabled state and not in Debug-Stop under the System Debugger (GDB). Utilities 421 Chapter 13: Ferret Utility (ferret) Redirecting Input and Output (INPUT and OUTPUT) Redirecting Input and Output (INPUT and OUTPUT) When you first start Ferret, it accepts input from STDIN, the console input file, and directs output to STDOUT, the console output file. By using the Ferret INPUT and OUTPUT commands, you can redirect the Ferret input and output data to files that you specify. Also, you can do the following: • Append Ferret data output to an existing output file • Overwrite an existing output file • Write only to a new file • Display the current output file When you direct output to a file with the OUTPUT command, Ferret echoes all input and diagnostic messages to that file. For more information, see “INPUT” on page 446 and “OUTPUT” on page 447. About the Teradata Database File System The Teradata Database file system is not a general-purpose file system. It helps isolate the Teradata Database from hardware platform dependencies. The file system supports the creation and maintenance of database tables under the direction of the Teradata Database. The file system provides a set of low-level operations and is largely unaware of the higher-level intent of a particular sequence of calls made by the Teradata Database to file system procedures. For more information about the Teradata Database file system, see Database Administration. Data Blocks and Cylinders In the Teradata Database file system, a data block (also known as a DB) is a disk-resident structure that contains one or more rows from the same table. Any single row is fully contained within a single data block, and every data block must be fully contained within a cylinder. A cylinder is a group of consecutive disk sectors, but not necessarily identical to a physical disk cylinder. Because new disks use different zones of cylinder sizes to increase the storage capacity of the disk, the file system uses an average cylinder size. Each cylinder used by the file system is logically independent from other cylinders. For more information about data blocks and cylinders, see Database Design. 422 Utilities Chapter 13: Ferret Utility (ferret) About Write Ahead Logging (WAL) Performance Considerations Depending on how the Ferret utility is used, certain Ferret commands can alter the performance behavior of the Teradata Database. For example, if the cylinders are packed 100% full, inserts take longer than if the cylinders are 50% full, but full file scans can run faster. About Write Ahead Logging (WAL) WAL is a log-based file system recovery scheme in which modifications to permanent data are written to a log file, the WAL log. The log file contains change records (Redo records) which represent the updates. At key moments, such as transaction commit, the WAL log is forced to disk. In the case of a reset or crash, Redo records can be used to transform the old copy of a permanent data block on disk into the version that existed at the time of the reset. By maintaining the WAL log, the permanent data blocks that were modified no longer have to be written to disk as each block is modified. Only the Redo records in the WAL log must be written to disk. This allows a write cache of permanent data blocks to be maintained. WAL protects all permanent tables and all system tables but is not used to protect either the Transient Journal (TJ), since TJ records are stored in the WAL log, or any type of spool tables, including global temporary tables. The WAL log is maintained as a separate logical file system from the normal table area. Whole cylinders are allocated to the WAL log, and it has its own index structure. The WAL log data is a sequence of WAL log records and includes the following: Utilities • Redo records, used for updating disk blocks and insuring file system consistency during restarts. • TJ records used for transaction rollback. 423 Chapter 13: Ferret Utility (ferret) Ferret Command Syntax Ferret Command Syntax This section describes the general conventions involved in typing Ferret commands. Then, each Ferret command is described, with syntax options, parameters, and keywords. Usage notes and examples are provided if appropriate to the command. Typing Commands The following is the general form for a command entry. You can type cmdoption or /dispopt at the beginning or end of the command. The syntax diagram only shows the option at the beginning. ; cmd cmdoption parameter /dispopt /Y GT06C001 where: Syntax element … Specifies … cmd the command or commands separated by a semicolon (;). cmdoption options that are specific to the command that you type. Different options pertain to specific commands. To determine the allowed options, see the specific command. /dispopt the following: Syntax element … Specifies the … /S short display of information. /M medium display of information. /L long display of information for the objects within the scope. This option is available only for the SHOWBLOCKS command. For detailed information, see “SHOWBLOCKS” on page 479. 424 Utilities Chapter 13: Ferret Utility (ferret) Ferret Command Syntax Syntax element … /Y Specifies … the following: IF the … THEN Ferret… option is set to /Y, does not prompt for confirmation of the command. /Y confirmation setting is omitted for a command where confirmation is required prompts for confirmation of the command before it executes the final step. This confirmation option is not available for all commands. Only specific commands allow you to use it. If a command takes /Y, the command does not take any other options. parameter Parameters are included only with specific commands. Types of parameters include multitoken parameters and decimal or hexadecimal numeric input. Command Usage Rules Although several command options are specific to a particular Ferret command, the following command usage rules apply to Ferret commands: • • A space is required between the following: • The cmdoption and the parameter • The cmd and the parameter if either you do not specify cmdoption or if the cmdoption is at the end of the command You can combine multiple Ferret commands on a single command line, as shown below: command ; command ; GS04A004 • Ferret is case insensitive, which means that you can enter any command, keyword, or option in uppercase, lowercase, or mixed-case letters. • If you end a command line with a backward slash (\), the command line continues on the next line. • If an error occurs during processing of a string of commands, processing stops because the latter commands usually depend on the correct processing of commands entered earlier. • If an error occurs while parsing the command line, you can type a single question mark (?) as the next command. Ferret displays a list of alternatives expected by the parser at that point of the syntax error. Note: If you type another single question mark (?) after Ferret displays the alternatives, Ferret returns the HELP text for the command in question. Utilities 425 Chapter 13: Ferret Utility (ferret) Ferret Command Syntax The following example shows help information about the RADIX command: Ferret ==>radix in dex radix in de<-Syntax error->x Ferret ==> ? Valid input at the point of error is: ; end of command Ferret ==> ? RADIX [ ( IN/PUT | OUT/PUT ) ] [ ( H/EX | D/EC ) ] Ferret ==> ? RADIX [ ( IN/PUT | OUT/PUT ) ] [ ( H/EX | D/EC ) ] Sets the Flags for how to treat Unqualified numbers. Either Hex (base 16) or Decimal (Base 10), respectively. See HELP NUMBER for a description of unqualified INPUT. The initial setting of these Flags is HEX. If neither INPUT nor OUTPUT is specified the command applies to both Flags. If neither HEX nor DEC is specified, the current setting of the Flag is displayed. Ferret ==> ? No more information available. • Use HELP /L Comments are allowed anywhere a blank is allowed. Enclose comments between braces ({}). If Ferret does not find a closing brace ( } ) on a line, Ferret interprets the rest of the line as a comment, as shown in the following example: Ferret ==> SCANDISK db 0 2 1fa { this is the broken data block • If you use a single question mark (?) in place of a legal syntactic element, Ferret informs you as to what you can type at that point in the command, as shown below: Ferret==> output ? Valid input at the ? is : , INTO OVER end of command TO ON ; In this example, Ferret accepts any of the following: • A comma (,) • INTO • OVER • TO • ON • A semicolon (;) Other examples of using a single question mark (?) in place of a legal syntactic element are shown below: output output output output 426 ? ?{comment} ? {comment {comment} ? Utilities Chapter 13: Ferret Utility (ferret) Using Ferret Parameters Using Ferret Parameters The variable, parameter, in the Ferret syntax diagram includes various types of parameters, including multitoken parameters and decimal and hexadecimal numeric input. Multitoken Parameters Multitoken parameters, such as a subtable identifier (tid) that is typed as three values, are typed on a single line with one or more spaces separating the individual tokens. Ferret also accepts multitoken parameters separated by hyphens. For example, Ferret accepts either of the following as subtable identifiers: 0 200 0 0-200-0 You can separate parameters from each other and from the command by spaces or a comma. To specify a command option (cmdoption), type it on the same line as the command (cmd). Numeric Input You can input numeric values into Ferret as either decimal or hexadecimal form. The numeric base for data input to and output from Ferret depends on the radix setting of hexadecimal or decimal. For more information on setting the default radix, see “RADIX” on page 456. In addition to the general rules for typing decimal and hexadecimal values, the following rules also apply to typing values so that hexadecimal entries can be recognized as decimal characters and decimal entries can be recognized as hexadecimal characters: • Decimal values are denoted as a string of decimal digits (0-9) with a trailing period, as shown in the following example: 4591. • Hexadecimal values are denoted as a string of hexadecimal digits (0 through 9 or A through F (or a through f)) with a trailing H, as shown in the following example: 459aH Note: The H can be lowercase or uppercase, and the leading zero is optional, as in FFh and 0ffH. • Ferret also accepts GDB-style hexadecimal numbers, which consist of 0x followed by hexadecimal digits, as shown in the following example: 0x45F • Ferret allows 0i (where i represents an integer) followed by decimal digits to be recognized as a decimal number. The variations of the decimal number 45 are shown in the following examples: 45. 2DH 0i45 0x2D i45 x2D Note: The leading zero is optional, and the i or x can be a lowercase or uppercase letter. The exception is 0d, since it is a legal hexadecimal number. • Utilities Ferret uses a default radix, initially set to decimal, which is used as the numeric base of a number, if not otherwise explicitly forced. 427 Chapter 13: Ferret Utility (ferret) Using Ferret Parameters For example, an entry of 45, depending on the current default radix, can be either of the following: 45. 0x45 An entry of 2D with a default radix of decimal is an error. • You can type all number values in Ferret as unsigned 16-bit values, 0 through 65535 (0x0 to 0xFFFF). The following entry is incorrect because FF is a hexadecimal character, and the i, which represents integer, indicates a decimal number: 0i45FF The following entry is also incorrect because it contains a space. The entry actually represents two numbers: 0i45 FF Specifying a Subtable Identifier (tid) A subtable identifier (tid) uniquely identifies a subtable. A subtable is a collection of rows. The rows of a particular subtable may be data rows, index rows, table header rows, etc. A table is a collection of subtables. Ferret commands operate on subtables, not on tables. The tid argument is used to identify a subtable to a Ferret command. The tid must identify not only the table of interest, but also the subtable of interest. A table is identified in the data dictionary by a table number (tvm.tvmid). Each table number is unique across the whole system, rather than local to a database. To identify a subtable, you must supply a tid, which is composed of a tablenumber (or TableNameString) and a typeandindex value. The tablenumber or TableNameString identifies the relevant table, and the typeandindex value identifies the relevant subtable. The subtable identifier, tid, is defined as follows: TableNameString typeandindex tablenumber = 1102A159 where: 428 Utilities Chapter 13: Ferret Utility (ferret) Using Ferret Parameters Syntax element … Specifies … TableNameString the database name and table name, which uniquely identifies a table in the system. A period (.) is required to separate databasename from tablename, and the string must be entered using either single ( ' ) or double ( " ) quotes. "databasename.tablename" "databasename"."tablename" 'databasename.tablename' 'databasename'.'tablename' 1102A160 tablenumber a pair of numbers, separated by a space, used to uniquely identify a table in the system. = Specifies that Ferret should use the most recently saved value for tablenumber This option cannot be used unless an input value has already been defined for tablenumber. typeandindex a kind of subtable, such as a table header, data subtable, or a particular index subtable. Note: typeandindex is a required component of tid. For example, you must use Scope Table ("xyz.empx"*) instead of Scope Table ("xyz.empx". The syntax for typeandindex is as follows: type / index / variant number 1102A095 where: Utilities 429 Chapter 13: Ferret Utility (ferret) Using Ferret Parameters Syntax Element Description type The type of subtable. type can be one of the following: index Type Description * All the subtables of this table. H The table header subtable. P The primary data subtable. F number The fallback data subtable specified by number. The default is 1. F* All of the fallback subtables. The index subtable to examine. If the index subtable is not given, it defaults to the data subtable. Index 1 is the first secondary index, Index 2 is the second secondary index, and so on. index can be one of the following: Index Description number A secondary index and can be used instead of specifying X number. If you enter number by itself, then number must be a multiple of 4 and it is interpreted in the following way: • • • • variant number = 0 is the same as entering X0 number = 4 is the same as entering X1 number = 8 is the same as entering X2 number = 12 is the same as entering X3 etc. * All the indexes of the table. D The primary data index (same as X0 or 0). X number The secondary index specified by number. The default is 1. X* All the secondary indexes, starting at 0. The possible subtables. variant can be one of the following: 430 Utilities Chapter 13: Ferret Utility (ferret) Using Ferret Parameters Syntax Element Description variant (cont) Variant Description * All the possible variant subtables. 0 The default. If you do not specify variant, 0 is assumed. 1 The value during a Sort or Table Modify operation. 2 A value that is not used. 3 A value that is not used. Note: If you do not specify /variant, it defaults to 0 because this field is always 0. However, during Sort or Table Modify processing, this value becomes 1. number A single number that represents internally both the type of subtable (header, primary, or fallback) and the index to use to order the rows by (primary data index or one of the secondary indexes) and the variant. Any number used instead of type[/index[/variant]]. Since the table header subtable has only one row and has no secondary indexes or work subtables such as H/X4/3, Ferret ignores the second part of this format and gives a table header display. The following table gives examples that describe the type and index fields. Each column in the table shows the syntax of a specific subtable listed under the column heading, Subtable Description. Utilities Subtable Description Number Type Table header 0 H Primary data subtable 1024 P First secondary index 1028 First fallback table 2048 Second secondary index of the third fallback table 4104 Type/ Index Type/Index/ Variant P/D P/X1 F1 F1/D F3/X2 All primary subtables P/* All primary secondary indexes P/X* All fallback subtables F* All subtables of this table * 431 Chapter 13: Ferret Utility (ferret) Classes of Tables Subtable Description Number Sort table of the first secondary index 1029 Both tables during a sort of the first secondary index Type Type/ Index Type/Index/ Variant P/X1/1 P/X1/ * Example Assume that table T4 is a table in database XYZ and has a tablenumber of 0 1198. Also assume that Ferret is currently set so that input is accepted in hexadecimal format. Some valid specifications of a tid for primary subtables of table T4 are as follows: • “XYZ.T4” 400 • “XYZ.T4” 1024. • “XYZ”.”T4” P • ‘XYZ’.‘T4’ 400 h • 0 1198 400 • 0 1198 P Classes of Tables The Teradata Database differentiates among the following four classes of tables. You can specify a table classification when defining the SCOPE parameters of an action. Table Type Description Permanent Journal (PJ) Tables Tables that can survive system restarts, but do not contain user-visible data. Permanent Tables Tables containing the real data, which can survive system restarts. Temporary Tables Tables that can exist as either global or volatile temporary tables as defined below: Each PJ table contains data generated internally by the Teradata Database. The PJ data is usually used to restore the journaled tables to a given checkpointed state by rolling transactions forward or backwards from an archived copy of the tables. • Global temporary tables exist only during the duration of the SQL session in which they are used. • Volatile temporary tables reside in memory and do not survive a system restart. 432 Utilities Chapter 13: Ferret Utility (ferret) Vproc Numbers Table Type Description Spool Tables Tables that contain non-permanent data and can be divided into classes according to their scope of persistence. Intermediate result spool tables hold temporary results during the processing of a single SQL query and persist only for the duration of that processing. Response spool tables hold the final answer set from a query and a limited number can optionally persist across further queries in the same session. Spool tables can be discarded as follows: • • • • Normally, when they are no longer needed. As part of a specific resource cleanup on a transaction abort or session logoff. As part of a general resource cleanup every time the system restarts. Rows for volatile tables are placed in spool spaces and are discarded at the end of a transaction or at the end of a session (depending on a table option or by a DROP TABLE statement). • Volatile table definitions reside in memory and do not survive a system restart. The attributes associated with each class of tables can affect system performance, since the attributes are set individually, and each class of tables is used for a different purpose. For example, you might want to pack only Permanent and PJ tables and leave Spool tables unmodified. Therefore, you would specify these tables when defining the SCOPE of the PACKDISK command. Vproc Numbers In Ferret, the vproc number (vproc_number) is used in the SCOPE command to specify one vproc or a range of vprocs for which the utility performs an action, such as reconfiguration or disk space display. A vproc number consists of a single number in the range 0 to 65535 (0x0 to 0xFFFF). For the Teradata Database, only the first 16383 (0x400) vproc numbers are available. Utilities 433 Chapter 13: Ferret Utility (ferret) Ferret Commands Ferret Commands Ferret gives you a wide range of commands that allow you to display specific information about the Teradata Database system, and optimize the system to improve performance. Use Ferret commands to: • Define the level or scope of a command, such as a range of tables, vprocs, cylinders, or the WAL log. • Display the parameters and scope of a previous action. • Perform an action to increase performance, such as moving data to reconfigure data blocks and cylinders. • Displaying utilization of disk space by percentage and cylinders Defining Command Parameters Using SCOPE Some Ferret commands require that you first define the parameters, or scope, of the action you want to initiate. The SCOPE command allows you to limit the command action in the following areas: 434 SCOPE Parameter Variables VPROCS • A single vproc • A range of vprocs • All vprocs in a configuration CYLINDERS • A single cylinder • A set of cylinders TABLES • • • • WAL The WAL log A single table A set of tables All tables in the system All class of tables Utilities Chapter 13: Ferret Utility (ferret) Ferret Commands Summary of Ferret Commands The following table summarizes the Ferret commands, their valid scopes, and gives a brief description of the function of each command: Command Valid SCOPE Options Function DATE/TIME None Displays the current system day, date, and time. DEFRAGMENT Vprocs and Cylinders, Vprocs and Tables, or Tables Combines free sectors, and moves them to the end of a cylinder. DISABLE None Sets a specific flag in the file system to FALSE, disabling certain features of Ferret. Most such flags are for internal use only. ENABLE None Sets a specific flag in the file system to TRUE, enabling certain features of Ferret. Most such flags are for internal use only. ERRORS None Redirects diagnostic messages to a file that you specify or to the default file STDERR. Using the ERRORS command, you can append an existing message file, overwrite an existing message file, write only to a new file, or display the current diagnostic message file. HELP None Provides general help for Ferret or detailed help if you specify an option or parameter. INPUT None Informs Ferret to read commands from a specified file rather than from the default input file STDIN. OUTPUT None Redirects Ferret output to a file you specify or to the default file STDOUT. PACKDISK Vprocs or Tables Reconfigures cylinders within a defined scope. PRIORITY None Sets the priority class of the Ferret process. QUIT None Ends a Ferret session. RADIX None Sets the default radix used as the numeric base for Ferret data input and output. SCANDISK WAL log, Vprocs, and Vprocs and Tables Performs a verification of the file system B-Tree structure. SHOWBLOCKS WAL log, Vprocs, and Vprocs and Tables Displays data block size and the number of rows per data block, or the data block size only for a defined scope. SHOWDEFAULTS None Displays the current default radix for input and output, the current input, output, and error file names, and the current scope settings. SHOWFSP Vprocs, and Vprocs and Tables Displays table names and space utilization for those tables that would free or consume some number of cylinders if PACKDISK is executed at a particular FSP. The scope can include one or more tables, one or more vprocs, or the entire system. Utilities 435 Chapter 13: Ferret Utility (ferret) Ferret Commands Command Valid SCOPE Options Function SHOWSPACE WAL log, Vprocs, and Vprocs and Tables Displays disk space utilization for permanent, spool, WAL log, temporary, and journal data, including the amount of free disk space remaining. TABLEID None Displays the table number of the specified table when given the database name and table name. UPDATE DATA INTEGRITY FOR None Updates the data integrity checksum level of a table type. Ferret Error Messages All Ferret error messages are directed by default to your system console screen. Ferret and file system error messages can be redirected through use of the ERRORS command. For more information on file system messages, see Messages. 436 Utilities Chapter 13: Ferret Utility (ferret) DATE/TIME DATE/TIME Purpose The DATE or TIME command shows the current system day, date, and time. Syntax DATE GS04A013 TIME GT06A027 Usage Notes The DATE or TIME command shows a timestamp in the following format: DDD mmm dd, yyyy HH:MM:SS where: Format … Specifies … DDD the day of the week. mmm dd, yyyy the calendar month, day, and year. HH:MM:SS the time in hour, minutes, and seconds. Example Example outputs generated by Ferret are shown below: Ferret ==> date Tue Jun 13, 2000 12:04:58 Ferret ==> time Tue June 13, 2000 12:06:15 Utilities 437 Chapter 13: Ferret Utility (ferret) DEFRAGMENT DEFRAGMENT Purpose Caution: Because of the difficulty in determining how severely a cylinder is fragmented, only trained personnel should use this command. The DEFRAGMENT command causes free sectors on each qualifying logical cylinder contained within the current scope to be combined together into a single contiguous block of free space on that cylinder. The scope used is designated by the SCOPE command or the default if no SCOPE command was issued. Syntax DEFRAGMENT DEFRAG /Y FORCE /Y GT06C007 where: Syntax element … Specifies … /Y the confirmation of the DEFRAGMENT command. You are then given the option to stop the command. FORCE to defragment every cylinder whether a cylinder meets the criteria specified in Usage Notes below. Usage Notes Unless the FORCE option is used, the DEFRAGMENT command performs defragmentation of a logical cylinder within the scope only if all of the following criteria are met. • More than one free block is on the cylinder, so there is something that could be combined. • 25% or more free sectors are on the cylinder. • The average free block size is less than the average size of a data block on that cylinder. If the FORCE option is used, the DEFRAGMENT command performs defragment of a logical cylinder within the scope if it has more than one block of free space. In that case, it will defragment a cylinder regardless of the percentage of free sectors or average block sizes. Note that the DEFRAGMENT operation does not change the size or content of any data blocks. Existing blocks may be moved, but they are otherwise unchanged. 438 Utilities Chapter 13: Ferret Utility (ferret) DEFRAGMENT For each AMP, the Ferret indicates how many cylinders it will attempt to defragment. For example: vproc 2 response Requested Cylinder Range had 197 cylinders placed on the defrag list Upon completion, for each amp, the actual number of cylinders defragmented will be logged into the system's message log. For example: 002507 14:47:07 043100d6 ... 44 8 340516600|appl|1|S|I|U|0|0|M|0|0|PDE|0|0|0|1#PDElogd: Event number 3405166-00 (severity 10, category 10) 5166: Defragment of cylinder[s] occurred. On Wed Jun 20 14:47:07 2007 on NODE 001-01, VPROC 2, partition 9, task fsubackgrnd 197 cylinder[s] defragmented Defragmentation proceeds as a background task, and can continue to run even after the Ferret prompt returns. To determine when defragmentation has completed, check DBC.SW_Event_Log for event_tag=34-05166-00. Example The following example shows the output that DEFRAGMENT generates: Ferret ==> defrag /y Defrag has been sent to all AMP vprocs in the SCOPE. Type ‘ABORT’ to stop them before completion vproc 0 response Requested Cylinder Range had 5 cylinders placed on the defrag list vproc 1 response Requested Cylinder Range had 9 cylinders placed on the defrag list Aborting DEFRAGMENT To stop the DEFRAGMENT command at any time, use the following ABORT command syntax: ABORT . GT06A021 ABORT can take up to 30 seconds to begin. After it is initiated, ABORT stops the defragmenting and reports the current status of the vprocs. When the abort is successful, you get the following prompt: Ferret ==> defrag /y Defrag has been sent to all AMP vprocs in the SCOPE. Utilities 439 Chapter 13: Ferret Utility (ferret) DEFRAGMENT Type ’ABORT’ to stop before completion ABORT Abort request has been sent vproc 0 response Aborted: Requested Cylinder Range had 11 cylinders placed on the defrag list vproc 1 response Aborted: Requested Cylinder Range had 11 cylinders placed on the defrag list Ferret ==>= 440 Utilities Chapter 13: Ferret Utility (ferret) DISABLE DISABLE Purpose The DISABLE command sets a specified flag in the file system to FALSE. This disables certain features of Ferret. Syntax , DISABLE DISA flag ? GS04C014 where: Syntax element … Specifies … flag Specifies the flag that will be set to false. The following flags are available: • SCRIPT, SCRIPT MODE, and SCRIPTMODE When script mode is disabled, the Ferret ABORT and INQUIRE commands are enabled. Script mode is disabled by default. Script mode should be enabled before running scripts that call Ferret. The following flags are for internal use only, and should not be disabled or enabled: • CHECK and CHECKTS ? Displays a complete list of available flags. Example An example is shown below: Ferret ==> disable script Utilities 441 Chapter 13: Ferret Utility (ferret) ENABLE ENABLE Purpose The ENABLE command sets a specified flag in the file system to TRUE. This enables certain features of Ferret. Syntax , ENABLE ENA flag ? GS04C015 where: Syntax element … Specifies … flag Specifies the flag that will be set to true. The following flags are available: • SCRIPT, SCRIPT MODE, and SCRIPTMODE Script mode is disabled by default. When script mode is enabled, the Ferret ABORT and INQUIRE commands are disabled to allow a script to run without interruption. Script mode should be enabled before running scripts that call Ferret. The following flags are for internal use only, and should not be disabled or enabled: • CHECK and CHECKTS ? Displays a complete list of available flags. Example An example is shown below: Ferret ==> enable script 442 Utilities Chapter 13: Ferret Utility (ferret) ERRORS ERRORS Purpose The ERRORS command redirects diagnostic messages to a file that you specify or to the default file STDERR. If nothing is specified, the name of the files where errors are directed displays. Syntax ERRORS TO file INTO STDERR OVER ME GT06C008 where: Syntax element … Specifies … TO that Ferret is to write diagnostic messages to a new file or to STDERR. If the file specified exists, Ferret returns an error. INTO that Ferret is to append diagnostic messages to a specified file or to STDERR. If the file already exists, Ferret appends the error messages to the end of the file. If the file does not exist, Ferret creates the file automatically. OVER that Ferret is to overwrite an existing file or STDERR with current diagnostic messages. If the file already exists, Ferret writes over the file. If the file does not exist, Ferret creates the file. file the name of the destination file for diagnostic messages. STDERR the default file to which Ferret writes diagnostic messages. ME the synonym for STDERR. Usage Notes When you start Ferret, it writes diagnostic messages to STDERR by default. You can use the ERRORS command to redirect the diagnostic messages in the following ways: Utilities • To write to a new file only • To append an existing file 443 Chapter 13: Ferret Utility (ferret) ERRORS • To overwrite an existing file • To display on your console If you include the file parameter in the ERRORS command, the file you specify becomes the destination for diagnostic messages redirected from STDERR. If you type the ERRORS command without any options, Ferret shows the name of the current diagnostic messages file STDERR on your system console. Example The following example shows the format for redirecting diagnostic messages into a specific file and directory: Ferret ==> Errors over /home/dcl/Ferret.error 444 Utilities Chapter 13: Ferret Utility (ferret) HELP HELP Purpose The HELP command provides general help for Ferret or detailed help if you specify an option or parameter. Syntax HELP H /L ALL keyword ? GT06C009 where: Syntax element … Specifies the … /L long form of a help display, showing parameter descriptions in addition to command syntax. If you do not type /L, Ferret assumes the short form of the help display, which shows command syntax only. ALL available help for all Ferret commands and parameters. This is the default. keyword Ferret command or parameter name. If you do not specify either a keyword or ALL, HELP lists all of the commands that you can type at the Ferret prompt. ? a list of all keywords for which help is available. Example The following is an example of output that HELP generates: Ferret ==> Help /L Radix RADIX [ ( IN/PUT | OUT/PUT ) ] [ ( H/EX | D/EC ) ] Sets the Flags for how to treat Unqualified numbers. Either Hex (base 16) or Decimal (Base 10), respectively. See HELP NUMBER for a description of unqualified INPUT. The initial setting of these Flags is HEX. If neither INPUT nor OUTPUT is specified,the command applies to both Flags. If neither HEX nor DEC is specified, the current setting of the Flag is displayed. Utilities 445 Chapter 13: Ferret Utility (ferret) INPUT INPUT Purpose The INPUT command informs Ferret to read commands from a file you specify rather than from the default input file STDIN. Syntax INPUT FROM file IN GT06B010 where: Syntax element … Specifies … file the name of a file you specify as the source of command input to Ferret. Usage Notes When you first start Ferret, it accepts input from the STDIN file by default. Using the INPUT command, you can redirect input from any file you specify. When Ferret reaches the end of the file you specify, Ferret again accepts input from you, if the file does not instruct Ferret to quit. You can nest the INPUT command inside command files to a maximum of nine files deep. Example The following command example shows the format for redirecting input from a file in a specific directory: Ferret ==> Input from /home/user1/commands 446 Utilities Chapter 13: Ferret Utility (ferret) OUTPUT OUTPUT Purpose The OUTPUT command redirects Ferret output to a file you specify or to the default file STDOUT. Syntax OUTPUT OUT TO file INTO STDOUT OVER ME GT06C011 where: Syntax element … Specifies … TO that Ferret is to redirect output to a new file or to STDOUT. If the file exists, Ferret returns an error. INTO that Ferret is to append output to an existing file specified by file or to STDOUT. If the file exists, Ferret appends the output to the end of the file. If the file does not exist, Ferret creates the file. OVER that Ferret is to overwrite an existing file or STDOUT with new Ferret output. If the file exists, Ferret writes over the file. If the file does not exist, Ferret creates the file. file name of the file you specify as the destination of Ferret output. STDOUT default file to which Ferret writes output. ME synonym for STDOUT. Usage Notes When you start Ferret, diagnostic messages are written to STDOUT by default. You can use the OUTPUT command to redirect Ferret output in any of the following ways: Utilities • To write to a new file only • To append an existing file • To overwrite an existing file • To display on your console 447 Chapter 13: Ferret Utility (ferret) OUTPUT When Ferret redirects output to a file, all input and diagnostic messages are echoed to the output file as well as to their usual destinations. If you include the file parameter in the OUTPUT command, Ferret uses that parameter as the destination for output redirected from STDOUT. If you type the OUTPUT command without any options, Ferret displays the name of the current output file STDOUT to your system console. Example The following command example shows the redirecting of Ferret output into a specific file: Ferret ==> Output into /home/user1/output.file 448 Utilities Chapter 13: Ferret Utility (ferret) PACKDISK PACKDISK Purpose The PACKDISK command reconfigures the contents of a disk, leaving a percentage of free space for cylinders within a scope defined by the SCOPE command. For additional information, see “SCOPE” on page 468. Syntax PACKDISK /Y number FREESPACEPERCENT FREE = FSP GT06B012 where: Syntax element … Specifies … /Y to bypass user confirmation. If you do not specify the /Y option, then Ferret requests for user confirmation before proceeding with PACKDISK. number percentage of free space to be left in the cylinder(s). What PACKDISK Does PACKDISK packs either the entire disk or a single table, leaving a specified percentage of the scoped object empty to account for subsequent insert and update operations. Packing applies only to entire logical cylinders, not to the space inside individual data blocks within those cylinders. Data block sizes are the same before and after the PACKDISK operation. For a cylinder, the free space percent is a minimum percentage that indicates how much extra free space should be left on each cylinder during a data loading operation. This allows you to reserve space for future updates. For details, see “Ferret Command Syntax” on page 424 and “Ferret Commands” on page 434. The amount of free space to be allotted is determined from one of three possible values. In order of precedence, these values are as follows: 1 Caution: Utilities The FREESPACEPERCENT value specified using PACKDISK. Generally, you should accept the default values for Free Space Percent established in the Table Level Attributes or in the DBS Control record. 449 Chapter 13: Ferret Utility (ferret) PACKDISK Assuming that your system-level default is acceptably defined and the table-level attributes for any tables not conforming to the defined system-level default also are reasonably defined, you should not specify a value for FREESPACEPERCENT unless you are testing for the optimal FSP setting in situations such as the following: • Preliminary tests scoped to a small prototype table to determine the most optimal value for the FSP. • Later tests of various FSPs on live tables that you think might require adjustment to ensure more optimal cylinder packing in the future. This list is not exhaustive. The point is that you should not routinely specify a FREESPACEPERCENT for PACKDISK. 2 The Table Level Attribute value specified by the FREESPACE variable in CREATE TABLE and ALTER TABLE. For more information on CREATE TABLE and ALTER TABLE, see “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. 3 The system-level value specified by the FreeSpacePercent field in the DBS Control record. For additional information, see Chapter 11: “DBS Control (dbscontrol).” In other words, PACKDISK determines the FSP to use for packing cylinders as follows. 1 Check for a FREESPACEPERCENT value in the PACKDISK command stream. IF … THEN … a value is specified use it as the FSP specification for all tables affected by this PACKDISK operation. Begin the PACKDISK operation. no value is specified 2 Go to stage 2. Check for an FSP value in the Table Level Attributes for each affected table as PACKDISK runs. IF … THEN … a value is specified for the current table use it as the FSP specification for packing cylinders that contain the current table. Begin the PACKDISK operation. no value is specified check the FreeSpacePercent field in the DBS Control record and use the value specified there as the free space percent when packing cylinders containing the current table. Begin the PACKDISK operation. 450 Utilities Chapter 13: Ferret Utility (ferret) PACKDISK Guidelines for Selecting an Optimal Value for FSP It is not possible to provide concrete guidelines for determining the values of FSP you should use because the optimal percentages are highly dependent on the individual mix of workload, tables, and applications in use by a site. Because of the way PACKDISK packs cylinders, some might still be fragmented after the procedure completes. If this happens, use the DEFRAGMENT command to defragment the cylinder. For information, see “DEFRAGMENT” on page 438. The scope for PACKDISK can be either vprocs or TABLES (but not both). The SHOWFSP command helps estimate the effectiveness of PACKDISK commands by providing information regarding cylinder utilization. In particular, you can use SHOWFSP to find loosely packed tables. The SHOWFSP command displays table names and space utilization for those tables that would free or consume some number of cylinders if PACKDISK is executed at a particular FSP. The scope can include one or more tables, one or more vprocs, or the entire system. For general guidelines for selecting optimal FSP values, see “File System Fields” on page 312. For additional guidelines for selecting an appropriate value for FSP, see Performance Management. Mini Cylinder Packs The file system automatically performs a mini cylinder pack if the number of free cylinders equals or falls below the threshold value specified for MiniCylPackLowCylProd in the DBS Control record. For additional information, see “MiniCylPackLowCylProd” on page 324. Mini cylinder packs ignore all definitions for FSP and use a value of 0. This means that they pack data as tightly as possible within a cylinder. When, as is often the case, a table affected by a mini cylinder pack requires a percentage of free space to permit growth without requiring the addition of new cylinders, this operation results in non-optimal system performance. For example, when many mini cylinder packs occur, they can produce a state known as thrashing. This happens because some portions of the disk are packed too tightly to permit growth, so frequent allocation of new cylinders to the table space is required. Because this action removes cylinders from the available cylinder pool, more mini cylinder packs are required and an ongoing cycle of thrashing results. Utilities 451 Chapter 13: Ferret Utility (ferret) PACKDISK Because all mini cylinder packs have a negative effect on system performance, you should monitor your cylinder usage activity closely. To monitor … Do the following … cylinder utilization Use the Ferret SHOWSPACE command. occurrences of mini cylinder packs • For Linux, check the software event log (DBC.SW_Event_Log), or the Linux event log, /var/log/messages. • For MP-RAS, check the software event log (DBC.SW_Event_Log). A system log also exists under MP-RAS at /var/adm/streams/error.<date>. • For Windows, check the software event log (DBC.SW_Event_Log), or the Windows event log. Schedule PACKDISK operations as often as is necessary to prevent mini cylinder packs from occurring. For more information about mini cylinder packs, see Performance Management. Example The following is an example report that PACKDISK generates: Ferret ==> packdisk fsp=50 Wed Jan 15, 2003 16:39:18 : Packdisk will be started On all AMP Vprocs. Do you wish to continue based upon this scope?? (Y/N) Y Wed Jan 15, 2003 16:39:19 : Packdisk has been started On all AMP Vprocs. Type ’ABORT’ to stop the command before completion Type ’INQUIRE’ to check on progress of command Wed Jan 15, 2003 16:40:35 : vproc 2 response Packdisk completed successfully. Allocated 72 (000048) cylinders Aborting PACKDISK Depending on the defined SCOPE, PACKDISK might take a long time to run. You can stop it at any time by typing this command: ABORT . GT06A021 After typing the ABORT request, as many as 30 seconds can pass before the command initiates. 452 Utilities Chapter 13: Ferret Utility (ferret) PACKDISK Once initiated, ABORT stops PACKDISK immediately and reports the status. No more packing is done to the remaining cylinders. If the abort is successful, the system redisplays the following prompt: Ferret ==> packdisk fsp=20 Are you sure you want to packdisk? (Y/N) y Tue Feb 28, 1995 15:16:50 : Packdisk has been started on all AMP Vprocs in the SCOPE. Type ’ABORT’ to stop them before completion ABORT Abort request has been sent Vproc 0 response Tue Feb 28, 1995 15:16:50 : Packdisk Freed up 100 (0064) cylinders Checking PACKDISK Status Because PACKDISK can take a long time to run, you might want to do a status check. You can do this using the INQUIRE command, which reports PACKDISK progress as a percentage of total time to completion: INQUIRE . INQ GT01A005 Example Type ‘INQUIRE’ to check on progress of command > INQUIRE inquire Inquire request has been sent > Tue Feb. 9, 1999 17:11:01 Slowest vproc0 is 4% done Fastest vproc0 is 4% done The packdisk is about 4% done Type ‘ABORT’ to abort current Operation. Type ‘INQUIRE’ to check on progress of command You can use this information to estimate how long the operation will take to complete. For example, if the process is 10 percent done after one hour, then the entire operation will take approximately 10 hours, and there are nine more hours until PACKDISK completes. Utilities 453 Chapter 13: Ferret Utility (ferret) PRIORITY PRIORITY Purpose The PRIORITY command allows you to set the priority of the Ferret process. Syntax PRIORITY = priorityclass SET 1102A183 where: Syntax element … Specifies … priorityclass the priority of the Ferret process. Valid values for priorityclass are: • • • • LOW, L, or 0 MEDIUM, M, or 1 (This is the default.) HIGH, H, or 2 RUSH, R, or 3 Usage Notes These values are not case-sensitive. The PRIORITY command is most commonly used with the SCANDISK and PACKDISK commands. Example An example is shown below: Ferret ==> SET PRIORITY = 3 454 Utilities Chapter 13: Ferret Utility (ferret) QUIT QUIT Purpose The QUIT command ends a Ferret session. Syntax QUIT Q STOP ST END EXIT GT06B013 Usage Notes STOP, END, and EXIT are synonyms for the QUIT command. Example The following command example shows the output that QUIT generates: Ferret ==> quit Waiting for Ferret Slave Tasks to exit Ferret Exited Utilities 455 Chapter 13: Ferret Utility (ferret) RADIX RADIX Purpose The RADIX command sets the default radix used as the numeric base for data input to and output from Ferret as either hexadecimal or decimal. If you type just the command RADIX, the current settings of the input and output are displayed. Syntax RADIX RAD INPUT HEX IN OUTPUT H DEC OUT D GT06C014 where: Syntax element … Specifies that numeric … INPUT input to Ferret defaults to the radix you select, either hexadecimal or decimal. OUTPUT output from Ferret defaults to the radix you select, either hexadecimal or decimal. HEX input to or output from Ferret defaults to a radix of hexadecimal. DEC input to or output from Ferret defaults to a radix of decimal. Usage Notes When you start Ferret, the default radix for both input and output from Ferret is decimal. If you omit both the INPUT and OUTPUT options from the RADIX command, the radix (HEX or DEC) that you select applies to both numeric input and output. You can select either INPUT or OUTPUT, but not both when changing the settings of Ferret data. If you omit both the HEX and DEC options, Ferret displays the current RADIX setting. Example The following command example shows how to set the input to decimal: Ferret ==> Rad Input Dec 456 Utilities Chapter 13: Ferret Utility (ferret) SCANDISK SCANDISK Purpose The SCANDISK command validates the file system and reports any errors found, including discrepancies in the following: • Key file system data structures, such as master index, cylinder index, and data blocks, including those associated with the WAL log. • The internal partition number for a row matching the internal index structures in the cylinder and master indexes. • Within a subtable, the internal partition number of a row being greater than or equal to the internal partition number in the preceding row, if any. • Within a partition, a RowID of a row being greater than the RowID in the preceding row, if any. • Within a subtable, either rows are all partitioned (a row includes the internal partition number) or nonpartitioned (a row does not include the internal partition number). In addition, SCANDISK calculates, modifies, and verifies checksums and reports any discrepancies. Note: The internal partition number is not validated for consistency with the result of the partitioning expression applied to the partitioning columns in a row. Utilities 457 Chapter 13: Ferret Utility (ferret) SCANDISK Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. SCANDISK /S CI /M DB /L FREECIS inquire_opt NOCR CR MI WCI WDB WMI 1102B149 where: Syntax Element Description /S Scans the MI and WMI. /M Scans the MI, CIs, WMI, and WCIs. /L Scans the MI, CIs, DBs, WMI, WCIs, and WDBs. CI Scans the MI and CIs. If the scope is AMP or all subtables, rather than selected subtables, the free CIs are also scanned. DB Scans the MI, CIs, and DBs. This is the default for the normal file system, which can be overridden by the CI, MI, or FREECIS options. If the scope is AMP or all subtables, rather than selected subtables, the free CIs are also scanned. FREECIS Scans the free CIs only. This option also detects missing WAL and Depot cylinders. MI Scans the MI only. WCI Scans the WMI and WCIs. WDB Scans the WMI, WCIs, and WDBs. This is the default for the WAL log, which can be overridden by the WCI or WMI options. WMI Scans the WMI only. 458 Utilities Chapter 13: Ferret Utility (ferret) SCANDISK Syntax Element Description inquire_opt Displays the lowest tid and rowid being scanned among the AMPS involved. This option also reports SCANDISK progress as a percentage of total time to completion and displays the number of errors encountered so far. The online help refers to tid as tableid. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 428. For more information on RowIDs, see “Rows (rowid)” on page 518. The syntax for the INQUIRE option is as follows: INQUIRE INQ - NONE number timeopt 1102E422 where: Syntax Element Description NONE Specifies that only one INQUIRE request is sent for the SCANDISK job. number An integer which defines the time interval to send an INQUIRE request to display SCANDISK progress. If you do not specify timeopt, then number defaults to SECONDS. timeopt Specifies the time unit which number represents. It should be one of the following: • • • • SECONDS, SECOND, SECON, SECO, SECS, SEC, S MINUTES, MINUTE, MINUT, MINU, MINS, MIN, M HOURS, HOUR, HOU, HO, HRS, HR, H DAYS, DAY, DA, D For example, scandisk inquire 5 m will start a SCANDISK job which reports SCANDISK progress every five minutes. Note: The maximum time interval allowed is seven days. NOCR Specifies to use regular data block preloads instead of cylinder reads. This is the default. CR Specifies to use cylinder reads instead of regular data block preloads. Usage Notes You can run SCANDISK while the system is online and the Teradata Database is available for normal operations. Teradata recommends you run SCANDISK in the following situations: Utilities • To validate data integrity before or after a system upgrade or expansion. • If you suspect data corruption. 459 Chapter 13: Ferret Utility (ferret) SCANDISK • As a routine data integrity check (perhaps weekly). Note: A slight performance impact might occur while SCANDISK is running. You can rearrange the order of the syntax following the SCANDISK command. For example, the command SCANDISK NOCR MI is the same as the command SCANDISK MI NOCR. If you do not type any options, SCANDISK defaults to DB and all subtables on the vproc. The default scope is to scan both the normal file system and the WAL log, each from the lowest (DB, WDB) level through the highest (MI, WMI). The free CIs are also scanned. The SCANDISK command can be limited by the SCOPE command to scan, for example, just one table, just the WAL log, or just certain AMPs. For more information, see “SCOPE” on page 468. By default, SCANDISK uses regular data block preloads instead of cylinder reads. The CR option allows you to run SCANDISK using cylinder reads to preload data into cylinder slots which may improve SCANDISK performance. However, if other work also requires the use of cylinder slots, the competition for slots could slow down SCANDISK and the other work. In addition, the performance gain is dependent on the amount of data loaded, the distribution of the data, and the average block I/O size. The NOCR option lets you turn off cylinder slot usage by SCANDISK, which could result in slower SCANDISK performance, but which will allow other work requiring cylinder slots to progress unimpeded. SCANDISK reports only what it finds when scanning is completed. The RowID output from SCANDISK consists of the following: 460 • A two-byte internal partition number. For a nonpartitioned table, the internal partition number is zero. • A four-byte row hash value. • A four-byte uniqueness value. Utilities Chapter 13: Ferret Utility (ferret) SCANDISK Example 1 The following is an example of output that SCANDISK generates. Ferret ==> scandisk Tue Feb 28, 1995 15:16:50 :Scandisk has been started on all AMP Vprocs in the SCOPE. Vproc 0 response DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001) DB ref count doesn’t match DBD row Count Tue Feb 28, 1995 15:16:50 : The scandisk found problems Vproc 1 response Tue Feb 28, 1995 15:16:50 : The scandisk found nothing wrong Example 2 The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a CI. Ferret ==> scandisk ci Mon May 06, 2002 15:12:20 :Scandisk has been started on all AMP Vprocs in the SCOPE. vproc 0 (0000) response Mon May 06, 2002 15:55:21 : CI @ Cylinder 0 7 (0000 000007) Mon May 06, 2002 15:55:21 : LSI interrupted write pattern found in CI. 0120 MAY 05 05:02:35 LUN 1111, Start Block 00004545, Blocks 0400 SRD num table id firstdbd dbdcount offset u0 u1 tai ---- ----- ----- ----- -------- -------- -----0001 0000 0494 0800 FFFF 0014 001E Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 14901 (3A35) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 26912 (6920) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 25972 (6574) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 12336 (3030) found Mon May 06, 2002 15:55:21 : First rowid out of order dbds 18 (0012) and 19 (0013) Utilities 461 Chapter 13: Ferret Utility (ferret) SCANDISK Example 3 The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a DB. Ferret ==> scandisk db Tue Feb 28, 1995 15:16:50 :Scandisk has been started on all AMP Vprocs in the SCOPE. vproc 0 (0000) response Mon May 06, 2002 15:12:20 1 of 1 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Reading vproc 0 (0000) response Mon May 06, 2002 15:11:11 : CI @ Cylinder 0 7 (0000 000007) Mon May 06, 2002 15:11:11 : LSI interrupted write pattern found in DB. 0120 MAY 05 05:02:35 LUN 1111, Start Block 00004545, Blocks 0400 Mon May 06, 2002 15:11:11 : rows -1 (FFFFFFFF) and 0 (0000) are out of order Example 4 The following example limits the scan to just the WAL log. scope wal scandisk Example 5 The following example scans one user data subtable. scope table 'employee.emp' p scandisk Example 6 In the following example, an INQUIRE command is sent per minute. Therefore, you get a display of SCANDISK progress every minute. Ferret ==> scandisk inq 1 m Tue Apr 17, 2007 11:18:51 : Scandisk ALL will be started On All AMP vprocs Do you wish to continue based upon this scope?? (Y/N) y Command has been sent to Slave tasks. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:19:53 SCANDISK STATUS : Slowest vproc 1 is 89% done Fastest vproc 0 is 92% done The scandisk is about 90% done Scanning Table: 0 1001 1024 462 Utilities Chapter 13: Ferret Utility (ferret) SCANDISK Scanning Row: 0 45284 58386 0 1 Tue Apr 17, 2007 11:19:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:20:53 Everyone is Scanning FREE CIS SCANFREE STATUS FOR SCANDISK: Slowest vproc 1 is 38% done Fastest vproc 0 is 42% done The scanfree is about 40% done Tue Apr 17, 2007 11:20:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:21:53 Everyone is Scanning FREE CIS SCANFREE STATUS FOR SCANDISK: Slowest vproc 1 is 92% done Fastest vproc 0 is 95% done The scanfree is about 93% done Tue Apr 17, 2007 11:21:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:22:01 2 of 2 vprocs responded with no messages or errors. Tue Apr 17, 2007 11:22:01: Scandisk Completed Aborting SCANDISK Since SCANDISK DB verifies that every byte in the file system is accounted for, this process can be very time consuming. Therefore, you have the option of stopping the process by typing the following command: ABORT . GT06A021 ABORT can take up to 30 seconds to process. After it is initiated, ABORT stops the SCANDISK process and reports the current status. When the abort is successful, the following appears: Utilities 463 Chapter 13: Ferret Utility (ferret) SCANDISK Are you sure you want to scandisk? (Y/N) y Tue Feb 28, 1995 15:16:50 : Scandisk has been started on all AMP Vprocs in the SCOPE. Type ‘ABORT‘ to stop them before completion Type ‘INQUIRE‘ to check on progress of command ABORT Abort request has been sent Vproc 0 response DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001) DB ref count doesn’t match DBD row Count Tue Feb 28, 1995 15:16:50 : The scandisk found problems Vproc 1 response Tue Feb 18, 1995 15:16:50 : The scandisk found nothing wrong Ferret ==> Checking SCANDISK Status Because SCANDISK can take a long time to run, you might want to do a status check. You can do this using the INQUIRE command: INQUIRE . INQ GT01A005 INQUIRE displays the lowest tid and rowid being scanned among the AMPS involved, and reports SCANDISK progress as a percentage of total time to completion. It also displays a list of errors that occurred since the last INQUIRE command. Sample INQUIRE output is shown below. Ferret ==> scandisk Wed Apr 11, 2007 y 16:46:24 : Scandisk will be started On All AMP vprocs Do you wish to continue based upon this scope?? (Y/N) Wed Apr 11, 2007 16:46:26 : Scandisk has been started Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command inq Inquire request has been sent Wed Apr 11, 2007 16:46:30 SCANDISK STATUS : Slowest vproc 0 is 2% done Fastest vproc 0 is 2% done The scandisk is about 2% done Scanning Table: 0 1434 1024 Scanning Row: 0 1972 32488 0 1 Nobody has reached the SCANFREE stage Wed Apr 11, 2007 16:46:30 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command inq Inquire request has been sent 464 Utilities Chapter 13: Ferret Utility (ferret) SCANDISK Wed Apr 11, 2007 16:46:36 SCANDISK STATUS : Slowest vproc 1 is 4% done Fastest vproc 0 is 5% done The scandisk is about 4% done Scanning Table: 0 1434 1024 Scanning Row: 0 28847 58771 0 95 Nobody has reached the SCANFREE stage vproc 1 (0001) response Wed Apr 11, 2007 16:46:33 : Wed Apr 11, 2007 16:46:33 : 0 1434 1024 (0000 059A 0 1435 1024 (0000 059B /nWed Apr 11, 2007 16:46:33 0 1434 1024 (0000 059A 0 1435 1024 (0000 059B CI @ Cylinder 0 100 (0000 000064) CID's First TID doesn't Match CI's First TID 0400) ( test.trans ) 0400) ( TEST.data1 ) : CID's Last TID doesn't Match CI's Last TID 0400) ( test.trans ) 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:33 : Table Header is missing. May be in the process of being dropped 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3418 (0D5A) length 126 (007E) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3629 (0E2D) length 70 (0046) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3699 (0E73) length 70 (0046) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 48 (0030) length 65 (0041) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 432 (01B0) length 65 (0041) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 113 (0071) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 179 (00B3) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 Wed Apr 11, 2007 Utilities 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2646 (0A56) length 122 (007A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 465 Chapter 13: Ferret Utility (ferret) SCANDISK 0 0 1435 (0000 059B) 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1953 (07A1) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2346 (092A) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2932 (0B74) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3004 (0BBC) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 684 (02AC) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 756 (02F4) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1191 (04A7) length 109 (006D) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1606 (0646) length 74 (004A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 2768 (0AD0) length 74 (004A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3150 (0C4E) length 119 (0077) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 1056 (0420) length 69 (0045) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) 466 Utilities Chapter 13: Ferret Utility (ferret) SCANDISK Wed Apr 11, 2007 16:46:34 : DB @ Cylinder 0 100 (0000 000064) Sector 3544 (0DD8) length 69 (0045) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Wed Apr 11, 2007 16:46:34 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Wed Apr 11, 2007 Wed Apr 11, 2007 0 1435 1024 0 1434 1024 16:46:34 : 16:46:34 : (0000 059B (0000 059A CI @ Cylinder 0 266 (0000 00010A) Table Ids are out of order 0400) ( TEST.data1 ) 0400) ( test.trans ) Wed Apr 11, 2007 16:46:36 1 of 2 vprocs responded with no messages or errors. Wed Apr 11, 2007 16:46:36 1 of 2 vprocs responded with messages or errors as specified above Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Utilities 467 Chapter 13: Ferret Utility (ferret) SCOPE SCOPE Purpose The SCOPE command defines the scope for subsequent DEFRAGMENT, PACKDISK, SCANDISK, SHOWBLOCKS, SHOWFSP, and SHOWSPACE commands. It defines the class of tables, range of tables, vprocs, cylinders and vprocs, or the WAL log to be used as parameters with these Ferret commands. Each SCOPE command defines a new scope and is not a continuation of the last one. Syntax Rules The Ferret SCOPE syntax is unusual. The following rules apply. IF you specify a … THEN … single_syntax_element commas and spaces are not required. Parentheses are optional. list_of_syntax_elements each syntax element must be separated by either a comma or space. Parentheses are required. The following example illustrates these syntax rules. single_syntax_element , ( list_of_syntax_elements ( 1102A059 The following are valid examples of the SCOPE command: scope scope scope scope vproc vproc vproc vproc 1 (1) (1,3) (1, 3) The following are invalid examples of the SCOPE command: scope vproc 1,3 scope vproc 1 3 Syntax Note: Not all combinations of acceptable syntax are shown. 468 Utilities Chapter 13: Ferret Utility (ferret) SCOPE , SCOPE class cylinder vproc table vproc WAL all 1102E028 class , ( CLASS ) JRNL PERMANENT P TEMPORARY TEMP SPOOL ALL 1102C029 cylinder , CYL ( drive cylinder ) INDER drive cylinder ALL 1102F030 vproc vproc_number VPROC , vproc_number ( ) vproc_number TO vproc_number ALL 1102E032 Utilities 469 Chapter 13: Ferret Utility (ferret) SCOPE table , TABLE tid ( ) tid ALL 1102E031 where: Syntax element … Specifies … CLASS the class of tables for the scope of a subsequent command. To type more than one class of table, use an opening parenthesis before the first class of table, separate each class of table using a comma or space, and use a closing parenthesis after the last class of table. Note: Classes are subtable ranges, so if a command requires tables in the recorded scope, you may specify a CLASS on the SCOPE command. class , CLASS ( JRNL ) PERMANENT P TEMPORARY TEMP SPOOL ALL 1102C029 where: 470 Syntax element … Specifies … JRNL the permanent journal tables containing non-visible user data. PERMANENT the permanent tables containing visible user data. TEMPORARY the temporary worktables (global temporary table instances) containing non-permanent data. SPOOL the intermediate worktables containing non-permanent data ALL all the table classes in the configuration. Utilities Chapter 13: Ferret Utility (ferret) SCOPE Syntax element … Specifies … CYLINDER the cylinders that are to be acted upon only by a subsequent DEFRAGMENT command. No other command uses the CYLINDER SCOPE. To type more than one drive cylinder pair, use an opening parenthesis before the first drive cylinder pair, separate each drive cylinder pair with a comma or space, and use a closing parenthesis after the last drive cylinder pair. Note: A SCOPE command with CYLINDER arguments must also include VPROC arguments to be valid. cylinder , CYL drive ( cylinder ) INDER drive cylinder ALL 1102F030 where: VPROC Syntax element … Specifies … drive the drive within the vproc. cylinder the cylinder within the drive. ALL all the cylinders in the vproc. the range of vproc numbers, or all vprocs in the current configuration that are to be acted upon by a subsequent command. The keyword VPROC must be entered before the vproc number. To type more than one vproc, use an opening parenthesis before the first vproc_number, separate each vproc_number with a comma or space, and use a closing parenthesis after the last vproc_number. vproc vproc_number VPROC , vproc_number ( ) vproc_number TO vproc_number ALL 1102E032 Utilities 471 Chapter 13: Ferret Utility (ferret) SCOPE Syntax element … Specifies … VPROC (continued) where: Syntax element … Specifies … vproc_number specifies a single vproc number or a range of numbers. Valid vproc numbers are from 0 to 16383. There is no default. If you type a vproc identifier that is assigned to a PE, Ferret ignores it and issues an error. Note: Ferret also informs you when you select a vproc number assigned to a down AMP. ALL TABLE all the vprocs in the configuration. the subtables that are to be acted upon by a subsequent command. To type more than one subtable identifier, use an opening parenthesis before the first tid, separate each tid with a comma or space, and use a closing parenthesis after the last tid. table , TABLE ( tid ) tid ALL 1102E031 where: Syntax element … Specifies … tid the subtable to process. Note: The typeandindex component of tid is required. For more information on tid formatting, refer to “Specifying a Subtable Identifier (tid)” on page 428. ALL WAL all the subtables in the configuration. the WAL log. WAL WAL 472 Utilities Chapter 13: Ferret Utility (ferret) SCOPE Syntax element … Specifies … ALL to reset SCOPE to the default startup settings of Ferret. The initial scope will consist, as appropriate to each command, of all tables, all cylinders, all vprocs, and the WAL log. all all 1102A079 Usage Notes The following table shows how scopes are interpreted. Scope Type Interpretation Table Specified subtables, which can be selected subtables, all subtables, or classes. Table scopes imply cylinder scopes, and all-table scopes imply free CIs. Cylinder All the specified cylinders. Cylinder scopes can be specified by implication as subtable scopes. For the DEFRAGMENT command, this means all cylinders containing the specified subtables. An explicit cylinder specification is only meaningful to the DEFRAGMENT command. If you specify a free cylinder in CYLINDER drive cylinder, Ferret SCANDISK will respond with an indication that the cylinder did not need to be defragmented. Vproc All subtables, all free CIs, and the WAL log. WAL The entire WAL log. The Ferret commands utilize SCOPE as follows, where classes are collections of tables and result in Table on AMP scopes. Command Description DEFRAGMENT The command uses Table on AMP scopes, or Cylinder on AMP scopes. The scope can contain tables only, both tables and vprocs, or both vprocs and cylinders. For more information, see “DEFRAGMENT” on page 438. PACKDISK The command uses AMP scopes, or Table on AMP scopes. The scope selected must include either vprocs or tables, but not both. For more information, see “PACKDISK” on page 449. Utilities 473 Chapter 13: Ferret Utility (ferret) SCOPE Command Description SCANDISK The command uses AMP scopes, or Table on AMP scopes, and WAL scope. The scope can contain tables only, vprocs only, both tables and vprocs, or the WAL log. For more information, see “SCANDISK” on page 457. SHOWBLOCKS The command uses Table on AMP scopes and WAL scope. The scope can contain tables only or the WAL log. For more information, see “SHOWBLOCKS” on page 479. SHOWFSP The command uses AMP scopes, or Table on AMP scopes. The scope can include one or more tables, one or more vprocs, or the entire system. For more information, see “SHOWFSP” on page 483. SHOWSPACE The command uses AMP scopes, or Table on AMP scopes, and WAL scope. The scope can contain tables only, vprocs only, both tables and vprocs, or the WAL log. For more information, see “SHOWSPACE” on page 490. All scopes are not applicable to all commands. When a command is executed and the scope is not applicable to the command, either the command is rejected or the inapplicable portions of the scope are ignored. The SHOWDEFAULTS command displays the various components of a recorded scope, which are interpreted individually by each of the commands: DEFRAGMENT, PACKDISK, SCANDISK, SHOWBLOCKS, SHOWFSP, and SHOWSPACE. The scopes appear in the SHOWDEFAULTS output as tables on vprocs, cylinders on vprocs, vprocs, or the WAL log. For more information, see “SHOWDEFAULTS” on page 482. Note: Because the Transient Journal was moved from table 26 to the WAL log, you will receive a warning message when SCOPE explicitly refers to any subtable of table 26. This table will continue to be known as dbc.transientjournal, but will be empty. The sole content of table 26 will be the header row, and if SCOPE is set to the header, a warning message will still be generated. 474 Utilities Chapter 13: Ferret Utility (ferret) SCOPE Example 1 The following command examples are representative of how the SCOPE command is normally used: Command Action Scope vproc ALL Select all the AMPs on the system. Scope vproc 4, vproc 6 Select vprocs 4 and 6. or Scope vproc (4,6) Scope Table 400H 0 400H Select table 400H 0 400H on all vprocs. Scope Class ( P, JRNL ) Select all the Permanent and Journal tables on all vprocs. or Scope Class P, Class JRNL Scope Class P, Class JRNL, vproc 4 Select all the Permanent and Journal tables on vproc 4. Scope Cyl ( 0 14 0 23 ), vproc ( 4 to 6 ) Select cylinders 14 through 23 on DSU 0 of vprocs 4, 5, and 6 if the DEFRAGMENT command is used with this SCOPE command. If the PACKDISK command is used, all of vprocs 4, 5, and 6 are packed. The following SCOPE command is an example of incorrect syntax usage: Command Action Scope Cyl ( 0 14 0 23 ) Selects nothing since the VPROC argument is missing. Note: Ferret informs you that the vproc is missing, and therefore, ignores this command. Example 2 Assume that table T4 is a table in database XYZ and has a table number of 0 1198. • • Utilities One of the following commands would place all T4 fallback subtables under scope. • SCOPE “TABLE XYZ.T4 F”* • SCOPE TABLE 0 1198 F* One of the following commands would place all T4 subtables under scope. • SCOPE TABLE “XYZ.T4” * • SCOPE TABLE 0 1198 * 475 Chapter 13: Ferret Utility (ferret) SCOPE Example 3 The following example resets the scope to the default Ferret startup settings. Some of the output is omitted to condense the example. scope all showd Scope for the Defrag command is : All Cylinders On all AMP vprocs Scope for the Packdisk command is : All of the AMP vprocs Scope for the Scandisk command is : All of the AMP vprocs Scope for the Showblocks command is : All tables WAL Log On all AMP vprocs Scope for the Showspace command is : All of the AMP vprocs Scope for the ShowFSP command is : All tables On all AMP vprocs Example 4 The following example shows a whole AMP scope, which includes the WAL log. SCOPE VPROC 1 The SCOPE has been set Ferret => SHOWD The current setting of the Input Radix is Decimal The current setting of the Output Radix is Decimal Scope for the Defrag command is: All Cylinders On AMP vproc(s) 1 Scope for the Packdisk command is: AMP vproc(s) 1 Scope for the Scandisk command is: AMP vproc(s) 1 Scope for the Showblocks command is: All tables WAL Log On AMP vproc(s) 1 476 Utilities Chapter 13: Ferret Utility (ferret) SCOPE Scope for the ShowFSP command is: AMP vproc(s) 1 Scope for the Showspace command is: AMP vproc(s) 1 Example 5 The following example shows the scope set to the WAL log on all AMPs. Note: Only SCANDISK, SHOWBLOCKS, and SHOWSPACE work with this scope. SCOPE WAL The SCOPE has been set Ferret => SHOWD The current setting of the Input Radix is Decimal The current setting of the Output Radix is Decimal Scope for the Defrag command is: Invalid because it contains WAL Scope for the Packdisk command is: Invalid because it contains WAL Scope for the Scandisk command is: WAL Log On all AMP vprocs Scope for the Showblocks command is: WAL Log On all AMP vprocs Scope for the ShowFSP command is: Invalid, because it contains WAL Scope for the Showspace command is: WAL Log On all AMP vprocs Example 6 The following example shows the scope set to all the tables on all amps, but not the WAL log. scope class all showd Scope for the Defrag command is : Table(s) 0 0 0 TO 65535 65535 65535 On All AMP vprocs Scope for the Packdisk command is : Table(s) 0 0 0 TO 65535 65535 65535 On All AMP vprocs Scope for the Scandisk command is : Utilities 477 Chapter 13: Ferret Utility (ferret) SCOPE Table(s) 0 0 0 TO On All AMP vprocs 65535 65535 65535 Scope for the Showblocks command is : Table(s) 0 0 0 TO 65535 65535 65535 On All AMP vprocs Scope for the ShowFSP command is : Table(s) 0 0 0 TO 65535 65535 65535 On All AMP vprocs Scope for the Showspace command is : Table(s) 0 0 0 TO 65535 65535 65535 On All AMP vprocs Example 7 The following example shows an invalid scope for the DEFRAGMENT command. In the example, cylinder 200 is a free cylinder. If it had been a WAL cylinder instead, you would have received an error message. scope vproc 0 cyl 0 200. defrag Defrag has been sent to all AMP vprocs in the SCOPE. vproc 0 response Requested cylinder did not needed to be defraged 478 Utilities Chapter 13: Ferret Utility (ferret) SHOWBLOCKS SHOWBLOCKS Purpose The SHOWBLOCKS command displays statistics about data block size and/or the number of rows per data block for all the tables defined by the SCOPE command. SHOWBLOCKS can display WAL log statistics also. Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. SHOWBLOCKS SHOWB /S /M /L 1102A150 where: Syntax element … Specifies... /S For each primary data subtable, display the following: • a histogram of block sizes • the minimum, average, and maximum block size per subtable This is the default display. /M Same as the /S option, but display the statistics for all subtables. /L For each subtable, for each block size, display the following: • number of blocks • the minimum, average, and maximum number of rows per data block size Displays the statistics for all subtables. Usage Notes The output of the long display is basically one line for every size data block from every subtable of every table in the scope. The output can be quite lengthy; therefore, consider using the OUTPUT command to redirect the output to a file. This command can be used with the CREATE/ALTER table option, DATABLOCKSIZE, to determine the best data block size for tables based on performance requirements. Utilities 479 Chapter 13: Ferret Utility (ferret) SHOWBLOCKS Aborting SHOWBLOCKS You can abort the display at any time using the ABORT command. ABORT . GT06A021 Example 1 The following example displays output from a SHOWBLOCKS command for two tables. Since no options were specified, the default /s option was used. The default SHOWBLOCKS display is 132 characters wide. 480 Utilities Chapter 13: Ferret Utility (ferret) SHOWBLOCKS Example 2 The following is an example of SHOWBLOCKS output using the /L option to show statistics for each block size, including row statistics. This example shows statistics for the WAL log and for two user tables. Utilities 481 Chapter 13: Ferret Utility (ferret) SHOWDEFAULTS SHOWDEFAULTS Purpose The SHOWDEFAULTS command shows the default settings and the remembered context.The command displays the current default radix for input and output, the current input, output, and error file names, and the SCOPE defined. In addition, SHOWDEFAULTS also displays WAL log context information. Syntax SHOWDEFAULTS SHOWD GT06B018 Example Ferret ==> showd The current setting of the Input Radix is Decimal The current setting of the Output Radix is Decimal Scope for the Defrag command is : All Cylinders On All AMP vprocs Scope for the Packdisk command is : All of the AMP vprocs Scope All WAL All for the Scandisk command is : of the AMP vprocs Log Tables Scope All WAL All for the Showblocks command is : Tables Log of the AMP vprocs Scope All WAL All for the Showspace command is : Tables Log of the AMP vprocs Scope for the ShowFSP command is : All Tables All of the AMP vprocs For more examples of the SHOWDEFAULTS command, see the examples for“SCOPE” on page 468. 482 Utilities Chapter 13: Ferret Utility (ferret) SHOWFSP SHOWFSP Purpose The SHOWFSP command displays information about table storage space utilization. SHOWFSP provides the following information on a per-vproc (per-AMP) basis: • Table name • Free space percentage (FSP), the amount of unused storage space on the cylinders used by the table • Number of cylinders currently occupied by tables meeting SHOWFSP filtering criteria • Number of cylinders that would be occupied by each of these tables after a PACKDISK command SHOWFSP shows the number of cylinders that will be recovered or consumed if PACKDISK is run to achieve a given percentage of free space on table cylinders. The scope of SHOWFSP depends on the most recent options set by the SCOPE command, and can include one or more specific tables, one or more specific vprocs, or all tables in the system. Syntax SHOWFSP SHOWF -a -c cyls -d fsp -m fsp -r cyls -v 1102E397 where: Utilities 483 Chapter 13: Ferret Utility (ferret) SHOWFSP Syntax element … Is the … -a all tables option which displays all tables meeting the criteria of -c, -d, and -m options. If you do not specify any of those options, they will assume their default values. Whether specified or not, the -r option automatically is overridden and set to the most negative integer known to Ferret. Note: Regardless of options, a table must occupy at least one full cylinder or be the first table on a cylinder to be considered for displaying. If you specify the -a option, it will consider both of the cases: • Where PACKDISK would tighten the packing (and thus free up cylinders) • Where PACKDISK would loosen the packing (and thus consume free cylinders). If you do not specify the -a option, the default is to consider only tables that would tighten the packing and ignore the other case. The number of cylinders affected by the PACKDISK are displayed either as a positive or negative value, depending on whether cylinders are consumed or freed. If cylinders are freed, the value is displayed as a positive. If cylinders are consumed, the value is displayed as a negative. You can qualify tables further by specifying the -a option in conjunction with the other options. See the examples for useful ways of using the -a option. -c cyls number of cylinders per AMP that must be exceeded by a table to be considered for display. The -c cyls option follows this priority order: • If -c cyls is specified, use it unless cyls is 0, in which case cyls defaults to 1 automatically. • If -c cyls is not specified, it automatically defaults to 0. You can further qualify tables by specifying the -c option in conjunction with the other options. -d fsp the desired FSP after packing. The default follows this priority order: • If -d fsp is specified, use it. • If -d fsp is not specified and a table-level FSP exists, use the table-level FSP. • Otherwise, use the system-wide default FSP as defined in the DBS Control GDO. Note: This option allows SHOWFSP to display tables that would free up cylinders on each AMP if you ran PACKDISK with this FSP. If specified in conjunction with the -a option, SHOWFSP also considers tables that consume free cylinders. You can qualify tables further by specifying the -d fsp option in conjunction with the other options. -m fsp minimum current FSP a table must exceed to qualify for display. The default is 0. Note: This option allows SHOWFSP to ignore tables whose current average FSP is under a certain FSP value. The average is calculated as a floating point value, and the option is input as an integer. Therefore, often the FSP appears to act as a minimum. For example, an average FSP of 10.1 is greater than a minimum FSP of 10, whereas an average FSP of 10 is not greater than the minimum FSP of 10. Therefore, a table with an average FSP of 10.1 qualifies, whereas a table with an average FSP of 10 would not qualify. You can qualify tables further by specifying the -m fsp option in conjunction with the other options. 484 Utilities Chapter 13: Ferret Utility (ferret) SHOWFSP Syntax element … Is the … -r cyls the number of recoverable cylinders that must be exceeded to qualify the table for display. The default follows this priority order: • If the -a option is specified, set -r cyls to the most negative integer known to Ferret. • If -r cyls is specified, use it unless cyls is 0, in which case cyls is defaulted to 1 automatically. • If -r cyls is not specified, it is defaulted to 0 automatically. You can qualify tables further by specifying the -r cyls option in conjunction with the other options, except for the -a option, in which case the -r cyls option is handled in the manner noted above. -v verbose mode. The default is Off. This is for debugging purposes and produces extremely detailed and voluminous output. Teradata does not recommend this option for normal use. Usage Notes All arguments and displays are on a per-AMP basis. Without parameters, SHOWFSP displays all tables with recoverable cylinders, assuming the defaults used by PACKDISK. For more details as to how the defaults of each option are determined, see their respective sections above. SHOWFSP provides only an approximation of the number of cylinders that can be freed or consumed by PACKDISK, so the number of recoverable or consumed cylinders are subject to small errors. This small error is because SHOWFSP assumes a continuous medium, meaning that part of a data block can reside at the end of one cylinder while the remaining part can reside at the beginning of the next cylinder. However, PACKDISK packs cylinders based on discrete boundaries, meaning a data block only can be on a cylinder in its entirety or not be on the cylinder at all. Examples For the following examples, assume the following: • The default system-wide FSP is set at 15%. • The table master.backup has a table-level FSP of 25%. • The table payroll.phoenixariz has a table-level FSP of 5%. • All other tables do not have a table-level FSP assigned to them. • The SCOPE is set to vproc 1 (by issuing a SCOPE VPROC 1 command). Example 1 Example 1 shows all tables that could be affected by a PACKDISK run against the current default FSPs, even if they will not recover any cylinders. showfsp -a Fri Jun 20, 2003 Utilities 14:41:15 : showfsp will be started On AMP vproc(s) 1 485 Chapter 13: Ferret Utility (ferret) SHOWFSP Fri Fri Fri Fri Jun Jun Jun Jun 20, 20, 20, 20, 2003 2003 2003 2003 14:41:15 14:41:15 14:41:15 14:41:15 : : : : to find all the tables specified greater than 0 cylinders which could free up/consume any number of cylinders only tables with a current FSP greater than 0% will be considered Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 1 (0001) 14:41:42 : ShowFsp has been started On AMP vproc(s) 1 response There are 10 tables larger than 0 cylinders on amp 1 Database Table fsp Recoverable Current Name Name % Cylinders Cylinders -------------------------- ----------------------- ----- ----------- --------DBC TVM 16 0 1 customers t0 17 0 35 employees t1 17 1 43 employees_address t2 17 0 9 customers_address t3 16 0 8 PAYROLL losangelesca 17 0 6 PAYROLL albanyny 17 0 5 MASTER backup 27 0 11 MASTER stocks 16 0 32 PAYROLL phoenixariz 6 0 41 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Based on the SHOWFSP results, if a PACKDISK command is executed without specifying an FSP, SHOWFSP predicts that the table employees.t1 will free up one cylinder. All other tables will be unaffected. Example 2 Example 2 shows all tables that could free up more than one cylinder per AMP if executing a PACKDISK with an FSP of 10%. showfsp -d 10 -r 1 Fri Jun 20, 2003 Fri Fri Fri Fri Fri Jun Jun Jun Jun Jun 20, 20, 20, 20, 20, 2003 2003 2003 2003 2003 16:07:29 : showfsp will be started On AMP vproc(s) 1 16:07:29 : to find all the tables specified greater than 0 cylinders 16:07:29 : which could free up more than 1 cylinders 16:07:29 : if packed to a desired FSP of 10%. 16:07:29 : only tables with a current FSP greater than 0% 16:07:29 : will be considered Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 486 1 (0001) 16:07:30 : ShowFsp has been started On AMP vproc(s) 1 response Utilities Chapter 13: Ferret Utility (ferret) SHOWFSP There are 10 tables larger than 0 cylinders on amp 1 Database Name -------------------------customer employees MASTER MASTER Table Name ----------------------t0 t1 backup stocks fsp Recoverable % Cylinders ----- ----------17 2 17 3 27 2 16 2 Current Cylinders --------35 43 11 32 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Note: The following command would result in the same output: showfsp -d 10 -r 0 If you omit the -r option, then SHOWFSP shows all tables that could free up one or more cylinders. Example 3 Example 3 shows all tables that could free up or consume any amount of cylinders per AMP if executing a PACKDISK command with an FSP of 10%. showfsp -a -d 10 Fri Jun 20, 2003 Fri Fri Fri Fri Fri Jun Jun Jun Jun Jun 20, 20, 20, 20, 20, 2003 2003 2003 2003 2003 16:10:05 : showfsp will be started On AMP vproc(s) 1 16:10:05 : to find all the tables specified greater than 0 cylinders 16:10:05 : which could free up/consume any number of cylinders 16:10:05 : if packed to a desired FSP of 10%. 16:10:05 : only tables with a current FSP greater than 0% 16:10:05 : will be considered Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 1 (0001) There are 16:10:06 : ShowFsp has been started On AMP vproc(s) 1 response 10 tables larger than 0 cylinders on amp 1 Database Name -------------------------DBC customers employees employees_address customer_address PAYROLL PAYROLL MASTER MASTER PAYROLL Utilities Table Name ----------------------TVM t0 t1 t2 t3 losangelesca albanyny backup stocks phoenixariz fsp Recoverable % Cylinders ----- ----------16 0 17 2 17 3 17 0 16 0 17 0 17 0 27 2 16 2 6 -2 Current Cylinders --------1 35 43 9 8 6 5 11 32 41 487 Chapter 13: Ferret Utility (ferret) SHOWFSP 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Example 4 Example 4 shows all tables that could free up or consume any amount of cylinders per AMP if executing a PACKDISK command with an FSP of 5%. Consider only tables that currently occupy more than 10 cylinders per AMP and have a current FSP of greater than 5%. showfsp -a -d 5 -c 10 -m 5 Fri Jun 20, 2003 Fri Fri Fri Fri Fri Jun Jun Jun Jun Jun 20, 20, 20, 20, 20, 2003 2003 2003 2003 2003 16:16:40 : showfsp will be started On AMP vproc(s) 1 16:16:40 : to find all the tables specified greater than 10 16:16:40 : cylinders which could free up/consume any number of 16:16:40 : cylinders if packed to a desired FSP of 5%. 16:16:40 : only tables with a current FSP greater than 5% 16:16:40 : will be considered Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 1 (0001) There are 16:16:41 : ShowFsp has been started On AMP vproc(s) 1 response 5 tables larger than 10 cylinders on amp 1 Database Name -------------------------customer employees MASTER MASTER PAYROLL Table Name ----------------------t0 t1 backup stocks phoenixariz fsp Recoverable % Cylinders ----- ----------17 4 17 5 27 2 16 3 6 0 Current Cylinders --------35 43 11 32 41 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Example 5 Example 5 shows all tables that could free up more than three cylinders per AMP if executing a PACKDISK command with an FSP of 7%. Consider only tables with a current FSP of more than 10% and currently occupying more than three cylinders per AMP. showfsp -d 7 -c 3 -m 10 -r 3 Fri Jun 20, 2003 Fri Fri Fri Fri Fri 488 Jun Jun Jun Jun Jun 20, 20, 20, 20, 20, 2003 2003 2003 2003 2003 16:22:00 : showfsp will be started On AMP vproc(s) 1 16:22:00 : to find all the tables specified greater than 3 cylinders 16:22:00 : which could free up more than 3 cylinders 16:22:00 : if packed to a desired FSP of 7%. 16:22:00 : only tables with a current FSP greater than 10% 16:22:00 : will be considered Utilities Chapter 13: Ferret Utility (ferret) SHOWFSP Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 1 (0001) There are 16:22:01 : ShowFsp has been started On AMP vproc(s) 1 response 9 tables larger than 3 cylinders on amp 1 Database Name -------------------------employees Table Name ----------------------t1 fsp Recoverable % Cylinders ----- ----------17 4 Current Cylinders --------43 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Example 6 Example 6 shows all tables that could free more one or more cylinders per AMP if executing a PACKDISK command at an FSP of 0%. Consider only tables with a current FSP of 20% or more. showfsp -d 0 -m 20 Fri Jun 20, 2003 Fri Fri Fri Fri Fri Jun Jun Jun Jun Jun 20, 20, 20, 20, 20, 2003 2003 2003 2003 2003 16:53:55 : showfsp will be started On AMP vproc(s) 1 16:53:55 : to find all the tables specified greater than 0 cylinders 16:53:55 : which could free up more than 0 cylinders 16:53:55 : if packed to a desired FSP of 0%. 16:53:55 : only tables with a current FSP greater than 20% 16:53:55 : will be considered Do you wish to continue based upon this scope?? (Y/N) y Fri Jun 20, 2003 vproc 1 (0001) There are 16:53:56 : ShowFsp has been started On AMP vproc(s) 1 response 10 tables larger than 0 cylinders on amp 1 Database Name -------------------------MASTER Table Name ----------------------backup fsp Recoverable % Cylinders ----- ----------27 2 Current Cylinders --------11 1 of 1 vprocs responded with the above tables fitting the criteria ShowFsp has completed Another useful interpretation of this output is the following: Show all tables that could free up more than 20% of their cylinders per AMP if packed at an FSP of 0%. Utilities 489 Chapter 13: Ferret Utility (ferret) SHOWSPACE SHOWSPACE Purpose The SHOWSPACE command shows disk space utilization. It displays the following information based on the defined scope. For more information, see “SCOPE” on page 468. • Number of cylinders allocated for permanent, journal, temporary, spool, DEPOT, and WAL log data. • Average utilization per cylinder for permanent, journal, temporary, DEPOT, and spool cylinders. • Number and percentage of available free cylinders. Syntax SHOWSPACE SHOWS /S /M /L 1102A151 where: Syntax element … Specifies... /S a one-line summary display for each AMP as defined by the SCOPE command. This is the default. 490 /M Same as the /L option. /L both the one-line summary display for each AMP, and a one-line display for each disk storage unit (DSU) as defined by the SCOPE command. Utilities Chapter 13: Ferret Utility (ferret) SHOWSPACE Example The following is an example of the output that SHOWSPACE generates: Utilities 491 Chapter 13: Ferret Utility (ferret) TABLEID TABLEID Purpose The TABLEID command displays the table number of the specified table when given the database name and table name. Syntax TABLEID "databasename. tablename" "databasename". "tablename" 'databasename. tablename' 'databasename'. 'tablename' 1102A005 where: Syntax element … Specifies… databasename the name of the database containing the table for which the table number will be displayed. tablename the name of the table for which the table number will be displayed. Usage Notes A table is identified in the data dictionary by a table number (tvm.tvmid). Each table number is unique across the whole system, rather than local to a database. Therefore, a table number uniquely identifies a table in the system. The TABLEID command displays the table number of the table specified by databasename and tablename. The output of the TABLEID command is a numeric subtable identifier (tid), which consists of three numbers: • The first two comprise the table number. This pair of numbers is used to uniquely identify a table in the system. • The third is the typeandindex value, which specifies a kind of subtable, such as a table header, data subtable, or a particular index subtable. TABLEID always returns a typeandindex value of zero (0), which specifies the table header. For more information on how to interpret a tid, see “Specifying a Subtable Identifier (tid)” on page 428. The following rules apply when specifying databasename and tablename: 492 • The period (.) is required to separate the database name from the table name. • You must use either single ( ' ) or double ( " ) quotation marks when typing a database name and table name. The results are the same. Utilities Chapter 13: Ferret Utility (ferret) TABLEID • You can specify a fully qualified table name using any one of the methods suggested in the syntax diagram with the following exceptions: • The object name has an apostrophe, in which case you must specify the object name in double quotes. Valid examples include the following: • tableid "xyz.mark’s table" • tableid "xyz"."mark’s table" Invalid examples include the following: • • tableid 'xyz.mark’s table' • tableid "xyz".'mark’s table' The object name has a period, in which case you must type the fully qualifying tablename in the form of "database"."tablename" or 'database'.'tablename'. Valid examples include the following: • tableid "xyz.0’s"."mark’s table.2.53.00" • tableid 'xyz'.'table.0' Invalid examples include the following: • tableid "xyz.0’s.mark’s table.2.53.00" • tableid 'xyz.0’s.mark’s table.2.53.00' Example 1 The following example shows output generated by TABLEID: Ferret ==> tableid "mydatabase.mytable" The table id for MYDATABASE.MYTABLE is 1 1217 0 (0x0001 0x4C1 0x0000) Note: You could get the same results with the following commands: tableid 'mydatabase.mytable' tableid "mydatabase"."mytable" tableid 'mydatabase'.'mytable' Example 2 The following example shows the table number for the old Transient Journal. With the implementation of WAL, the Transient Journal was moved from table 26 to the WAL log. Therefore the table is always empty, except that space accounting will show WAL log space under table 26. TABLEID "dbc.transientjournal" *** Warning *** The TJ was moved from table 26 to the WAL Log. Table DBC.TRANSIENTJOURNAL is obsolete except the table header is retained for administrative purposes. The table id for DBC.TRANSIENTJOURNAL is 0x0000 0x001A 0x0000 ( 0 26 0 ) Utilities 493 Chapter 13: Ferret Utility (ferret) UPDATE DATA INTEGRITY FOR UPDATE DATA INTEGRITY FOR Purpose The UPDATE DATA INTEGRITY FOR command allows you to update the disk I/O integrity checksum levels fields of a table type you modified using the DBS Control utility. For more information, see Chapter 11: “DBS Control (dbscontrol).” Syntax UPDATE DATA INTEGRITY FOR ALL SYSTEM SYSTEM JOURNAL SYSTEM LOGGING USER PERMANENT JOURNAL TEMPORARY 1102A043 where: Syntax element … Updates the checksum values on … ALL all table types (system, system journal, system logging, user, permanent journal, and temporary tables) simultaneously. SYSTEM all system table types (data dictionaries, session information, and so forth) and table numbers0, 1 through 0, 999. SYSTEM JOURNAL transient journals, change tables, and recovery journals. SYSTEM LOGGING system and resource usage (RSS) tables. USER all user tables (table numbers 0, 1001 through 16383, 65535), which includes the following: • Stored procedures • User-defined functions • Join indexes • Hash indexes This also includes fallback for these and secondary indexes for tables and join indexes. 494 Utilities Chapter 13: Ferret Utility (ferret) UPDATE DATA INTEGRITY FOR Syntax element … Updates the checksum values on … PERMANENT JOURNAL all permanent journal tables (table uniq[0] IDs 16384 through 32767). TEMPORARY all temporary and spool tables (table uniq[0] IDs 32768 through 65535), which includes the following: • Global temporary tables • Volatile tables Usage Notes This command provides similar functionality as issuing an ALTER TABLE command on an individual table where the data integrity level is changed with the IMMEDIATE option. Performing this operation causes all tables in the table type being updated to be read and have the checksum updated and DBD rewritten. By rewriting the DBD, the checksums are updated to the correct data integrity level automatically. By updating the data integrity level immediately, you can convert back to a lower data integrity level if you previously had to run at a higher level because of corruption problems, but the problem was fixed. To enable disk I/O integrity checking on an individual table, use the ALTER TABLE command. For detailed information, see “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. Example 1 To update the data integrity level for System Table, type the following: UPDATE DATA INTEGRITY FOR SYSTEM Example 2 To update the data integrity level for System Journal Tables, type the following: UPDATE DATA INTEGRITY FOR SYSTEM JOURNAL Example 3 To update the data integrity level for System Logging Tables, type the following: UPDATE DATA INTEGRITY FOR SYSTEM LOGGING Example 4 To update the data integrity level for User Tables, type the following: UPDATE DATA INTEGRITY FOR USER Example 5 To update the data integrity level for Permanent Journal Tables, type the following: UPDATE DATA INTEGRITY FOR PERMANENT JOURNAL Utilities 495 Chapter 13: Ferret Utility (ferret) UPDATE DATA INTEGRITY FOR Example 6 To update the data integrity level for Temporary Tables, type the following: UPDATE DATA INTEGRITY FOR TEMPORARY 496 Utilities CHAPTER 14 Filer Utility (filer) The Filer utility, filer, enables trained personnel to display or modify any data structure related to the Teradata Database file system, the Write Ahead Logging (WAL) log, and their resources. Use Filer to obtain the information needed to find and correct problems within the file system and the WAL log. Caution: Filer sometimes bypasses the security checking when displaying, accessing, and/or changing items. Audience Users of Filer include the following: • Field engineers • Teradata Database developers • Teradata Database system architects • Teradata Database system test and verification personnel • Teradata Support Center personnel Users should have an understanding of the basic operation of the Teradata GNU Debugger (gdb) and Coroner, which helps analyze dumps. Users should also understand the basic storage structures of the Teradata Database file system and the WAL log. Starting Filer Starting and Exiting on Linux Caution: Do not leave Filer running unattended because it might access a segment and block other tasks. You can start Filer before or after the DBS (and thus the file system) has been started. You can type Filer commands in uppercase letters, lowercase letters, or any combination of uppercase and lowercase letters. You can start Filer from the following: Utilities • Database Window. See “Starting Filer From the Database Window” on page 502. • Teradata MultiTool 497 Chapter 14: Filer Utility (filer) Starting Filer From Teradata MultiTool To start Filer, do the following: 1 From the Linux command line, enter the following: multitool -display displayname:0.0 where displayname is your IP address or host name. The Teradata MultiTool main window opens. Note: For more information on using the Teradata MultiTool, see Graphical User Interfaces: Database Window and Teradata MultiTool. 2 In the Teradata MultiTool main window, select Tools>Database Window (DBW). The DBW appears. 3 Select the Supervisor tab. 4 In the Command field, type the following and press Enter: start filer The Supervisor window displays, for example, the following: Started ‘filer’ in window 1 The number represents the application window in which Filer is running. The tab that previously said Application 1 now says Filer and is the active window. Note: For more details on starting Filer and using the Filer options, see “Starting Filer From the Database Window” on page 502. To exit Filer, do the following: 1 In the DBW window, select the Filer tab. 2 In the Command field, type one of the following and press Enter: • QUIT • STOP • END • EXIT The following message appears: Filer exited. 3 In the DBW, select File>Exit. Starting and Exiting on MP-RAS Caution: Do not leave Filer running unattended because it might access a segment and block other tasks. You can start Filer before or after the DBS (and thus the file system) has been started. 498 Utilities Chapter 14: Filer Utility (filer) Starting Filer You can start Filer from the following: • Database Window. See “Starting Filer From the Database Window” on page 502. • System Debugger • Coroner From the System Debugger On MP-RAS, use the System Debugger mode of the Teradata GNU Debugger (gdb) to analyze system problems. The Teradata Database must be in Debug-Stop state. If you cannot stop the system, use the online version of Filer. This version observes all the locking protocols of the file system. However, system performance might be hampered if you are trying to type commands in the online version of Filer because other tasks might be running and accessing the same segments. Patching the Master Index (MI) from the online version of Filer is an example of when system performance might be hampered. If you start Filer from the System Debugger, Filer can do the following: • Control the file system structures and data • Display, change, or delete anything in the file system without considering whether other tasks will affect this same segment. To start Filer, type the following: invoke filer cmdstring GS04A001 where: Utilities Syntax Element Description invoke The System Debugger startup command that must be typed in all lowercase letters. filer The name of this utility, which must be typed in all lowercase letters. cmdstring The option that enables you to provide a command directly to Filer. 499 Chapter 14: Filer Utility (filer) Starting Filer You can use the debugger invoke command to type a command string (cmdstring) directly to Filer. If you specify cmdstring, then Filer parses and executes that single command and exits. If present, the cmdstring must be a complete Filer command with all required parameters. If the command is in error or incomplete, Filer generates a syntax error but terminates rather than prompts for a new command. Note: Since the PATCH command requires at least two lines to operate, it cannot be passed as a cmdstring. For more information, see “PATCH” on page 647. If you do not provide cmdstring in the invoke command, then Filer enters an interactive mode of operation. In this mode, Filer behaves like the startable version and prompts for commands and missing required parameters. Unlike the startable version, invoked Filer does not observe the file system locking protocols used to avoid hang or deadlock situations. This means Filer might see inconsistent information. This also means that any action performed while you invoke Filer is visible to other tasks immediately. From the Coroner Use the Coroner mode of the Teradata GNU Debugger (gdb) to analyze a crashdump. You can start Filer from the Coroner in a manner similar to the System Debugger, see “From the System Debugger” on page 499. Filer severely restricts the command set available when running the Coroner because commands only act on the dump data. Therefore, only a subset of the disk block commands, as listed below, are allowed when you start Filer from the Coroner: BLK CI CID DB END FIB FIND HELP MEMBLK MEMCTX MEMDB MEMDUMP MEMROW MEMSORCTX MEMWCTX MEMWDB MEMWREC MI QUIT ROW STOP WCI WCID WDB WFIND WMI The HELP command lists only the active commands. If other Filer commands are typed, the command is rejected, and the following error is displayed: Command is not allowed when invoked from the Coroner. 500 Utilities Chapter 14: Filer Utility (filer) Starting Filer The following commands are available only when Filer is invoked from the System Debugger or Coroner: MEMBLK, MEMCTX, MEMDB, MEMDUMP, MEMROW, MEMSORCTX, MEMWCTX, MEMWDB, and MEMWREC. Starting and Exiting on Microsoft Windows Caution: Do not leave Filer running unattended because it might have a segment accessed that might cause blockage of other tasks. You can start Filer before or after the DBS (and thus the file system) has been started. You can type the command in uppercase letters, lowercase letters, or any combination of uppercase and lowercase letters. You can start and exit Filer from the following: • Database Window • Teradata MultiTool From the Database Window To start Filer, do the following: 1 Select Start>Programs>Teradata Database>Database Window. The Database Window opens. 2 Follow the steps in “Starting Filer From the Database Window” on page 502. From Teradata MultiTool To start Filer, do the following: 1 Select Start> Programs>Teradata Database>Teradata MultiTool. The Teradata MultiTool main window opens. Note: For more information on using the Teradata MultiTool, see Graphical User Interfaces: Database Window and Teradata MultiTool. 2 In the Teradata MultiTool main window, select Tools>Database Window (DBW). The DBW appears. 3 Select the Supervisor tab. 4 In the Command field, type the following and press Enter: start filer The Supervisor window displays, for example, the following: Started ‘filer’ in window 1 The number represents the application window in which Filer is running. The tab that previously said Application 1 now says Filer and is the active window. Note: For more details on starting Filer and using the Filer options, see “Starting Filer From the Database Window” on page 502. Utilities 501 Chapter 14: Filer Utility (filer) Starting Filer To exit Filer, do the following: 1 In the DBW window, select the Filer tab. 2 In the Command field, type one of the following and press Enter: • QUIT • STOP • END • EXIT The following message appears: Filer exited. 3 In the DBW, select File>Exit. Starting Filer From the Database Window To start Filer, do the following: 1 In the Database Window, select the Supervisor (Supvr) icon. The Supervisor window appears. 2 In the Supervisor window, type the following at the command input line and press Enter: START filer -v vproc -l -i -v -w -r vprocs -x -r vprocs -y -r vprocs -z -r vprocs -n -r vprocs -h -? 1102B089 where: Syntax Element Description -v vproc Identifies the vproc number that Filer will start on. Note: -v vproc is an option for the start command, whereas -v is an option for Filer. -h Displays the online help for Filer. ? Displays the online help for Filer. -l Starts Filer with file system locking disabled. This option should be used only when the Teradata Database is in the Debug-Stop state. Filer will not observe the file system locking protocols used to avoid hang or deadlock situations. Therefore, Filer may see inconsistent information. -i 502 Same as the -l option. Utilities Chapter 14: Filer Utility (filer) Starting Filer Syntax Element Description -v Starts Filer on a single vproc. If -v vproc is specified together with the -v Filer option, Filer is started on the vproc identified by vproc; otherwise, Filer is started on the control vproc. Note: Remote commands are not allowed with this option. -w Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Executes the normal file system startup process. However, processing of the Redo records will continue even if errors were encountered during the Redo phase. You can start Filer with the -w option only on the vprocs where the Teradata Database is down. In addition, you must use the -r option in conjunction with the -w option. If you use the -w option with the -x, -y, -z, or -n options, you need to specify the -r option only once. For example: start filer -w -y -r 2 For detailed information on using this option, see “Filer Diagnostic Options” on page 508. -x Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Builds the WAL Master Index (WMI), but does not perform Redo processing, and does not build the Master Index (MI). This option is used when the WAL log is corrupted. You can start Filer with the -x option only on the vprocs where the Teradata Database is down. In addition, you must use the -r option in conjunction with the -x option. For detailed information on using this option, see “Filer Diagnostic Options” on page 508. -y Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Builds the WMI and performs Redo processing, but does not build the MI. This option is used when the file system index structure is corrupt, and building the MI causes Filer to abort. You can start Filer with the -y option only on the vprocs where the Teradata Database is down. In addition, you must use the -r option in conjunction with the -y option. For detailed information on using this option, see “Filer Diagnostic Options” on page 508. -z Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Builds the WMI, does not perform Redo processing, but does build the MI. This option is used when the WAL log is damaged beyond repair. You can start Filer with the -z option only on the vprocs where the Teradata Database is down. In addition, you must use the -r option in conjunction with the -z option. For detailed information on using this option, see “Filer Diagnostic Options” on page 508. Utilities 503 Chapter 14: Filer Utility (filer) Starting Filer Syntax Element Description -n Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Does not build the WMI, does not perform Redo processing, and does not build the MI. This option is used when serious problems exist in the file system which cause file system startup to fail in the early stages. You can start Filer with the -n option only on the vprocs where the Teradata Database is down. In addition, you must use the -r option in conjunction with the -n option. For detailed information on using this option, see “Filer Diagnostic Options” on page 508. -r vprocs Warning: This is a special diagnostic mode to be used by trained Teradata personnel only. Starts Filer in the -w, -x, -y, -z, or -n modes on the specified vprocs. The -r option must be used in conjunction with the -w, -x, -y, -z, or -n options to limit the scope of these diagnostic modes. vprocs can be one of the following: • a single vproc number • a comma-separated list of vproc numbers • a range of vproc numbers in the form of start:end. For example, 2:5 represents vprocs 2, 3, 4, and 5. • a combination of vproc numbers and ranges of vproc numbers separated by commas The syntax for vprocs is as follows: , number number:number 1102A179 Filer will start with the specified -w, -x, -y, -z, or -n options on the vprocs specified by the vprocs argument. Filer will start normally (without the -w, -x, -y, -z, or -n options) on all vprocs not specified in the vprocs argument. Note: If the Filer -v option is specified, the vproc number selected must be included in -r vprocs. Filer can be started with the -r option only on the vprocs where the Teradata Database is down. For detailed information on using this option, see “Filer Diagnostic Options” on page 508. The Supervisor window displays, for example, the following: Started 'filer' in window 1 The number represents the application window in which Filer is running. The Filer window opens. 504 Utilities Chapter 14: Filer Utility (filer) Starting Filer IF you want to … THEN type … start Filer on a single specified vproc start -v vproc filer -v The first -v identifies the vproc that Filer will start on. The second -v specifies that Filer should start only on the specified vproc. For example, start -v 1 filer -v starts a single Filer task on vproc 1. As an alternative, you can omit the second -v and enter the following: start -v vproc filer start Filer only on the control vproc start filer -v. This starts a single Filer task on the control vproc. Note: This form is seldom used. Note: For details on the Database and Supervisor windows, see Graphical User Interfaces: Database Window and Teradata MultiTool. To exit Filer, do the following: 1 In the Filer window, type one of the following and press Enter: • QUIT • STOP • END • EXIT The following message appears: Filer exited. 2 In the Filer window, select File>Close. 3 In the Supervisor window, select File>Close. Redirecting Input and Output When you first start Filer, it accepts input from STDIN, the console input file, and directs output to STDOUT, the console output file. By using the Filer INPUT and OUTPUT commands, you can redirect the Filer input and output data to files that you specify. Also, you can do the following: Utilities • Append Filer data output to an existing output file • Overwrite an existing output file • Write only to a new file • Display the current output file 505 Chapter 14: Filer Utility (filer) Write Ahead Logging (WAL) When you direct output to a file with the OUTPUT command, Filer echoes all input and diagnostic messages to that file. For more information, see “INPUT” on page 613 and “OUTPUT” on page 644. Write Ahead Logging (WAL) WAL is a log-based file system recovery scheme in which modifications to permanent data are written to a log file, the WAL log. The log file contains change records (Redo records) which represent the updates. At key moments, such as transaction commit, the WAL log is forced to disk. In the case of a reset or crash, Redo records can be used to transform the old copy of a permanent data block on disk into the version that existed at the time of the reset. By maintaining the WAL log, the permanent data blocks that were modified no longer have to be written to disk as each block is modified. Only the Redo records in the WAL log must be written to disk. This allows a write cache of permanent data blocks to be maintained. WAL protects all permanent tables and all system tables but is not used to protect either the Transient Journal (TJ), since TJ records are stored in the WAL log, or any type of spool tables, including global temporary tables. The WAL log is maintained as a separate logical file system from the normal table area. Whole cylinders are allocated to the WAL log, and it has its own index structure. The WAL log data is a sequence of WAL log records and includes the following: • Redo records, used for updating disk blocks and insuring file system consistency during restarts. • TJ records used for transaction rollback. The WAL log is subject to many of the same problems as the normal file system, such as data corruption from hardware, software, and operational problems. Filer provides commands to display and modify the WAL log and its index so that trained personnel can diagnose and repair such problems. The Teradata Database File System The Teradata Database file system is not a general-purpose file system. It helps isolate the Teradata Database from hardware platform dependencies. The file system supports the creation and maintenance of database tables under the direction of the Teradata Database. The file system provides a set of low-level operations and is largely unaware of the higher-level intent of a particular sequence of calls made by the Teradata Database to file system procedures. For more information about the Teradata Database file system, see Database Administration. 506 Utilities Chapter 14: Filer Utility (filer) The Teradata Database File System Data Blocks and Cylinders In the Teradata Database file system, a data block (also known as a DB) is a disk-resident structure that contains one or more rows from the same table. Any single row is fully contained within a single data block, and every data block must be fully contained within a cylinder. The cylinder is a group of consecutive disk sectors but not necessarily identical to a physical disk cylinder. Since new disks use different zones of cylinder sizes to increase the storage capacity of the disk, the file system uses an average cylinder size. Each cylinder used by the file system is logically independent from other cylinders. For more information about data blocks and cylinders, see Database Design. File System Startup A normal startup of the Teradata Database file system starts the WAL log, starts the normal file system, then continues with the DBS startup, through transaction rollback and logons enabled. The steps are detailed below: File System Startup 1 2 Start the WAL log. a Validate the File Information Block (FIB). b Validate the Cylinder Status Array (CSA) and WAL Cylinder Indexes (WCIs). c Build the WAL Master Index (WMI). Start the normal file system. a Perform log analysis. b Perform Redo processing. c Validate the CSA and Cylinder Indexes (CIs). d Clean up the migrations. e Build the Master Index (MI). DBS startup includes starting the file system as follows: DBS Startup 1 File system startup 2 Start the AMPs 3 Start the PEs 4 Voting for Transaction Recovery 5 Transaction Rollback Errors encountered during WAL log startup or during Redo processing will generally abort the startup. You can use the Filer diagnostic options to analyze the problems and possibly recover from the errors. For more information, see “Filer Diagnostic Options” on page 508. Utilities 507 Chapter 14: Filer Utility (filer) Filer Diagnostic Options Filer Diagnostic Options Warning: The Filer diagnostic options should be used by trained Teradata personnel only. The Filer diagnostic options should be used only to repair a corrupted file system or WAL log. Only trained personnel with sufficient knowledge to repair Teradata file system internal structures should attempt to use these options. Users of the diagnostic options should have a thorough understanding of the following subjects: • Teradata file system internal operation and structures • Basic Teradata file system startup sequence The key phases of Teradata file system startup include the following: 1 Build the WAL Master Index (WMI). This is the index structure for the WAL log. The WAL log contains the Redo records and the Transient Journal (TJ) records. 2 Perform Redo analysis and replay. This scans the WAL log for Redo records and applies the necessary modifications. Redo processing must be performed before the MI is built to bring all the Cylinder Index (CI) structures up-to-date. 3 Build the Master Index (MI). Because the WAL protocol allows for the delayed writing of modified blocks to their home disk address, the blocks on disk are only completely valid after the Redo processing is complete. When the processing is finished, the CIs have been updated to reflect any cylinder migrates or other modifications that were performed. At this time, the building of the MI can proceed. When a system is corrupted, some or all of the above steps may be difficult to complete. The Filer diagnostic options allow trained personnel to start Filer even when errors are encountered during file system startup. The options also provide the ability to control which phases of the file system startup sequence to execute. This allows users to skip the startup phases which have errors and to use Filer to troubleshoot and repair the problems. 508 Utilities Chapter 14: Filer Utility (filer) Filer Diagnostic Options The following table describes each diagnostic option and when to use it. Option Actions When to use -w • Executes the normal file system startup process. • Continues processing Redo records even if errors are encountered during the Redo process. Use this option to clean up the WAL log and the file system as much as possible. This option skips certain file system startup errors, such as software errors related to the Redo process and its prerequisite conditions. Read errors and other hardware-related errors are not skipped. The Redo process attempts to process as much of the WAL log as possible, and then the rest of the normal file system startup logic is executed. It is highly recommended that you run SCANDISK after the Redo process to determine the structural integrity of the file system. See “SCANDISK” on page 668. In cases where errors are encountered before the Redo phase, (for example, while building the WAL log), you can use the -w option together with another diagnostic option such as -z to skip both the errors and the Redo phase. This allows you to start Filer and possibly repair the WAL log so that subsequent file system startup and Redo processing attempts will succeed. A log file is created for each vproc where Filer -w is invoked. You can check these files for errors and warnings. See “Filer -w Error Log” on page 511. -x • Builds the WAL Master Index (WMI). • Does not perform Redo processing. • Does not build the Master Index (MI). Use this option to examine and repair a corrupted WAL log. The option is useful when errors are encountered during Redo processing or when building the MI. The option provides the ability to examine and repair the WMI. It allows you to inspect the WAL log without trying to process the log or build the file system. It is highly recommended that you run SCANDISK WAL to determine the structural integrity of the WAL index structure. See “SCANDISK” on page 668. Once repairs are completed, you can run Filer again to process the Redo records. -y • Builds the WMI. • Performs Redo processing. • Does not build the MI. Use this option when the file system index structure is corrupt, and building the MI causes Filer to abort. This option gives you the ability to examine and repair the index structure. Once repairs are completed, you can run Filer again to build the MI. Utilities 509 Chapter 14: Filer Utility (filer) Filer Diagnostic Options Option Actions When to use -z • Builds the WMI. • Does not perform Redo processing. • Builds the MI. Use this option when errors are encountered during Redo processing and the WAL log may be damaged beyond repair. You can examine the file system to determine whether it can be salvaged. You can determine whether it is possible to repair the WAL log sufficiently so that Redo processing using the -w option can complete, or to ignore the WAL log and just repair the file system index structure. It is highly recommended that you run SCANDISK and SCANDISK WAL to determine the structural integrity of the WAL log and the file system. See “SCANDISK” on page 668. -n -r vprocs • Does not build the WMI. • Does not perform Redo processing. • Does not build the MI. Use this option when serious problems exist in the file system which cause file system startup to fail in the early stages. Defines the scope of the diagnostic options. Use this option when using the -w, -x, -y, -z, or -n options. The other diagnostic options will not function unless you use them together with the -r option. This option executes as little file system startup logic as possible to bypass errors so that Filer can be started. You can examine the file system to determine whether it can be salvaged. Since key global file system structures are not rebuilt in this mode, some commands, including a full SCANDISK, will be disabled. Filer will start with the specified -w, -x, -y, -z, or -n options on the vprocs identified by the vprocs argument. Filer will start normally (without the -w, -x, -y, -z, or -n options) on all vprocs not specified in the vprocs argument. Note: If you use any of the diagnostic options together with the -v Filer option, you must include the target vproc in the -r vprocs specification. Usage Notes The diagnostic options can be used only when Filer is started on a vproc where the Teradata Database is not running. This can occur if the whole DBS is down, or if the particular vproc is in a fatal state. These options are invalid on any vproc where the Teradata Database is up. The -x, -y, -z, and -n options are mutually exclusive; however, the -w option can be used in combination with the -x, -y, -z, or -n options. When using any of the diagnostic options, SCANDISK should be run at the level that is available to the option. Initial results from SCANDISK will indicate whether the file system structures are coherent. If repairs are made based on the SCANDISK result, SCANDISK should be run again, either immediately after the repairs, or after quitting and restarting Filer with the appropriate options. This will insure that the repairs resulted in a structurally correct file system. See “SCANDISK” on page 668. Some Filer commands are not available with certain diagnostic modes because these commands depend on specific file system structures which may not be built when Filer is started with those diagnostic options. 510 Utilities Chapter 14: Filer Utility (filer) Filer Diagnostic Options The following table shows the commands that are disabled for the various diagnostic options. An X indicates that the command is not available when Filer is started with that option. Any command that is not listed in the table is valid in all modes of Filer. -w -x -y CID X X X FIND X X X MI X X X MODIFY -z -n X ROW X X X SCANDISK (Full) X X X SCANDISK WAL TABLE X X X X WAL X WCID X WFIND X WFLUSH X WMI X WREC X WSUMMARY X The diagnostic options have no direct effect on the Transient Journal (TJ). However, if manual repairs are made to the WAL log, the TJ records might also be affected. When Filer is started with any of the diagnostic options, an informational message will be appended to the streams log(s) specifying which vprocs were affected. Filer -w Error Log When Filer is started with the -w option, a separate log file is created for each vproc where Filer -w is invoked. The location and name of the file is displayed on the Filer screen. The file logs any warnings and errors encountered during Filer startup on that vproc. After Filer is started, users should check the log files for errors or warnings, and take the appropriate action to ensure that the file system structures are consistent. The log file is useful for diagnosing WAL log problems, and identifying tables that may need repair. Utilities 511 Chapter 14: Filer Utility (filer) Filer Diagnostic Options Example 1 The following example shows the Filer screen when Filer is invoked with the -w option. The output screen displays the location and names of the log files created. File System Debug Utility _______ | | ___ __ ____ | / |/ \ ____| | --| / | | \___ | \____| | | ____| / | \____| ____ ____| / | \____| | __|__ | | |__ ____ ____| / | \____| Release 12.00.00.00 Version 12.00.00.00 Filer Waiting for 2 Filer Slave tasks to Start Command has been sent to Slave tasks. vproc 0 (0000) response Filer -w started on VPROC 0. Startup information and errors will be logged in the file C:\Program Files\NCR\Tdat\TdTemp\filer.w0.153839.txt. vproc 1 (0001) response Filer -w started on VPROC 1. Startup information and errors will be logged in the file C:\Program Files\NCR\Tdat\TdTemp\filer.w1.153839.txt. Wed Jun 28, 2006 15:38:54 2 of 2 amps have been selected Filer ==> Example 2 The following example starts Filer with the -w option on vprocs 2, 3 and 4, but starts Filer normally (without the -w option) on all other vprocs. start filer -w -r 2, 3, 4 This command can also be invoked using the following syntax: start filer -w -r 2:4 Example 3 The following example starts Filer with the -y option on vprocs 1, 4 through 7, and 9, but starts Filer normally on all other vprocs. start filer -y -r 1, 4:7, 9 512 Utilities Chapter 14: Filer Utility (filer) Filer Command Syntax Example 4 The following example starts Filer with the -n option only on vproc 3. Since the Filer -v option (the second -v) is used, the target vproc (vproc 3 as specified by the -v 3 option) must be listed in the arguments for the -r option. start -v 3 filer -v -n -r 3 Filer Command Syntax This section describes the general conventions involved in typing Filer commands. Then, each Filer command is described, with syntax options, parameters, and keywords. Usage notes and examples are provided if appropriate to the command. Typing Commands When you first start Filer, the following command prompt appears: Filer ==> Depending on the command that you typed, the prompt will change appropriately to convey what mode Filer is in and which commands Filer will accept. Filer commands are prompt-sensitive, as follows: • Global and upper-level commands are valid at any prompt. • Common commands are valid only under certain prompts that are initiated by upper-level commands. The following is the general form for a command entry: cmd parameterlist cmdoption cmdoption 1102A192 where: Syntax Element Description cmd The Filer command. cmdoption The options that are specific to the command that you type. Different options pertain to specific commands. To determine the allowed options, see the specific command. parameterlist Utilities The parameters included with specific commands. 513 Chapter 14: Filer Utility (filer) Filer Command Syntax Command Usage Rules The following command usage rules apply to Filer commands: • • A space is required between the following: • The cmdoption and the parameterlist • The cmd and the parameterlist if you do not specify cmdoption or if the cmdoption is at the end of the command You can combine multiple Filer commands on a single command line, as shown below: command ; command ; GS04A004 • Filer is case insensitive, which means that you can enter any command, keyword, or option in uppercase, lowercase, or mixed-case letters. • If you end a command line with a backward slash (\), the command line continues on the next line. • If an error occurs during processing of a string of commands, processing stops because the latter commands usually depend on the correct processing of commands typed earlier, as shown below: CI/P 1 10; DELETE /Y If there is a problem accessing CI 110, you might not want to execute the DELETE command. • If an error occurs while parsing the command line, you can type a single question mark (?) as the next command. Filer displays a list of alternatives expected by the parser at that point of the syntax error. If you type another single question mark (?) after Filer displays the alternatives, Filer returns the HELP text for the command in question. The following example shows help information about the RADIX command: Filer ==>radix in dex radix in de<-Syntax error->x Filer ==> ? Valid input at the point of error is: ; end of command Filer ==> ? RADIX [ ( IN[PUT] | OUT[PUT] ) ] [ ( H[EX] | D[EC] ) Filer ==> ? RADIX [ ( IN[PUT] | OUT[PUT] ) ] [ ( H[EX] | D[EC] ) ] Sets the Flags for how to treat Unqualified number. Either Hex (base 16) or Decimal (Base 10), respectively. See HELP NUMBER for a description of unqualified INPUT. The initial setting of these Flags are HEX. If neither INPUT nor OUTPUT is specified, the command applies to both Flags. If neither HEX nor DEC is specified, the current setting of the Flag is displayed. 514 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects Filer ==> ? No more information available. Use HELP /L • Comments are allowed anywhere a blank is allowed. Enclose comments between braces ({}). If Filer does not find a closing brace (}) on the line, Filer interprets the rest of the line as a comment, as shown in the following example: Filer ==> db 0 2 1fa { this is the broken data block • If you use a single question mark (?) in place of a legal syntactic element, Filer informs you as to what you can type at that point in the command, as shown below: Filer ==> output ? Valid input at the ? is : , INTO OVER end of command TO ON ; In this example, Filer accepts any of the following: • A comma (,) • INTO • OVER • TO • ON • A semicolon (;) Other examples of using a single question mark (?) in place of a legal syntactic element are shown below: output output output output • ? ?{comment} ? {comment {comment} ? Unlike other commands, the PATCH command cannot be combined on the command line with other commands. For more information, see “PATCH” on page 647. Specifying Data Objects This section provides detailed information for specifying the following data objects and input values: Utilities • Cylinders and sectors • Multitoken parameters • Numeric input • Stored input values • Rows (rowid) • RowID ranges (ridrange) • Subtable identifiers (tid) 515 Chapter 14: Filer Utility (filer) Specifying Data Objects Cylinders and Sectors Type the number of the drive and number of the cylinder as two numeric fields consisting of drive and cylinder. If drive is greater than the number of drives on the vproc, an error message appears. If the cylinder is greater than the number of cylinders on the drive, an error message appears. sectornum and sectorcount are the parameters for the disk block commands. These represent the starting sector number and length (in sectors) of the data block. Type each of these values as a single numeric field. If the sectornum or sectornum + sectorcount is greater than the number of sectors on a cylinder, an error message appears. You can use the File Information Block (FIB) command to determine the number of cylinders and sectors on each disk, and the number of drives available to this vproc. For more information, see “FIB” on page 593. Multitoken Parameters Multitoken parameters, such as a subtable identifier (tid) that is typed as three values, are typed on a single line with one or more spaces separating the individual tokens. Filer also accepts multitoken parameters separated by hyphens. For example, Filer accepts either of the following as subtable identifiers: 0 200 0 0-200-0 You can separate parameters from each other and from the command by spaces or a comma. To specify a command option (cmdoption), type it on the same line as the command (cmd). Numeric Input You can input numeric values into Filer as either decimal or hexadecimal form. The numeric base for data input to and output from Filer depends on the radix setting of hexadecimal or decimal. For more information on setting the default radix, see “RADIX” on page 656. In addition to the general rules for typing decimal and hexadecimal values, the following rules also apply to typing values so that hexadecimal entries can be recognized as decimal characters and decimal entries can be recognized as hexadecimal characters. • Decimal values are denoted as a string of decimal digits (0-9) with a trailing period, as shown in the following example: 4591. • Hexadecimal values are denoted as a string of hexadecimal digits (0 through 9 or A through F (or a through f)) with a trailing H, as shown in the following example: 459aH Note: The H can be lowercase or uppercase, and the leading zero is optional, as in FFh and 0ffH. • Filer also accepts gdb-style hexadecimal numbers, which consist of 0x, followed by hexadecimal digits, as shown in the following example: 0x45F 516 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects • Filer allows 0i (where i represents an integer) followed by decimal digits to be recognized as a decimal number. The variations of the decimal number 45 are shown in the following examples: 45. 2DH 0i45 0x2D i45 x2D Note: The leading zero is optional, and the i and x can be a lowercase or uppercase letter. The exception is 0d, since it is a legal hexadecimal number. • Filer uses a default radix, initially set to hexadecimal, which is used as the numeric base of a number, if not otherwise explicitly forced. For example, an entry of 45, depending on the current default radix, can be either of the following: 45. 0x45 An entry of 2D with a default radix of decimal is an error. • You can type all number values in Filer as unsigned 16-bit values, 0 through 65535 (0x0 through 0xFFFF), except when patching using /L or /W for 32-bit integers, in which case their range is 0x0 through 0xFFFFFFFF. For more information, see “Specifying a Subtable Identifier (tid)” on page 524. You must separate two numbers on the same line from each other by a space or a comma to be parsed correctly. The following entry is incorrect because FF is a hexadecimal character, and the i, which represents integer, indicates a decimal number: 0i45FF The following entry also is incorrect because it contains a space. The entry actually represents two numbers: 0i45 FF Stored Input Values Filer stores the most recent values entered for the following parameters: Utilities • cylinder • drive • endcylnum • enddrive • length • memaddr • offset • row_hash • row_partition • row_uniq • sectorcount • sectornum • startcylnum 517 Chapter 14: Filer Utility (filer) Specifying Data Objects • startdrive • tablenumber • tid You can enter an equal sign (=) for any of these parameters to use the stored value. These context values are position-dependent. (For example, values stored for a start_rid_spec can be used only as part of a start_rid_spec argument in a later command and not as part of an end_rid_spec). The stored values are updated by the commands as well. For example, if you select a data block, the stored value for the tid is updated to the subtable identifier of the data block, and the RowIDs are updated to the first and last row in the data block. Note: To use = to represent a stored value for a current command, you must have entered an input value for that parameter in a previous command, or issued a previous command which saved a value for that parameter. Use the SHOWDEFAULTS command to see the currently stored values. For more information, see “SHOWDEFAULTS” on page 696. Rows (rowid) A RowID uniquely identifies a row in a table, and logically consists of a two-byte internal partition number, a four-byte row hash value, and a four-byte uniqueness value. The internal partition number is stored only if the row belongs to a table with a partitioned primary index (PPI). A flag byte in the row indicates whether the internal partition number is stored in the row. IF the flag is... THEN... set • the internal partition number is stored in the row. • the row is from a PPI table. not set • the internal partition number is not stored in the row. • the system interprets the internal partition number to be 0. • the row is from a nonpartitioned (NPPI) table. For more information on row structure, see “Database-Level Capacity Planning Considerations, Base Table Row Format” in Database Design. 518 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects A RowID is defined as follows: For a row in a... Use this syntax... NPPI table row_partition = row_hash = row_uniq = 1102A184 PPI table row_partition = row_hash = row_uniq = 1102A185 where: Syntax Element Description row_partition The internal partition number of the row. • For a row in a NPPI table, either omit row_partition or specify a value of 0 for row_partition. • For a row in a PPI table, specify an internal partition number. row_hash The row hash value of the row, which is used by the system for row distribution. row_uniq The system-generated uniqueness value which is used with the row hash value to uniquely identify a row. = Filer will use the most recently saved values for row_partition, row_hash, or row_uniq. This option cannot be used unless input values have already been defined for row_partition, row_hash, or row_uniq. For more information, see “Stored Input Values” on page 517. Example 1 Filer ==> showdefaults The current object selected is Nothing The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 0 (0000) Cylinder:CylNum 2 (0002) Sector Number 972 (03CC) Sector Count 16 (0010) Memory Address is undefined. Length is undefined. Utilities 519 Chapter 14: Filer Utility (filer) Specifying Data Objects Patch Offset TID Start Rowid End Rowid 0 0 65535 is undefined. 26 1024 (0000 001A 0400) 512 657 0 1059 (0000 0200 0291 0000 0423 ) 512 657 0 1059 (FFFF 0200 0291 0000 0423 ) Filer is currently running on Vproc 0 Filer is running as a startable utility File System has Internal Tracing -- Enabled Example 2 DBD num firstrid lasthash start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ---- ----- ----- ----- ----- ---- ----- ----- ----- ------- ---- ---- -----0001 0000 0A00 0001 0000 0001 0000 0A00 0001 0010 0001 0000 0001 0021 Example 3 DB ==> dbrow /m ROW length -----09CD 0097 0800 00D5 00D5 0097 rowid flags presences part h0 h1 u0 u1 ---- ----- ----- ----- ----- ----- --------0000 7C6B 71AB 0000 0001 00 9C 0000 7D47 ADC8 0000 0001 00 91 0000 7D57 B91E 0000 0001 00 9C 0000 823F CDAE 0000 0001 00 99 0000 871F 7438 0000 0001 00 99 0000 8913 51BD 0000 0001 00 91 Example 4 CID dr cyl firsttid u0 u1 tai -- ---- ---- ---- ---00 0002 0000 0000 0000 01 0000 C000 0000 0000 firstrid lasttid part h0 h1 u0 u1 u0 u1 tai ---- ---- ---- ---- ---- ---- ---- ---0000 0000 0000 0000 0001 0000 001A 0400 0000 0000 0000 0000 0001 C000 0000 0000 lasthash part h0 h1 ---- ---- ---0000 0000 018C 0000 0000 0000 fl -00 00 in -00 00 fsec ---0246 05BF Specifying RowID Ranges (ridrange) A ridrange specifies a range of rows in a table and is defined as follows: start_rid_spec To end_rid_spec 1102A182 Note: The Filer online help refers to ridspec as rowspec, and defines ridrange as rowspec [TO rowspec]. Although the terminology is different, the usage is the same. 520 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects A ridspec (either start_rid_spec or end_rid_spec) is defined as follows: For a table with a... Use this syntax... PPI row_partition = row_hash = row_uniq = 1102A188 NPPI row_partition = row_partition = row_hash = row_hash = row_uniq = row_uniq = 1102A187 where: Syntax Element Description start_rid_spec The RowID specification which identifies the start of the row range. IF … THEN … an equal sign (=) is used for row_partition, row_hash, or row_uniq Filer will use the most recently saved values from the previous start_rid_spec for row_partition, row_hash, or row_uniq. row_uniq is omitted and no end_rid_spec exists all the rows in the row_hash are selected. row_uniq is omitted and end_rid_spec exists row_uniq defaults to 0 0. Note: The saved values for a start_rid_spec can be used only as part of a start_rid_spec argument in a later command, and not as part of an end_rid_spec argument. The saved values for row_partition, row_hash, or row_uniq cannot be used unless input values have already been defined for these parameters. For more information, see “Stored Input Values” on page 517. Filer also reports an error if you use a saved start_rid_spec value for a PPI table, but the table referenced in the current command is not partitioned, and vice versa. Utilities 521 Chapter 14: Filer Utility (filer) Specifying Data Objects Syntax Element end_rid_spec Description The RowID specification which identifies the end of the row range. IF … THEN … an equal sign (=) is used for row_partition, row_hash, or row_uniq Filer will use the most recently saved values from the previous end_rid_spec for row_partition, row_hash, or row_uniq. row_uniq is omitted row_uniq defaults to 0xFFFF 0xFFFF. Note: The saved values for an end_rid_spec can be used only as part of an end_rid_spec argument in a later command, and not as part of a start_rid_spec argument. The saved values for row_partition, row_hash, or row_uniq cannot be used unless input values have already been defined for these parameters. For more information, see “Stored Input Values” on page 517. Filer also reports an error if you use a saved end_rid_spec value for a PPI table, but the table referenced in the current command is not partitioned, and vice versa. PPI Table Rules For a PPI table, a row_partition is a required element of a ridspec. In addition, the following rules apply. IF … THEN … both row_hash and row_uniq are not specified for start_rid_spec row_hash and row_uniq default to 0x0000 0x0000. only row_uniq is not specified for start_rid_spec row_uniq defaults to 0x0000 0x0000. TO end_rid_spec is not specified and both row_hash and row_uniq for start_rid_spec are specified end_rid_spec defaults to the value of start_rid_spec. TO end_rid_spec is not specified and only row_partition and row_hash for start_rid_spec are specified end_rid_spec defaults to the same row_partition and row_hash as for start_rid_spec and row_uniq for end_rid_spec defaults to 0xFFFF 0xFFFF. TO end_rid_spec is not specified and only row_partition for start_rid_spec is specified end_rid_spec defaults to the same row_partition as for start_rid_spec and both row_hash and row_uniq for end_rid_spec default to 0xFFFF 0xFFFF. TO end_rid_spec is specified both row_hash and row_uniq for end_rid_spec have defaults of 0xFFFF 0xFFFF when not specified. NPPI Table Rules For a NPPI table, the following rules apply. 522 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects Utilities IF … THEN … only row_hash is specified for start_rid_spec row_uniq defaults to 0x0 0x0. only a 0 for row_partition is specified for start_rid_spec row_hash and row_uniq default to 0x0000 0x0000. TO end_rid_spec is not specified and row_uniq for start_rid_spec is specified end_rid_spec defaults to the value of start_rid_spec. TO end_rid_spec is not specified and only row_hash for start_rid_spec is specified end_rid_spec defaults to the same row_hash as for start_rid_spec and row_uniq for end_rid_spec defaults to 0xFFFF 0xFFFF. TO end_rid_spec is specified row_uniq for end_rid_spec defaults to 0xFFFF 0xFFFF. 523 Chapter 14: Filer Utility (filer) Specifying Data Objects Specifying a Subtable Identifier (tid) A subtable identifier (tid) uniquely identifies a subtable. A subtable is a collection of rows. The rows of a particular subtable may be data rows, index rows, table header rows, etc. A table is a collection of subtables. Filer commands operate on subtables, not on tables. The tid argument is used to identify a subtable to a Filer command. The tid must identify not only the table of interest, but also the subtable of interest. A table is identified in the data dictionary by a table number (tvm.tvmid). Each table number is unique across the whole system, rather than local to a database. To identify a subtable, you must supply a tid, which is composed of a tablenumber (or TableNameString) and a typeandindex value. The tablenumber or TableNameString identifies the relevant table, and the typeandindex value identifies the relevant subtable. Note: The Filer online help labels a subtable identifier as tableid instead of tid. The online help tableid has the same usage and meaning as tid and should not be confused with the Filer TABLEID command. For more information, see “TABLEID” on page 716. The subtable identifier, tid, is defined as follows: TableNameString typeandindex tablenumber = 1102A159 where: Syntax Element Description TableNameString The database name and table name, which uniquely identifies a table in the system. A period (.) is required to separate databasename from tablename, and the string must be entered using either single ( ' ) or double ( " ) quotes. "databasename.tablename" "databasename"."tablename" 'databasename.tablename' 'databasename'.'tablename' 1102A160 tablenumber A pair of numbers, separated by a space, used to uniquely identify a table in the system. = Specifies that Filer should use the most recently saved value for tablenumber. This option cannot be used unless an input value has already been defined for tablenumber. For more information, see “Stored Input Values” on page 517. 524 Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects Syntax Element Description typeandindex A kind of subtable, such as a table header, data subtable, or a particular index subtable. Note: typeandindex is a required component of tid. For example, you must use Scope Table ("xyz.empx"*) instead of Scope Table ("xyz.empx"). The syntax for typeandindex is as follows: type / index / variant number 1102A095 where: Utilities Syntax Element Description type The type of subtable. type can be one of the following: Type Description * All the subtables of this table. H The table header subtable. P The primary data subtable. F number The fallback data subtable specified by number. The default is 1. F* All of the fallback subtables. 525 Chapter 14: Filer Utility (filer) Specifying Data Objects Syntax Element Description index The index subtable to examine. If the index subtable is not given, it defaults to the data subtable. Index 1 is the first secondary index, Index 2 is the second secondary index, and so on. index can be one of the following: Index Description number A secondary index and can be used instead of specifying X number. If you enter number by itself, then number must be a multiple of 4 and it is interpreted in the following way: • • • • 526 number = 0 is the same as entering X0 number = 4 is the same as entering X1 number = 8 is the same as entering X2 number = 12 is the same as entering X3 etc. * All the indexes of the table. D The primary data index (same as X0 or 0). X number The secondary index specified by number. The default is 1. X* All the secondary indexes, starting at 0. Utilities Chapter 14: Filer Utility (filer) Specifying Data Objects Syntax Element Description variant The possible subtables. variant can be one of the following: variant (cont) Variant Description * All the possible variant subtables. 0 The default. If you do not specify variant, 0 is assumed. 1 The value during a Sort or Table Modify operation. 2 A value that is not used. 3 A value that is not used. Note: If you do not specify /variant, it defaults to 0 because this field is always 0. However, during Sort or Table Modify processing, this value becomes 1. number A single number that represents internally both the type of subtable (header, primary, or fallback) and the index to use to order the rows by (primary data index or one of the secondary indexes) and the variant. Any number used instead of type[/index[/variant]]. Since the table header subtable has only one row and has no secondary indexes or work subtables such as H/X4/3, Filer ignores the second part of this format and gives a table header display. The following table gives examples that describe the type and index fields. Each column in the table shows the syntax of a specific subtable listed under the column heading, Subtable Description. Utilities Subtable Description Number Type Table header 0 H Primary data subtable 1024 P First secondary index 1028 First fallback table 2048 Second secondary index of the third fallback table 4104 Type/ Index Type/Index/ Variant P/D P/X1 F1 F1/D F3/X2 All primary subtables P/* All primary secondary indexes P/X* 527 Chapter 14: Filer Utility (filer) Specifying Display Ranges (ordinalrange) Subtable Description Number Type All fallback subtables F* All subtables of this table * Sort table of the first secondary index 1029 Both tables during a sort of the first secondary index Type/ Index Type/Index/ Variant P/X1/1 P/X1/ * Example Assume that table T4 is a table in database XYZ and has a tablenumber of 0 1198. Also assume that Filer is currently set so that input is accepted in hexadecimal format. Some valid specifications of a tid for primary subtables of table T4 are as follows: • “XYZ.T4” 400 • “XYZ.T4” 1024. • “XYZ”.”T4” P • ‘XYZ’.‘T4’ 400 h • 0 1198 400 • 0 1198 P Specifying Display Ranges (ordinalrange) The ordinalrange parameter is used to specify a range of objects relative to the current position to be displayed. ordinalrange can be used on the following commands: • DISPLAY • TABLE • WAL When used on the … ordinalrange … DISPLAY command restricts or expands the initial context, producing a different resulting context. DISPLAY shows the objects in the new context. Filer saves the context from a previous command, and the ordinalrange is interpreted with respect to this initial context. The initial context for the DISPLAY command can be a row, subtable, CI, CID, DB, DBD, MI, WAL log record, WCI, WCID, WDB, WDBD, WMI, or a range thereof (except for the MI and WMI which are singular contexts). 528 Utilities Chapter 14: Filer Utility (filer) Specifying Display Ranges (ordinalrange) When used on the … ordinalrange … TABLE command restricts the range of rows to display, but does not influence the resulting context. An implicit initial context consisting of the rows of the table exists, and the ordinalrange is interpreted with respect to this context. The initial context for the TABLE command is always this same row range context. No matter what is displayed, the resulting context is always a subtable rather than a row range. WAL command restricts the WAL log records that are displayed. The initial context is from the first WAL log record to the last, and the ordinalrange is interpreted with respect to this context. The resulting context is a WAL log record or WAL log record range; therefore, the resulting context matches the records selected. Note: The Filer online help refers to ordinalrange as rangeopt, but the usage is the same. ordinalrange input is as follows: start TO stop 1102A092 start and stop are defined as follows: number + . BEG + number $ END + number * ALL 1102A076 where: Syntax Element Description BEG BEG always refers to the first object in the context. If the context is singular, BEG and END refer to the same object. END END always refers to the last object in the context. If the context is singular, BEG and END refer to the same object. +/- number The meaning of +/- number without BEG/END depends on whether it is used on a DISPLAY, TABLE, or WAL command: Utilities 529 Chapter 14: Filer Utility (filer) Specifying Display Ranges (ordinalrange) Syntax Element Description When used on a … + number is equivalent to … DISPLAY command END + number, and – number is equivalent to BEG - number, as described below: • A + number is a displacement from the last object in the context, expanding the context beyond the last object by the specified number of objects. • A - number is a displacement from the first object in the context, expanding the context before the first object by the specified number of objects. TABLE command BEG + number - 1, and – number is equivalent to ENDnumber, as described below: • A + number is an ordinal row number, where 1 is the first row. • A - number is a backwards displacement from the last row, so that -1 is the second to the last row. The exception is if the TABLE command uses a wildcard for the type part of the tid. In this case, the resultant context is special (nothing), and the display is a multiple subtable display, where each subtable is constrained by the ordinal range. For each subtable, the BEG/END +/- number rules apply, except that the – number construct is not allowed. WAL command BEG + number - 1, and – number is equivalent to ENDnumber, as described below: • A + number is an ordinal record number, where 1 is the first WAL log record. • A - number is a backwards displacement from the last record, so that -1 is the second to the last WAL log record. For examples, see “DISPLAY” on page 582, “TABLE” on page 707, and “WAL” on page 729. BEG/END +/- number Allows specifying an object relative to the first or last object of a context. When used on a … BEG/END +/- number can … DISPLAY command be used to expand or contract a context. TABLE or WAL command only restrict the initial context for display purposes. . If the current position encompasses a range of objects, then start or the period (.) means from the first object in the range. $ If the current position encompasses a range of objects, then stop or the dollar sign ($) means from the last object in the range. */ALL If you specify an asterisk (*) or ALL as the end field, ALL is translated into an end field. After an operation involving ordinalrange, the context, including the currently selected object, is adjusted to be these new objects just acted upon by this command. 530 Utilities Chapter 14: Filer Utility (filer) Specifying a WHERE clause Specifying a WHERE clause The WHERE clause can be supplied to the DISPLAY, WAL, and WREC commands to restrict selection based on row/record type or content. The constraint is in addition to the ridrange, ordinalrange and wlsnrange constraints. For more information about these constraints, see the description of the DISPLAY, WAL, or WREC command. Most of the constraints in the WHERE clause apply to WAL log records only, and not to rows in normal tables. Syntax WHERE , , , KIND=kind ACTION=action FLAGS=flags A NTASTATE=ntastate A B , , TJKIND=tjkind TJTABLE=tid B , TJROW=rowid TJTRANS=procnum transuniq C , TRXSTATE=trxstate D C , , , TJHOST=number , , TJREQUEST=number TJRCVSESS=number D TJSESSION=number 1102A154 where: Utilities 531 Chapter 14: Filer Utility (filer) Specifying a WHERE clause Syntax Element Description kind Types of WAL log records to display. The following are the valid values. • • • • • • • • • • • • • • • • • • • action ALLOCSECT BACKOUTSECT BEFORECHECKSUM CHECKPOINT DBD DIAGNOSTIC FREECYL FREELINEAGE FSP HDRMIGINFO HDRONLY NEWDB NONTJ ROW ROWCOPY ROWNEWSECT SRD TJRECORD UNFSE Indicates the action to be redone in certain NONTJ records. The following are the valid values. • INSERT • UPDATE • DELETE flags The following are the derived flags values that are valid in the WHERE clause. • NTA • NTABEGIN • NTAEND ntastate The following are the valid values. • OPEN • CLOSED 532 Utilities Chapter 14: Filer Utility (filer) Specifying a WHERE clause Syntax Element Description tjkind Types of Transient Journal (TJ) records to display. The following are the valid values. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • Utilities NILL TIP HSTSTRT BEG END CLRDMP FALL DELTBL BEFROW DELROW NEWROW DELIDX NEWIDX MODTBL DBLOK PJTRNBEG PJROW DELPJ DELALL INSETB TIPLOK TIPAPJ SESSEP 2PCVOTE 2PCABRT 2PCSTAT IDT REQABT NEWTMPTBL BEGSAVEPT ENDSAVEPT SAVEPTABT NEWLOB DELETELOB 533 Chapter 14: Filer Utility (filer) Specifying a WHERE clause Syntax Element Description tjkind (continued) • • • • • • • • • • • TJTABLE tid tid of the table referenced inside a TJ record. Some TJ records contain the subtable identifier (tid) and row identifier for the applicable row (the row to which the TJ record will be applied during rollback). This is displayed using RcvDisTJ conventions as a 4-byte table number and 2-byte typeandindex. However, as a TJTABLE argument, this is supplied in the normal Filer tid format, using two numbers for the halves of the table number, and a third number for the typeandindex. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. TJROW rowid rowid of the row referenced inside a TJ record. This is the RowID of the database row that the TJ record applies to. For example, this identifies the row whose update caused the TJ record to be created. TJTRANS procnum transuniq TJ record transaction identification. procnum and transuniq are both numbers. See RCVDISTJ output. trxstate For the TJ records, display only the TJ records for given transaction states. The following are the valid values. DELPART INSPART QTNEWROW QTDELROW FATMODTBL REPACT MARKER NUSIDEL NUSIINS CRESNAPSHOT REMSNAPSHOT • OPEN • ABORTED • CLOSED TJHOST number TJ record host number. TJSESSION number TJ record session number. TJREQUEST number For the TJ records, display only the TJ records for these requests. TJRCVSESS number For the TJ records, display only the TJ records for these recovery sessions. Usage Notes You can use the Boolean OR operator with KIND and TJKIND. You can use the Boolean AND operator for all other conditions. The != (not equal to) comparison operator is also allowed in comparisons. 534 Utilities Chapter 14: Filer Utility (filer) Specifying a WHERE clause You can enter Keyword arguments in any order. Separate Keyword arguments (some of which contain lists) with a space. Within a list, separate items with a comma. KIND=TJRECORD implies a WAL type of TJ. The kind value NONTJ does not represent an actual WAL log record kind, but is provided as a convenience, where KIND=NONTJ is equivalent to KIND!=TJRECORD. A mix of NONTJ and TJRECORD kinds is allowed. In qualifying records for display, if the record is a NONTJ kind, the NONTJ selectors (kind, action, flags, and ntastate) are used. If the record is a TJRECORD kind, then the TJ selectors (tjkind, tid, etc.) are used. The NTASTATE, TRXSTATE, and TJRCVSESS arguments require special processing because these values are not recorded in the log records. The log is read backwards to determine transaction states or to find recovery session boundaries. It is then read forwards to display selected log records, which can be further filtered by other arguments. For TJ records, the WHERE clause provides functionality similar to the RCVDISTJ debugger invokable, which was used in prior releases to examine the Transient Journal. The WHERE clause provides selection from the WAL log in a single, integrated display stream, displaying both NONTJ records and TJ records in time sequence when used with Filer commands such as WAL and WREC. The old RCVDISTJ debugger only showed the TJ stream. Example 1 The following example selects checkpoint records and TJ BEG and END records for host 7. wal /m where kind=checkpoint tjkind=beg,end tjhost=7 Example 2 The following example finds a TJ END record and deletes it. The output is not shown, but the desired TJ END record with WLSN 43e72 is assumed to be found amongst the TJ END records returned. wal /L where tjkind=end wrec /L 43e72 delete y // // // // display TJ END set context to request delete confirm delete records record found of selected record request Example 3 The following example finds all TJ records for open transactions from host 7. wal /L where tjhost=7 trxstate=open Example 4 The following example displays WAL insert records and TJ insert records. wal /l where action=insert and tjkind=newrow Utilities 535 Chapter 14: Filer Utility (filer) Hex Dumps Format Hex Dumps Format HEX DUMPS always are displayed in hexadecimal, regardless of the default radix output. An example is shown below: 0000: 0010: 0020: 00 01 02 03 04 05 06 07.08 09 0A 0B 0C 0D 0E 0F *................* 20 21 22 23 24 25 26 27.28 29 2A 2B 2C 2D 2E 2F * !"$%&’()*+,-./ * 10 11 12 13 14 15 16 17.18 19 1A 1B 1C 1D 1E 1F *................* The hexadecimal number in the first column represents the offset of the rest of the row from the beginning of the segment. In the example, the 0020 means that the second number on the third line 10 is 0x20(32.) bytes from the beginning of the segment. Characters in the last column are the ASCII representation of the hexadecimal numbers displayed in the row. 536 Utilities Chapter 14: Filer Utility (filer) Filer Command Structure Filer Command Structure Filer command structure is divided into two levels: • Lower • Upper The following table describes what you can do at each level. At the … You can … lower level tell Filer what to do with the selected segment by using primarily the common commands. upper level set the context to the object that Filer is involved with (for example, a CI), and change the prompt to reflect the new context. You can run these commands at any prompt. In the new context, you can use commands that are specific to the object. For detailed information about the options available to each command, see the command associated with the particular object (for example, the CI command). Common Commands Common commands can be used at most Filer prompts, but can behave in a slightly different manner at each prompt, depending on the segment/object currently selected. These commands act on the currently selected object, and not necessarily on a segment. For example, at the CI prompt, the currently selected object can be the CI, an SRD, or a DBD. For rows, all rows selected by the last row command are included. The currently selected object is reflected in the prompt. If these commands are typed at a prompt where they are not allowed, an error message is displayed. Note: Of the common commands, only the DISPLAY, DROP, NEXT, and PREV commands are allowed if you start Filer from the Coroner mode of the Teradata GNU Debugger (gdb). For information on starting Filer from the Coroner, see “Starting and Exiting on MP-RAS” on page 498. For a list of the common commands, see “Filer Commands” on page 539. Global Commands You can type global commands at any Filer prompt. They behave in the same manner at any prompt. For a list of the global commands, see “Filer Commands” on page 539. Utilities 537 Chapter 14: Filer Utility (filer) Filer Command Structure Upper-Level Commands Related to the drive, cylinder, and sectornum Fields These upper-level commands are used to position to data structures using the drive, cylinder, and sectornum field parameters. Note: Checksum header and fields are only displayed in Filer commands if checksums are enabled on that CI, CID, DBD, or MI. For a list of these upper-level commands, see “Filer Commands” on page 539. Upper-Level Commands Related to the tid and rowid Fields These upper-level commands are used to position to data structures using the tid and rowid field parameters. For a list of these upper-level commands, see “Filer Commands” on page 539. Upper-Level Commands Not Related to Any Particular Object These upper-level commands are not related to any particular object in the file system. They do not set context. After you select a segment or object, the prompt changes to reflect the selection. The prompt is changed back to the default prompt when the command is complete. For a list of these upper-level commands, see “Filer Commands” on page 539. 538 Utilities Chapter 14: Filer Utility (filer) Filer Commands Filer Commands The following lists Filer commands alphabetically. Command Description Type of Command ACCESS Accesses a specific copy of a CI or DB segment located on DISK, DRAM, or is the LATEST. Upper Level related to the drive, cylinder, and sectornum fields ALTCI Makes the non-active CI copy the active copy, and the formerly active copy the non-active copy. ALTWCI Makes the non-active WCI copy the active copy, and the formerly active copy the non-active copy. BLK Selects the segment that starts at the specified cylinder and sector number, determines the type of block, and displays it accordingly. Upper Level related to the drive, cylinder, and sectornum fields CHECKSUM Validates, displays, and optionally repairs the checksum for a DB, WDB, CI, or WCI segment. Upper Level related to the drive, cylinder, and sectornum fields CI Selects and displays the Cylinder Index (CI) segment for the specified cylinder. Upper Level related to the drive, cylinder, and sectornum fields CID Selects and displays the Cylinder Index Descriptor (CID) for the specified drive and cylinder. Upper Level related to the drive, cylinder, and sectornum fields DATE/TIME Displays the current system day, date, and time. Global DB Selects and displays the Data Block (DB) segment that starts at the specified cylinder and sector number. Upper Level related to the drive, cylinder, and sectornum fields DBD Displays the Data Block Descriptors (DBDs) of the current cylinder. Upper Level related to the drive, cylinder, and sectornum fields DBROW Displays the rows of a DB. Upper Level related to the drive, cylinder, and sectornum fields DELETE Deletes the currently selected object or range of objects, including all descendants and antecedents. Common DEPOT Displays cylinder summary information for cylinders in the Depot, or block summary information for blocks in a particular Depot cylinder. Upper Level related to the drive, cylinder, and sectornum fields DISABLE Sets a specific flag in the file system to FALSE, disabling certain features of Filer. Most such flags are for internal use only. Global DISPLAY Shows a formatted display of the currently selected object or range of objects. If you specify an ordinalrange, then DISPLAY shows a related object or range. Common DROP Drops the access on the current object and returns to the default prompt. Common Utilities 539 Chapter 14: Filer Utility (filer) Filer Commands Command Description Type of Command DUMPDISK Selects the disk segment that starts at the specified cylinder and sector number, determines the type of block, and displays it accordingly. Upper Level related to the drive, cylinder, and sectornum fields ENABLE Sets a specific flag in the file system to TRUE, enabling certain features of Filer. Most such flags are for internal use only. Global ERRORS Redirects diagnostic messages to a file that you specify or to the default file, stderr. Global FIB Displays the File Information Block (FIB) and information about cylinder usage. Upper level not related to any particular object FIND Given the table and optional ridrange, displays the cylinders containing the range. Upper Level related to the tid and rowid fields HELP Provides context sensitive help for Filer commands. Global IDENT Identifies the objects in the specified sectors, and displays the properties of the objects. Upper Level related to the drive, cylinder, and sectornum fields INIT Initializes the current cylinder or range of cylinders to free. Common INPUT Directs Filer to read commands from a specified file rather than from the default input file, stdin. Global MEMBLK Accesses the file system segment at the specified memory address, determines the type of the segment, and returns a formatted display of the segment. Upper level not related to any particular object MEMCTX Returns a formatted display of a file system context structure (ctxcontext_t) beginning at the specified memory address. Upper level not related to any particular object MEMDB Returns a formatted display of a DB beginning at the specified memory address. Upper level not related to any particular object MEMDUMP Dumps memory in the hexadecimal format, starting at the specified location for a specified length of bytes. Upper level not related to any particular object MEMROW Formats a row beginning at the specified memory address. Upper level not related to any particular object MEMSORCTX Returns a formatted display of a context structure (sorcontext_t) beginning at the specified memory address. Upper level not related to any particular object MEMWCTX Returns a formatted display of a context structure (wtjcontext_t) beginning at the specified memory address. MEMWDB Returns a formatted display of a WDB beginning at the specified memory address. 540 Utilities Chapter 14: Filer Utility (filer) Filer Commands Command Description Type of Command MEMWREC Formats a WAL log record beginning at the specified memory address. Upper level not related to any particular object MI Selects and displays the Master Index (MI). Upper Level related to the drive, cylinder, and sectornum fields MODIFY REDO Replays the specified WAL log records, or defines whether or not to replay the WAL log records during the next file system startup. NEXT Displays the next Row, WAL log record, DB, WDB, DBD, WDBD, CI, WCI, CID, WCID or subtable. Common OUTPUT Redirects Filer output to a file you specify or to the default file, stdout. Global PACK Packs the segment to eliminate fragmentation. Common PATCH Modifies file system segments and other objects in memory. Common PREV Displays a previous Row, WAL log record, DB, WDB, DBD, WDBD, CI, WCI, CID, WCID or subtable. Common PRIORITY Sets the priority class of the Filer process. Global QUIT Ends a Filer session. Global RADIX Sets the default radix (decimal or hexadecimal) used as the numeric base for Filer data input and output. Global RENAME Renames the currently selected segment to the specified location on the disk. Common RESETFREECYL Resets the file system internal free cylinder count back to the correct value. Upper level not related to any particular object ROW Displays rows from one or more subtables. For a single subtable, ROW sets the context to those rows. Upper Level related to the tid and rowid fields SCANDISK Verifies the integrity of the file system. Upper level not related to any particular object SCOPE (or VPROC) Selects a set of vprocs that Filer will communicate with until Filer quits or a different set of vprocs is selected. Upper level not related to any particular object SEGZERO or SEG0 Selects and displays Segment Zero (0). Upper Level related to the drive, cylinder, and sectornum fields SET FREECYL Sets the file system internal Free Cylinder count to the specified number. Upper level not related to any particular object SHOWDEFAULTS Displays the default settings and the saved context. Global SRD Returns a formatted display of all the Subtable Descriptors (SRDs) on the current CI that have any rows from the specified subtable tid. If tid is not specified, then all SRDs are displayed. Upper Level related to the drive, cylinder, and sectornum fields Utilities 541 Chapter 14: Filer Utility (filer) Filer Commands Command Description Type of Command STAMP Takes five hexadecimal numbers and converts them to a file system timestamp. Global SYNCSCAN Shows all currently running scans on an AMP that are eligible for the synchronized full file scan feature. Upper level not related to any particular object TABLE Displays rows from the subtable specified by tid. Upper Level related to the tid and rowid fields TABLEID Displays the table number of a specified table. Upper Level related to the tid and rowid fields TRACEPRINT Dumps the internal trace buffer of the file system. The drive and cylinder limit the display to entries for that drive and cylinder. Upper level not related to any particular object TRASH Places the currently selected segment into a state of FSGFILEONAME. Common UNJOIN Removes disks from existing AMPs in the scope. Upper Level related to the drive, cylinder, and sectornum fields VPROC (or SCOPE) Selects a set of vprocs that Filer will communicate with until Filer quits or a different set of vprocs is selected. Upper level not related to any particular object WABC Displays the WAL Append Buffer Control (WABC) structure. Upper level not related to any particular object WAL Displays Write Ahead Logging (WAL) log records in an ordinal record number range, such as the 10th through the 20th WAL log records. WCI Selects and displays the WAL Cylinder Index (WCI). WCID Selects and displays the WAL Cylinder Index Descriptor (WCID) associated with the requested WAL log cylinder. WDB Selects and displays the WAL Data Block (WDB) segment that starts at the specified cylinder and sector number. Upper Level related to the drive, cylinder, and sectornum fields WDBD Displays the WAL Data Block Descriptors (WDBDs) of a WAL log cylinder. Upper Level related to the drive, cylinder, and sectornum fields WDBREC Displays WAL log records for a WDB. Upper Level related to the drive, cylinder, and sectornum fields WFIND Displays the WAL log cylinders containing WAL log records in a given range, or if no range is specified, then all of the WAL log cylinders. Upper Level related to the tid and rowid fields WFLUSH Manually force some or all of the WAL log records in memory to disk. 542 Upper Level related to the drive, cylinder, and sectornum fields Utilities Chapter 14: Filer Utility (filer) Filer Commands Command Description Type of Command WMI Returns a formatted display of the WAL Master Index (WMI). Upper Level related to the drive, cylinder, and sectornum fields WREC Displays the WAL log records within a given range and within the restrictions of the whereclause. Upper Level related to the tid and rowid fields WSUMMARY Retrieves table IDs from WAL records within a given WAL log sequence number (wsln) range. WRITE Forces the currently selected segment to disk. Utilities Common 543 Chapter 14: Filer Utility (filer) ACCESS ACCESS Purpose The ACCESS command drops access to the current CI or DB segment, and accesses a copy of the same segment in the specified location. If a location is not given, ACCESS identifies the copy of the segment that is currently accessed. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /X, /H, /V) as /dispopt. You can type the options at the beginning or end of the command. ACCESS AC /P place /S /M /L /X /H /V 1102A162 where: Syntax Element Description /P Positions to the segment. Nothing is displayed unless there is a problem. /S Displays the segment in a short format. This is the default. /M Displays the segment in a medium-length format. /L Displays the segment in a long format. /X Displays the segment in an extended format. /H Displays the segment in hexadecimal. /V Verifies that the segment is logically correct, but does not display it. place The location of the segment you want to access. The valid values are DISK, DRAM, or LATEST. If you omit place, the ACCESS command identifies which copy of the segment is currently accessed. 544 Utilities Chapter 14: Filer Utility (filer) ACCESS Usage Notes The ACCESS command must be invoked from a CI or DB context (as indicated by the CI> or DB> prompt). Example In the following example, the ACCESS command is invoked within the CI context. CI ==> access Command has been sent to Slave tasks. vproc 1 (0001) response Currently we have the copy from the DRAM. Utilities This is the Latest copy. 545 Chapter 14: Filer Utility (filer) ALTCI ALTCI Purpose There are two copies of the CI, only one of which is active at any time. The active copy reflects the current state of the cylinder. The altci command makes the non-active CI copy the active copy, and the formerly active copy the non-active one. Syntax drive ALTCI cylinder 1102A193 where: Syntax Element Description drive The numeric identifier of the drive that contains the cylinder for which the CI will be changed. cylinder The numeric identifier of the cylinder for which the CI will be changed. Usage Notes ALTCI can be used only when the scope is set to one vproc. For more information on the SCOPE command, see “SCOPE or VPROC” on page 692. ALTCI can be used only when Teradata Database is not running. Example Filer ==> scope vproc 0 Command has been sent to Slave tasks. Thu Jul 05, 2007 18:59:30 1 of 4 amps have been selected Filer ==> altci 0 EA Active CI --------Location: 546 PRIMARY Utilities Chapter 14: Filer Utility (filer) ALTCI Blk Code: CI Version Number: 62 WLSN Stamp : (00000000001F9239) : Thu Jun 07, 2007 16:40:00.46 (50 97 68 46 2E) Non-Active CI ------------Location: SECONDARY Blk Code: CI Version Number: 60 WLSN : (00000000001F4446) Stamp : Thu Jun 07, 2007 07:40:00.90 (C0 18 68 46 5A) *** WARNING *** Picking the alternate copy of a [W]CI might result in overlapping tableids/rowids across cylinders and mismatches between the [W]CI and the blocks on the associated cylinder. After performing this command, use scandisk to determine whether additional repairs are required. *** WARNING *** Do you want to switch the effective copy to the alternate copy? (Y/N) y Active CI --------Location: SECONDARY Blk Code: CI Version Number: 60 WLSN : (00000000001F4446) Stamp : Thu Jun 07, 2007 07:40:00.90 (C0 18 68 46 5A) Successfully alternated the CI. Utilities 547 Chapter 14: Filer Utility (filer) ALTWCI ALTWCI Purpose There are two copies of the WCI, only one of which is active at any time. The active copy reflects the current state of the WAL cylinder. The altwci command makes the non-active WCI copy the active copy, and the formerly active copy the non-active copy. Syntax ALTWCI drive cylinder 1102A194 where: Syntax Element Description drive The numeric identifier of the drive that contains the WAL cylinder for which the WCI will be changed. cylinder The numeric identifier of the WAL cylinder for which the WCI will be changed. Usage Notes ALTWCI can be used only when the scope is set to one vproc. For more information on the SCOPE command, see “SCOPE or VPROC” on page 692. ALTWCI can be used only when Teradata Database is not running. 548 Utilities Chapter 14: Filer Utility (filer) ALTWCI Example Filer ==> scope vproc 0 Command has been sent to Slave tasks. Tue Jul 03, 2007 16:47:39 1 of 8 amps have been selected Filer ==> altci 0 2A Active WCI --------Location: PRIMARY Blk Code: WCI Version Number: 19 WLSN Stamp : (0000000000024E32) : Wed Jul 11, 2007 15:28:36.51 (64 2F 95 46 33) Non-Active WCI ------------Location: SECONDARY Blk Code: WCI Version Number: 3 WLSN : (000000000000AF68) Stamp : Tue Jul 03, 2007 10:51:10.01 (5E 62 8A 46 01) *** WARNING *** Picking the alternate copy of a [W]CI might result in overlapping tableids/rowids across cylinders and mismatches between the [W]CI and the blocks on the associated cylinder. After performing this command, use scandisk to determine whether additional repairs are required. *** WARNING *** Do you want to switch the active copy to the alternate copy? (Y/N) > y y Active WCI --------Location: SECONDARY Blk Code: WCI Version Number: 3 WLSN : (000000000000AF68) Stamp : Tue Jul 03, 2007 10:51:10.07 (5E 62 8A 46 07) Successfully alternated the WCI. Utilities 549 Chapter 14: Filer Utility (filer) BLK BLK Purpose The BLK (Block) command recognizes file system blocks and displays CI, WCI, DB, and WDB blocks based on the block code in the block header. For other types of blocks, the command indicates the block type. This command will also display DB or WDB blocks in Depot cylinders. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X, /V) as /dispopt. You can type the options at the beginning or end of the command. BLK drive /P /S /M /L /H /X /V cylinder = sectornum = sectorcount = 1102B025 where: 550 Syntax Element Description /P Positions to the block, but does not display it. /S /M /L /H /X The display options: Short, Medium, Long, Hex, and Extended. The display format depends on the block type. For descriptions of how the display options are applied to the different block types, see the associated commands:“CI” on page 557, “DB” on page 569, “WCI” on page 732, and “WDB” on page 736. /V Validates the block according to the block type, but does not display the block. drive The drive of the entries displayed. cylinder The cylinder of the entries displayed. sectornum The sector number of the entries displayed. sectorcount The number of sectors to examine, starting from sectornum, but not extending beyond the end of the cylinder. This can be used for either normal or Depot sectors. All blocks within this range are displayed. Utilities Chapter 14: Filer Utility (filer) BLK Syntax Element Description = Filer will use the most recently saved values for drive, cylinder, sectornum, or sectorcount. This option cannot be used unless input values have already been defined for drive, cylinder, sectornum, or sectorcount. For more information, see “Stored Input Values” on page 517. Usage Notes This command first looks to see if the requested sector is in a segment in memory. If found, that segment is displayed. If not found, this command tries to locate the requested sector in the file system B-Tree structures and reads in the segment pointed to by the file system structures. If the requested sector is currently not in use in the file system, the requested sectors are read in from disk and are dumped in the hexadecimal format. For more information, see “Global Commands” on page 537. Example 1 An example dump in the hexadecimal format follows: Filer ==> Blk 0 2 28 1 Hex Dumping Blk - Dr 0000 (0) Cyl 0002 (2) Sect 0028 (40) 0000: 0010: 0020: 0030: 0040: 01F0: Starting Address: 801c0000 89 01 00 00 04 00.00 80 1E 00 00 00 00 00 00.00 00 00 08 10 C6 FD 00 00.20 00 00 00 80 1E 00 20 00.20 00 15 00 00 00 00 00 00.20 00 00 . . 00 00 00 00 00 00 00 00.20 00 00 00 01 FF 05 00 00 00 03 00 00 00 00 00 00 00 2A 00 89 00 89 00 00 01 00 01 2A 18 00 00 00 00 00 00 00 00 *............*.*.* *................* *........ .......* *...... . .......* *........ .......* 00 89 01 00 00 *........ .......* Example 2 The following shows a new format CI in a normal file system cylinder. blk 1 4 0 Latest CI For Drive 0000 Cyl 000004 Effective CI location - sector 24 (0x18) FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version Utilities CI : : : : : 24 (0018) CI DATA (0003) Thu Nov 13, 2003 13:50:56.01 (C0 FC B3 3F 01) 1802 (070A) 1802 (070A) 551 Chapter 14: Filer Utility (filer) BLK FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FseHead FreeSects DbNewVer SRDCount FreeSpacePercent Flags MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm WLSN UnFSEHead : : : : : : : : : : : : : : : : : : : : : : : : : 5402 55 686 686 NULL NULL 28 935 55 17 DEFAULT 0 0 0 9 4031 22 0 4 1 1464837648 42 226 32 40 (151A) (0037) (02AE) (02AE) (0000) (0000) (001C) (03A7) (0037) (0011) (00FF) (0000) (0000) (0000) (00000009) (0FBF) (0016) (0000) (00000004) (0001) (574FA610) (002A) (00E2) (0000000000000020) (0028) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 0462 0800 firstdbd dbdcount offset -------FFEF -------- -----0002 0146 First 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ Example 3 The following example shows the BLK command for a DB in the Depot, assuming the cylinder is a Depot cylinder. The example also shows that a sector number past the first sector can be used to display a block. blk 1 0 9f2 Requested sector in the middle of an existing block Block is in a DEPOT cylinder. DB location - Drive 0001 Cyl 000000 Start 09F1 FilHeader for the Length(in sectors) BlkCode 552 DB : 127 : DB DATA (007F) (0006) Utilities Chapter 14: Filer Utility (filer) BLK Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail TableID DbMigVer DbNewVer Flags Checksum WLSN DepotChecksum HomeDiskAddress Drive Cylinder Start VprocId ChecksumSampleCount ChecksumAlgorithm : : : : : : : : : : : : : : : : : : : : : : : Thu Jun 12, 2003 22:17:13.36 (59 5E E9 3E 24) 0 (0000) 0 (0000) 3 (0003) 570 (023A) 31938 (7CC2) 31938 (7CC2) NULL (0000) NULL (0000) 0 1191 1024 (0000 04A7 0400) 0 (0000) 2559 (09FF) 0 (0000) 1464837648 (574FA610) 37 (0000000000000025) 598459447 (23ABC437) 1 0 2545 1 42 226 (01) (000000) (09F1) (0001) (002A) (00E2) ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0070 0000 00E4 4A6E 0000 0002 00 F8 0070 0000 0126 BBB1 0000 0001 00 F8 Example 4 The following example shows the BLC command for a Depot cylinder CI area. Blk 0 4 0 This is a DEPOT cylinder, and the CI area is empty. Use the DEPOT command to display a list of all DEPOT cylinders. Use the DEPOT <drv> <cyl> command to display summary information about a particular DEPOT cylinder, including start sectors for DEPOT blocks. Use the BLK command with <drv> <cyl> <sect> to display DB's or WDB's in a DEPOT cylinder. Utilities 553 Chapter 14: Filer Utility (filer) CHECKSUM CHECKSUM Purpose The CHECKSUM command validates and displays the checksum for a DB, WDB, CI or WCI segment and optionally stores a recalculated checksum. If you specify the FIX option, the CHECKSUM command attempts to repair any checksum mismatches if detected. Note: The Teradata Database must be down when using the CHECKSUM command. Syntax CHECKSUM drive cylinder sectornum = CI drive = cylinder WDB drive = cylinder DB FIX WCI drive = cylinder sectornum = = 1102D044 where: 554 Syntax Element Description FIX Overwrites the old checksum with a newly calculated checksum if there was an error in the old checksum. DB The segment that contains the data rows saved on disk. CI The compound data structure that is saved on disk to describe the current state of a cylinder. WDB The segment that contains the WAL log records and the TJ rows. WCI The structure that identifies the WDBs that are contained on the cylinder. drive The drive of the entries displayed. cylinder The cylinder of the entries displayed. sectornum The sector of the entries displayed. Utilities Chapter 14: Filer Utility (filer) CHECKSUM Syntax Element Description = Filer will use the most recently saved values for drive, cylinder, or sectornum. This option cannot be used unless input values have already been defined for drive, cylinder, or sectornum. For more information, see “Stored Input Values” on page 517. Example 1 To calculate and display the checksum for a cylinder index located on drive 0, cylinder 4 and verify the checksum with the existing checksum in the internal checksum field of the CI and the checksum in its CID, type the following: CHECKSUM CI 0 4 CI For Drive 0000 Cyl 000004 CI checksum in CID: 0x42152DF5, CI: 0x42152FG5, calculated value is 0x42152DF5 Example 2 To calculate and display the checksum for a data block located on drive 0, cylinder 4, sector b78 and verify the checksum with the existing checksum in the checksum field in the DBD of the DB, type the following: CHECKSUM DB 0 4 b78 DB location - Drive 0000 Cyl 000004 Start 0B78 DB checksum in DBD is 0x707E7916, calculated value 0x707E7916 Example 3 To calculate and display the checksum for a cylinder index located on drive X, cylinder Y, verify the checksum with the checksum fields of the CI and CID, and write the correct checksum to the CI checksum fields in the CI and CID if verification fails, type the following: CHECKSUM FIX CI X Y Example 4 To calculate and display the checksum for a data block located on drive X, cylinder Y, sector Z, verify the checksum with the checksum fields of the DBD, and write the correct checksum to the DB checksum field in the DBD if verification fails, type the following: CHECKSUM FIX DB X Y Z Example 5 The following is an example of the WAL log checksums: >checksum wci 0 44 WCI For Drive 0000 Cyl 000044 WCI checksum in WCID: 0x42152DF5, WCI: 0x42152DF5, calculated value is 0x42152DF5 Utilities 555 Chapter 14: Filer Utility (filer) CHECKSUM >checksum wdb 0 44 b78 WDB location - Drive 0000 556 Cyl 000044 Start 0B78 Utilities Chapter 14: Filer Utility (filer) CI CI Purpose The CI (Cylinder Index) command accesses the latest copy of the CI for the given cylinder and formats it in accordance with the display options. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /X, /H, /V) as /dispopt. You can type the options at the beginning or end of the command. drive CI /P /S /M /L /X /H /V FORCE FIX cylinder = 1102B014 where: Syntax Element Description /P Positions to this CI. If this cylinder is not a file system cylinder, an error occurs. Nothing is displayed unless a problem occurs. /S Shows a formatted display of the following: • header and trailer. • first and last DBDs. • first and last SRDs. /M Shows a formatted display of the following: • header and trailer. • all of the SRDs, with each one followed by the first and last DBDs for that SRD. /L Shows a formatted display of the following: • header and trailer. • all of the SRDs, with each one followed by all of the DBDs for that SRD. • the Free Sector (FSE) and the Unfree Sector (UNFSE) lists, if they exist. /X Shows the same display as /L, but also include the timestamp and other details from the DB for each DBD. /H Shows a hexadecimal dump of the requested CI. Utilities 557 Chapter 14: Filer Utility (filer) CI Syntax Element Description /V Verifies that the CI is logically correct, but does not display it. FORCE Filer will attempt to format and display the segment as a CI. Without FORCE, the command fails on a mismatched block. FIX Filer will attempt automatic repair of the CI. You must supply the /V option with the FIX option, and the Teradata Database must be down. drive The drive of the entries displayed. cylinder The cylinder of the entries displayed. = Filer will use the most recently saved values for drive and cylinder. This option cannot be used unless input values have already been defined for drive and cylinder. For more information, see “Stored Input Values” on page 517. Usage Notes If the segment acquired is not a CI, then an error occurs unless you specify FORCE, in which case Filer will attempt to format the block as a CI. The CI command displays the CI checksum, checksum algorithm, and checksum sample count fields in the CI header. The checksum and checksum algorithm are in both the CID and the CI, providing both internal and external checksums. The count is only in the CI and is used for either an internal or an external check. In addition, the checksum, checksum algorithm, and checksum sample count fields contained in the DBD structure are displayed for each DBD listed. The addition of these three checksum fields to the DBD structure expands the width of the DBD display from 88 to 105 characters. The following table shows the checksum algorithms and their values. Checksum Algorithm Checksum Algorithm Value None 0 External version number 45 32-bit simple checksum 100 32-bit sampled checksum 120 64-bit simple folded checksum 190 64-bit sampled folded checksum 225 Note: The checksum algorithm is not selectable. Currently, the Teradata Database uses the 64bit sampled folded checksum with an algorithm value of 225. 558 Utilities Chapter 14: Filer Utility (filer) CI The value of the checksum sample count field is a byte in the range 0 – 128. This number corresponds to the number of 32-bit words to sample per disk sector (512 bytes) in the file system block. The CI is stored on the first n sectors of each cylinder and describes only that cylinder. The CI has a redundant copy immediately following it on the disk. The CI can reside in one of two places: • Disk • DRAM The default access is the latest copy of the CI. The prompt for this selection is as follows: CI ==> The commands allowed at the CI prompt are listed below: • ACCESS. For more information, see “ACCESS” on page 544. • DBD. For more information, see “DBD” on page 573. • SRD. For more information, see “SRD” on page 702. • Common commands DELETE, DISPLAY, NEXT, PACK, PATCH, PREV, TRASH, AND WRITE. Although the current object selected can be the latest CI, the redundant CI, an SRD, or a DBD, the prompt reflects the current object. NEXT and PREV always access the latest copy of the next or previous CI. To get to the next or previous CI, when at an SRD or DBD object, type one of the following: • CI =; NEXT • CI =; PREV The display options for any of these commands are the same as that of the currently selected object, either the CI or the SRD, and makes no difference on a DBD. For more information, see “Common Commands” on page 537. • Any Global or Upper-Level commands. Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 The CI format was changed to accommodate the WAL feature. After installation of a Teradata release which includes the WAL feature, the majority of the CIs will still be in the old format, but as the CIs are accessed during normal usage, they will be automatically converted to the new CI format required by the WAL feature. During this transition period, you may encounter both types of CI blocks when analyzing file system problems. Utilities 559 Chapter 14: Filer Utility (filer) CI Example 1 The following example shows how checksum is displayed: CI ==> > ci 0 E04 ci 0 E04 Command has been sent to Slave tasks. vproc 0 (0000) Latest CI For FilHeader for response Drive 0000 the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FseHead FreeSects DbNewVer SRDCount FreeSpacePercent MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm Cyl 000E04 CI : : : : : : : : : : : : : : : : : : : : : : : : : : : 24 (0018) CI DATA (0003) Mon Dec 30, 2002 20:52:19.82 (53 F8 10 3E 52) 33 (0021) 33 (0021) 5626 (15FA) 31 (001F) 486 (01E6) 486 (01E6) NULL (0000) NULL (0000) 28 (001C) 74 (004A) 30 (001E) 1 (0001) DEFAULT (00FF) 1 (0001) 0 (0000) 3408 (00000D50) 65 (0041) 0 (0000) 0 (0000) 3588 (00000E04) 0 (0000) 2208322319 (83A0530F) 128 (0080) 225 (00E1) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 05D9 0C00 firstdbd dbdcount offset -------FFFF -------- -----001E 001F First 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset checksum ct ag part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ ---------- -- -0001 0000 56C4 A3FF 0000 0001 0000 570C 17BB 0030 007D 0000 001E 0024 F85731DC 80 E1 Last 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset checksum ct ag part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ ---------- -- -001E 0000 5DE4 6739 0000 0001 0000 5E21 80D4 0E59 007D 0000 001E 01D7 A2557956 80 E1 560 Utilities Chapter 14: Filer Utility (filer) CI Example 2 The extended display of the CI (/X option) also displays the checksum fields in the DBD and verifies the checksum with the data block itself. If a checksum mismatch occurs, then the invalid checksum is reported, as shown in the following example: CI ==> > ci /x 0 E04 ci /x 0 E04 Command has been sent to Slave tasks. vproc 0 (0000) response Latest CI For Drive 0000 Cyl 000E04 . . . All The SRDs and DBDs on the CI -- EXtended SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 05D9 0C00 firstdbd dbdcount offset -------FFFF -------- -----001E 001F DBD num firstrid lastrowkey start sectors flgs rows offset checksum part hash0 hash1 uniq0 uniq1 part hash0 hash1 dblen timestamp ver dbnewver tableid uniq0 uniq1 tai ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ -------------- ---------------------------- ----- -------- ----- ----- ----0001 0000 56C4 A3FF 0000 0001 0000 570C 17BB 0030 007D 0000 001E 0024 F85731DC 007D Mon Dec 30, 2002 20:51:56.63 0000 0000 0002 0000 570C B21B 0000 0001 0000 5754 D2B9 00AD 007D 0000 001E 0033 050F89F6 * INVALID *007D Mon Dec 30, 2002 20:51:56.68 0000 0001 Expected: 050F79F6 0003 0000 5754 DD9A 0000 0001 0000 57A8 A196 012A 007D 0000 001E 0042 B2275A42 007D Mon Dec 30, 2002 20:51:56.78 0000 0002 . . . ct ag -- -80 E1 80 E1 80 E1 Example 3 The following is an example using the FIX option on drive 0000 and cylinder 0002: ci /v fix 0000 0002 Example 4 The following is an example of an old, pre-WAL format CI without checksums present in any of the DBs: > ci 0 3 Latest CI For Drive 0000 Cyl 000003 Effective CI location - sector 0 (0x00) FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount Utilities CI : : : : : : 24 (0018) CI DATA (0003) Tue Sep 23, 2003 17:18:58.09 (F2 E2 70 3F 09) 1 (0001) 1 (0001) 6090 (17CA) 561 Chapter 14: Filer Utility (filer) CI RefCount HoleHead HoleTail DegenHead DegenTail FseHead FreeSects DbNewVer SRDCount FreeSpacePercent Flags MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm : : : : : : : : : : : : : : : : : : : : : : 2 51 51 NULL NULL 28 3823 1 1 DEFAULT 0 0 0 0 0 0 3 1 0 0 0 (0002) (0033) (0033) (0000) (0000) (001C) (0EEF) (0001) (0001) (00FF) (0000) (0000) (0000) (00000000) (0000) (0000) (0000) (00000003) (0001) (00000000) (0000) (0000) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 8000 0000 0000 Only firstdbd dbdcount offset -------FFFF -------- -----0001 001F 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 0000 0001 0000 0001 0000 0000 0001 0030 0001 0000 0001 0024 Example 5 The following is an example of an old, pre-WAL format CI with checksum: > ci 0 4 Latest CI For Drive 0000 Cyl 000004 Effective CI location - sector 24 (0x18) FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail 562 CI : : : : : : : : : : : 24 (0018) CI DATA (0003) Thu Nov 13, 2003 13:50:56.01 (C0 FC B3 3F 01) 1802 (070A) 1802 (070A) 5402 (151A) 55 (0037) 686 (02AE) 686 (02AE) NULL (0000) NULL (0000) Utilities Chapter 14: Filer Utility (filer) CI FseHead FreeSects DbNewVer SRDCount FreeSpacePercent Flags MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm : : : : : : : : : : : : : : : : : 28 935 55 17 DEFAULT 0 0 0 9 4031 22 0 4 1 1464837648 42 226 (001C) (03A7) (0037) (0011) (00FF) (0000) (0000) (0000) (00000009) (0FBF) (0016) (0000) (00000004) (0001) (574FA610) (002A) (00E2) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 0462 0800 firstdbd dbdcount offset -------FFEF -------- -----0002 0146 First 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 9513 A3A9 0000 0006 0000 C69F 19F9 03FF 0058 0000 011C 014B Last 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0011 0000 050E 0400 firstdbd dbdcount offset -------FFCA -------- -----0001 029A Last 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset checksum ct ag part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ ---------- -- -0026 0000 79B6 9E37 0000 0001 0000 79B6 9E37 0B78 0001 0000 0001 029F 707E7916 2A E2 Example 6 The following example shows the new WAL format CI with checksum: ci 1 4 Latest CI For Drive 0000 Cyl 000004 Effective CI location - sector 24 (0x18) FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FseHead FreeSects DbNewVer Utilities CI : : : : : : : : : : : : : : 24 (0018) CI DATA (0003) Thu Nov 13, 2003 13:50:56.01 (C0 FC B3 3F 01) 1802 (070A) 1802 (070A) 5402 (151A) 55 (0037) 686 (02AE) 686 (02AE) NULL (0000) NULL (0000) 28 (001C) 935 (03A7) 55 (0037) 563 Chapter 14: Filer Utility (filer) CI SRDCount FreeSpacePercent Flags MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm WLSN UnFSEHead : : : : : : : : : : : : : : : : 17 DEFAULT 0 0 0 9 4031 22 0 4 1 1464837648 42 226 32 40 (0011) (00FF) (0000) (0000) (0000) (00000009) (0FBF) (0016) (0000) (00000004) (0001) (574FA610) (002A) (00E2) (0000000000000020) (0028) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 0462 0800 firstdbd dbdcount offset -------FFEF -------- -----0002 0146 First 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 9513 A3A9 0000 0006 0000 C69F 19F9 03FF 0058 0000 011C 014B Last 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0011 0000 050E 0400 firstdbd dbdcount offset -------FFCA -------- -----0001 029A Last 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0026 0000 79B6 9E37 0000 0001 0000 79B6 9E37 0B78 0001 0000 0001 029F checksum ct ag -------707E7916 -- -2A E2 Example 7 The following example shows the new WAL format CI without Checksum: > ci 0 1 Latest CI For Drive 0000 Cyl 000001 Effective CI location - sector 0 (0x00) FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FseHead FreeSects DbNewVer SRDCount FreeSpacePercent 564 CI : : : : : : : : : : : : : : : : 24 (0018) CI DATA (0003) Thu Nov 13, 2003 13:50:33.38 (A9 FC B3 3F 26) 36537 (8EB9) 36537 (8EB9) 5124 (1404) 71 (0047) 114 (0072) 4355 (1103) 90 (005A) NULL (0000) 87 (0057) 1051 (041B) 1804 (070C) 22 (0016) DEFAULT (00FF) Utilities Chapter 14: Filer Utility (filer) CI Flags MigVer MigSrcDrv MigSrcCyl MigSrcVer MigSrcBlks Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm WLSN UnFSEHead : : : : : : : : : : : : : : 0 55 0 6 49362 2 0 1 1 0 0 0 32 40 (0000) (0037) (0000) (00000006) (C0D2) (0002) (0000) (00000001) (0001) (00000000) (0000) (0000) (0000000000000020) (0028) first 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0001 0000 0087 0400 firstdbd dbdcount offset -------FFEA -------- -----0009 005B First 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 10C2 4098 0000 0001 0000 14C2 09CE 09AC 003D 0000 0004 01F5 Last 'SRD' SRD num table id u0 u1 tai ---- ----- ----- ----0016 0000 0462 0800 firstdbd dbdcount offset -------FFBC -------- -----0003 0247 Last 'DBD' DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0031 0000 7CB9 A4ED 0000 0002 0000 9513 A3A9 0610 0059 0000 011E 0306 Utilities 565 Chapter 14: Filer Utility (filer) CID CID Purpose The Master Index is the highest level of the file system structure and contains a sorted list of all the Cylinder Index Descriptors (CIDs), which represent the cylinders that are being used. The CID command displays the CID associated with the requested cylinder. Syntax CID drive cylinder = 1102B016 where: Syntax Element Description drive The drive. cylinder The cylinder. = Filer will use the most recently saved values for drive and cylinder. This option cannot be used unless input values have already been defined for drive and cylinder. For more information, see “Stored Input Values” on page 517. Usage Notes The checksum and the checksum algorithm are in both the CID and the CI, providing both internal and external checksums. The count is only in the CI and is used for either an internal or an external check. The prompt for this selector follows: MI:CID ==> The commands allowed at this MI:CID prompt are shown in the following table. 566 Utilities Chapter 14: Filer Utility (filer) CID Command Syntax and Description Common commands PATCH, WRITE, DELETE, DISPLAY, NEXT, and PREV. For more information, see the individual commands. Any Global or Upper-Level Command Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 Example 1 An example with checksums in cylinder is shown below: cid 0 4 CID drv cyl firsttid firstrid lasttid lastrowkey u0 u1 tai part h0 h1 u0 u1 u0 u1 tai part h0 h1 fl in fsec checksum -- ------ ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- ---- -------00 000004 0000 0462 0800 0000 9513 A3A9 0000 0006 0000 050E 0400 0000 79B6 9E37 00 00 03A7 574FA610 ag -2e Example 2 An example without checksums in cylinder is shown below: cid 0 3 CID drv cyl firsttid firstrid lasttid lastrowkey u0 u1 tai part h0 h1 u0 u1 u0 u1 tai part h0 h1 fl in fsec checksum -- ------ ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- ---- -------00 000003 8000 0000 0000 0000 0000 0001 0000 0001 8000 0000 0000 0000 0000 0001 00 00 0EEF Utilities ag -- 567 Chapter 14: Filer Utility (filer) DATE/TIME DATE/TIME Purpose The DATE or TIME command shows the current system day, date, and time. Syntax DATE GS04A013 TIME GT06A027 Usage Notes The DATE or TIME command shows a timestamp in the following format: DDD mmm dd, yyyy HH:MM:SS where: Format … Specifies … DDD the day of the week. mmm dd, yyyy the calendar month, day, and year. HH:MM:SS the time in hour, minutes, and seconds. Example Example outputs generated by Filer are shown below: Filer ==> date Tue Jun 13, 2000 12:04:58 Filer ==> time Tue June 13, 2000 12:06:15 568 Utilities Chapter 14: Filer Utility (filer) DB DB Purpose The DB (Data Block) command selects and displays the DB segment that starts at the specified cylinder and sector number. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X, /V) as /dispopt. You can type the options at the beginning or end of the command. drive DB /P /S /M /L /H /X /V FORCE cylinder = sectornum = sectorcount = 1102A105 where: Utilities Syntax Element Description /P Positions to the DB. If one does not exist, an error occurs. Nothing is displayed unless a problem exists. /S A formatted display of the block, header, block trailer, and first and last row header. /M A formatted display of the block, header, block trailer, first and last row header, and the intervening row headers. /L A formatted display of the block, header, block trailer, first and last row header, the intervening row headers, and the row content in hex following each row header. /H A formatted display of the DB header followed by the entire DB in hex. /X Same as /L. /V Verifies that the DB is logically correct but does not display it. FORCE Formats as DB even if the block code indicates otherwise. Without FORCE, the command fails on a mismatched block. drive The drive. cylinder The cylinder. 569 Chapter 14: Filer Utility (filer) DB Syntax Element Description sectornum The sector number. sectorcount The sector count. = Filer will use the most recently saved values for drive, cylinder, sectornum, or sectorcount. This option cannot be used unless input values have already been defined for drive, cylinder, sectornum, or sectorcount. For more information, see “Stored Input Values” on page 517. Usage Notes Since the DB command only displays parameters from the data block itself, this command does not display any checksum field values for the DB. Checksum field values for the DB are stored in the DBD in the CI. To display the checksum fields for a DB, either the DBD should be displayed using the DBD command or use the CHECKSUM command. A DB contains one or more rows, all of which are members of the same subtable. Any single row is contained fully within a single DB. In addition, every DB must be fully contained within a cylinder. If count is omitted, Filer reads in the first sector of the block and obtains the sector count from the DB header. If given, Filer attempts to display only the information contained in those sectors. If the segment accessed is not a DB, Filer displays a message indicating an assumed type, unless you specify FORCE, in which case Filer tries to format the block as a DB. The prompt for the DB selector is shown below: DB ==> The commands allowed at the DB prompt are listed below: • ACCESS. For more information, see “ACCESS” on page 544. • DBROW. For more information, see “DBROW” on page 575. • Common commands DELETE, DISPLAY, NEXT, PACK, PATCH, PREV, TRASH, AND WRITE. These commands affect the entire data block. NEXT and PREV always access the latest version of the next or previous data block. The options for any of these commands are the same as those listed for the DB command. For more information, see “Global Commands” on page 537 or see the individual command. • Any Global or Upper-Level commands. Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • 570 “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 or see the individual commands. Utilities Chapter 14: Filer Utility (filer) DB • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 or see the individual commands. • “Upper-Level Commands Not Related to Any Particular Object” on page 538 or see the individual commands. The DB format was changed to accommodate the WAL feature. After installation of a Teradata release which includes the WAL feature, the majority of the DBs will still be in the old format, but as the DBs are accessed during normal usage, they will be automatically converted to the new DB format required by the WAL feature. During this transition period, you may encounter both types of data blocks when analyzing file system problems. Example 1 The following is an example of an old format DB before conversion to the new WAL format: > db 0 4 b78 DB location - Drive 0000 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail TableID DbMigVer DbNewVer Flags Cyl 000004 Start 0B78 DB : : : : : : : : : : : : : : : 1 DB DATA Thu Nov 13, 2003 13:50:56.01 0 0 228 1 26 26 NULL NULL 0 1294 1024 0 54 0 (0001) (0006) (C0 FC B3 3F 01) (0000) (0000) (00E4) (0001) (001A) (001A) (0000) (0000) (0000 050E 0400) (0000) (0036) (0000) ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 79B6 9E37 0000 0001 00 C0 Utilities 571 Chapter 14: Filer Utility (filer) DB Example 2 The following is an example of a new format DB after conversion to the WAL format. The first checksum is for the DB within the file system and has algorithm and sample count. The second is for the DB when in the Depot and has fixed algorithm and count. db 1 0 9f1 DB location - Drive 0001 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail TableID DbMigVer DbNewVer Flags Checksum WLSN DepotChecksum HomeDiskAddress Drive Cylinder Start VprocId ChecksumSampleCount ChecksumAlgorithm Cyl 000000 Start 09F1 DB : : : : : : : : : : : : : : : : : : : : : : : : : 127 (007F) DB DATA (0006) Thu Jun 12, 2003 22:17:13.36 (59 5E E9 3E 24) 0 (0000) 0 (0000) 3 (0003) 570 (023A) 31938 (7CC2) 31938 (7CC2) NULL (0000) NULL (0000) 0 1191 1024 (0000 04A7 0400) 0 (0000) 2559 (09FF) 0 (0000) 1464837648 (574FA610) 37 (0000000000000025) 598459447 (23ABC437) 1 0 2545 1 42 226 (01) (000000) (09F1) (0001) (002A) (00E2) ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0070 0000 00E4 4A6E 0000 0002 00 F8 0070 0000 0126 BBB1 0000 0001 00 F8 572 Utilities Chapter 14: Filer Utility (filer) DBD DBD Purpose The DBD (Data Block Descriptor) command displays the DBDs of the current cylinder. Syntax DBD /H tid ridspec sectornum = 1102D015 where: Syntax Element Description /H Shows a formatted display of all the DBDs in the current CI followed by a display of the DBDs in hexadecimal. tid Shows only the DBDs from the subtable specified by tid for the current CI. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. ridspec Shows only the DBDs within the row(s) specified by ridspec within the subtable (tid) for the current CI. For information on ridspec formatting, see “Specifying RowID Ranges (ridrange)” on page 520. The online help lists this option as rowspec. sectornum Shows only the DBDs covering this sector of the cylinder. = Specifies that Filer should use the most recently saved value for sectornum. This option cannot be used unless an input value has already been defined for sectornum. For more information, see “Stored Input Values” on page 517. Usage Notes The DBD command must be invoked from a CI context (as indicated by the CI> prompt). Without arguments, DBD shows all DBDs in the current CI. Utilities 573 Chapter 14: Filer Utility (filer) DBD Example 1 The following is an example without checksum. CI ==> dbd 30 SRD num table id u0 u1 tai ---- ----- ----- ----0001 8000 0000 0000 firstdbd dbdcount offset -------FFFF -------- -----0001 001F DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 0000 0001 0000 0001 0000 0000 0001 0030 0001 0000 0001 0024 Example 2 The following is an example with checksum. CI ==> dbd b78 SRD num table id u0 u1 tai ---- ----- ----- ----0011 0000 050E 0400 firstdbd dbdcount offset -------FFCA -------- -----0001 029A DBD num firstrid lastrowkey start sectors flgs rows offset checksum ct ag part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- ------ ---------- -- -0001 0000 79B6 9E37 0000 0001 0000 79B6 9E37 0B78 0001 0000 0001 029F 707E7916 2A E2 574 Utilities Chapter 14: Filer Utility (filer) DBROW DBROW Purpose The DBROW command displays the rows of a data block. Syntax Note: The online help lists the row options (/S, /M, /L, /H) as /rowopt. DBROW DBR /S /M /L /H 1102A108 where: Syntax Element Description /S or /C Displays the row count without the block header. /M or /I Displays the row headers. /L or /R Displays the row headers, each followed by the formatted row. /H Displays the row headers, each followed by the row in hexadecimal. Usage Notes The DBROW command must be invoked from a DB context (as indicated by the DB> prompt). Example DB ==> dbrow Command has been sent to Slave tasks. vproc 1 (0001) there are Utilities response 8 (0008) rows in the current Data Block 575 Chapter 14: Filer Utility (filer) DELETE DELETE Purpose Warning: The DELETE command can damage the File System B*Tree such that data can be removed or lost permanently. If used incorrectly, any changes might be irreversible. The DELETE command deletes the currently selected object or range of objects, including all descendants and antecedents, meaning the delete cascades both up and down through the index. Syntax DELETE /Y GS04A063 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. Usage Notes The selected object or range is from the last operation and is saved in the context. Executing SHOWD displays the selected object or range. For more information, see “SHOWDEFAULTS” on page 696. The delete context can be a row, table, DB, DBD, CI, CID, WAL log records, WDB, WDBD, WCI, WCID, and ranges thereof. If a WAL object is selected, DELETE cascades throughout the WAL log index structure. DELETE can apply to one, several or all AMPs, depending on the current scope. The DELETE confirmation scope can span AMPs but is condensed into a single range. For some ranges, DELETE is allowed only when the Teradata Database is down. If there is a whereclause in the context, then only those rows or WAL log records that satisfy the whereclause are deleted. For more information on the whereclause, see “Specifying a WHERE clause” on page 531. Only tables and rows can be deleted if running from remote DBW console with multiple vprocs selected. If the selected object is a CI, then the DELETE command effectively performs the same action as the INIT command. For more information, see “INIT” on page 612. 576 Utilities Chapter 14: Filer Utility (filer) DELETE For example, deleting a CI would remove the CID from the MI and all DBs with DBDs in the CI. Example 1 The following example deletes the TJ: wal where kind=TJRecord delete Example 2 The following example deletes the whole WAL log, all Non-TJ records, and all TJ records: wal delete Example 3 The following example uses the whereclause to delete Redo and other Non-TJ records, but not the TJ records: wal where kind=NONTJ delete Utilities 577 Chapter 14: Filer Utility (filer) DEPOT DEPOT Purpose The DEPOT command displays cylinder summary information for cylinders in the Depot, or block summary information for blocks in a particular Depot cylinder. Syntax DEPOT drive cylinder = 1102A110 where: Syntax Element Description drive The drive. cylinder The cylinder. = Filer will use the most recently saved values for drive and cylinder. This option cannot be used unless input values have already been defined for drive and cylinder. For more information, see “Stored Input Values” on page 517. Usage Notes To view the contents of the Depot, the Teradata Database must be online. WAL stages in-place writes of permanent and system tables through a disk area called the Depot, which is a collection of cylinders. In-place modifications are first written to the Depot and only then written to their original Home Disk Address (HDA). During system startup, the Depot is examined and any blocks that are found are read in, validated, and re-written to their original HDA. This ensures that any blocks that might have been partially written to their HDA, when a system outage occurred, can be rewritten as complete blocks. Handling writes this way greatly reduces the possibility of a partial-write scenario destroying pre-existing data. Any blocks partially written to the Depot will not pass validation, and thus will not overwrite the previous version of the block that still exists at the HDA. Because a write to the Depot must be complete before the block is written to the HDA, an interruption can only corrupt one of the copies of the block. A failed write to the Depot can be 578 Utilities Chapter 14: Filer Utility (filer) DEPOT recovered by applying the WAL log records to the copy of the block at the HDA. A failed write to the HDA can be recovered by copying the block in the Depot over the block at the HDA. The Depot can contain both DBs and WDBs. The contents of the Depot may be different each time you view it since data is constantly moving in and out of the Depot. Example 1 The following example shows a Depot summary: Filer ==> depot vproc 1 (0001) response ******************************************************************** * Expect the output data from the DEPOT to be constantly changing. * ******************************************************************** drv cyl blocks -- ------ -------00 000001 0000000E 00 000002 0000000E Example 2 In the following example, some lines of the output were omitted to condense the example. Filer ==> depot 0 1 vproc 1 (0001) response ******************************************************************** * Expect the output data from the DEPOT to be constantly changing. * ******************************************************************** DEPOT 0x00 0x000001 WDB: DEPOT start sector: 0x00000030 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FirstWLSN PrevWdbLastWLSN PrevWDBStart PrevWDBSects Checksum Utilities WDB : : : : : : : : : : : : : : : : 1 (0001) WDB DATA (000C) Mon May 01, 2006 12:43:54.68 (FA 64 56 44 44) 2 (0002) 2 (0002) 12 (000C) 3 (0003) 240 (00F0) 240 (00F0) NULL (0000) NULL (0000) 1060359 (0000000000102E07) 1060358 (0000000000102E06) 210 (000000D2) 1 (0001) 0 (00000000) 579 Chapter 14: Filer Utility (filer) DEPOT ChecksumSampleCount ChecksumAlgorithm HDA Drv HDA Cyl HDA Start Sector HDA VprocId RECORD Length -----0078 0060 00C0 : : : : : : 0 0 0 2255 211 1 (0000) (0000) (0000) (000008CF) (00D3) (0001) WLSN kind ---------------- --------------0000000000102E07 DBD 0000000000102E08 HDRMIGINFO 0000000000102E09 ROW [...Output lines omitted to condense the example...] WDB: DEPOT start sector: 0x00000D23 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FirstWLSN PrevWdbLastWLSN PrevWDBStart PrevWDBSects Checksum ChecksumSampleCount ChecksumAlgorithm HDA Drv HDA Cyl HDA Start Sector HDA VprocId RECORD Length -----0078 0068 0078 00C0 0078 00C0 WDB : : : : : : : : : : : : : : : : : : : : : : 2 (0002) WDB DATA (000C) Mon May 01, 2006 12:43:54.40 (FA 64 56 44 28) 2 (0002) 2 (0002) 45 (002D) 6 (0006) 460 (01CC) 460 (01CC) NULL (0000) NULL (0000) 1060293 (0000000000102DC5) 1060291 (0000000000102DC3) 187 (000000BB) 2 (0002) 0 (00000000) 0 (0000) 0 (0000) 0 (0000) 2255 (000008CF) 189 (00BD) 1 (0001) WLSN kind ---------------- --------------0000000000102DC5 DBD 0000000000102DC6 NEWDB 0000000000102DC7 ROWCOPY 0000000000102DC8 ROW 0000000000102DC9 ROWCOPY 0000000000102DCA ROW drv cyl blocks -- ------ -------00 000001 0000000E Filer ==> 580 Utilities Chapter 14: Filer Utility (filer) DISABLE DISABLE Purpose The DISABLE command sets a specified flag in the file system to FALSE. This disables certain features of Filer. Syntax , DISABLE DISA flag ? GS04C014 where: Syntax Element Description flag Specifies the flag that will be set to false. The following flags are available: • LOCKING When locking is disabled, Filer does not observe the file system locking protocols, which normally prevent system hangs and deadlocks. This flag should only be disabled when Teradata Database is in the DebugStop state. • SCRIPT, SCRIPT MODE, and SCRIPTMODE When script mode is disabled, the Filer ABORT and INQUIRE commands are enabled. Script mode is disabled by default. Script mode should be enabled before running scripts that call Filer. The following flags are for internal use only, and should not be disabled or enabled: • • • • • • ? CHECK and CHECKTS PANIC STOP SUSPEND TPARESET TRACE Displays a complete list of available flags. Example Filer ==> disable script Utilities 581 Chapter 14: Filer Utility (filer) DISPLAY DISPLAY Purpose The DISPLAY command shows a formatted display of the currently selected object or range of objects. If you specify an ordinalrange, then DISPLAY shows a related object or range. Syntax Note: You can type /dispopt and /rowopt at the beginning or end of the command. DISPLAY D /dispopt ordinalrange whereclause /rowopt 1102B120 where: Syntax Element Setting Selections Description /dispopt /P /S /M /L /X /H Specifies the format of the display output for the selected object. The display options are dependent on the object selected and may differ from those in the saved context. /P /S or /C /M or /I /L or /R /H Specifies the format of the display output for the selected object. The row options are dependent on the object selected and may differ from those in the saved context. /rowopt ordinalrange Not all display options work with all object types. For descriptions of how the display options are applied to different object types, see the command for the selected object, such as CI, WCI, DB, WREC, etc. Not all row options work with all object types. For descriptions of how the row options are applied to different object types, see the command for the selected object, such as DBROW, ROW, WDBREC, etc. Used to establish a new context based upon the old context, and then DISPLAY shows the objects in the new context. The online help lists this option as rangeopt. whereclause 582 For a WAL log record range context, a WHERE clause can be supplied to replace the current WHERE clause saved in the context. Utilities Chapter 14: Filer Utility (filer) DISPLAY Usage Notes The DISPLAY command is based on the current context, which may be a row, subtable, CI, CID, DB, DBD, MI, WAL log record, WCI, WCID, WDB, WDBD, or WMI. Except for the MI and WMI contexts, DISPLAY can also be based on a range selection. The current context is established by the previous BLK, CI, CID, DB, DBD, DISPLAY, MI, ROW, TABLE, WAL, WCI, WCID, WDB, WDBD, WMI, or WREC command. These commands save a single object or range of objects as the context. This saved context can be displayed using the SHOWDEFAULTS command. For more information, see “SHOWDEFAULTS” on page 696. If a prior command was a WAL command, the resulting context is a WAL log record or a range of WAL log records. For the WAL all command, the context begins with the first row in the WAL log and ends with the last row in the WAL log. This differs from the TABLE command where the resulting context is a subtable rather than a row range. You can use the ordinalrange argument of the DISPLAY command to expand the current context to a larger range of objects of the same type. Similarly, you can use ordinalrange to shrink a range to a smaller range or to a single object. The standalone integers (without the BEG/END prefix) in an ordinalrange always refer to objects outside the current context, so that positive values refer to objects past the end of the current context, and negative values refer to objects before the beginning of the current context, thus extending the context. For more information, see “Specifying Display Ranges (ordinalrange)” on page 528. Note: This differs from the interpretation of an ordinalrange for the TABLE or WAL command, where positive integers without the BEG/END prefix are ordinal row/record numbers, so that 1 is the first row or record. Negative integers without the BEG/END prefix are backwards displacements from the last row or record. For more information, see “TABLE” on page 707 and “WAL” on page 729. The DISPLAY command with an ordinalrange functions similarly for a WAL log record, WDB, WDBD, WCI, or WCID context, as it does for a Row, DB, DBD, CI, or CID context. Both singular and range contexts are allowed. If a prior command was a TABLE command which used a wildcard for the type part of the tid, the resultant context is special (nothing), and this context is not usable with the ordinalrange argument. For more information, see “TABLE” on page 707. The whereclause for the WAL and WREC commands is applied in conjunction with the ordinalrange or wlsnrange. The whereclause is recorded in the context and remains active for subsequent DISPLAY, NEXT, and PREV commands. As the display context is expanded or contracted, DISPLAY continues to use the whereclause in the context. The whereclause for a DISPLAY command must be appropriate to the saved context, or the DISPLAY command is rejected. For example, a whereclause is not allowed with a WCI context. For more information about the whereclause, see “Specifying a WHERE clause” on page 531. Utilities 583 Chapter 14: Filer Utility (filer) DISPLAY Example 1 Row ==> Display /m 1 to 2 ROW length rowid flags presences h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- --------09CD 7C6B 71AB 0000 0001 00 9C 0097 7D47 ADC8 0000 0001 00 91 Row (Range) ==> Example 2 The following example establishes a context consisting of all rows in a table and then shrinks the context. row 'employees.emp' p 0 // all rows of primary data subtable (p) of employees.emp disp /c disp /c beg+10000 to end-10000 Example 3 The following example establishes a context consisting of all rows in a table, shrinks the context to a single row, and then expands the context. 584 Utilities Chapter 14: Filer Utility (filer) DISPLAY Example 4 The following example establishes a data subtable context and then expands the context to include the table header subtable. Then DISPLAY shows both header and data subtables. Example 5 The following example displays the headers for the first 10 WAL log records and then displays the data for these same records. Since an ordinalrange is specified in the WAL command, the standalone positive integers are interpreted as sequential record numbers. This is the same as the ordinalrange in a TABLE command, except the context is set to the selected range. A similar TABLE-DISPLAY command sequence would first show the range within the table for the TABLE command and then display the whole table for the DISPLAY command. WAL /m 1 to 10 disp /1 Utilities 585 Chapter 14: Filer Utility (filer) DISPLAY Example 6 The following example shows the difference from Example 5. The first 10 row headers of the primary data subtable are displayed, followed by a display of the entire subtable, since the TABLE command always sets the context to the whole subtable, even if a smaller row range is displayed. > table /m 'employee.ttt' p 1 to 2 TableID: 0000 04A3 0400 ROWS: 00000004 SECTS: 00000001 SECTS: 00000001 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 540E 5384 0000 0001 00 C0 0010 0000 79B6 9E37 0000 0001 00 C0 > disp TableID: 0000 04A3 0400 ROWS: 00000004 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 540E 5384 0000 0001 00 C0 0010 0000 79B6 9E37 0000 0001 00 C0 0010 0000 CDC4 F1BB 0000 0001 00 C0 0010 0000 E6E2 78DD 0000 0001 00 C0 Example 7 The following example displays the number of records in the WAL log, then displays the last five WAL log records, and finally increases the display to the last 10 WAL log records. WAL all/s Disp /l end-4 to end Disp 5 to end Example 8 The following example first will find out how many records exist for open transactions from host 7, second will display the first TJ record header, third will display the next TJ record header, and finally will display the record content for the record. wal /s where tjhost=7 trxstate=open disp /l beg next disp /x 586 Utilities Chapter 14: Filer Utility (filer) DROP DROP Purpose The DROP command drops its access on the current object and returns to the default prompt. Syntax DROP GS04A065 Usage Notes Filer always locks access to FIB and MI, even if the default prompt is showing. Example Row (range) ==> Drop Filer ==> Utilities 587 Chapter 14: Filer Utility (filer) DUMPDISK DUMPDISK Purpose The DUMPDISK command selects the disk segment that starts at the specified cylinder and sector number, determines the type of block, and displays it according to the specified display options. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /V) as /dispopt. You can type the options at the beginning or end of the command. drive DUMPDISK DUMPDIS /P /S /M /L /H /V cylinder sectornum = = sectorcount = 1102B018 where: 588 Syntax Element Description /P Positions to the specified disk segment, but does not display it. /S Shows a short formatted display of the disk segment. /M Shows a medium-length formatted display of the disk segment. /L Shows a long formatted display of the disk segment. /H Shows a hexadecimal display of the disk segment. /V Verifies the disk segment and displays any errors encountered. drive The drive. cylinder The cylinder. sectornum The sector number. sectorcount The number of sectors to display, starting from sectornum. If sectorcount is omitted, DUMPDISK will display one sector. Utilities Chapter 14: Filer Utility (filer) DUMPDISK Syntax Element Description = Filer will use the most recently saved values for drive, cylinder, sectornum, or sectorcount. This option cannot be used unless input values have already been defined for drive, cylinder, sectornum, or sectorcount. For more information, see “Stored Input Values” on page 517. Usage Notes If the type is invalid, the segment is displayed in the hexadecimal format. This command differs from the BLK command because data is always dumped from disk. Utilities 589 Chapter 14: Filer Utility (filer) ENABLE ENABLE Purpose The ENABLE command sets a specified flag in the file system to TRUE. This enables certain features of Filer. Syntax , ENABLE ENA flag ? GS04C015 where: Syntax Element Description flag Specifies the flag that will be set to true. The following flags are available: • LOCKING When locking is enabled, Filer observes the file system locking protocols, which prevent system hangs and deadlocks. Locking is enabled by default when Filer is started without the -l or -i command-line options. • SCRIPT, SCRIPT MODE, and SCRIPTMODE Script mode is disabled by default. When script mode is enabled, the Filer ABORT and INQUIRE commands are disabled to allow a script to run without interruption. Script mode should be enabled before running scripts that call Filer. The following flags are for internal use only, and should not be enabled or disabled: • • • • • • ? CHECK and CHECKTS PANIC STOP SUSPEND TPARESET TRACE Displays a complete list of available flags. Example Filer ==> enable script 590 Utilities Chapter 14: Filer Utility (filer) ERRORS ERRORS Purpose The ERRORS command redirects diagnostic messages to a file that you specify or to the default file, stderr. Syntax ERRORS TO file INTO STDERR OVER ME GT06C008 where: Syntax Element Description TO Specifies that Filer is to write diagnostic messages to a new file or to STDERR. If the file specified exists, Filer returns an error. INTO Specifies that Filer is to append diagnostic messages to a specified file or to STDERR. If the file already exists, Filer appends the error messages to the end of the file If the file does not exist, Filer creates it automatically. OVER Specifies that Filer is to overwrite an existing file or STDERR with current diagnostic messages. If the file already exists, Filer writes over the file If the file does not exist, Filer creates the file. Utilities file The name of the destination file for diagnostic messages. STDERR The default file to which Filer writes diagnostic messages. ME A synonym for STDERR. 591 Chapter 14: Filer Utility (filer) ERRORS Usage Notes When you start Filer, it writes diagnostic messages to STDERR by default. You can use the ERRORS command to redirect the diagnostic messages in the following ways: • To write to a new file only • To append an existing file • To overwrite an existing file • To display on your console If you include the file parameter in the ERRORS command, the file you specify becomes the destination for diagnostic messages redirected from STDERR. If you type the ERRORS command without any options, Filer shows the name of the current diagnostic messages file STDERR on your system console. Example The following example shows the format for redirecting diagnostic messages into a specific file and directory: Filer ==> Errors over /home/user1/Filer.error 592 Utilities Chapter 14: Filer Utility (filer) FIB FIB Purpose The FIB (File Information Block) command displays the file system Information Block and information about cylinder usage, including WAL log cylinder and Depot cylinder usage. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H) as /dispopt. You can type the options at the beginning or end of the command. A FIB /P /S /M /L /H startdrive = startcylnum TO enddrive = = endcylnum = A cylstatustype TYPE '=' 1102B020 where: Syntax Element Description /P Positions to the FIB. Nothing is displayed unless a problem exists. /S Displays the fixed area of the FIB and a summary of the cylinder status array (CSA) index. /M Same as /S but also includes a detailed display of the CSA index. /L Same as /M but also includes the Cyl History Array and FTR information. /H Displays the contents of the FIB in hexadecimal. startdrive The first drive. If startdrive is omitted, the whole State Array is displayed. = Filer will use the most recently saved values for startdrive, startcylnum, enddrive, or endcylnum. This option cannot be used unless input values have already been defined for startdrive, startcylnum, enddrive, or endcylnum. For more information, see “Stored Input Values” on page 517. startcylnum The first cylinder number on the drive. If startcylnum is omitted, the first cylinder on the drive is assumed. TO The introduction of the closing identifier in a range of cylinders or drives. Utilities 593 Chapter 14: Filer Utility (filer) FIB Syntax Element Description enddrive The last drive. endcylnum The last cylinder on the drive. If endcylnum is omitted, the last cylinder on the drive is assumed. TYPE The types of cylinders to display. cylstatustype A list of the types of cylinders to be displayed. If no values are given, all cylinders in the given range, regardless of state, are displayed. The values for cylstatustype are as follows: cylstatustype Abbreviation ALLOC A BAD B DEFRAG DEF DEPOT DEP DURABLE DU FREE F HIDDEN H JOURNAL J PERMANENT P SPOOL S TEMPORARY TEMP TEST T UNDEFINED UND UNFREE U WAL W Usage Notes The prompt for the FIB selector is as follows: FIB ==> The commands allowed at this FIB prompt are listed in the following table. 594 Command Syntax and Description Common Commands DROP, PATCH, and WRITE. DISPLAY without an ordinalrange also is allowed. Utilities Chapter 14: Filer Utility (filer) FIB Command Syntax and Description Any Global or Upper-Level Command Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 Example Filer ==> fib /s FilHeader Utilities for the FIB Length(in sectors) : BlkCode : Stamp : Version : Trailer Version : FCRenable : BackgrndMainTask : DeFragTask : MiniCylPackTask : WalCheckBufTask : WalWriteBufTask : CheckPointTask : WriteBlksTask : Cylinders : Drives : SectsPerCyl : DBSectsPerCyl : BytesPerSect : MaxDBDsPerCI : CISize(sects) : TabMRowsDelCount : TabMRowsBlkSample : MaxDBsToMove : CylAllocHistSize : MiniCylPackMaxCyls : MiniCylPackSectSlop : MiniCylPackByStartup: Uninited : 264 (0108) FIB (0001) Wed May 23, 2007 03:09:43.03 (E7 12 54 46 03) 37487 (926F) Not Applicable TRUE (0001) 1005 (03ED) 1006 (03EE) 1007 (03EF) 1008 (03F0) 1009 (03F1) 1010 (03F2) 1011 (03F3) 18378 (000047CA) 1 (0001) 3872 (0F20) 3824 (0EF0) 512 (0200) 380 (017C) 24 (0018) 380 (017C) 20 (0014) 10 (000A) 5 (0005) 10 (000A) 120 (0078) FALSE (0000) FALSE (0000) PickFibByWLSN PreReversionWLSN FIB WLSN CloneWrittenLogWLSN CSA WLSN OldWMIID Length TRUE 0 31817201 31817211 31817200 : : : : : : 515072 (0001) (0000000000000000) (0000000001E57DF1) (0000000001E57DFB) (0000000001E57DF0) (7DC00) 595 Chapter 14: Filer Utility (filer) FIB Name Class Attr WMIID Length Name Class Attr WABCID BldFsysPhase VprocID : 0 1 0 : FSGMEMORY : AGELESS,VPROCWIDE (0000 0001 0000) (0003) (0044) : : : : : : : (7DC00) (0000 0001 0000) (0003) (0044) (0007 0DDC) (0041) (0000) FreeSpacePercent FragSectPercent MiniCylPackLowCylProd DefragLowCylProd PermDBSize(sects) PermDBAllocUnit(sects) JournalDBSize(sects) WorkDBSize(sects) DisableWALForDBs DisableWAL Drv ---0 515072 0 1 0 FSGMEMORY AGELESS,VPROCWIDE 7 3548 BADENUM 0 (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): (GDO5): 0 25 10 100 127 1 12 255 FALSE FALSE (0000) (0019) (000A) (0064) (007F) (0001) (000C) (00FF) (0000) (0000) Cyls BaseIdx Alloc'd DepotCnt 1stFree RaidLevel Arraytype -------- -------- -------- -------- -------- ------------- -------0047CA 000000 000127 000003 0000C1 1 Not Striped UNKNOWN Summary of Number of Cylinders in Each CYL state State Free Perm Spool Temporary Jrnl Durable Unfree Bad Test Allocating Hidden Defrag Undefined WAL DEPOT Number 18083 271 1 1 1 3 0 0 0 0 0 0 0 15 3 (Hex ) (0046A3) (00010F) (000001) (000001) (000001) (000003) (000000) (000000) (000000) (000000) (000000) (000000) (000000) (00000F) (000003) FIB ==> 596 Utilities Chapter 14: Filer Utility (filer) FIND FIND Purpose The FIND command, given the subtable and optional RowID range, displays cylinders containing the range with detail, depending on the options. Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. You can type the options at the beginning or end of the command. tid FIND F /S ridrange /M /L 1102B080 where: Syntax Element Description /S Displays the first CID, SRD, and DBD for range. /M Displays the first CID, SRD, and DBD for range, as well as all CIDs and the last SRD and DBD for range. /L Displays every CID, SRD, and DBD for range. tid the subtable of interest. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. ridrange the portion of the subtable of interest. For more information on ridrange formatting, see “Specifying RowID Ranges (ridrange)” on page 520. The online help lists this option as rowspec [TO rowspec]. Usage Notes The range default is the entire subtable. FIND sets the context to null. If Filer is invoked from the Coroner, the FIND command works in a limited manner, displaying whatever is found in the dump. For information on invoking Filer from the Coroner mode of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Utilities 597 Chapter 14: Filer Utility (filer) FIND Example 1 Filer ==> find /1 0 26. 0 CID dr cyl firsttid firstrid lasttid u0 u1 tai h0 h1 u0 u1 u0 u1 tai -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---00 0002 0000 0000 0000 0000 0000 0000 0001 0000 001A 0400 SRD num table id u0 u1 tai ---- ----- ----- ----0019 0000 001A 0000 firstdbd dbdcount offset -------FF82 -------- -----0001 03AC lasthash h0 h1 fl in fsec ---- ---- -- -- ---0000 01C8 00 00 0234 DBD num firstrid lasthash start sectors flgs rows offset hash0 hash1 uniq0 uniq1 hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 0001 0000 0001 0000 0001 0298 0001 0000 0001 03B1 SRD num table id u0 u1 tai ---- ----- ----- ----001A 0000 001A 0400 firstdbd dbdcount offset -------FF81 -------- -----0001 0418 DBD num firstrid lasthash start sectors flgs rows offset hash0 hash1 uniq0 uniq1 hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 0191 0000 0001 0000 01C8 0060 0007 0000 0044 0457 Totals ---> 598 00000008 00000045 Utilities Chapter 14: Filer Utility (filer) FIND Example 2 The following example displays the CI range for a user table. > find 'employee.ttt' p CID drv cyl firsttid firstrid lasttid lastrowkey u0 u1 tai part h0 h1 u0 u1 u0 u1 tai part h0 h1 fl in fsec -- ------ ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- ---01 000000 0000 0480 0400 0000 E288 3608 0000 0001 0000 04A7 0400 0000 0126 BBB1 00 00 02FE SRD num table id firstdbd dbdcount offset u0 u1 tai ---- ----- ----- ----- -------- -------- -----000F 0000 04A3 0400 FFCE 0001 0199 DBD num firstrid lastrowkey start sectors flgs rows offset part hash0 hash1 uniq0 uniq1 part hash0 hash1 ---- ----- ----- ----- ----- ----- ----- ----- ----- ----- ------- ---- ---- -----0001 0000 540E 5384 0000 0001 0000 E6E2 78DD 005F 0001 0000 0004 02D2 Utilities 599 Chapter 14: Filer Utility (filer) HELP HELP Purpose The HELP command provides context sensitive help for Filer commands. The help displayed is based on the mode that Filer is running in as indicated by the Filer prompt. Syntax HELP H /L ALL keyword ? GT06C009 where: Syntax Element Description /L Displays the long form of a help display, showing a description of the command in addition to command syntax. If you do not type /L, Filer assumes the short form of the help display, which shows command syntax only. ALL Displays the help for all Filer commands, regardless of the current Filer context. keyword Displays the help for the Filer command or parameter specified by keyword. You may specify any Filer command, not just the commands that are valid in the current Filer context. If you do not specify either a keyword or ALL, HELP displays help only for the commands that are valid in the current context. ? 600 Displays the list of all the keywords for which help is available. Utilities Chapter 14: Filer Utility (filer) HELP Example 1 To display help for all Filer commands, regardless of the current Filer prompt or context, type the following: Help all In the Filer context, the following displays: Filer ==> help all For more information please type HELP /L command For a explanation of the conventions used in this help type HELP CONVENTION AC/CESS [ /dispopt ] [ place ] [/dispopt ] BLK [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] CHECKSUM [ FIX ] { DB drive cylinder sector | CI drive cylinder } CI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] CID drive cylinder { COPY | CP } VPROC number [ THRU VPROC number] { INTO | OVER } filename { COPY | CP } PMA { INTO | OVER } filename { COPY | CP } CLIQUE { INTO | OVER } filename { COPY | CP } FROM filename ( DATE | TIME ) DB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] DBD [ /H { tableid [ rowspec ] | sectornum } ] DBR/OW [ /rowopt ] DELETE [/Y] DEPOT [ drv cyl ] DISA/BLE flag [ [,] flag ... ] D/ISPLAY [ { /dispopt | /rowopt } ] [ rangeopt ] [WHERECLAUSE] [ { /dispopt | /rowopt } ] DROP DUMPDIS [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] ENA/BLE flag [ [,] flag ... ] ERRCLR /P drive cylinder head sector ERRCLR [ /L ] drive cylinder sector [ /L ] ERRORS [ { INTO | OVER | TO }{ STDERR | ME | filename } ] ERRSET /P drive cylinder head sector ERRSET [ /L ] drive cylinder sector [ /L ] FIB [ /dispopt ] [ startdrive [ startcylnum ] [ TO enddrive [endcylnum]]] [TYPE [ = ] cylstatustype [ cylstatustype ... ]] [/dispopt ] F/IND [ /dispopt ] tableid [ rowspec [ TO rowspec ] ] [/dispopt ] H/ELP [ /L ] [ { command | parameter } ] ID/ENT drive cylinder sectornum INIT [/Y] INPUT FROM filename LISTB/AD [ drive [ cylnum ] ] MEMB/LK [ /dispopt ] memaddr [/dispopt ] MEMCTX memaddr MEMDB [ /dispopt ] [FORCE] memaddr [/dispopt ] MEMD/UMP memaddr [ length ] MEMR/OW [ /rowopt ] memaddr [ /rowopt ] MEMSORCTX memaddr MEMWCTX memaddr Utilities 601 Chapter 14: Filer Utility (filer) HELP MEMWDB [ /dispopt ] [FORCE] memaddr [/dispopt ] MEMWR/EC [ /nextopt ] memaddr [ /nextopt ] MI [ /dispopt ] MOD/IFY [/Y] REDO { REPLAY LIN/EAGE wlsn | REPLAY WREC wlsnrange | ACTIVATE [ NEXT [ REDO ] ] | DEACTIVATE [ NEXT [ REDO ] ] } N/EXT [ { /dispopt | /rowopt } ] [ number ] [ { /dispopt | /rowopt } ] OUT/PUT [ { INTO | OVER | TO }{ STDOUT | ME | filename } ] PACK [/Y] PAT/CH [ /patchopt ] offset [ /patchopt ] 'patchopt' is defined as ( B | C | W | S | D | L ) PR/EV [ { /dispopt | /rowopt } ] [ number ] [ { /dispopt | /rowopt } ] [SET] PRIORITY = PRIORITYCLASS { Q/UIT | ST/OP | END | EXIT } RADIX [ { IN/PUT | OUT/PUT } ] [ { H/EX | D/EC } ] REMOVE /P drive cylinder head sector REMOVE [ /L ] drive cylinder sector [ /L ] RESETFREE/CYL] RETURN/SECT /P drive cylinder head sector RETURN/SECT [ /L ] drive cylinder sector [ /L ] ROW [ /rowopt ] tableid rowspec [ TO rowspec ] [ /rowopt ] SCANDISK [ /dispopt ] [ { DB | CI | MI | FREECIS | WAL | WMI | WCI | WDB } ] [ FIX ] [ { tableid rowspec [ TO rowspec ] | TAB[L[E]] tableid1 [ rowspec1 ] [ TO tableid2 [ rowspec2 ] ] } ] [ /dispopt ] [INQUIRE <interval>] [ { NOCR | CR } ] [ SCOPE ] VPROC ALL [ SCOPE ] VPROC number [ SCOPE ] VPROC { ( number [ TO number] [ number [ TO number] ] ... ) } ( SEG0 | SEGZERO ) [ /dispopt ] SET FREE/CYL [ /Y ] number SHOWD/EFAULTS SRD [ /dispopt ] [ tableid ] [/dispopt ] STAMP number number number number number SYNCSCAN [ /dispopt ] [ tableid ] [/dispopt ] TAB/LE [ /rowopt ] tableid [ rangeopt ] [ /rowopt ] TRA/CEPRINT [ drive [ cylinder ] ] [ LAST number ] TRAS/H [/Y] UNJOIN [ LAST [ number ] ] UNJOIN [ number [ TO number] [ number [ TO number] ] ... ] WRIT/E [/Y] [ /NOCHECKSUM ] WAL [ /dispopt ] [ rangopt ] [WHERECLAUSE][ /dispopt ] WABC [ /dispopt ] WCI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] WCID drive cylinder WDB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] WDBD [/dispopt] [ ( WLSNSPEC | SECTORSPEC ) ] WDBREC [ /rowopt ] WFIND [ /dispopt ] [wlsnrange] [/dispopt ] WFLUSH WLSN=wlsn WMI [ /dispopt ] WREC [ /dispopt ] wlsn [ TO wlsn ] [WHERECLAUSE][ /dispopt ] 602 Utilities Chapter 14: Filer Utility (filer) HELP Example 2 To display help only for the Filer commands that are valid in the current Filer context, type Help at the prompt without any options. Help In the Filer context, HELP displays only the commands that Filer will accept at the Filer prompt. Filer ==> help For more information please type HELP /L command For a explanation of the conventions used in this help type HELP CONVENTION BLK [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] CHECKSUM [ FIX ] { DB drive cylinder sector | CI drive cylinder } CI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] CID drive cylinder ( DATE | TIME ) DB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] DEPOT [ drv cyl ] DISA/BLE flag [ [,] flag ... ] DROP DUMPDIS [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] ENA/BLE flag [ [,] flag ... ] ERRCLR /P drive cylinder head sector ERRCLR [ /L ] drive cylinder sector [ /L ] ERRORS [ { INTO | OVER | TO }{ STDERR | ME | filename } ] ERRSET /P drive cylinder head sector ERRSET [ /L ] drive cylinder sector [ /L ] FIB [ /dispopt ] [ startdrive [ startcylnum ] [ TO enddrive [endcylnum]]] [TYPE [ = ] cylstatustype [ cylstatustype ... ]] [/dispopt ] F/IND [ /dispopt ] tableid [ rowspec [ TO rowspec ] ] [/dispopt ] H/ELP [ /L ] [ { command | parameter } ] ID/ENT drive cylinder sectornum INPUT FROM filename LISTB/AD [ drive [ cylnum ] ] MI [ /dispopt ] MOD/IFY [/Y] REDO { REPLAY LIN/EAGE wlsn | REPLAY WREC wlsnrange | ACTIVATE [ NEXT [ REDO ] ] | DEACTIVATE [ NEXT [ REDO ] ] } OUT/PUT [ { INTO | OVER | TO }{ STDOUT | ME | filename } ] [SET] PRIORITY = PRIORITYCLASS { Q/UIT | ST/OP | END | EXIT } RADIX [ { IN/PUT | OUT/PUT } ] [ { H/EX | D/EC } ] REMOVE /P drive cylinder head sector REMOVE [ /L ] drive cylinder sector [ /L ] RESETFREE/CYL] RETURN/SECT /P drive cylinder head sector RETURN/SECT [ /L ] drive cylinder sector [ /L ] ROW [ /rowopt ] tableid rowspec [ TO rowspec ] [ /rowopt ] Utilities 603 Chapter 14: Filer Utility (filer) HELP SCANDISK [ /dispopt ] [ { DB | CI | MI | FREECIS | WAL | WMI | WCI | WDB } ] [ FIX ] [ { tableid rowspec [ TO rowspec ] | TAB[L[E]] tableid1 [ rowspec1 ] [ TO tableid2 [ rowspec2 ] ] } ] [ /dispopt ] [INQUIRE <interval>] [ { NOCR | CR } ] [ SCOPE ] VPROC ALL [ SCOPE ] VPROC number [ SCOPE ] VPROC { ( number [ TO number] [ number [ TO number] ] ... ) } ( SEG0 | SEGZERO ) [ /dispopt ] SET FREE/CYL [ /Y ] number STAMP number number number number number SYNCSCAN [ /dispopt ] [ tableid ] [/dispopt ] TAB/LE [ /rowopt ] tableid [ rangeopt ] [ /rowopt ] TRA/CEPRINT [ drive [ cylinder ] ] [ LAST number ] WAL [ /dispopt ] [ rangopt ] [WHERECLAUSE][ /dispopt ] WABC [ /dispopt ] WCI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] WCID drive cylinder WDB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] WFIND [ /dispopt ] [wlsnrange] [/dispopt ] WFLUSH WLSN=wlsn WMI [ /dispopt ] WREC [ /dispopt ] wlsn [ TO wlsn ] [WHERECLAUSE][ /dispopt ] Example 3 In the CI context, HELP with no options displays only the commands that Filer will accept at the CI prompt. CI ==> help For more information please type HELP /L command For a explanation of the conventions used in this help type HELP CONVENTION AC/CESS [ /dispopt ] [ place ] [/dispopt ] BLK [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] CHECKSUM [ FIX ] { DB drive cylinder sector | CI drive cylinder } CI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] CID drive cylinder ( DATE | TIME ) DB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] DBD [ /H { tableid [ rowspec ] | sectornum } ] DELETE [/Y] DEPOT [ drv cyl ] DISA/BLE flag [ [,] flag ... ] D/ISPLAY [ { /dispopt | /rowopt } ] [ rangeopt ] [WHERECLAUSE] [ { /dispopt | /rowopt } ] DROP DUMPDIS [ /dispopt ] drive cylinder sectornum [ sectorcount ] [/dispopt ] ENA/BLE flag [ [,] flag ... ] ERRCLR /P drive cylinder head sector ERRCLR [ /L ] drive cylinder sector [ /L ] ERRORS [ { INTO | OVER | TO }{ STDERR | ME | filename } ] ERRSET /P drive cylinder head sector 604 Utilities Chapter 14: Filer Utility (filer) HELP ERRSET [ /L ] drive cylinder sector [ /L ] FIB [ /dispopt ] [ startdrive [ startcylnum ] [ TO enddrive [endcylnum]]] [TYPE [ = ] cylstatustype [ cylstatustype ... ]] [/dispopt ] F/IND [ /dispopt ] tableid [ rowspec [ TO rowspec ] ] [/dispopt ] H/ELP [ /L ] [ { command | parameter } ] ID/ENT drive cylinder sectornum INIT [/Y] INPUT FROM filename LISTB/AD [ drive [ cylnum ] ] MI [ /dispopt ] MOD/IFY [/Y] REDO { REPLAY LIN/EAGE wlsn | REPLAY WREC wlsnrange | ACTIVATE [ NEXT [ REDO ] ] | DEACTIVATE [ NEXT [ REDO ] ] } N/EXT [ { /dispopt | /rowopt } ] [ number ] [ { /dispopt | /rowopt } ] OUT/PUT [ { INTO | OVER | TO }{ STDOUT | ME | filename } ] PACK [/Y] PAT/CH [ /patchopt ] offset [ /patchopt ] 'patchopt' is defined as ( B | C | W | S | D | L ) PR/EV [ { /dispopt | /rowopt } ] [ number ] [ { /dispopt | /rowopt } ] [SET] PRIORITY = PRIORITYCLASS { Q/UIT | ST/OP | END | EXIT } RADIX [ { IN/PUT | OUT/PUT } ] [ { H/EX | D/EC } ] REMOVE /P drive cylinder head sector REMOVE [ /L ] drive cylinder sector [ /L ] RESETFREE/CYL] RETURN/SECT /P drive cylinder head sector RETURN/SECT [ /L ] drive cylinder sector [ /L ] ROW [ /rowopt ] tableid rowspec [ TO rowspec ] [ /rowopt ] SCANDISK [ /dispopt ] [ { DB | CI | MI | FREECIS | WAL | WMI | WCI | WDB } ] [ FIX ] [ { tableid rowspec [ TO rowspec ] | TAB[L[E]] tableid1 [ rowspec1 ] [ TO tableid2 [ rowspec2 ] ] } ] [ /dispopt ] [INQUIRE <interval>] [ { NOCR | CR } ] [ SCOPE ] VPROC ALL [ SCOPE ] VPROC number [ SCOPE ] VPROC { ( number [ TO number] [ number [ TO number] ] ... ) } ( SEG0 | SEGZERO ) [ /dispopt ] SET FREE/CYL [ /Y ] number SRD [ /dispopt ] [ tableid ] [/dispopt ] STAMP number number number number number SYNCSCAN [ /dispopt ] [ tableid ] [/dispopt ] TAB/LE [ /rowopt ] tableid [ rangeopt ] [ /rowopt ] TRA/CEPRINT [ drive [ cylinder ] ] [ LAST number ] TRAS/H [/Y] WRIT/E [/Y] [ /NOCHECKSUM ] WAL [ /dispopt ] [ rangopt ] [WHERECLAUSE][ /dispopt ] WABC [ /dispopt ] WCI [ /dispopt ] [ FORCE ] [ FIX ] drive cylinder [/dispopt ] WCID drive cylinder WDB [ /dispopt ] [ FORCE ] drive cylinder sectornum [ sectorcount ] [/dispopt ] WFIND [ /dispopt ] [wlsnrange] [/dispopt ] WFLUSH WLSN=wlsn WMI [ /dispopt ] WREC [ /dispopt ] wlsn [ TO wlsn ] [WHERECLAUSE][ /dispopt ] Utilities 605 Chapter 14: Filer Utility (filer) HELP Example 4 To display help for a specific Filer command, such as DBD, type the following: Help dbd The following displays in the Filer context: Filer ==> help dbd DBD [ /H { tableid [ rowspec ] | sectornum } ] Example 5 To display detailed help, which includes a description of the command in addition to the command syntax, use the /L option. Help /L dbd The following displays in the CI context: CI ==> help /L dbd DBD [ /H { tableid [ rowspec ] | sectornum } ] Gives a formatted display of all the DBDs on the current CI that, 1. if a 'tableid' is given, describe a DB that has any rows, or any rows in the 'rowspec' if given, from the specified TABLE 'tableid'. 2. if a 'sectornum' is given, describe a DB that SECTOR 'sectornum' belongs to. 3. if neither is given, exist on the CI. 4. if /h is specified, will display hex dump of DBD. Example 6 To display a list of all the keywords for which Filer help is available, type the following: Help ? The following displays: Filer ==> help ? Valid input at the ? is : / , DEPOT BLK DBR/OW WDBREC WCID CP COPY WDB DBD WDBD DELE/TE DONE DUMPDIS/K VARIANT ID/ENT INIT MEMWCTX MEMDB MEMWDB MEMS/ORCTX MI MOD/IFY TRA/CEPRINT PATCHOPT 606 AC/CESS CANCEL CHECKSUM WMI FIB IN/PUT MEMD/UMP NVMM/OVE PATCHSTUFF ALL CI DATE WABC INDEX LISTB/AD MEMR/OW PACK PAT/CH * BACK WCI CID TIME DB WAL TYPE MEMB/LK MEMCTX MEMWR/EC PACKDISK PRIORITYCLASS Utilities Chapter 14: Filer Utility (filer) HELP SET RETURN/SECT SEGZERO SYNC/SCAN SCOPE OFFSET SECTORCOUNT CONFIRM D/ISPLAY N/EXT TPARESET ST/OP Utilities PRIO/RITY SEG/MENT TABLEID VPROC MEMADDR PLACE F/IND OUT/PUT WFLUSH ; PR/EV REPEAT REMOVE ROW WREC SCANDISK FREE SHOWD/EFAULTS TAB/LE TRAS/H UPGRADETVSA WRIT/E DISPOPT ROWOPT CYL/INDER DRIVE/CYL DRV/CYL RANGEOPT ROWSPEC TIDX COMMAND CONV/ENTIONS WFIND WHERECLAUSE RAD/IX ERRORS TRACE SUSPEND STOP Q/UIT end of command RESETFREE/CYL SEG0 SRD STAMP UNJOIN SCANOPT NUMBER SECTORNUM TID LENGTH NOTA/TIONAL WLSNSPEC H/ELP PANIC END EXIT 607 Chapter 14: Filer Utility (filer) IDENT IDENT Purpose The IDENT command identifies the objects in the specified sectors, and displays the properties of the objects. Syntax IDENT drive ID cylinder = sectornum = sectorcount = 1102B013 where: Syntax Element Description drive The drive. cylinder The cylinder. sectornum The sector number. sectorcount The number of sectors to examine, starting from sectornum, but not extending beyond the end of the cylinder. = Filer will use the most recently saved values for drive, cylinder, sectornum, or sectorcount. This option cannot be used unless input values have already been defined for drive, cylinder, sectornum, or sectorcount. For more information, see “Stored Input Values” on page 517. Usage Notes An object is identified even if the sector is not the first sector in that object. A description of all DBs or WDBs in the specified area is provided for both normal and Depot cylinders. Other objects or regions are identified but not described in detail. IDENT accepts any drive, cylinder, and sector number. Therefore, in addition to the DB sectors, CI, FREE, MI, FIB, SEG0, etc. are also accepted and the owner identified. 608 Utilities Chapter 14: Filer Utility (filer) IDENT IDENT also displays the WAL log objects containing WAL log sectors. For example, for a sector in a data block, IDENT displays the SRD, DBD, database name, and table name. For a sector in the cylinder index, IDENT indicates that the sector is in the CI. Wherever the sector is, IDENT indicates the object, such as SEG0, FIB, MI, CI, DB, the cylinder’s free sector list, WCI, WDB, or WAL log cylinder free list. The WMI is omitted because the WMI never is written to disk. Example 1 The following example identifies a DB sector for a user table. Example 2 The following example identifies a range of sectors. Utilities 609 Chapter 14: Filer Utility (filer) IDENT Example 3 The following example identifies a sector in a CI. > ident 0 6 1 Requested sector is in the CI Example 4 The following example identifies the sector owner as the free list for the cylinder. > ident 0 6 3700. Sector 3700 (0E74) is in the Free Sector List Example 5 The following example determines the sector is not in use in the cylinder and is not in the free sector list for the cylinder. In the following case (which is a live example), the sector is after the CI but before the DB/Free area, thus generated on a system without dual CIs. For a system with dual CIs, the response would be that sector 24 was in the CI. This message may still occur for sectors outside the CI area on a dual CI system, in which case it indicates a structural error in the cylinder. > ident 0 6 24. Sector 24 (0018) is currently unaccounted for Example 6 The following example identifies a Depot sector. Ident 0 7 bcd Sector 0 7 bcd is in a WDB in a DEPOT cylinder. WDB Depot Start Sector: 0bcd firstwlsn ---------------00000000000003ad start ---0037 scts ---002c flags ----0000 recs ---0052 checksum -------707E7916 ct -2A ag -E2 Example 7 The following example examines sectors in various parts of the file system root. > ident 0 0 1 The requested sector is on a durable cylinder.Use appropriate command to access these sectors. Requested sector is in Segment 0 > ident 0 0 9. The requested sector is on a durable cylinder.Use appropriate command to access these sectors. Requested sector is in the FIB > ident 0 0 57. The requested sector is on a durable cylinder.Use appropriate command to access these sectors. Requested sector is in the MI 610 Utilities Chapter 14: Filer Utility (filer) IDENT > ident 0 0 159. The requested sector is on a durable cylinder.Use appropriate command to access these sectors. Requested sector is in the Trace Buffer > ident 0 0 2000. The requested sector is on a durable cylinder.Use appropriate command to access these sectors. The rest of the sectors are unused on the durable cylinder Example 8 The following example identifies a WDB sector. > ident 1 2 3b Sector 59 (003b) is in a WAL Data Block WDBD firstwlsn ---------------00000000000003ad start ---0037 scts ---002c flags ----0000 recs ---0052 checksum -------707E7916 ct -2A ag -E2 Example 9 The following example identifies a WCI sector. > ident 0 521. 1 Requested sector is in the WCI Example 10 The following example identifies a WMI sector. > ident 0 237. 57. The requested sector is on a durable cylinder.Use appropriate command to access these sectors. Requested sector is in the WMI. Example 11 The following example identifies the free list in a WAL log cylinder as containing the sector. > ident 0 521. 3700. Sector 3700 (0E74) is in the Free Sector List of a WAL Log Cylinder Utilities 611 Chapter 14: Filer Utility (filer) INIT INIT Purpose Warning: The INIT command can damage the File System B*Tree such that data can be removed or lost permanently. If used incorrectly, any changes might be irreversible. The INIT command initializes the current cylinder or range of cylinders to free by deleting the contained DBs, marking the cylinder as free in the FIB, and removing the cylinder from the MI. Syntax INIT /Y 1102A017 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. Usage Notes This command is not valid if the prompt reflects a range selection. The INIT command is allowed only at the CI prompt. INIT is the same as DELETE with a cylinder context. The command also initializes WAL log cylinders. For information on how to initialize or remove other objects, see “DELETE” on page 576. Example The following example initializes a WAL cylinder, assuming that drive 1 cylinder 2 is a WAL cylinder. > wci 1 2 [output omitted] > init You currently have the WCI for cylinder 1 2 (000001 000002) selected. Are you sure you want to INIT this? (Y/N) > n n INIT Cancelled WCI ==> 612 Utilities Chapter 14: Filer Utility (filer) INPUT INPUT Purpose The INPUT command directs Filer to read commands from a specified file rather than from the default input file, stdin. Syntax INPUT FROM file IN GS04B019 where: Syntax Element Description file The name of a file you specify as the source of command input to Filer. Usage Notes When you first start Filer, it accepts input from the stdin file by default. Using the INPUT command, you can redirect input from any file you specify. When Filer reaches the end of the file you specify, Filer again accepts input from you. You can nest the INPUT command inside command files to a maximum of nine files deep. Example The following command example shows the format for redirecting input from a file in a specific directory: Filer ==> input from /home/user1/commands Utilities 613 Chapter 14: Filer Utility (filer) MEMBLK MEMBLK Purpose The MEMBLK command accesses the file system segment at the specified memory address, determines the type of the segment, and returns a formatted display of the segment. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X) as /dispopt. You can type the options at the beginning or end of the command. memaddr MEMBLK MEMB /P /S /M /L /H /X = 1102B023 where: Syntax Element Description /P Positions to the segment. Nothing is displayed unless there is a problem. /S /M /L /H /X The display options: Short, Medium, Long, Hex, and Extended. The display format depends on the segment type. For descriptions of how the display options are applied to the different segment types, see the associated commands:“CI” on page 557, “DB” on page 569, “WCI” on page 732, and “WDB” on page 736. memaddr The memory address specifying the start of the segment. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. 614 Utilities Chapter 14: Filer Utility (filer) MEMBLK Usage Notes The MEMBLK command is similar to the BLK command. See “BLK” on page 550. The MEMBLK command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. MEMBLK might access obsolete copies of segments, so the displays might not be current. In addition, sometimes segments are inaccessible from the Debugger (gdb) when run against a dump, so problems might occur when accessing either DBs or CIs in dumps. Example 1 16384//: Keyin Request: memblk 0x79000000 memblk 0x79000000 Hex Dumping Blk - at address 79000000 0000: 0010: 0020: 0030: 0040: 0050: 0060: 0070: 0080: 0110:* 0120: 0130: 01F0:* Utilities Starting 00 00 00 02 00 00 01 C4 00 00 01 40 00 00 01 40 00 00 00 00 10 00 Address: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1D 00 00 00 79000000 00 00 00.02 30 00 00.00 00 00 00.20 CC 00 00.00 00 00 00.00 00 02 00.00 00 00 00.00 00 00 00.00 00 00 00.00 02 01 00.10 00 00 00.00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 08 00 38 00 9E 00 00 00 1D 00 0F 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 *............ ...* *.....0..........* *........ .......* *............8...* *................* *.@..............* *................* *.@..............* *................* *................* *................* 00 00 00 00 00 00 00 00.00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00.00 00 00 00 00 00 00 00 *................* *................* 615 Chapter 14: Filer Utility (filer) MEMCTX MEMCTX Purpose The MEMCTX command returns a formatted display of a file system context structure (ctxcontext_t) beginning at the specified memory address. Syntax MEMCTX memaddr MEMC = 1102A033 where: Syntax Element Description memaddr The memory address at which to begin the file system context structure display. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Usage Notes The MEMCTX command displays the internal file system context structure, ctxcontext_t. To display the saved Filer context information, use the SHOWD command. For more information about the SHOWD command, see “SHOWDEFAULTS” on page 696. The MEMCTX command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example Filer ==> memctx 0x69dd9fc ReturnOnReadError Zflags PreLoadDB DontCacheDBS TblHdr TableID DeltaBytes 616 : FALSE (0000) : : : : : (0000) (0000) FALSE FALSE NULL 0 0.00 40 1032 (0000 0028 0408) Utilities Chapter 14: Filer Utility (filer) MEMCTX DB (pointer) ROW (pointer) RowID F.MI Ver Posver CID_p CIDindex CID Drv Cyl FirstTableID FirstRowID LastTableID LastHash Flags FreeSects : 0x1124F000 : NULL : 0 0 0 0 0 (0000 0000 0000 0000 0000) : : : : 146 8737 0x101BA2C0 -1 (FFFFFFFF) : : : : : : : : 0 27 0 0 0 0 0 2936 (0000) (0000001B) (0000 001E 0400) 1 (0000 7FC8 441B 0000 0001) (0000 0066 0400) (0000 F390 43CD) (0000) (0B78) : : : : 128 ACCESS READONLY 0x10F20000 : : : : : : : : : : : : : : : : : : : 12288 1 0 65456 0 FILE PRIMARY PJRNLDBCI NORMAL NONE NONE NULL 0 3954 29 2120 0x10F20000 0x10F20656 0x10F20660 -8 -51 30 32712 102 62352 (0092) (2221) 1024 17435 1024 17357 0 F.CI SRB Flavor Lock Access Address ID Length Name Dual Name Class Attr Resusage Age Action Auxstatus Nsrbp Retcode Ver MigVer DbNewVer Ci_p SRD_p DBD_p SRDIndex DBDIndex SRD TableID FirstDBD DBDCount DBD FirstRowID LastHash Start Sects Flags RowCount (0080) (0001) (0001) 27 27 (0000) (0F72) (001D) (0848) (FFFFFFF8) (FFFFFFCD) : 0 : -51 : 1 40 1028 : : : : : : 0 0 1 1 0 0 254 1 0 1 (3000) (0001 0000 001B 0000) (FFB0 0000 001B 0018) (0001) (0002) (0001) (0004) (0000) (0000) 0 24 (0000 0028 0404) (FFFFFFCD) (0001) 0 1 (0000 0000 0001 0000 0001) (0000 0000 0001) (00FE) (0001) (0000) (0001) F.DB SRB Utilities 617 Chapter 14: Filer Utility (filer) MEMCTX Flavor Lock Access Address ID Length Name Class Attr Resusage Age Action Auxstatus Nsrbp Retcode Ver DbMigVer DbNewVer DB_p Row_p RowIndex F.Cyl Dblist_p ActiveCI_p TableUniq_p DbdCount DbdIndex CylReadState DbDensity NextCyl CylReadMode CylStopCode F.MakeValidIndex F.CtxState F.PFSpace F.TableID F.RowID F.Flags SyncScan F.CheckSumCount F.WalDbs F.WalNonDbs F.TskNoStopCount F.TryLockFailures F.CiBufAllocated F.DbBufAllocated F.SSTaskEntry_p F.SSTableEntry_p F.SSStartRowID : : : : 4 READ READONLY 0x1124F000 : : : : : : : : : : : : : : : : 512 1 FILE : : : : : : : : : : NULL NULL NULL 0 0 CTXCYLNONE 0 FALSE CTXCYLFULLREAD CTXEOBLOCK : : : : : FALSE NULL 0 0 0 : : : : : : : : : : : FALSE 0 TRUE TRUE 0 0 0 0 NULL NULL 0 0 (0004) (0004) (0001) 27 (0200) (0001 0000 001B 00FE) (0001) (0001) (0000) (0000) (00F2) (0000) 254 TJRNLDBCI PRELOADOUTNOW BADENUM NONE 0x10F20656 0 68 0 526 0x1124F000 0x1124F048 0 40 0 (0000) (0044) (0000) (020E) (0000) (0000) (0000) (0000) (0000) (0000) (0000) (0000) 1032 1 0 (0000) (0000) (0000) (0000 0028 0408) 1 (0000 0000 0001 0000 0001) (0000) (0000) (0001) (0001) (0000) (0000) (0000) (0000) 0 0 0 0 (0000 0000 0000 0000 0000) Filer ==> 618 Utilities Chapter 14: Filer Utility (filer) MEMDB MEMDB Purpose The MEMDB command returns a formatted display of a data block (DB) beginning at the specified memory address. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X) as /dispopt. You can type the options at the beginning or end of the command. memaddr MEMDB /P /S /M /L /H /X FORCE = 1102B034 where: Syntax Element Description /P Positions to the DB. Nothing is displayed unless there is a problem. /S /M /L /H /X The options used to specify the format of the DB display. For detailed information about these display options, see “DB” on page 569. FORCE Attempts to format and display the segment as a DB even if the segment is not a DB. memaddr The memory address at which to begin the DB display. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Usage Notes The MEMDB command is similar to the DB command. See “DB” on page 569. Utilities 619 Chapter 14: Filer Utility (filer) MEMDB MEMDB reports an error if the segment is not a DB (block code is not FILBLKDB). However, if you specify FORCE, Filer tries to display the memory block as a data block. The MEMDB command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. MEMDB might access obsolete copies of segments, so the displays might not be current. In addition, sometimes segments are inaccessible from the Debugger (gdb) when run against a dump, so problems might occur when accessing either DBs or CIs in dumps. Example Filer ==> 16384//: Keyin Request: memdb 0x796e0000 memdb 0x796e0000 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail TableID DbMigVer DbNewVer flags CheckSum WLSN DepotCheckSum Drv Cyl Start checksumcount checksumalgorithm DB : : : : : : : : : : : : : : : : : : : : : : : 86 (0056) DB DATA (0006) Tue Jun 27, 2006 17:37:24.09 (44 CF A1 44 09) 72 (0048) 72 (0048) 96 (0060) 277 (0115) 21642 (548A) 21642 (548A) NULL (0000) NULL (0000) 0 1154 2048 (0000 0482 0800) 0 (0000) 57 (0039) 64 (0040) 0 (00000000) 96178 (00000000000177B2) 4135276238 (F67B4ECE) 0 (0000) 13 (0000000D) 413 (019D) 0 (0000) 0 (0000) ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------009C 0000 5ECA 0590 0000 0005 00 F8 009C 0000 97F0 1C6F 0000 0003 00 F8 Filer ==> 620 Utilities Chapter 14: Filer Utility (filer) MEMDUMP MEMDUMP Purpose The MEMDUMP command dumps memory in hexadecimal for a specified length of bytes, starting at the specified location. Syntax MEMDUMP MEMD memaddr = 256 length = 1102A035 where: Syntax Element Description memaddr The memory address at which to begin the memory dump. length The amount of memory (in bytes) to be displayed. 256 is the default. = Specifies that Filer should use the most recently saved values for memaddr or length. This option cannot be used unless the input values have already been defined for memaddr or length. For more information, see “Stored Input Values” on page 517. Usage Notes If length is omitted, 256 bytes are dumped. The MEMDUMP command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example Filer ==> 16384//: Keyin Request: memdump 0x81023000 memdump 0x81023000 0000: 0010: Utilities Starting Address: 81023000 00 18 03 E6 59 B4 44 50.FD 0B 4B 16 14 00 F0 00 AD 01 37 01 00 00 00 00.38 01 CE 06 1A 00 03 00 *....Y.DP..K.....* *..7.....8.......* 621 Chapter 14: Filer Utility (filer) MEMDUMP 0020: 0030: 0040: 622 FF 40 82 6E 00 00 25 00.04 08 02 00 00 00 13 00 12 00 00 00 00 00 00 00.25 31 16 00 00 00 00 00 5B 30 16 00 00 00 00 00.BC 2F 16 00 00 00 00 00 *[email protected]..%.........* *........%1......* *[0......./......* Utilities Chapter 14: Filer Utility (filer) MEMROW MEMROW Purpose The MEMROW command formats a row beginning at the specified memory address. Syntax Note: The online help lists the row options (/P, /S, /M, /L, /H) as /rowopt. You can type the options at the beginning or end of the command. memaddr MEMROW MEMR /P /S /M /L /H = 1102C036 where: Syntax Element Description /P Positions to the row. Nothing is displayed unless there is a problem. /S or /C Counts the number of rows selected. This is the default. /M or /I Displays only the length, RowID, and the flags. /L or /R Formats the row header and the fields in the row. /H Formats the row header, and displays the entire row in hexadecimal, including the header. memaddr The memory address at which to begin the row format. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Usage Notes The MEMROW command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Utilities 623 Chapter 14: Filer Utility (filer) MEMROW Example Filer ==> 16384//: Keyin Request: memrow 0x821c0024 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------009C 0000 97F0 1C6F 0000 0003 00 F8 624 Utilities Chapter 14: Filer Utility (filer) MEMSORCTX MEMSORCTX Purpose The MEMSORCTX command returns a formatted display of a context structure (sorcontext_t) beginning at the specified memory address. Syntax MEMSORCTX MEMS memaddr = 1102A006 where: Syntax Element Description memaddr The memory address at which to begin the context structure display. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Usage Notes The MEMSORCTX command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Utilities 625 Chapter 14: Filer Utility (filer) MEMWCTX MEMWCTX Purpose The MEMWCTX command returns a formatted display of a context structure (wtjcontext_t) beginning at the specified memory address. Syntax MEMWCTX memaddr = 1102A118 where: Syntax Element Description memaddr The memory address at which to begin the context structure display. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Usage Notes The MEMWCTX command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. 626 Utilities Chapter 14: Filer Utility (filer) MEMWCTX Example Filer ==> 16384//: Keyin Request: memwctx 0x805c194 memwctx 0x805c194 PreLoadOption WLSN: DeltaBytes ROW (pointer) F.WMI Ver Posver WCID_p WCIDindex WCID Drv Cyl Flags FreeSects : NONE : 0000000000000000 : 0.00 : NULL : : : : 0 0 NULL 0 (0000) (0000) (00000000) : : : : 0 0 0 0 (0000) (00000000) (0000) (0000) : 0 (0000) : : : : : : : : : : : : : : NONE BADENUM NULL Invalid/Unused Ident TJRNLDBCI PRELOADOUTNOW NONE NONE NULL 0 0 NULL NULL 0 (0000) (0000) : : : : 0 0 0 0 (0000) (0000) (0000) (0000) Flavor : 0 (0000) Lock Access Address ID Resusage Age Action Auxstatus : : : : : : : : (0000) (0000) F.WCI SRB Flavor Lock Access Address ID Resusage Age Action Auxstatus Nsrbp Retcode Ver WCI_p WDBD_p WDBDIndex WDBD Start Sects Flags RowCount (0000) (0000) (0000) (0000) (0000) (0000) (0000) F.WDB SRB Utilities NONE BADENUM NULL Invalid/Unused Ident TJRNLDBCI PRELOADOUTNOW NONE NONE (0000) (0000) (0000) (0000) 627 Chapter 14: Filer Utility (filer) MEMWCTX Nsrbp Retcode Ver WDB_p WALRec_p WALRecIndex F.CtxState F.Flags ChecksumValid 628 : : : : : : NULL 0 0 NULL NULL 0 (0000) (0000) (0000) : NULL (0000) : FALSE (0000) Utilities Chapter 14: Filer Utility (filer) MEMWDB MEMWDB Purpose The MEMWDB command returns a formatted display of a WAL data block (WDB) beginning at the specified memory address. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X) as /dispopt. You can type the options at the beginning or end of the command. memaddr MEMWDB /P /S /M /L /H /X FORCE = 1102A112 where: Syntax Element Description /P /S /M /L /H /X The options used to specify the format of the WDB display. For detailed information about these display options, see “WDB” on page 736. FORCE Attempts to format and display the segment as a WDB even if the block code does not indicate a WDB. memaddr The memory address at which to begin the WDB display. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Utilities 629 Chapter 14: Filer Utility (filer) MEMWDB Usage Notes The MEMWDB command is similar to the WDB command. See “WDB” on page 736. The MEMWDB command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example Filer ==> 16384//: Keyin Request: memwdb 0x796e0000 memwdb 0x796e0000 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FirstWLSN PrevWDBLastWLSN PrevWDBStart PrevWDBSects Checksum ChecksumSampleCount ChecksumAlgorithm DepotChecksum HDA Drv HDA Cyl HDA Start Sector HDA VprocId WDB : : : : : : : : : : : : : : : : : : : : : : : 3 (0003) WDB DATA (000C) Thu Jun 29, 2006 19:05:07.88 (D3 86 A4 44 58) 1 (0001) 1 (0001) 94 (005E) 9 (0009) 664 (0298) 664 (0298) NULL (0000) NULL (0000) 169388 (00000000000295AC) 169386 (00000000000295AA) 677 (000002A5) 3 (0003) 0 (00000000) 0 (0000) 0 (0000) 0 (00000000) 0 (0000) 20 (00000014) 680 (02A8) 0 (0000) RECORD Length WLSN kind ------ ---------------- --------------0078 00000000000295AC DBD 00C0 00000000000295B4 ROW Filer ==> 630 Utilities Chapter 14: Filer Utility (filer) MEMWREC MEMWREC Purpose The MEMWREC command formats a WAL log record beginning at the specified memory address. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X) as /nextopt. You can type the options at the beginning or end of the command. memaddr MEMWREC /P /S /M /L /H /X = 1102A113 where: Syntax Element Description /P Positions to the WAL log record. Nothing is displayed unless there is a problem. /S /M /L /H /X The options used to specify the format of the WAL log record. For detailed information about these display options, see “WREC” on page 749. memaddr The memory address specifying the start of the WAL log record. = Specifies that Filer should use the most recently saved value for memaddr. This option cannot be used unless an input value has already been defined for memaddr. For more information, see “Stored Input Values” on page 517. Utilities 631 Chapter 14: Filer Utility (filer) MEMWREC Usage Notes The MEMWREC command is available only when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example Filer ==> 16384//: Keyin Request: memwrec 0x805bbd0 RECORD Length WLSN kind ------ ---------------- --------------8142 000000007D6C0048 TJRECORD 632 Utilities Chapter 14: Filer Utility (filer) MI MI Purpose The Master Index is the highest level of the B-Tree structure of the file system and contains a sorted list of all the CI descriptors. The MI command displays the following: • The Master Index with the requested display option • The checksum contained in the CID for each one that is displayed with the command Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /V, /X) as /dispopt. MI /P /S /M /L /H /V /X 1102A119 where: Syntax Element Description /P Positions to the MI. Nothing is displayed unless a problem exists. /S Shows the fixed area and a formatted display of the first and last CID of the MI segment. /M Same as /L. /L Shows the fixed area and a formatted display of all the CIDs in the MI segment. /H Displays a hex dump of the MI segment. /V Verifies that the MI segment has all CIDs in the correct order, that all sectors are accounted for, and matches the setting of the FIB. /X Same as /L. Usage Notes The prompt for the MI selector is shown below: MI ==> The commands allowed at the MI prompt are listed in the following table. Utilities 633 Chapter 14: Filer Utility (filer) MI Command Syntax and Description Common Commands DROP, PATCH, and WRITE. DISPLAY without ordinalrange is also allowed. Any Global or Upper-Level Command Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: Note: The display options are the same as those described for the MI command. • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 No checksum exists for the MI itself, so one will not be displayed. The addition of the checksum field to the CID structure will expand the width of the CID display from 80 to 89 characters. Example 1 The following example using the /P display option shows that no problems were encountered when positioning to the MI. MI ==> mi /p Command has been sent to Slave tasks. Wed Jul 28, 2004 10:31:22 1 of 1 vprocs responded with no messages or errors. Example 2 The following example using the /S option shows the fixed area and a formatted display of the first and last CID of the MI. MI ==> mi /s Command has been sent to Slave tasks. vproc 1 (0001) FilHeader for response the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead 634 MI : : : : : : : : 102 (00000066) MI (0002) Mon Jun 28, 2004 16:29:05.26 (C1 A9 E0 40 1A) 57451 (E06B) 57451 (E06B) 977 (000003D1) 104 (00000068) 105 (00000069) Utilities Chapter 14: Filer Utility (filer) MI HoleTail PosVer : 105 : 0 (00000069) (0000) These are the first and last 'CID' CID drv cyl firsttid u0 u1 tai -- ------ ---- ---- ---00 000067 0000 0000 0000 00 00005A C000 0000 0000 in this MI firstrid lasttid part h0 h1 u0 u1 u0 u1 ---- ---- ---- ---- ---- ---- ---0000 0000 0001 0000 0001 0000 0006 0000 0000 0001 0000 0001 C030 85F6 tai ---0800 0400 lastrowkey part h0 h1 ---- ---- ---0000 0F2F 13D6 0000 0000 0001 fl -00 00 in -00 00 fsec checksum ---- -------03D9 0EDF Example 3 The following example shows the /M display option. Note that one CID has a checksum because one of its DBs had checksums. MI ==> mi /m FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail PosVer MI : : : : : : : : : : 100 (00000064) MI (0002) Fri Nov 14, 2003 12:26:23.00 (6F 3A B5 3F 00) 516 (0204) 516 (0204) 1052 (0000041C) 9 (00000009) 10 (0000000A) 10 (0000000A) 414 (019E) All The CIDs on the MI CID drv cyl -00 00 00 00 00 00 00 00 00 -----000012 000011 00000B 000006 000001 000004 000002 000003 000005 firsttid u0 u1 tai ---- ---- ---0000 0000 0000 0000 0008 0800 0000 001B 0000 0000 006D 0400 0000 0087 0400 0000 0462 0800 4000 0000 0000 8000 0000 0000 C000 0000 0000 part ---0000 0000 0000 0000 0000 0000 0000 0000 0000 firstrid h0 h1 ---- ---0000 0001 0EF5 EF18 0000 0001 0000 0000 10C2 4098 9513 A3A9 0000 0001 0000 0001 0000 0001 u0 ---0000 0000 0000 0000 0000 0000 0000 0000 0000 u1 ---0001 0001 0001 0001 0001 0006 0001 0001 0001 lasttid u0 u1 ---- ---0000 0008 0000 001A 0000 006D 0000 0087 0000 0462 0000 050E 4000 0000 8000 0000 C000 0000 tai ---0400 0400 0000 0400 0800 0400 0000 0000 0000 lastrowkey part h0 h1 ---- ---- ---0000 8686 4F87 0000 0000 01BC 0000 0000 0001 0000 103A C3FA 0000 9513 A3A9 0000 79B6 9E37 0000 0000 0001 0000 0000 0001 0000 0000 0001 fl -00 00 00 00 00 00 00 00 00 in -00 00 00 00 00 00 00 00 00 fsec checksum ---- -------0EE3 0ED5 0A29 0417 041B 03A7 574FA610 0EEF 0EEF 0EEF Example 4 The following example using the /L option shows the fixed area and a formatted display of all the CIDs in the MI segment. Note: The middle section of the output has been deleted to shorten the example. MI ==> mi /L Command has been sent to Slave tasks. vproc 1 (0001) FilHeader for response the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount Utilities MI : : : : : : 102 (00000066) MI (0002) Mon Jun 28, 2004 16:29:05.26 (C1 A9 E0 40 1A) 57456 (E070) 57456 (E070) 977 (000003D1) 635 Chapter 14: Filer Utility (filer) MI RefCount HoleHead HoleTail PosVer : : : : 104 105 105 0 (00000068) (00000069) (00000069) (0000) All The CIDs on the MI CID drv cyl -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0. . . 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -----000067 000066 000068 000006 000005 000028 00001A 00000F 00002E 000009 00001F 000010 000031 000020 000015 000022 000001 000027 00000E 000017 firsttid u0 u1 tai ---- ---- ---0000 0000 0000 0000 0006 0800 0000 001A 0400 0000 001B 0000 0000 003F 0800 0000 0097 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 0000 04CD 0400 part ---0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 firstrid h0 h1 ---- ---0000 0001 0F2F 13D6 0001 87C5 0000 0001 0FE3 3C18 27C4 CF0C 0802 6BD9 16B8 7A3E 23F0 9206 2A4C 7E15 35F2 AD0E 4246 0E9E 4EA4 B4EE 5330 7BE9 6038 995A 6F10 5745 7B3A ED98 87A6 D8CC 943C E33B A102 01F9 u0 ---0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 u1 ---0001 0005 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 lasttid u0 u1 ---- ---0000 0006 0000 001A 0000 001A 0000 003F 0000 0097 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD 0000 04CD tai ---0800 0000 0400 0800 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 0400 lastrowkey part h0 h1 ---- ---- ---0000 0F2F 13D6 0000 0000 0001 0000 0001 87EB 0000 0FDD 95A3 0000 275C 9C49 0000 07F6 D5A6 0000 16B8 4FED 0000 23E6 6008 0000 2A40 D96A 0000 35E6 52EA 0000 4240 952A 0000 4EA4 69B8 0000 5330 4E1E 0000 6022 45C8 0000 6F04 3C83 0000 7B28 B9DC 0000 87A6 47FA 0000 941C 0812 0000 A0F0 53BE 0000 AD62 AD5F fl -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 in -00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fsec checksum ---- -------03D9 04FE 0EE9 02B5 03F0 0109 0220 0321 090F 03E3 0251 039F 0A7D 0390 0317 047E 0359 040B 040B 033F 000034 000043 00003D 00005E 000032 000065 000060 00005C 000063 00005D 00004A 000064 00005F 000061 000062 00005B 000002 000003 00005A 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4000 8000 C000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 C0DD D035 DFCD F167 F87B 2288 2BFC 6248 96BE B7A4 E930 1DFD 3E1B 6F89 9CFB C911 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 4000 8000 C020 0800 0800 0800 0800 0400 0400 0400 0400 0400 0400 0800 0800 0800 0800 0800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02C4 02C2 01BD 09E9 0215 0C7E 02D7 0275 07B6 03A0 02DD 07AB 0397 0484 04B6 02D3 0EEF 0EEF 0EEE 04FC 04FC 04FC 04FC 04FC 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 0000 0000 0000 0800 0800 0800 0800 0800 0400 0400 0400 0400 0400 0400 0800 0800 0800 0800 0800 0000 0000 0000 EE49 F7F3 9699 2F57 3636 229D FE78 A6A0 2242 3A44 3E88 DBF1 EB83 7525 EB37 BA44 0001 0001 0001 04FC 04FC 04FC 04FC 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 04FD 0502 0000 0000 85FB D031 DFC7 F165 F869 2288 2BF0 6220 96B2 B768 E914 1DF9 3E15 6F83 9CDD C90B 0000 0000 0000 0000 62B9 73F7 E2A0 C4D4 1C4B 2235 D182 7D97 2ED2 F12E BFF2 0034 C901 DBED A9AF 0001 0001 0001 0001 Example 5 The following example using the /H option shows a hex dump of the MI segment. Note: The middle section of the output has been deleted to shorten the example. MI ==> mi /h Command has been sent to Slave tasks. vproc 0000: 0000: 0000: 0001: 0001: 0001: 0002: 636 1 (0001) Starting 00 00 D1 03 00 00 00 00 00 00 00 00 00 00 response Address: 02 C1 A9 00 00 68 00 00 00 CD 04 00 CD 04 00 00 00 00 00 00 00 79040000 E0 40 1A.71 00 00 00.69 00 00 00.00 04 00 00.3A 04 00 00.A6 00 00 00.00 00 01 00.00 E0 00 00 7B 87 00 00 00 00 00 98 FA 02 01 00 00 00 ED 47 00 00 A2 69 00 00 00 00 00 04 00 00 00 00 40 40 00 00 01 01 59 00 00 00 00 00 00 03 00 00 *[email protected].......* *....h...i...i...* *................* *........:{......* *...........G..Y.* *.............@..* *.............@..* Utilities Chapter 14: Filer Utility (filer) MI 0002: 0002: 0003: 0003: 0004: 0004: 0004: . . . 049D: 049D: 049E: 049E: 049E: 049F: 049F: 04A0: 04A0: 04A0: 04A1: 04A1: 04A1: 04A2: 04A2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 04 01 CF 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 03 01 EF CD CD 00 00.00 00.00 00.00 0E.00 04.00 04.00 00.00 00 80 80 00 08 08 00 EF 00 00 00 00 00 00 0E 00 00 00 00 00 00 00 00 00 00 1D B9 00 00 00 00 00 E4 F3 00 00 00 00 00 00 9E 05 00 00 00 00 56 2B 00 *................* *................* *................* *................* *...............V* *...............+* *................* 3A 12 14 30 18 24 0A 29 01 31 2E 05 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 0C 2F 19 13 16 21 17 22 10 0F 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 71 00 00 00.1B 00.2A 00.0B 00.0D 00.2D 00.2C 00.2B 00.0E 00.15 00.1F 00.1A 00.68 E0.00 00.00 00.00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 23 1D 26 25 07 1E 11 27 20 09 28 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *:...........#...* *........*.......* *..../.......&...* *0...........%...* *........-.......* *$.......,.......* *....!...+.......* *)...........'...* *...."....... ...* *1...............* *............(...* *........h...f...* *g.....q.........* *................* *................* Example 6 The following example using the /V display option verifies that the MI segment has all CIDs in the correct order, all sectors are accounted for, and matches the setting of the FIB. MI ==> mi /V Command has been sent to Slave tasks. vproc 1 (0001) response MI is valid Example 7 The following example shows the use of the DATE command at the MI prompt. MI ==> date Wed Jul 28, 2004 Utilities 11:36:31 637 Chapter 14: Filer Utility (filer) MODIFY REDO MODIFY REDO Purpose The MODIFY REDO command replays or performs Redo processing on specified WAL log records. The command also determines whether or not to replay the WAL log records during the next file system startup. Syntax MODIFY MOD REDO REPLAY /Y wlsn LINEAGE LIN REPLAY WREC wlsnrange ACTIVATE NEXT REDO DEACTIVATE NEXT REDO 1102A180 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. REPLAY LINEAGE Replays the records in the WAL log with the lineage value specified by wlsn. Warning: Filer will not perform any WAL log analysis before replaying the records. Therefore, be absolutely sure that the specified records must be replayed before using this option. An attempt to replay an obsolete lineage may result in data loss. wlsn The lineage number that identifies the Redo records to be replayed by the REPLAY LINEAGE option. REPLAY WREC Replays the WAL log record or range of records specified in the wlsnrange. Only modifications from complete NTAs are committed. If a range of records is specified, Filer will attempt to replay closed NTAs and will skip or discard modifications related to open NTAs in the portion of the log specified. Warning: Filer will not perform any WAL log analysis before replaying the records. Therefore, be absolutely sure that the specified records must be replayed before using this option. An attempt to replay one or more obsolete records may result in data loss. 638 Utilities Chapter 14: Filer Utility (filer) MODIFY REDO Syntax Element Description wlsnrange Selects one or a range of WAL log records based on the WAL log sequence number (WLSN) in the record header. To define wlsnrange, use this syntax: wlsn TO wlsn 1102B155 ACTIVATE Replays the WAL log records during the next file system startup. Filer scans the WAL log for the most recent checkpoint and restores that checkpoint as the basis for the next WAL replay. DEACTIVATE Disables the replay of WAL log records during the next file system startup. This option is useful in cases where so many repairs have been made to the file system that attempting to replay WAL log records during the next file system startup will likely fail. Usage Notes The MODIFY REDO command is useful for repairing systems that encounter problems when attempting to replay WAL log records. These commands are valid only if Filer is started when the Teradata Database is down. Lineage refers to a chain of modifications that occurs on a particular block while the block is in memory. A lineage chain begins when the first modification using WAL is made to an unmodified block in memory. The chain “dies” when the block is written to disk with the accumulated changes. To track a particular lineage, a lineage number is assigned to the block. The MODIFY REDO REPLAY LINEAGE command allows you to process Redo records belonging to a particular lineage. When a transaction requires one or more changes to multiple blocks, the modifications are tied together via an NTA (Nested Top Action). An NTA joins a series of WAL log records into a single atomic unit. All records participating in a particular NTA must be written completely to the WAL log to be complete. The MODIFY REDO REPLAY WREC command will not process incomplete NTAs. Example 1 The following example replays the WAL log records in the WLSN range from 00491D2 to 000491D4. Since the /Y option is not specified, Filer prompts for confirmation before executing the command. WREC ==> modify redo replay wrec 00491D2 to 000491D4 You have chosen to attempt the replay of all records between 00000000000491D2 and 00000000000491D4 inclusive. Utilities 639 Chapter 14: Filer Utility (filer) MODIFY REDO WARNING: This command performs the replay of the specified WAL records WITHOUT performing the WAL Analysis. Erroneous use of this command could potentially lead to irrepairable data loss. Please be sure this is the desired action before proceeding. Are you sure you want to continue? (Y/N) y Command has been sent to Slave tasks. vproc 0 (0000) response SKIPPED : Filer skipped Record already SKIPPED : Filer skipped Record already SKIPPED : Filer skipped Record already WAL record with wlsn 00000000000491D2 applied. WAL record with wlsn 00000000000491D3 applied. WAL record with wlsn 00000000000491D4 applied. Filer attempted to replay a total of 3 record(s). Example 2 The following example replays all of the WAL log records with a lineage value of 49163. Filer ==> modify /y redo replay lin 49163 You have chosen to attempt the replay of all records with a linwlsn of 0000000000049163 Command has been sent to Slave tasks. vproc 0 (0000) REPLAYED: REPLAYED: REPLAYED: REPLAYED: REPLAYED: REPLAYED: Filer Filer Filer Filer Filer Filer response replayed replayed replayed replayed replayed replayed WAL WAL WAL WAL WAL WAL record record record record record record with with with with with with wlsn wlsn wlsn wlsn wlsn wlsn 0000000000049165 0000000000049166 0000000000049167 0000000000049168 0000000000049187 00000000000491BF Filer attempted to replay a total of 6 record(s). Example 3 The following example activates the replay of WAL log records in the next file system startup. Filer ==> modify redo activate next redo You have chosen to enable the WAL replay on the next File System startup. 640 Utilities Chapter 14: Filer Utility (filer) MODIFY REDO Filer will search from the end of the WAL log for the latest checkpoint and utilize that checkpoint for the next startup. Are you sure you want to continue? (Y/N) y Command has been sent to Slave tasks. vproc 0 (0000) response The checkwlsn in segment zero has been updated to 00000000000491E5. The chkptredowlsn in segment zero has been updated to 00000000000491D8. The maxdeletablewlsn in segment zero has been updated to 00000000000491D8. Example 4 The following example deactivates the replay of WAL log records in the next file system startup. Filer ==> modify /y redo deactivate next You have chosen to disable the WAL replay on the next File System startup. Command has been sent to Slave tasks. vproc 0 (0000) response The WAL replay has been deactivated for the next File System startup. To undo this command, you can issue the following: MODIFY REDO ACTIVATE NEXT Utilities 641 Chapter 14: Filer Utility (filer) NEXT NEXT Purpose The NEXT command displays the next Row, WAL log record, DB, WDB, DBD, WDBD, CI, WCI, CID, WCID or subtable. Syntax Note: You can type /dispopt or /rowopt at the beginning or end of the command. NEXT N /dispopt number /rowopt GS04C066 where: Syntax Element Description /dispopt The display options, which are listed below. /rowopt 642 Setting Selection Description /S show a short formatted display of the object. This is the default. /M show a medium-length formatted display of the object. /L show a long formatted display of the object. /X show an extended display of the object. /H show a hexadecimal display of the object. The row options, which are listed below. Setting Selection Description /P Positions to the rows or table requested. At least one row must be in the selected range. Nothing is displayed unless there is a problem. /C or /S Count the number of rows selected. This is the default for all subtables except the table header subtable. Utilities Chapter 14: Filer Utility (filer) NEXT Syntax Element Description /rowopt /I or /M Display only the length, row ID, and flags. (continued) /L or /R Display the formatted row header and the fields in the row. This option is the default for the table header subtable. However, this option will not be the default formatted field display because the table header subtable is a special row format and requires special formatting. /H Display the entire row in hexadecimal, including the header. number The number of objects to display, starting with the first object following the end of the current context. The default is 1. Usage Notes If number is specified, NEXT displays subsequent objects of the same type until the requested number is reached. NEXT sets the context to the objects displayed. If a whereclause is saved in the context, NEXT will apply the conditions of the whereclause. For more information about the whereclause, see “DISPLAY” on page 582 and “Specifying a WHERE clause” on page 531. NEXT displays objects which follow the end of the current context as shown in the following table. Utilities From … NEXT displays … row context next rows within the table. table context (whether a subset of rows was displayed or ALL) next subtables. DB context next DBs. DBD context next DBDs. CI context next CIs. CID context next CIDs. WAL log record context next WAL log records. WDB context next WDBs. WDBD context next WDBDs. WCI context next WCIs. WCID context next WCIDs. 643 Chapter 14: Filer Utility (filer) OUTPUT OUTPUT Purpose The OUTPUT command redirects Filer output to a file you specify or to the default file, stdout. Syntax OUTPUT OUT TO file INTO STDOUT OVER ME GT06C011 where: Syntax Element Description TO Specifies that Filer is to redirect output to a new file or to STDOUT. If the file exists, Filer returns an error. INTO Specifies that Filer is to append output to an existing file specified by file or to STDOUT. If the file exists, Filer appends the output to the end of the file. If the file does not exist, Filer creates the file. OVER Specifies that Filer is to overwrite an existing file or STDOUT with new Filer output. If the file exists, Filer writes over the file. If the file does not exist, Filer creates the file. file The name of a file you specify as the destination of Filer output. STDOUT The default file to which Filer writes output. ME A synonym for STDOUT. Usage Notes When you first start Filer, diagnostic messages are written to STDOUT by default. You can use the OUTPUT command to redirect Filer output in any of the following ways: 644 • To write to a new file only • To append an existing file Utilities Chapter 14: Filer Utility (filer) OUTPUT • To overwrite an existing file • To display on your console When Filer redirects output to a file, all input and diagnostic messages are echoed to the output file as well as to their usual destinations. If you include the file parameter in the OUTPUT command, Filer uses that parameter as the destination for output redirected from STDOUT. If you type the OUTPUT command without any options, Filer displays the name of the current output file STDOUT to your system console. Example The following command example shows the redirecting of Filer output into a specific file: Filer ==> output into /home/user1/output.file Utilities 645 Chapter 14: Filer Utility (filer) PACK PACK Purpose The PACK command packs the segment to eliminate fragmentation. Syntax PACK /Y GS04A068 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. Usage Notes Currently, only a CI and DB can be packed. Example CI ==> Pack /Y CI has been packed 646 Utilities Chapter 14: Filer Utility (filer) PATCH PATCH Purpose The PATCH command does the following: • Modifies file system segments while the segment is in memory, whether the segment is a CI, a DB, the FIB, the MI, a row, or a WAL log segment or object. The modified segments can later be forced to disk with the WRITE command. The PATCH command can also be used with interior file system objects, such as a CID, SRD, DBD, WCID, and WDBD. • Automatically updates the checksum of the segment being modified when the modified segment is written. Syntax Note: The online help lists the patch options (/B, /C, /W, /S, /D, /L) as /patchopt. The syntax diagram only shows the options at the beginning of the command, but you can type the options at the beginning or end of the command. offset PATCH PAT /B /C /W /S /D /L 1102A122 where the following tells how to address the segment being patched: Utilities Syntax Element Description /B or /C Input is one byte at a time. You can type input as a number (0x0 to 0xFF) or a character string delimited by single or double quotes (a character is a string of length 1). /W or /S Input is one numeric Half Word (Short Integer, two bytes) at a time (0x0 to 0xFFFF). This is the default. /D or /L Input is one numeric Word (Long Integer, four bytes) at a time (0x0 to 0xFFFFFFFF). offset the first location to be patched is specified as offset bytes from the beginning of the current selected object. In most cases, the current selected object is reflected by the prompt, but in some cases, this might not be true. For example, even though the prompt shows Row==>, the last selected object can be one row or a range of rows. With a range of rows, the offset is displaced from the beginning of the first row in the range. 647 Chapter 14: Filer Utility (filer) PATCH Usage Notes The prompt changes to indicate that Filer has entered Patch Mode. The PATCH command syntax is the same no matter which prompt you are at, except when you are in PATCH mode already, in which case offset is optional. If omitted, offset defaults to the current location. If you type an invalid command, an error message is displayed, and the command is ignored. When you type the PATCH command, it must be the only command on the command line because the command switches from general command syntax to a specific command syntax. Therefore, both the following command entries will generate an error: CI /P 200; PATCH /W 1567H PATCH /W 1567H;WRITE After you issue the PATCH command, the prompt changes to reflect the Patch mode and the object and address being patched. The current value of the cell open for patching is displayed in both HEX and DECIMAL. Prompting continues until the DONE or CANCEL command is issued, at which time the prompt is restored to what it was before patching started. The following table describes what happens when exiting Patch Mode. IF you exit Patch Mode using … THEN … DONE changes are saved to the segment and other tasks will see the changes immediately. CANCEL changes are not saved and the segment will be left exactly the same as when you entered Patch Mode. Because the checksum is stored externally, patching a single file system segment causes an additional segment to be updated with the new checksum of the segment if checksums are enabled on the block. The commands allowed while patching are listed in the following table. Subcommand/Syntax Description Enter Pressing Enter means do not change the value at this location and increment to the next location. 648 Utilities Chapter 14: Filer Utility (filer) PATCH Subcommand/Syntax Description patchstuff Replace the contents of the current cell with the input. The general syntax for a patchstuff is as follows: element, element, . . . , number string SKIP GS04B073 SK where: Syntax Element Description number For a description, see “Numeric Input” on page 516. string A single- or double-quoted delimited list of characters (only valid in /B or /C mode). A closing quote is required. Two consecutive quotes translate to a single quote. SKIP Skips the contents of the current cell and moves to the next cell. Note: You can use a number, a string, or a combination of a number and a string. Do not change the value of this cell and move back the specified number of cells. The default for number is 1. BACK number GS04A081 Exit from Patch Mode and do not save the changes. Leave the segment exactly as it looked when Patch Mode was entered. CANCEL 1102A146 Exit from Patch Mode and save the changes to the segment. Now the segment is patched, and modifications are visible to the outside world. Specifying the /NOCHECKSUM option means that if checksums are enabled on the segment being modified or written, the checksum is not updated and written to the external segment that contains the checksum. DONE /NOCHECKSUM QUIT Q STOP ST END EXIT Utilities 1102C083 649 Chapter 14: Filer Utility (filer) PATCH Subcommand/Syntax Description Change the options. The offset is counted from the start of the current selected entity. If omitted, the current location is not changed. offset PATCH /B /C /W /S /D /L PAT REPEAT You can type the options at the beginning or end of the command. The syntax diagram only shows the options at the beginning. 1102A122 ALL Take the patchstuff and repeat it the designated number of times or until the end of segment if you specify ALL or *. patchobject * number GS04A034 Press Enter to move to the next cell without changing anything. SKIP SK GS04B074 Any global command except QUIT command All the commands behave exactly as they do in Command Mode. For additional information, see “Global Commands” on page 537. Example DB ==> patch /b 0 Now entering PatchMode Patch: DB : 0000 : 0000 Patch: DB : 0001 : 0008 Patch: DB : 0002 : 0006 Patch: DB : 0003 : 00f0 Exiting Patch Mode DB ==>> 650 ( ( ( ( 0) 8) 6) 240) ==> ==> ==> ==> 2 4 sk done Utilities Chapter 14: Filer Utility (filer) PREV PREV Purpose The PREV command displays a previous Row, WAL log record, DB, WDB, DBD, WDBD, CI, WCI, CID, WCID or subtable. Syntax Note: You can type /dispopt or /rowopt at the beginning or end of the command. PREV PR /dispopt number /rowopt GS04C069 where: Syntax Element Description /dispopt The display options, which are listed below. /rowopt Utilities Setting Selection Description /S show a short formatted display of the object. This is the default. /M show a medium-length formatted display of the object. /L show a long formatted display of the object. /H show a hexadecimal display of the object. /X show an extended display of the object. The row options, which are listed below. Setting Selection Description /P Positions to the rows or table requested. At least one row must be in the selected range. Nothing is displayed unless there is a problem. /C or /S Count the number of rows selected. This is the default for all subtables except the table header subtable. 651 Chapter 14: Filer Utility (filer) PREV Syntax Element Description /rowopt /I or /M Display only the length, row ID, and flags. (continued) /L or /R Display the formatted row header and the fields in the row. This option is the default for the table header subtable. However, this option will not be the default formatted field display because the table header subtable is a special row format and requires special formatting. /H Display the entire row in hexadecimal, including the header. number The number of objects to display, starting with the object just previous to the beginning of the current context. The default is 1. Usage Notes If number is specified, PREV displays previous objects of the same type until the requested number is reached. PREV sets the context to the objects displayed. If a whereclause is saved in the context, PREV will apply the conditions of the whereclause. For more information about the whereclause, see “DISPLAY” on page 582 and “Specifying a WHERE clause” on page 531. PREV displays the objects previous to the beginning of the current context as shown in the following table. 652 From … PREV displays … row context previous rows within the table. table context (whether a subset of rows was displayed or ALL) previous subtables. DB context previous DBs. DBD context previous DBDs. CI context previous CIs. CID context previous CIDs. WAL log record context previous WAL log records. WDB context previous WDBs. WDBD context previous WDBDs. WCI context previous WCIs. WCID context previous WCIDs. Utilities Chapter 14: Filer Utility (filer) PREV Example The following example displays the previous two rows. Row ==> Prev 2 ROW length rowid flags presences h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- --------09CD 7C6B 71AB 0000 0001 00 9C 0097 7D47 ADC8 0000 0001 00 91 Row (Range) ==> Utilities 653 Chapter 14: Filer Utility (filer) PRIORITY PRIORITY Purpose The PRIORITY command allows you to set the priority of the Filer process. Syntax PRIORITY = priorityclass SET 1102A183 where: Syntax element … Specifies … priorityclass the priority of the Filer process. Valid values for priorityclass are: • • • • LOW, L, or 0 MEDIUM, M, or 1 (This is the default.) HIGH, H, or 2 RUSH, R, or 3 Usage Notes The values are not case-sensitive. The PRIORITY command is most commonly used with the SCANDISK command. Example Filer ==> set priority = 3 654 Utilities Chapter 14: Filer Utility (filer) QUIT QUIT Purpose The QUIT command ends a Filer session. Syntax QUIT Q STOP ST END EXIT GT06B013 Usage Notes STOP, END, and EXIT are synonyms for the QUIT command. Example Filer ==> quit Command has been sent to Slave tasks. Mon Oct 22, 2001 15:05:40 Filer has exited on 8 of 8 vprocs Filer Exited Filer has exited Utilities 655 Chapter 14: Filer Utility (filer) RADIX RADIX Purpose The RADIX command sets the default radix used as the numeric base for data input to and output from Filer as either hexadecimal or decimal. If you type just the command RADIX, the current settings of the input and output are displayed. Syntax RADIX RAD INPUT HEX IN H OUTPUT DEC OUT D GS04B022 where: Syntax Element Description INPUT Numeric input to Filer defaults to the radix you select, either hexadecimal or decimal. OUTPUT Numeric output from Filer defaults to the radix you select, either hexadecimal or decimal. HEX Numeric input to or output from Filer defaults to a radix of hexadecimal. DEC Numeric input to or output from Filer defaults to a radix of decimal. Usage Notes When you start Filer, the default radix for both input and output from Filer is hexadecimal. If you omit both the INPUT and OUTPUT options from the RADIX command, the radix (HEX or DEC) that you select applies to both numeric input and output. You can select either INPUT or OUTPUT, but not both when changing the settings of Filer data. If you omit both the HEX and DEC options, Filer displays the current RADIX setting. 656 Utilities Chapter 14: Filer Utility (filer) RADIX Example Filer ==> rad input hex Command has been sent to Slave tasks. Tue Jun 13, 2000 12:18:53 20 of 20 vprocs responded with no messages or errors. Utilities 657 Chapter 14: Filer Utility (filer) RENAME RENAME Purpose The RENAME command renames the currently selected segment to the specified location on the disk. Syntax drive RENAME /Y cylinder sectornum = = 1102B009 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. drive The drive. cylinder The cylinder. sectornum The sector number. = Filer will use the most recently saved values for drive, cylinder, or sectornum. This option cannot be used unless input values have already been defined for drive, cylinder, or sectornum. For more information, see “Stored Input Values” on page 517. Usage Notes RENAME makes a copy of the object in a new location. The object still exists in the old location too. You must make sure that the corresponding DBD or CID is updated to reflect the object in its new location. This might involve deleting the DBD or CID which is pointing to the old copy of the object and creating a new DBD or CID to point to the object in its new location. Example DB ==> Rename /Y 0 2 1fa Datablock has been renamed DB ==> 658 Utilities Chapter 14: Filer Utility (filer) RESETFREECYL RESETFREECYL Purpose The RESETFREECYL command resets the file system internal free cylinder count back to the correct value. Syntax RESETFREECYL RESETFREE GS04B053 Usage Notes This command complements the SET FREECYL command. Example Filer ==>ResetFree All Hidden cylinders have been recovered Utilities 659 Chapter 14: Filer Utility (filer) ROW ROW Purpose The ROW command displays rows from one or more subtables. For a single subtable, ROW sets the context to those rows. Syntax Note: The online help lists the row options (/P, /S, /M, /L, /H) as /rowopt. You can type the options at the beginning or end of the command. tid ROW ridrange /P /S /M /L /H 1102C022 where: Syntax Element Description /P Positions to the rows or subtable requested. At least one row must be in the selected range. Nothing is displayed unless there is a problem. /S or /C Counts the number of rows selected. This is the default for all subtables except the table header subtable. /M or /I Displays only the length, row ID, and flags. /L or /R Formats the row header and fields in the row. This option is the default for the table header subtable; however, this option is not the default formatted field display because the table header subtable has a special row format and requires special formatting. /H Format the row header and display the entire row in hexadecimal, including the header. tid Specifies the subtable to display, which must include a typeandindex value.For detailed information, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. ridrange A range of rows selected based upon row identification in the row header rather than the ordinal position within the subtable. For information on ridrange formatting, see “Specifying RowID Ranges (ridrange)” on page 520. The online help lists this option as rowspec [TO rowspec]. 660 Utilities Chapter 14: Filer Utility (filer) ROW Usage Notes The prompt for the ROW selector is shown below: ROW ==> The ROW command operates on subtables. In the Teradata Database, a subtable is a collection of rows, and a table is a collection of subtables. The rows of a particular subtable may be data rows, index rows, table header rows, etc. Therefore, you can use the ROW command to display rows from the primary data subtable, the table header subtable, a secondary index subtable, etc. For example, to obtain a formatted display of the table header, use ROW /L x y H, 0 1 where x and y make up the tablenumber which identifies the table, and H is the typeandindex value which identifies the table header subtable. For more information on identifying tables and subtables, see “Specifying a Subtable Identifier (tid)” on page 524. The commands allowed at the ROW prompt are listed in the following table. Command Syntax and Description Common Commands DISPLAY, DROP, DELETE, NEXT, PREV, PATCH, and WRITE. The current object selected can be a row or a range of rows. The prompt reflects your selection. Note: The options are the same as those described for the ROW command. Any Global or Upper-Level Command Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 Example 1 Filer ==> row /m 0 26. 400 0 291 0 422 ROW length rowid flags presences h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- --------0020 0000 0291 0000 0422 00 80 Row ==> Utilities 661 Chapter 14: Filer Utility (filer) ROW Example 2 Row ==> row 'xyz.ttt' p 79B6 9E37 0000 0001 /l Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 79B6 9E37 0000 0001 00 C0 Len = 16 Part = 0 Hash = 79B6 9E37 Uniq = 0 * FieldId 1025 DBCInteger = 1 1 NumFlds = 1 Example 3 In the following example, assume the following: • The scope is set to vproc 0. • In the BOOKS database, the table BESTSELLERS is a PPI table. The following command returns an error since PPI tables do not have any rows with a partition number of zero. Filer ==> row 'books.bestsellers' 400 0 Command has been sent to Slave tasks. vproc 0 (0000) response Invalid partition value 0 662 Utilities Chapter 14: Filer Utility (filer) ROW Example 4 In the following example, assume the following: • The scope is set to vproc 0. • In the BOOKS database, the table PRICE is not a PPI table. The following command returns all row headers located on vproc 0 of the table. All rows in the table have no real partition numbers. Therefore, they are logically displayed as rows belonging to the zeroth partition. Row (Range) ==> row /m 'books.price' 400 0 Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0014 0000 477F 8FF3 0000 0001 00 E0 0014 0000 609D 1715 0000 0001 00 E0 0014 0000 DA53 B54C 0000 0001 00 E0 0014 0000 F371 3C6E 0000 0001 00 E0 Example 5 In the following example, assume the following: • The scope is set to vproc 0. • In the BOOKS database, the table BESTSELLERS is a PPI table. The following command returns all row headers of rows located on vproc 0 of the table whose partition numbers are between hexadecimal 50FA and 5216 inclusive. Row (Range) ==> row /m 'books.bestsellers' 400 50FA to 5216 Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------003E 50FA 9B8D E377 0000 0001 80 FC 003E 5216 26BF FDEB 0000 0001 80 FC 003E 5216 371F C6EF 0000 0001 80 FC 003E 5216 58FB 0C2F 0000 0001 80 FC Utilities 663 Chapter 14: Filer Utility (filer) ROW Example 6 In the following example, assume the following: • The scope is set to vproc 0. • In the BOOKS database, the table PRICE is not a PPI table. The following command returns all row headers located on vproc 0 of the table whose RowID value is between hexadecimal 7fff 7fff 0 0 and ffff ffff ffff ffff. Row (Range) ==> row /m 'books.price' 400 7fff 7fff 0 0 to ffff ffff ffff ffff Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0014 0000 DA53 B54C 0000 0001 00 E0 0014 0000 F371 3C6E 0000 0001 00 E0 Example 7 The following command returns the row with a RowID of hexadecimal f371 3c6e 0 1 and all fields in the row. Row ==> row /r 'books.price' 400 f371 3c6e 0 1 Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0014 0000 F371 3C6E 0000 0001 00 E0 Len = 20 Part = 0 Hash = F371 3C6E Uniq = 0 * FieldId 1025 DBCInteger = 2 * FieldId 1026 DBCInteger = 78 664 1 NumFlds = 2 Utilities Chapter 14: Filer Utility (filer) ROW Example 8 Field 4 in the table header indicates that a restore of selected partitions is occurring. The following example shows the output for field 4 in bold. row /R "user1.t1" H, 0 1 Command has been sent to Slave tasks. vproc 0 (0000) response ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0670 0000 0000 0001 0000 0001 00 80 Database Name : "USER1 Table Name : "t1 DataBase ID : 0 1027 Account ID : 0 1027 Created : 06/12/15 16:02:20 Last Updated : 06/12/15 16:02:20 Last Archived : 01/01/01 00:00:00 StructVersion : 1 Util Version : 1 # of Backups : 1 QueueTable : FALSE Perm Journal : 0 0 0 Table kind : TabPermPresLog SPFlag : FALSE BaseTable ID : 0 0 Protection : No FallBack User Journal : FALSE Hashed Table : TRUE Dropped Flag : FALSE DDL change : FALSE Journal : CharSet : ASCII(127) Parent Count : 0 Child Count : 0 RSErrorTableId: 0 0 RSInitFlag : FALSE PrimaryKey Id : 0 RowFormat : 32-bit Row Format Fat Header : FALSE ErrTbl : FALSE AbortedFlag : TABUSABLE ******************** PrimaryMsgClass : 0 PrimaryMsgKind : 0 SecondaryMsgClass : 0 SecondaryMsgKind : 0 LogicalHostId : 0 SessionNo : 0 0 RequestNo : 0 0 TransactionNo : 0 0 0 ************************************* ********* Field 4 ********** Utilities " " 665 Chapter 14: Filer Utility (filer) ROW All Amps Restore in progress . . . of an All-AMPs Dump in progress. Restore of selected partitions. Errors logged in databaseid: 0 , 1027 tableid: 2 partition ranges are being restored: StartPartition EndPartition 3 7 12 17 0 , 1650 , 0 Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 1024 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 3 0 1 27 PPI Base Table DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 96 32-bit FALSE FALSE ***************************************************** Single Level PPI: BaseCombinedPart# LastCombinedPart# MaxCombinedPart# 1 65535 65535 NumberofLevels FirstMappedLevel 1 1 PPI LEVEL DESCRIPTORS Level #: 1 numparts numsubparts basepart# lastpart# maxpart# 65535 1 3 12 12 nopart unknownpart ppiexprkind nextmappedlevel 2 1 rangefnc 1 reservedparts 2 ***************************************************** UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 AscKey DBC INTEGER 2 1026 18 P 3 0 Offset Nullable 0 2 PPIKey DBC INTEGER 3 1027 22 P 0 0 Offset Nullable 0 3 NonKey DBC CHAR(5) LATIN ---------------------------------------------------------------******************************************************************************* 666 Utilities Chapter 14: Filer Utility (filer) ROW Start of Primary Index Descriptor... IdxId:1, IndexType:NonUniq/Hash, Valid:True, OrdByVal:False Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 0 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 2 0 1 27 PPI Secondary Index DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 0 32-bit FALSE FALSE UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 AscKey DBC INTEGER 2 1026 18 P 0 0 Offset Nullable 0 2 PPIKey DBC INTEGER ---------------------------------------------------------------******************************************************************************* Table ==> Utilities 667 Chapter 14: Filer Utility (filer) SCANDISK SCANDISK Purpose The SCANDISK command validates the file system and reports any errors found, including discrepancies in the following: • Key file system data structures, such as master index, cylinder index, and data blocks, including those associated with the WAL log. • The internal partition number for a row matching the internal index structures in the cylinder and master indexes. • Within a subtable, the internal partition number of a row being greater than or equal to the internal partition number in the preceding row, if any. • Within a partition, a RowID of a row being greater than the RowID in the preceding row, if any. • Within a subtable, either rows are all partitioned (a row includes the internal partition number) or nonpartitioned (a row does not include the internal partition number). In addition, SCANDISK calculates, modifies, and verifies checksums and reports any discrepancies. Note: The internal partition number is not validated for consistency with the result of the partitioning expression applied to the partitioning columns in a row. 668 Utilities Chapter 14: Filer Utility (filer) SCANDISK Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. A SCANDISK /S CI FIX /M DB /L FREECIS MI WAL WCI WDB WMI A B tid ridrange TABLE tid1 TAB ridspec1 TO tid2 ridspec2 B inquire_opt NOCR CR 1102C127 where: Syntax Element Description /S Scans the MI and WMI. /M Scans the MI, CIs, WMI, and WCIs. /L Scans the MI, CIs, DBs, WMI, WCIs, and WDBs. CI Scans the MI and CIs. The free CIs are also scanned unless a tid is provided. DB Scans the MI, CIs, and DBs. This is the default for the normal file system, which can be overridden by the CI, MI, or FREECIS options. The free CIs also are scanned unless a tid is provided. FREECIS Scans the free CIs only. This option also detects missing WAL and Depot cylinders. MI Scans the MI only. WAL Scans the WAL log. WCI Scans the WMI and WCIs. WDB Scans the WMI, WCIs, and WDBs. This is the default for the WAL log, which can be overridden by the WCI or WMI options. Utilities 669 Chapter 14: Filer Utility (filer) SCANDISK Syntax Element Description WMI Scans the WMI only. FIX Automatically fix problems with the CIs and DBs if possible. The Teradata Database must be down in order to use this option. tid Specifies the subtable to scan. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. ridrange Restricts the scan of a subtable to the specified RowID range. For more information on ridrange formatting, see “Specifying RowID Ranges (ridrange)” on page 520. The online help lists this option as rowspec [TO rowspec]. TABLE Scans the specified subtable range. SCANDISK starts the scan at the subtable location specified by tid1 and ridspec1, and ends the scan at the subtable location specified by tid2 and ridspec2. Note: The starting subtable location, tid1 ridspec1, must be less than the ending subtable location, tid2 ridspec2. If the starting subtable does not exist (that is, the table was deleted), SCANDISK starts from the next tid which is greater than the starting tid. Similarly, if the ending subtable does not exist, SCANDISK ends the scan at the tid which is just less than the specified ending tid. If the ending subtable is not specified, SCANDISK scans from the starting subtable until the end of all the subtables, followed by the free CIs and the WAL log. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. For more information on ridspec formatting, see “Specifying RowID Ranges (ridrange)” on page 520. ridspec The RowID specification used with the TABLE option to specify the subtable locations to start and stop the scan. For more information on RowIDs and ridspec formatting, see “Rows (rowid)” on page 518 and “Specifying RowID Ranges (ridrange)” on page 520. The online help lists this option as rowspec. inquire_opt Displays the lowest tid and rowid being scanned among the AMPS involved. This option also reports SCANDISK progress as a percentage of total time to completion and displays the number of errors encountered so far. The syntax for the INQUIRE option is as follows: INQUIRE INQ - NONE number timeopt 1102E422 670 Utilities Chapter 14: Filer Utility (filer) SCANDISK Syntax Element Description inquire_opt where: (continued) Syntax Element Description NONE Specifies that only one INQUIRE request is sent for the SCANDISK job. number An integer which defines the time interval to send an INQUIRE request to display SCANDISK progress. If you do not specify timeopt, then number defaults to SECONDS. timeopt Specifies the time unit which number represents. It should be one of the following: • • • • SECONDS, SECOND, SECON, SECO, SECS, SEC, S MINUTES, MINUTE, MINUT, MINU, MINS, MIN, M HOURS, HOUR, HOU, HO, HRS, HR, H DAYS, DAY, DA, D For example, scandisk inquire 5 m will start a SCANDISK job which reports SCANDISK progress every five minutes. Note: The maximum time interval allowed is seven days. NOCR Specifies to use regular data block preloads instead of cylinder reads. This is the default. CR Specifies to use cylinder reads instead of regular data block preloads. Starting SCANDISK You can start SCANDISK in two different modes: • Normal mode • Restartable mode In normal mode, SCANDISK checks the file system structures from the beginning to the end of the SCANDISK job based on the options selected. If SCANDISK is stopped or aborted in the middle of the scan, you normally will have to rerun the job from the beginning, unless you do the following: 1 Before aborting the SCANDISK job, send an INQUIRE request. For details, see “Checking SCANDISK Status” on page 688. 2 When you see the output from the INQUIRE command in the application window, manually capture the tid and rowid displayed, then abort the SCANDISK job. You can restart the aborted SCANDISK job in one of the following ways: Utilities • Start SCANDISK with the TABLE option, and pass the captured tid and rowid to the TABLE option to indicate the subtable where the scan should restart. • Start SCANDISK using the restartscandisk.pl script with the -t option, and pass the captured tid and rowid to the -t option. 671 Chapter 14: Filer Utility (filer) SCANDISK In restartable mode, it is much easier to start a SCANDISK job, stop it, then restart it from the place at which it was stopped. It is recommended that you start SCANDISK in restartable mode if you want to restart it later. Running SCANDISK in normal mode To run SCANDISK in normal mode, enter the SCANDISK command at the Filer prompt. Running SCANDISK in restartable mode To run SCANDISK in restartable mode, execute the restartscandisk.pl Perl script at the command line or at the Teradata Command Prompt. The following requirements apply when running the script. • restartscandisk.pl must be executed in the Teradata environment. Therefore, to run the script on a Linux system, make sure you have executed tdatcmd first to set up the Teradata environment. For more information, see Appendix B: “Starting the Utilities.” • restartscandisk.pl must be run on the control node (the lowest numbered active node). • restartscandisk.pl configures Filer to use decimal numeric values as input and output. Therefore, you must enter decimal values when specifying numeric input to the script. For more information, see “RADIX” on page 656. The syntax for restartscandisk.pl is shown below. perl restartscandisk.pl A scandisk command A B -i input filename -o output filename -t tid ENA DIS ridspec B -tm time interval -s AMP number 1102A190 where: Syntax Element Description scandisk command The SCANDISK command and options you want to run. Note: You must enter decimal values when specifying numeric input for SCANDISK options, such as tid or ridspec. input filename The file to be used as input to the script. This file should contain the output from the previously executed SCANDISK job. Note: If you specify SCANDISK with the TABLE option, restartscandisk.pl will use the TABLE option values and ignore this input file. In this case, SCANDISK can only be manually restarted. 672 Utilities Chapter 14: Filer Utility (filer) SCANDISK Syntax Element Description tid [ridspec] Specifies the subtable and optionally, the row where SCANDISK should restart the scan job. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. For more information on RowIDs and ridspec formatting, see “Rows (rowid)” on page 518 and “Specifying RowID Ranges (ridrange)” on page 520. The online help lists the tid option as tableid, and lists the ridspec option as rowspec. Note: You must enter decimal values for tid and ridspec. If you specify SCANDISK with the TABLE option, restartscandisk.pl will use the TABLE option values and ignore these tid and ridspec values. In this case, SCANDISK can only be manually restarted. output filename The file which will store the SCANDISK output. Note: You must specify an absolute path to this file. If you use a relative path, the SCANDISK output from the application log may be redirected to a different location than the output from restartscandisk.pl. If you do not specify an output file or input file, the script will use the standard output file (stdout). If you specify SCANDISK with the TABLE option, restartscandisk.pl will use the TABLE option values and ignore this output file. In this case, SCANDISK can only be manually restarted. ENA Specifies to start Filer with locking enabled, which means that Filer will observe the file system locking protocols used to avoid hang or deadlock situations. This is the default. DIS Specifies to start Filer with locking disabled. This option starts Filer with the -l locking option, which means that Filer will not observe the file system locking protocols used to avoid hang or deadlock situations. For information about the -l locking option, see “Starting Filer From the Database Window” on page 502. time interval The time in seconds specifying the interval at which the INQUIRE request is sent to display SCANDISK progress. The default is 600 seconds. Note: The minimum time interval allowed is 600 seconds. If you enter a time interval that is less than 600 seconds, restartscandisk.pl uses the default value of 600 seconds. AMP number Specifies the vproc number to be used with the Filer SCOPE command. The SCANDISK command will be sent only to the specified vproc. For more information, see “SCOPE or VPROC” on page 692. Usage Notes for the restartscandisk script Note: If the file system data structures were fixed to repair a problem, and the location (tid and rowid) where the previous SCANDISK halted is beyond the location where the file system fix occurred, then Teradata recommends that you restart the SCANDISK job from the beginning instead of restarting the scan at the location where it last halted. Entering options to the restartscandisk script There are many ways to enter options to the restartscandisk script. The following describes how you can specify a SCANDISK command and options for the script to run. Utilities IF you specify... THEN... a SCANDISK command the script starts Filer to run the SCANDISK command and any options specified. 673 Chapter 14: Filer Utility (filer) SCANDISK IF you specify... THEN... an input file, but no SCANDISK command the script starts Filer to run the SCANDISK command and options used in the previous scan job as specified in the input file. an input file, and a SCANDISK command the script will check if the submitted SCANDISK command is the same as the command previously executed. If the submitted command and options are different from the previous command, the script will display a warning and ask for confirmation to run the new command. no input file and no SCANDISK command the script starts Filer to run SCANDISK with no options. The following describes how you can specify the location where SCANDISK should restart a previous scan job. IF you specify... THEN... an input file SCANDISK restarts from the subtable specified by the tid and rowid from the last INQUIRE command in the input file. the -t option with a tid and optional ridspec SCANDISK restarts from the subtable specified by tid and ridspec. the TABLE option with the SCANDISK command the script ignores any input file, -t option, or output file you specify, and runs SCANDISK with the values of the TABLE option. To restart SCANDISK later, you must manually capture the last tid and rowid from the application window. no input file, no -t option, and no TABLE option SCANDISK restarts the job from the beginning. Note: You can specify either the -i option or the -t option, but not both options together. The following describes how you can specify where the SCANDISK output will be saved or sent. 674 IF you specify... THEN... an output file the output of SCANDISK is saved to this file. an input file, but no output file the script reuses the input file to save the output of the SCANDISK job. The new output is appended to the end of the file. no input file and no output file the output of SCANDISK is sent to the standard output file (stdout). Utilities Chapter 14: Filer Utility (filer) SCANDISK The output from the restartscandisk script includes output from the INQUIRE command, which contains the lowest tid and rowid scanned among the AMPS involved. This INQUIRE output can be used to identify the location where a scan ended. When this output is saved to a file, you can use the file as input to the restartscandisk script, by using the -i option. The script restarts SCANDISK at the location specified by the tid and rowid from the last INQUIRE command in the file. If the database restarts while executing this script, the output file may not capture the complete application window output. Therefore, the output file may not contain a restart point for SCANDISK, or the restart point may be incorrect. If the exact restart point is not important, you can still use this output file as input to restart SCANDISK. However, if the exact restart point is important, then it is better to manually capture the last tid and rowid from the application window, and use these values to restart SCANDISK. You can pass the tid and rowid to the restartscandisk script using the -t option, which restarts SCANDISK at the specified location. If you do not use the -o or -i options to save the SCANDISK output to a file, then you must manually capture the tid and rowid from the last INQUIRE command in the application window if you want to restart SCANDISK later by using the -t option. It is recommended that you use the -o or -i option to ease restartability. Note: If you manually capture the SCANDISK output in the application window to a separate log file, this file cannot be used as an input file to the restartscandisk script because the application window log does not contain the output required by the restartscandisk script. Aborting the restartscandisk script You can use one of the methods listed below to interrupt the restartscandisk script and abort the running SCANDISK job. For specific key sequences used to generate the signals specified, see the documentation for signal generation for your Operating System platform. 1 Send a SIGINT signal (CTRL+C) 2 Send a SIGBREAK signal (CTRL+BREAK) 3 Send a SIGQUIT signal (CTRL+\, on MP-RAS or Linux systems) 4 Enter the ABORT command in the application window where Filer is running In the first 3 cases, when the restartscandisk script receives the signal to abort, it displays the current percentage of SCANDISK completion and requests confirmation to abort the scan job. Upon confirmation, the script gracefully aborts the running SCANDISK. You can restart the aborted SCANDISK job later by using the -i or -t option. If you enter the ABORT command in the application window where Filer is running, the script will gracefully abort the running SCANDISK job without asking for confirmation. You can restart the aborted SCANDISK job later by using the -i or -t option. If you abort SCANDISK when it is scanning free CIs or the WAL log, and you restart the scan job, SCANDISK will restart the scan from the beginning of the particular stage where it was aborted (either scanning free CIs or the WAL log). Utilities 675 Chapter 14: Filer Utility (filer) SCANDISK restartscandisk errors and warnings The restartscandisk script displays various error messages when it encounters problems. It also displays warnings and informational messages to assist the user. The following table lists possible error messages returned by the restartscandisk script, with explanations and suggested remedies for each. Error Message Explanation Remedy The AMP number specified with the -s option is invalid. The user specified an invalid AMP number with the -s option. Specify a valid AMP number with the -s option. The AMP number specified with the -s option is invalid. The AMP number is greater than the total number of AMPs in the system. The user specified an AMP number that is greater than the number of AMPs in the system. Specify an AMP number that is less than the number of AMPs in the system. Cannot get the application window number. The Teradata Database restarted just after the “start filer” command was submitted. Check the PDE state, and submit the script when the PDE is running. Cannot get the total number of AMPs in the system to validate the specified AMP number. The script tried to verify that the AMP number specified with the -s option is not greater than the number of AMPs in the system; however, it failed to get the total number of AMPs present in the system. Verify that the DBS is running and that you have the correct permissions to run the vprocmanager command. cnscim -s failed. The Teradata Database was restarted or stopped after the script submitted the “start filer” command. If the database was restarted, wait until the PDE is running, then resubmit the script. If the PDE is not running, start the PDE, then resubmit the script. ENA and DIS are options to the restartscandisk script and cannot be used as output file names. Please specify another file name for the output file. The user specified ENA or DIS as the output file, which is not allowed since ENA and DIS are options to the script. Specify a file name other than ENA or DIS for the output file. Error encountered when submitting the SCANDISK command to Filer. Possible SCANDISK syntax error. The script submitted the SCANDISK command to Filer, and it received an error from SCANDISK. The submitted SCANDISK command may be invalid. Make sure the SCANDISK command you submit to the script is valid. If you are not specifying a SCANDISK command to the script, and the error persists, report the problem to the Teradata Support Center. Failed to open filename. The script failed to open a needed file. The file may be a temporary file used by the script, the specified input or output file, or cnstool. Verify that the required file has the correct permissions. 676 Utilities Chapter 14: Filer Utility (filer) SCANDISK Error Message Explanation Remedy Filer cannot be started because all of the interactive partitions are busy. All of the application windows are currently used for other purposes, and the script cannot find an available application window where Filer can be started. Run the script at a later time when an application window is free. Input file is invalid. Please specify a correct input file to restart SCANDISK. The user specified an invalid input file which does not contain SCANDISK output. Specify an input file which contains output from a previous SCANDISK job. If multiple output files exist, submit the latest output file as input for restarting SCANDISK. Output file is invalid. Please check the output file name. The user specified an invalid output file. Check the path of the output file for correctness. Do not specify a directory name as the output file name. PDE must be running to start the restartscandisk script. The PDE is not running, and the script cannot be started if the PDE is down. Start the PDE, and submit the script when the PDE is running. The restartscandisk script cannot be run on nodes other than the control node. The user did not run the restartscandisk script on the control node. The script can be run only on the control node. Run the script on the control node, the lowest numbered active node in the system. SCANDISK command submitted with incomplete options. Please resubmit the SCANDISK command with all the required options. The user submitted a SCANDISK command with incomplete options, and Filer prompted for additional input. Make sure the SCANDISK command you submit to the script includes all the required options. The specified input file does not exist. The user specified an input file that does not exist. Verify the path and file name of the input file, and make sure that the file exists. Syntax Error: Invalid syntax or options were entered for the restartscandisk script. The user specified invalid options to the script. Check the syntax and options entered for the script, and verify that they are correct. Syntax Error: Please specify a time interval with the -tm option. The user specified the -tm option, but did not specify a time interval. Specify a time interval in seconds with the -tm option. The time interval must be 600 seconds or more. Syntax Error: Please specify an AMP number with the -s option. The user specified the -s option, but did not specify an AMP number. Specify an AMP number with the -s option. The AMP number will be used with the Filer SCOPE command to limit the SCANDISK scope. Syntax Error: Please specify an input file with the -i option. The user specified the -i option, but did not specify an input file. Specify an input file with the -i option. Syntax Error: Please specify an output file with the -o option. The user specified the -o option, but did not specify an output file. Specify an output file with the -o option. Syntax Error: Please specify table options tid[ridspec] with the -t option. The user specified the -t option, but did not specify a tid or ridspec. Specify a tid and optional ridspec with the -t option. Utilities 677 Chapter 14: Filer Utility (filer) SCANDISK Error Message Explanation Remedy Syntax Error: -t option cannot be used together with the -i option. The user specified both -i and -t options to the script. Specify either the -i option or the -t option. You cannot specify both options together. Syntax Error: The ENA and DIS options cannot be specified together. The user specified both the ENA and the DIS options. Specify either the ENA or the DIS option. You cannot specify both options together. The time interval specified is invalid. Please enter a number which represents the number of seconds as the time interval. The minimum time interval allowed is 600. The user specified the -tm option, but the time interval specified is not a number. Specify a number which represents the number of seconds as the time interval. The time interval must be 600 seconds or more. The vprocmanager command failed. The script executed the vprocmanager command to get the number of AMPs in the system, and the command failed. Verify that the DBS is running and that you have the correct permissions to run the vprocmanager command. 678 Utilities Chapter 14: Filer Utility (filer) SCANDISK The following table lists warnings and informational messages that may be displayed by the restartscandisk script. Message Description Already received abort request, please wait... The script already received the previous interrupt signal and is waiting until Filer is in Read mode before it can process the abort request. Based on the input file, SCANDISK will restart scanning at the FREECIS stage. Based on information from the specified input file, the restart point will be FREECIS. That is, SCANDISK will start scanning the free cylinders. This implies that all of the subtables in the system were scanned already. Based on the input file, SCANDISK will restart scanning at the WAL log stage. Based on information from the specified input file, the restart point will be the WAL log. That is, SCANDISK will start scanning the WAL log buffers. This implies that all of the subtables and free cylinders in the system were scanned already. Did not find any status to display. If the script is interrupted, the status of the SCANDISK job is normally displayed before aborting. In this case, the script has not submitted any INQUIRE commands to Filer before the interrupt. Therefore, no status information is available. The script will ask the user for confirmation before aborting. Filer is not in Read mode, please wait... The script received an interrupt signal when Filer was not in Read mode and could not accept the ABORT command. The script will wait until Filer is in Read mode, then it will ask the user for confirmation to abort after displaying the latest SCANDISK status. Filer is starting, please wait... The script has started Filer and is waiting for Filer to reach Read mode. Initializing... The script is submitting initial commands to Filer and has not submitted the SCANDISK command yet. The input file does not contain output from an INQUIRE command for the last SCANDISK job. Do you want to check previous SCANDISK jobs for status? The specified input file does not contain INQUIRE command output from the latest execution of SCANDISK. The script asks the user for confirmation to check previous SCANDISK jobs to get a restart point. If the input file has output from more than one SCANDISK job, then the latest SCANDISK job containing INQUIRE command output will be used to determine the restart point. The input file does not contain output from an INQUIRE command. SCANDISK will start the scan from the beginning. The specified input file does not contain any INQUIRE command output. Therefore, the script cannot determine a restart point. The script will ask the user for confirmation to start the scan from the beginning. Processing the abort request, please wait… The script received an interrupt signal and is processing the abort request. Restart point found in the input file. Restart subtable is tid and RowID is rowid. SCANDISK will restart from this location. The script found the restart point based on the last INQUIRE command output in the input file. SCANDISK will restart at the specified tid and rowid. The restartscandisk script received an interrupt signal during the Initializing stage. The script received an interrupt signal before it could send the SCANDISK command to Filer. Utilities 679 Chapter 14: Filer Utility (filer) SCANDISK Message Description SCANDISK completed the scan job in the previous run. Starting this scan job from the beginning. The input file indicates that the previous SCANDISK job was completed. Therefore, the script will start a new SCANDISK job from the beginning. The specified INQUIRE time interval is less than 600 seconds. Setting the time interval to the default value of 600 seconds. The user specified the -tm option with a time interval that is less than the minimum time interval allowed, which is 600 seconds. The script will set the time interval to the default value of 600 seconds. Unable to get the current status. If the script is interrupted, the status of the SCANDISK job is normally displayed before aborting. However, since the user did not specify the -o or -i option, the script cannot get the SCANDISK status. It is recommended that the -o or -i option be used so that SCANDISK output will be saved to a file, which allows the script to display status information before aborting. User specified an input file, but no output file. Using the file filename as both input and output file. The user specified an input file, but did not specify an output file. The script will reuse the input file as the output file. User specified an input file, but no SCANDISK command. Using previous SCANDISK command: scandisk_cmd The user specified an input file, but did not specify a SCANDISK command. The script will submit the SCANDISK command used to run the previous scan job as specified in the input file. WARNING: No output file was specified. To restart this SCANDISK job later, capture the last tid and rowid from the application window. The user did not specify an output file. In order to restart this SCANDISK job later, the user must manually capture the tid and rowid from the latest INQUIRE output in the application window. It is recommended that the user specify an output file to ease restartability. WARNING: Previous SCANDISK command and current SCANDISK command are different. The user is restarting a previous SCANDISK job and has specified both an input file and a SCANDISK command. The submitted SCANDISK command is different from the command used to run the previous scan job. In this case, the user will be asked for confirmation to run the submitted command. WARNING: Specifying the INQUIRE option with the SCANDISK command may result in more INQUIRE outputs than expected. Use the -tm option to display INQUIRE output instead. The user specified the INQUIRE option with the SCANDISK command. Since the restartscandisk script already sends periodic INQUIRE commands by default, this will result in more INQUIRE commands sent than expected. The user should use the -tm option to display INQUIRE output instead of using the INQUIRE option with the SCANDISK command. WARNING: You have specified the TABLE option. The -i, -t, and -o options will be ignored. To restart this SCANDISK job later, capture the last tid and rowid from the application window. The user specified the TABLE option with the SCANDISK command. Therefore, SCANDISK will run with the values of the TABLE option and ignore the -i, -t, and -o options. The SCANDISK output will not be saved to a file. The user must manually capture the last tid and rowid from the application window to restart SCANDISK later. Usage Notes You can run SCANDISK while the system is online and the Teradata Database is available for normal operations. Teradata recommends you run SCANDISK in the following situations: • 680 To validate data integrity before or after a system upgrade or expansion. Utilities Chapter 14: Filer Utility (filer) SCANDISK • If you suspect data corruption. • As a routine data integrity check (perhaps weekly). Note: A slight performance impact might occur while SCANDISK is running. You can rearrange the order of the syntax following the SCANDISK command. For example, the command SCANDISK FIX MI is the same as the command SCANDISK MI FIX. If you do not type any options, SCANDISK defaults to DB and all subtables on the vproc. The default scope is to scan both the normal file system and the WAL log, each from the lowest (DB, WDB) level through the highest (MI, WMI). The free CIs are also scanned. The SCANDISK command can be limited by the SCOPE command to scan, for example, just one table, just the WAL log, or just certain AMPs. For more information, see “SCOPE or VPROC” on page 692. If you specify either tid or ridrange or both, all of the Teradata Database and CIs containing the requested table and/or rows are verified. If you use the TABLE option with the CI option, SCANDISK will check all of the cylinders that contain the specified subtable range. Note: The first and last of the cylinders checked may contain subtables outside of the specified range because multiple subtables can reside on a given cylinder. The lowest level file system structure that SCANDISK verifies is the data block. If you specify RowIDs, SCANDISK will start and end the scan at the data blocks which contain the specified rows. The entire data block is checked; therefore, rows outside of the specified row range may also be checked since a DB contains multiple rows. By default, SCANDISK uses regular data block preloads instead of cylinder reads. The CR option allows you to run SCANDISK using cylinder reads to preload data into cylinder slots which may improve SCANDISK performance. However, if other work also requires the use of cylinder slots, the competition for slots could slow down SCANDISK and the other work. In addition, the performance gain is dependent on the amount of data loaded, the distribution of the data, and the average block I/O size. The NOCR option lets you turn off cylinder slot usage by SCANDISK, which could result in slower SCANDISK performance, but which will allow other work requiring cylinder slots to progress unimpeded. SCANDISK reports only what it finds when scanning is completed. The RowID output from SCANDISK consists of the following: • A two-byte internal partition number. For a nonpartitioned table, the internal partition number is zero. • A four-byte row hash value. • A four-byte uniqueness value. Note: Teradata recommends that you do not run SCANDISK FIX directly. First, run SCANDISK and store its output. Then, run SCANDISK FIX. The Teradata Database must be down in order to run SCANDISK FIX. Utilities 681 Chapter 14: Filer Utility (filer) SCANDISK If you specify the FIX option with the FREECIS option, SCANDISK will add missing WAL and Depot cylinders back into the File Information Block (FIB) in addition to repairing the CIs. Even if you specify the FIX option, SCANDISK will not attempt to fix the following: • An incorrect internal partition number of a row in a table with a partitioned primary index • The table header with an invalid partitioning expression To correct the table header and/or the partitioning of rows for a table, use the ALTER TABLE statement with the REVALIDATE PRIMARY INDEX option. For more information about the ALTER TABLE statement, see “SQL Data Definition Language Statement Syntax” in SQL Reference: Data Definition Statements. Example 1 The following example illustrates a typical way to start, stop and restart a SCANDISK job. 1 Start the restartscandisk.pl script with the -o option. perl restartscandisk.pl -o /home/test/ofile.out Because no SCANDISK command or input file was specified, the script runs the default SCANDISK command from the beginning. That is, it runs SCANDISK with no options on all subtables, free CIs, and the WAL log from the lowest (DB, WDB) level to the highest (MI, WMI). The output of the scan is saved to the ofile.out file. 2 Stop the running SCANDISK job by entering the ABORT command or sending a signal to abort. For details, see “Aborting the restartscandisk script” on page 675. 3 Restart the SCANDISK job at the point in which it was interrupted by issuing the following command. perl restartscandisk.pl -i /home/test/ofile.out The output file from step one contains the location where the SCANDISK job was stopped; therefore, it is used as the input file to restart SCANDISK at that point. Since an input file was specified, but no SCANDISK command, the script starts the previous SCANDISK command from step one. Since no output file was specified, the script will reuse the input file and append the results of the restarted scan to /home/test/ofile.out. Example 2 The following example illustrates one way to start, stop, and restart a halted SCANDISK job from the location specified by a tid and ridspec. 1 Start the restartscandisk script. perl restartscandisk.pl SCANDISK CI Because no input file or tid[ridspec] were specified, the script runs the SCANDISK CI command from the beginning. The output is not saved to a file, but is sent to the standard output file (stdout). 2 682 Stop the running SCANDISK job by entering the ABORT command or sending a signal to abort. For details, see “Aborting the restartscandisk script” on page 675. Utilities Chapter 14: Filer Utility (filer) SCANDISK 3 Because the SCANDISK output was not saved to a file, you must manually capture the tid and rowid displayed by the last INQUIRE command in the application window if you want to restart this SCANDISK job. 4 If the tid and rowid displayed by the last INQUIRE command was 0 100 1024 0 1000 10000, you can restart SCANDISK from that location by issuing the following: perl restartscandisk.pl -t 0 100 1024 0 1000 10000 Note: Because no SCANDISK command or input file was specified, the script runs the default SCANDISK command (SCANDISK with no options) instead of the previous SCANDISK CI command. Example 3 The following shows sample output from a SCANDISK job started by the restartscandisk script on an MP-RAS platform. The user aborted the SCANDISK job before it completed, so the script displayed the latest status and asked the user for confirmation to abort. $perl /tpasw/bin/restartscandisk.pl -o /tmp/out1 PDE state is RUN/STARTED. restartscandisk.pl started at Thu 04/05/2007 05:26 PM Filer is starting, please wait......... Filer started in window 1 Initializing ... Submitting SCANDISK to filer Processing abort request, please wait... STATUS: 1:The scandisk is about 7% done Do you really want to abort (y/n)? [n]:y Scandisk is aborted by user Exiting from the script Utilities 683 Chapter 14: Filer Utility (filer) SCANDISK To restart the above SCANDISK job, the output file, /tmp/out1, is submitted as input to the restartscandisk script. The script determines the restart point from the file and restarts SCANDISK at that location. The following shows sample output from the restarted SCANDISK job. $perl /tpasw/bin/restartscandisk.pl -i /tmp/out1 PDE state is RUN/STARTED. restartscandisk.pl started at Thu 04/05/2007 06:00 PM Reading input file /tmp/out1 to get restart point Using /tmp/out1 as output file Restart point found from input file. Restart table is 0 1455 1024, rowid is 0 10138 35070 0 35 Filer is starting, please wait......... Filer started in window 1 Initializing ... Submitting SCANDISK TAB 0 1455 1024 0 10138 35070 0 35 to filer Processing abort request, please wait... STATUS: 1:The scandisk is about 2% done Do you really want to abort (y/n)? [n]:y Scandisk is aborted by user Exiting from the script Example 4 SCANDISK with no options scans all subtables from the DB level examining DBs, CIs, the MI, and free CIs. It also scans the WAL log at the WDB level, scanning WDBs, WCIs, and the WMI. In the following example, SCANDISK is started in normal mode with no options. In order to restart this scan job later, you must submit an INQUIRE request to SCANDISK before aborting, and manually capture the tid and rowid from the last INQUIRE output in the application window. To restart SCANDISK, submit the captured tid and rowid to the SCANDISK command as part of the TABLE option, or restart SCANDISK using the restartscandisk script with the -t option. Filer ==> scandisk DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001) DB ref count doesn’t match DBD row Count The scandisk found problems 684 Utilities Chapter 14: Filer Utility (filer) SCANDISK Example 5 The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a CI. In this example, SCANDISK is started in normal mode. Filer ==> scandisk ci Mon May 06, 2002 15:12:20 :Scandisk has been started on all AMP Vprocs in the SCOPE. vproc 0 (0000) response Mon May 06, 2002 15:55:21 : CI @ Cylinder 0 7 (0000 000007) Mon May 06, 2002 15:55:21 : LSI interrupted write pattern found in CI. 0120 MAY 05 05:02:35 LUN 1111, Start Block 00004545, Blocks 0400 SRD num table id firstdbd dbdcount offset u0 u1 tai ---- ----- ----- ----- -------- -------- -----0001 0000 0494 0800 FFFF 0014 001E Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 14901 (3A35) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 26912 (6920) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 25972 (6574) found Mon May 06, 2002 15:55:21 : Invalid DBD sector length of 12336 (3030) found Mon May 06, 2002 15:55:21 : First rowid out of order dbds 18 (0012) and 19 (0013) Example 6 The following is an example of output that SCANDISK generates when it finds an LSI interrupted write pattern in a DB. In this example, SCANDISK is started in normal mode. Filer ==> scandisk db Tue Feb 28, 1995 15:16:50 :Scandisk has been started on all AMP Vprocs in the SCOPE. vproc 0 (0000) response Mon May 06, 2002 15:12:20 1 of 1 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Reading vproc 0 (0000) response Mon May 06, 2002 15:11:11 : CI @ Cylinder 0 7 (0000 000007) Mon May 06, 2002 15:11:11 : LSI interrupted write pattern found in DB. 0120 MAY 05 05:02:35 LUN 1111, Start Block 00004545, Blocks 0400 Mon May 06, 2002 15:11:11 : rows -1 (FFFFFFFF) and 0 (0000) are out of order Example 7 In the following example, SCANDISK scans all subtables at the CI level, but not the WAL log. SCANDISK CI Utilities 685 Chapter 14: Filer Utility (filer) SCANDISK Example 8 In the following example, SCANDISK scans only the WAL log, examining the WMI, WCIs, and WDBs. SCANDISK WAL Example 9 In the following example, SCANDISK scans the WAL log at the WCI level, but not the subtables. SCANDISK WCI Example 10 In the following example, SCANDISK scans the employee.ttt data subtable at the DB level. SCANDISK “employee.ttt” p Example 11 In the following example, SCANDISK scans a range of rows in a primary data subtable. SCANDISK “employee.ttt” p 09E8 C4AB to 4732 009C Example 12 In the following example, an INQUIRE command is sent per minute. Therefore, you get a display of SCANDISK progress every minute. Filer ==> scandisk inq 1 m Tue Apr 17, 2007 11:18:51 : Scandisk ALL will be started On All AMP vprocs Do you wish to continue based upon this scope?? (Y/N) y Command has been sent to Slave tasks. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:19:53 SCANDISK STATUS : Slowest vproc 1 is 89% done Fastest vproc 0 is 92% done The scandisk is about 90% done Scanning Table: 0 1001 1024 Scanning Row: 0 45284 58386 0 1 Tue Apr 17, 2007 11:19:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:20:53 686 Utilities Chapter 14: Filer Utility (filer) SCANDISK Everyone is Scanning FREE CIS SCANFREE STATUS FOR SCANDISK: Slowest vproc 1 is 38% done Fastest vproc 0 is 42% done The scanfree is about 40% done Tue Apr 17, 2007 11:20:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:21:53 Everyone is Scanning FREE CIS SCANFREE STATUS FOR SCANDISK: Slowest vproc 1 is 92% done Fastest vproc 0 is 95% done The scanfree is about 93% done Tue Apr 17, 2007 11:21:53 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Tue Apr 17, 2007 11:22:01 2 of 2 vprocs responded with no messages or errors. Tue Apr 17, 2007 11:22:01: Scandisk Completed Aborting SCANDISK Since SCANDISK DB verifies that every byte in the file system is accounted for, this process can be very time consuming. Therefore, you have the option of stopping the process by typing the following command: ABORT . GT06A021 ABORT can take up to 30 seconds to process. After it is initiated, ABORT stops the SCANDISK process and reports the current status. When the abort is successful, the following appears: Are you sure you want to scandisk? (Y/N) y Tue Feb 28, 1995 15:16:50 : Scandisk has been started on all AMP Vprocs in the SCOPE. Type ‘ABORT‘ to stop them before completion Type ‘INQUIRE‘ to check on progress of command ABORT Abort request has been sent Vproc 0 response Utilities 687 Chapter 14: Filer Utility (filer) SCANDISK DB @ Cylinder 0 2 (0000 0002) Sector 16 (0010) length 1 (0001) DB ref count doesn’t match DBD row Count Tue Feb 28, 1995 15:16:50 : The scandisk found problems Vproc 1 response Tue Feb 18, 1995 15:16:50 : The scandisk found nothing wrong Filer ==> Checking SCANDISK Status Because SCANDISK can take a long time to run, you might want to do a status check. You can do this using the INQUIRE command below: INQUIRE . INQ GT01A005 INQUIRE displays the lowest tid and rowid being scanned among the AMPS involved, and reports SCANDISK progress as a percentage of total time to completion. It also displays a list of errors that occurred since the last INQUIRE command. Sample INQUIRE output is shown below. Filer ==> scandisk Thu Apr 05, 2007 y 17:12:34 : Scandisk ALL will be started On All AMP vprocs Do you wish to continue based upon this scope?? (Y/N) Thu Apr 05, 2007 17:12:35 : Scandisk has been started Command has been sent to Slave tasks. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command inq Inquire request has been sent Thu Apr 05, 2007 17:12:41 SCANDISK STATUS : Slowest vproc 0 is 2% done Fastest vproc 1 is 3% done The scandisk is about 2% done Scanning Table: 0 1434 1024 Scanning Row: 0 8657 56736 0 420 Nobody has reached the SCANFREE stage Thu Apr 05, 2007 17:12:41 2 of 2 vprocs responded with no messages or errors. Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command inq Inquire request has been sent Thu Apr 05, 2007 17:12:49 SCANDISK STATUS : Slowest vproc 0 is 6% done Fastest vproc 1 is 7% done The scandisk is about 6% done Scanning Table: 0 1434 1024 Scanning Row: 0 49306 65309 0 408 688 Utilities Chapter 14: Filer Utility (filer) SCANDISK Nobody has reached the SCANFREE stage vproc 1 (0001) response Thu Apr 05, 2007 17:12:42 : Thu Apr 05, 2007 17:12:42 : 0 1434 1024 (0000 059A 0 1435 1024 (0000 059B /nThu Apr 05, 2007 17:12:42 0 1434 1024 (0000 059A 0 1435 1024 (0000 059B CI @ Cylinder 0 100 (0000 000064) CID's First TID doesn't Match CI's First TID 0400) ( test.trans ) 0400) ( TEST.data1 ) : CID's Last TID doesn't Match CI's Last TID 0400) ( test.trans ) 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : Table Header is missing. May be in the process of being dropped 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3418 (0D5A) length 126 (007E) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3629 (0E2D) length 70 (0046) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3699 (0E73) length 70 (0046) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 48 (0030) length 65 (0041) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 432 (01B0) length 65 (0041) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 113 (0071) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 179 (00B3) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 2646 (0A56) length 122 (007A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 1953 (07A1) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Utilities 689 Chapter 14: Filer Utility (filer) SCANDISK Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 2346 (092A) length 66 (0042) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 2932 (0B74) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3004 (0BBC) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 684 (02AC) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 756 (02F4) length 72 (0048) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 1191 (04A7) length 109 (006D) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 1606 (0646) length 74 (004A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 2768 (0AD0) length 74 (004A) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3150 (0C4E) length 119 (0077) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 1056 (0420) length 69 (0045) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : DB @ Cylinder 0 100 (0000 000064) Sector 3544 (0DD8) length 69 (0045) : TID : 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) Thu Apr 05, 2007 17:12:42 : SRD TID.uniq doesn't match DB tid.uniq 0 1435 (0000 059B) 0 1434 (0000 059A) Thu Apr 05, 2007 17:12:42 : CI @ Cylinder 0 266 (0000 00010A) Thu Apr 05, 2007 17:12:42 : Table Ids are out of order 0 1435 1024 (0000 059B 0400) ( TEST.data1 ) 690 Utilities Chapter 14: Filer Utility (filer) SCANDISK 0 1434 1024 (0000 059A 0400) Thu Apr 05, 2007 Thu Apr 05, 2007 Thu Apr 05, 2007 Thu Apr 05, 2007 ( test.trans ) 17:12:47 : DB @ Cylinder 0 209 (0000 0000D1) Sector 1043 (0413) length 119 (0077) : TID : 0 1434 1024 (0000 059A 0400) ( test.trans ) 17:12:47 : DBD row count 1594 (063A) doesn't match DB ref Count 1595 (063B) 17:12:47 : DB @ Cylinder 0 208 (0000 0000D0) Sector 914 (0392) length 115 (0073) : TID : 0 1434 1024 (0000 059A 0400) ( test.trans ) 17:12:47 : duplicate rowids rows -1 (FFFFFFFF) and 0 (0000) ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------36 0 46592 3862 0 5 0 252 36 0 46592 3862 0 5 0 252 Thu Apr 05, 2007 Thu Apr 05, 2007 17:12:47 : DB @ Cylinder 0 208 (0000 0000D0) Sector 1468 (05BC) length 70 (0046) : TID : 0 1434 1024 (0000 059A 0400) ( test.trans ) 17:12:47 : rows 0 (0000) and 1 (0001) are out of order ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------36 0 47073 16639 0 160 0 252 36 0 47072 16639 0 161 0 252 Thu Apr 05, 2007 17:12:49 1 of 2 vprocs responded with no messages or errors. Thu Apr 05, 2007 17:12:49 1 of 2 vprocs responded with messages or errors as specified above Type 'ABORT' to stop the command before completion Type 'INQUIRE' to check on progress of command Utilities 691 Chapter 14: Filer Utility (filer) SCOPE or VPROC SCOPE or VPROC Purpose The SCOPE or VPROC command selects a set of vprocs that Filer will communicate with until Filer quits or a different set of vprocs is selected. Syntax SCOPE SCOPE VPROC ALL number , VPROC ( number ) TO number GS04C055 where: Syntax Element Description ALL Sets the scope to all vprocs. number Numeric identifier of a single vproc. Usage Notes In this mode, all subsequent Filer commands are sent to each vproc selected, and each vproc responds with its answer. After this command is issued, most commands requiring confirmation cannot be used. The SCOPE or VPROC command is not supported when Filer is started from the Debugger. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example This example shows the scope set to all vprocs. Filer ==> Scope all 4 of 4 amps have been selected This example shows the scope set to vproc 1. Filer ==> vproc 1 Command has been sent to Slave tasks. Thu May 04, 2000 00:29:03 1 of 2 amps have been selected 692 Utilities Chapter 14: Filer Utility (filer) SEGZERO (or SEG0) SEGZERO (or SEG0) Purpose The SEGZERO command selects and displays Segment Zero (0). Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /V) as /dispopt. SEGZERO SEG0 /P /S /M /L /H /V 1102A129 where: Syntax Element Description /P Positions to Segment 0, but does not display it. /S Shows a short formatted display of Segment 0. /M Shows a medium-length display of Segment 0. /L Shows a long display of Segment 0. /H Shows a hexadecimal display of Segment 0. /V Verifies Segment 0 and displays any errors encountered. Usage Notes This segment contains the following: Utilities • The information the file system needs to interface with the FSG kernel subsystem. • The VDISK information. • The flags that indicate to the file system what happened the last time the vproc was shut down. • The FSG segment IDs of the FIB, MI, and FTR trace buffer. 693 Chapter 14: Filer Utility (filer) SEGZERO (or SEG0) Example 1 Filer ==> SEGZERO Segment 0 FSGInfo VProcID : 0 PDisks : 2 SectsPerCyl : 1488 BytesPerSect : 512 TpaInit[0] Length : 2048 Name : 0 0 0 Class : FILE Attr : AGELESS TpaInit[1] Length : 7168 Name : 0 0 0 Class : FILE Attr : AGELESS TpaInit[2] Length : 65536 Name : 0 0 0 Class : FILE Attr : NONE TpaInit[3] : Invalid Class TpaInit[4] : Invalid Class TpaInit[5] : Invalid Class TpaInit[6] : Invalid Class TpaInit[7] : Invalid Class Pdisk [0] BadSectorList: Invalid Class CylsPerDrive: 100 RaidLevel : 1 ArrayType : 2 [1] BadSectorList: Invalid Class CylsPerDrive: 100 RaidLevel : 1 ArrayType : 2 SEG0 694 (0000) (0002) (05D0) (0200) 8 12 26 (0800) (0000 0000 0000 0008) (0001) (0004) (1C00) (0000 0000 0000 000C) (0001) (0004) (10000) (0000 0000 0000 001A) (0001) (0000) (0064) (0001) (0002) (0064) (0001) (0002) Utilities Chapter 14: Filer Utility (filer) SET FREECYL SET FREECYL Purpose The SET FREECYL command sets the file system internal Free Cylinder count to the specified number. Syntax number SET FREECYL SET FREE /Y 1102C054 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. number The number of free cylinders. An error occurs if less than the specified number of cylinders free already exist. Usage Notes Use the RESETFREECYL command to reset the Free Cylinder count back to the correct value. Example Filer ==> Set Free 16 Are you sure you want to do this (Y/N)? Y Only 22 (0016) cylinders remain free Utilities 695 Chapter 14: Filer Utility (filer) SHOWDEFAULTS SHOWDEFAULTS Purpose The SHOWDEFAULTS command shows the default settings and the saved context. The command displays the current default radix for input and output, the current input, output, and error file names, and the SCOPE defined, including what the equal sign (=) means, as shown in the following example: The present value for the = is: Dec (HEX) In addition, SHOWDEFAULTS also displays WAL log context information. Syntax SHOWDEFAULTS SHOWD GS04B023 Example 1 Filer ==> showd The current object selected is Nothing The current defaults are: The present value for the = Cylinder:Drive is Cylinder:CylNum is Sector Number is Sector Count is Memory Address is Length is Patch Offset is TID is Start Rowid is End Rowid is Start WLSN is End WLSN is Where Clause is is: Dec (Hex) undefined. undefined. undefined. undefined. undefined. undefined. undefined. undefined undefined. undefined. undefined undefined undefined Filer is currently running on Vproc 1 Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled Filer ==> 696 Utilities Chapter 14: Filer Utility (filer) SHOWDEFAULTS Example 2 The following example shows a range of rows selected: > row /c 'employee.ttt' p 0 [...] showd [...] vproc 1 (0001) response The current object selected is a range of Rows The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 1 (0001) Cylinder:CylNum 0 (0000) Sector Number 95 (005F) Sector Count 1 (0001) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID 0 1187 1024 (0000 04A3 0400) Start Rowid 0 21518 21380 0 1 (0000 540E 5384 0000 0001 ) End Rowid 0 59106 30941 0 1 (0000 E6E2 78DD 0000 0001 ) Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled Row (Range) ==> Example 3 The following example shows context with a whereclause: > WAL /l end-5000 to end where kind=checkpoint WRECS: WREC length ---0020 0000001E SECTS: 00000006 wlsn ---------------0000000000000076 kind -----------Checkpoint TJKind: Checkpoint Drv:000 Cyl:00b0 Sect:04c RecWLSN:000000000000002b WREC length ---0020 wlsn ---------------00000000000000df kind -----------Checkpoint TJKIND: Checkpoint Utilities 697 Chapter 14: Filer Utility (filer) SHOWDEFAULTS Drv:000 Cyl:00b0 Sect:09d RecWLSN:00000000000000f8 > showd vproc 0 (0000) response The current object selected is a Range of WAL records The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 0 (0000) Cylinder:CylNum 4 (0004) Sector Number 2445 (098D) Sector Count 64 (0040) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID WAL Start WLSN 118 (0000000000000076) End WLSN 223 (00000000000000df) WHERE Clause: kind=checkpoint Example 4 The following example shows a cylinder selected: > blk 0 4 0 [...] vproc 0 (0000) response The current object selected is a CI Currently we have the copy from the D RAM. The current defaults are: This is the Latest copy. The present value for the = is: Dec (Hex) Cylinder:Drive 0 (0000) Cylinder:CylNum 4 (0004) Sector Number 2445 (098D) Sector Count 64 (0040) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID 0 26 1024 (0000 001A 0400) Start Rowid 0 12780 52315 0 1 (0000 31EC CC5B 0000 0001 ) End Rowid 0 12780 52315 0 1 (0000 31EC CC5B 0000 0001 ) Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled CI ==> 698 Utilities Chapter 14: Filer Utility (filer) SHOWDEFAULTS Example 5 The following example shows the whole WAL log selected by a WAL command: > WAL /s there are 4 (0004) wal records in the selected range > showd [...] vproc 0 (0000) response The current object selected is a Range of WAL records The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 0 (0000) Cylinder:CylNum 4 (0004) Sector Number 2445 (098D) Sector Count 64 (0040) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID WAL Start WLSN 1 (0000000000000001) End WLSN 4 (0000000000000004) Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled WAL ==> Example 6 The following displays a table selected and a subset of rows displayed. The object selected is a table and the row IDs in the SHOWDEFAULTS display are meaningless residue. > table 'employee.ttt' p 1 to 2 /m TableID: 0000 04A3 0400 ROWS: 00000004 SECTS: 00000001 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 540E 5384 0000 0001 00 C0 0010 0000 79B6 9E37 0000 0001 00 C0 > showd [...] vproc Utilities 1 (0001) response 699 Chapter 14: Filer Utility (filer) SHOWDEFAULTS The current object selected is a Table The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 1 (0001) Cylinder:CylNum 0 (0000) Sector Number 95 (005F) Sector Count 1 (0001) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID 0 1187 1024 (0000 04A3 0400) Start Rowid 0 21518 21380 0 1 (0000 540E 5384 0000 0001 ) End Rowid 0 59106 30941 0 1 (0000 E6E2 78DD 0000 0001 ) Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled Example 7 The following example shows a range of CIDs. Only the last CID number is shown in the context: MI:CID ==> next 2 Command has been sent to Slave tasks. vproc 0 (0000) response CID drv cyl firsttid u0 u1 tai part h0 -- ------ ---- ---- ---- ---- -------00 00000B 0000 0498 0800 0000 00 00000C 0000 050F 0400 0000 MI:CID showd firstrid lasttid lastrowkey h1 u0 u1 u0 u1 tai part h0 h1 fl in fsec checksum ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- -- --B046 95B4 0000 0001 0000 050F 0400 0000 5197 9BC2 00 00 0666 519B 2EE8 0000 0001 0000 050F 0400 0000 A97B 3AB6 00 00 077F (Range) ==> The current object selected is a range of CIDs The current defaults are: The present value for the = is: Dec (Hex) Cylinder:Drive 0 (0000) Cylinder:CylNum 12 (000C) Sector Number 2870 (0B36) Sector Count 127 (007F) Memory Address is undefined. Length is undefined. Patch Offset is undefined. TID 0 1183 1024 (0000 049F 0400) 700 Utilities Chapter 14: Filer Utility (filer) SHOWDEFAULTS Start Rowid End Rowid 0 31345 63740 0 31345 63740 0 0 2 2 (0000 7A71 F8FC 0000 0002 ) (0000 7A71 F8FC 0000 0002 ) Filer is running as a startable utility Filer is running with Locking -- Enabled File System has Internal Tracing -- Enabled Utilities 701 Chapter 14: Filer Utility (filer) SRD SRD Purpose The SRD (Subtable Descriptor) command returns a formatted display of all the SRDs on the current CI that have any rows from the subtable specified by tid. If you omit tid, all SRDs are displayed. Syntax Note: The online help lists the display options (/P, /S, /M, /L) as /dispopt. You can type the options at the beginning or end of the command. SRD /P /S /M /L tid 1102B093 where: Syntax Element Description /P Positions to the SRD with rows from the subtable, tid. This option is valid only if you specify a tid. If this tid does not exist on this CI, the command will position to the SRD of the next higher tid. Nothing is displayed unless there is a problem. /S Displays the selected SRDs on the CI. /M Displays the first and last DBDs of each selected SRD, in addition to the information displayed by the /S option. /L Displays all the DBDs of each selected SRD and the free sector entries, in addition to the information displayed by the /S option. tid The subtable of interest. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. Usage Notes The SRD command must be invoked from a CI context (as indicated by the CI> prompt). The command formats the SRDs and DBDs associated with the specified tid. If you omit the optional tid, then all the SRDs on the CI are selected and displayed. For more information, see “Specifying a Subtable Identifier (tid)” on page 524. 702 Utilities Chapter 14: Filer Utility (filer) SRD Example CI ==> srd 0 26. SRD num table id u0 u1 ---- ----- ----0019 0000 001A Utilities 0 tai ----0000 firstdbd dbdcount offset -------FF82 -------- -----0001 0091 703 Chapter 14: Filer Utility (filer) STAMP STAMP Purpose The STAMP command takes five hexadecimal numbers and converts them to a file system timestamp. Syntax STAMP number number number number number GS04A024 where: Syntax Element Description number number must be less than 256, since each number represents one byte of the timestamp. Example Filer ==> stamp 94 35 DB 38 1D The stamp is Fri March 24, 2000 01:29:56:39 704 Utilities Chapter 14: Filer Utility (filer) SYNCSCAN SYNCSCAN Purpose The SYNCSCAN command shows all currently running scans on an AMP that are eligible for the synchronized full-file scan feature. Note: The Teradata Database must be down when using the SYNCSCAN command. Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. You can type the options at the beginning or end of the command. SYNCSCAN /S /M /L tid 1102B084 where: Syntax Element Description /S Displays global information and a one-line summary for each eligible subtable. /M Same as /S, but also displays the process IDs of the tasks scanning each subtable. /L Displays global information and detailed information for each task scanning each subtable. tid The subtable of interest. For more information on tid formatting, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. Utilities 705 Chapter 14: Filer Utility (filer) SYNCSCAN Example The following example is a long display showing five scanners of one subtable: Sync ==> syncscan/l freehead freetail multiscantablecount usedbytes : : : : Hash (0020) value 32 19 7 1 4096 firstpidx nexttidx tableid --------- -------- -----------14 0 0 1726 1024 rowid oldrowid nexttidx version h0 h1 u0 oldpagenum oldpagesread -------- ------- ----- ----- ------- ----------15 3474 22672 58790 0 8685 8685 16 156 22718 41046 0 8685 390 17 156 22718 41046 0 8685 390 18 156 22718 41046 0 8685 390 0 154 22718 41046 0 8680 385 706 (0013) (0007) (0001) (1000) pagesintable pagesread numscans numgroups ------------ --------- -------- --------0 10265 5 1 u1 pagenum pagesread wrapped usedontcachedbs pid h0 h1 u0 u1 -- ------- --------- ------- ---------------- ---- ----- ----- -- -- ---2 8690 8690 FALSE FALSE 2075 22672 58790 0 1 2 8700 395 FALSE FALSE 2086 22718 41046 0 1 2 8700 395 FALSE FALSE 2085 22718 41046 0 1 2 8700 395 FALSE FALSE 2084 22718 41046 0 1 1 8695 390 FALSE FALSE 2076 22672 58790 0 2 Utilities Chapter 14: Filer Utility (filer) TABLE TABLE Purpose The TABLE command displays rows from the subtable specified by the tid argument. Syntax Note: The online help lists the row options (/P, /S, /M, /L, /H) as /rowopt. You can type the options at the beginning or end of the command. tid TABLE TAB ordinalrange /P /S /M /L /H 1102B083 where: Syntax Element Description /P Positions to the rows or subtable requested. At least one row must be in the selected range. Nothing is displayed unless there is a problem. /S or /C Counts the number of rows selected. This is the default for all subtables except the table header subtable. /M or /I Displays only the length, row ID, and flags. /L or /R Formats the row header and fields in the row. This option is the default for the table header subtable; however, this option is not the default formatted field display because the table header subtable has a special row format and requires special formatting. /H Format the row header and display the entire row in hexadecimal, including the header. tid Specifies the subtable to display. The tid specification must include a typeandindex value. For detailed information, see “Specifying a Subtable Identifier (tid)” on page 524. The online help lists this option as tableid. ordinalrange Selects the range of rows to display. No matter what is displayed, the resulting context is the whole subtable. For detailed information, see “Specifying Display Ranges (ordinalrange)” on page 528. The online help lists this option as rangeopt. Utilities 707 Chapter 14: Filer Utility (filer) TABLE Usage Notes The prompt for the TABLE selector is shown below: TABLE ==> The commands allowed at the TABLE prompt are listed in the following table. Command Syntax and Description Common Commands DISPLAY, DROP, DELETE, NEXT, PREV. Use the option definitions of the ROW command with these common commands. Also, the current object selected can be a subtable or a range of subtables. The prompt reflects your selection. The TABLE command operates on subtables. In the Teradata Database, a subtable is a collection of rows, and a table is a collection of subtables. The rows of a particular subtable may be data rows, index rows, table header rows, etc. Therefore, you can use the TABLE command to display rows from the primary data subtable, the table header subtable, a secondary index subtable, etc. For example, to obtain a formatted display of the table header, use Table /L x y H 1 where x and y make up the tablenumber which identifies the table, and H is the typeandindex value which identifies the table header subtable. For more information on identifying tables and subtables, see “Specifying a Subtable Identifier (tid)” on page 524. The initial context for the TABLE command consists of the rows of the subtable, and the ordinalrange argument is interpreted with respect to this context. Positive integers without the BEG/END prefix are ordinal row numbers, where 1 is the first row. Negative integers without the BEG/END prefix are backwards displacements from the last row, so that -1 is the second to last row. Note: This differs from the interpretation of an ordinalrange for the DISPLAY command, where integers without the BEG/END prefix always refer to objects outside the current context, so that positive values refer to objects past the end of the current context, and negative values refer to objects before the beginning of the current context. The resulting context from a TABLE command is a whole subtable, a subtable range, or null, but never a row range. The ordinalrange can restrict the display to a subset of the resulting context, even though this ordinalrange has no affect on the resulting context. If the TABLE command uses a wildcard for the type part of the tid, the resultant context is special (nothing), and this context is not usable with an ordinalrange argument. The display is a multiple subtable display, where each subtable is constrained by the ordinal range. For each subtable, the BEG/END +/- number rules apply, except that the - number construct is not allowed. For more information on ordinalrange, see “Specifying Display Ranges (ordinalrange)” on page 528. 708 Utilities Chapter 14: Filer Utility (filer) TABLE Example 1 _Filer ==> table /m 1000 0 400 1 to 5 TableID: 1000 0000 0400 ROWS: 0000087B SECTS: 0000117D ROW length rowid flags presences h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- --------004F 0024 35C2 0000 000A 00 00 07ED 0033 0965 0000 000A 00 00 0829 003A 4C5B 0000 000A 00 00 004F 0100 6FDC 0000 000A 00 00 0059 010A 65DD 0000 000A 00 00 Table ==> Example 2 The following example shows a row header for the second-to-the-last row of a user table. table "employee.ttt" p end-1 /m TableID: 0000 04A3 0400 ROWS: 00000004 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 CDC4 F1BB 0000 0001 00 C0 SECTS: 00000001 Example 3 The following example displays an ordinal range of a subtable and then uses DISPLAY to exhibit the resulting context as the whole subtable. > tab /m 'employee.ttt' p beg+1 to end-1 TableID: 0000 04A3 0400 ROWS: 00000004 SECTS: 00000001 SECTS: 00000001 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 79B6 9E37 0000 0001 00 C0 0010 0000 CDC4 F1BB 0000 0001 00 C0 disp TableID: 0000 04A3 0400 ROWS: 00000004 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0010 0000 540E 5384 0000 0001 00 C0 0010 0000 79B6 9E37 0000 0001 00 C0 0010 0000 CDC4 F1BB 0000 0001 00 C0 0010 0000 E6E2 78DD 0000 0001 00 C0 > showd [...] The current object selected is a Table [...] Utilities 709 Chapter 14: Filer Utility (filer) TABLE Example 4 With the implementation of WAL, the Transient Journal was moved from table 26 to the WAL log. In the following example, the TABLE command for the dbc.transientjournal table header shows that the header for table number 26 exists, but the data subtable is empty. The table retains table number 26 (1A) for administrative purposes. The ROWS and SECTS values apply to the primary data subtable and are zero because Transient Journal records are now in the WAL log. A Warning message is provided. > table "dbc.transientjournal" h * *** Warning *** Table 26 (1A) dbc.transientjournal is now empty, as the TJ is in the WAL Log. TableID: 0000 001A 0000 ROWS: 00000000 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------01E2 0000 0000 0001 0000 0001 00 80 Database Name Table Name DataBase ID Account ID : "DBC : "TransientJournal : 0 1 : 0 1 SECTS: 00000000 " " […] Example 5 The following example shows output from the TABLE command with the /l option. In this example, sppi1 is a single-level PPI table, so the output displays the PPI descriptor and the PPI level descriptor. Filer ==> tableid "testppi.sppi1" The table id for testppi.sppi1 is 0x0000 0x0672 0x0000 ( 0 1650 0 ) Filer ==> table/l 0 0x672 0 Please Enter <RangeSpec> ==> * Command has been sent to Slave tasks. vproc 0 (0000) TableID: 0000 response 0672 0000 ROWS: 00000001 SECTS: 00000004 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0670 0000 0000 0001 0000 0001 00 80 710 Utilities Chapter 14: Filer Utility (filer) TABLE Database Name : "TESTPPI Table Name : "sppi1 DataBase ID : 0 1027 Account ID : 0 1027 Created : 06/12/15 16:02:20 Last Updated : 06/12/15 16:02:20 Last Archived : 01/01/01 00:00:00 StructVersion : 1 Util Version : 1 # of Backups : 1 QueueTable : FALSE Perm Journal : 0 0 0 Table kind : TabPermPresLog SPFlag : FALSE BaseTable ID : 0 0 Protection : No FallBack User Journal : FALSE Hashed Table : TRUE Dropped Flag : FALSE DDL change : FALSE Journal : CharSet : ASCII(127) Parent Count : 0 Child Count : 0 RSErrorTableId: 0 0 RSInitFlag : FALSE PrimaryKey Id : 0 RowFormat : 32-bit Row Format Fat Header : FALSE ErrTbl : FALSE AbortedFlag : TABUSABLE ******************** PrimaryMsgClass : 0 PrimaryMsgKind : 0 SecondaryMsgClass : 0 SecondaryMsgKind : 0 LogicalHostId : 0 SessionNo : 0 0 RequestNo : 0 0 TransactionNo : 0 0 0 ************************************* " " Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 1024 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 3 0 1 27 PPI Base Table DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 96 32-bit FALSE FALSE ***************************************************** Single Level PPI: BaseCombinedPart# LastCombinedPart# MaxCombinedPart# Utilities 711 Chapter 14: Filer Utility (filer) TABLE 1 65535 65535 NumberofLevels FirstMappedLevel 1 1 PPI LEVEL DESCRIPTORS Level #: 1 numparts numsubparts basepart# lastpart# maxpart# 65535 1 3 12 12 nopart unknownpart ppiexprkind nextmappedlevel 2 1 rangefnc 1 reservedparts 2 ***************************************************** UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 AscKey DBC INTEGER 2 1026 18 P 3 0 Offset Nullable 0 2 PPIKey DBC INTEGER 3 1027 22 P 0 0 Offset Nullable 0 3 NonKey DBC CHAR(5) LATIN ---------------------------------------------------------------******************************************************************************* Start of Primary Index Descriptor... IdxId:1, IndexType:NonUniq/Hash, Valid:True, OrdByVal:False Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 0 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 2 0 1 27 PPI Secondary Index DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 0 32-bit FALSE FALSE UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 AscKey DBC INTEGER 2 1026 18 P 0 0 Offset Nullable 0 2 PPIKey DBC INTEGER ---------------------------------------------------------------- 712 Utilities Chapter 14: Filer Utility (filer) TABLE ******************************************************************************* Table ==> Example 6 In the following example, mppi1 is a multilevel PPI table, so the output displays the PPI descriptor and the PPI level descriptors. Filer ==> tableid "testppi.mppi1" The table id for testppi.mppi1 is 0x0000 0x0673 0x0000 ( 0 1651 0 ) Filer ==> table/l 0 0x673 0 * Command has been sent to Slave tasks. vproc 0 (0000) TableID: 0000 response 0673 0000 ROWS: 00000001 SECTS: 00000005 ROW length rowid flags presences part h0 h1 u0 u1 ------ ----- ----- ----- ----- ----- ----- --------0948 0000 0000 0001 0000 0001 00 80 Database Name Table Name DataBase ID Account ID Created Last Updated Last Archived StructVersion Util Version # of Backups QueueTable Perm Journal Table kind SPFlag BaseTable ID Protection User Journal Hashed Table Dropped Flag DDL change Journal CharSet Parent Count Child Count Utilities : : : : : : : : : : : : : : : : : : : : : : : : "TESTPPI "mppi1 0 1027 0 1027 06/12/15 16:03:34 06/12/15 16:03:34 01/01/01 00:00:00 1 1 1 FALSE 0 0 0 TabPermPresLog FALSE 0 0 No FallBack FALSE TRUE FALSE FALSE " " ASCII(127) 0 0 713 Chapter 14: Filer Utility (filer) TABLE RSErrorTableId: 0 0 RSInitFlag : FALSE PrimaryKey Id : 0 RowFormat : 32-bit Row Format Fat Header : FALSE ErrTbl : FALSE AbortedFlag : TABUSABLE ******************** PrimaryMsgClass : 0 PrimaryMsgKind : 0 SecondaryMsgClass : 0 SecondaryMsgKind : 0 LogicalHostId : 0 SessionNo : 0 0 RequestNo : 0 0 TransactionNo : 0 0 0 ************************************* Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 1024 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 3 0 1 27 PPI Base Table DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 96 32-bit FALSE FALSE ***************************************************** Multi Level PPI: BaseCombinedPart# LastCombinedPart# MaxCombinedPart# 1 65532 65532 NumberofLevels FirstMappedLevel 2 1 PPI LEVEL DESCRIPTORS Level #: 1 numparts numsubparts basepart# lastpart# maxpart# 5461 12 3 12 12 nopart unknownpart ppiexprkind nextmappedlevel 2 1 rangefnc 1 reservedparts 0 Level #: 2 numparts numsubparts basepart# lastpart# maxpart# 12 1 1 10 10 nopart unknownpart ppiexprkind nextmappedlevel 11 12 rangefnc 0 714 Utilities Chapter 14: Filer Utility (filer) TABLE reservedparts 0 ***************************************************** UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 PPIAsc DBC INTEGER 2 1026 18 P 3 0 Offset Nullable 0 2 PPIKey DBC INTEGER 3 1027 22 P 0 0 Offset Nullable 0 3 NonKey DBC CHAR(5) LATIN ---------------------------------------------------------------******************************************************************************* Start of Primary Index Descriptor... IdxId:1, IndexType:NonUniq/Hash, Valid:True, OrdByVal:False Table header field 5 Descriptor: BaseFieldId NumVFields NumPBits Compressible OffsetToPBits FirstVarOffset 0 0 4 FALSE 11 14 NumFields FirstCompFInd FirstPhyFInd FirstVarFldOff TypeofDescriptor 2 0 1 27 PPI Secondary Index DupRowsAllowed OffsetToPPIDesc RowFormat HasUDTs Fathdr Never 0 32-bit FALSE FALSE UDT or Num- Next ComPresIn- Fld Off- Comp- Fld press Calc Stoence Sort dex id set ress Ind offset offset rage Byte Bit Desc EvlRepr --- ---- ----- ----- --- ------ ------ -------- ---- --- ------ -----------------1 1025 14 P 2 0 Offset Nullable 0 1 PPIAsc DBC INTEGER 2 1026 18 P 0 0 Offset Nullable 0 2 PPIKey DBC INTEGER ---------------------------------------------------------------******************************************************************************* Table ==> Utilities 715 Chapter 14: Filer Utility (filer) TABLEID TABLEID Purpose The TABLEID command displays the table number of the specified table when given the database name and table name. Syntax TABLEID "databasename. tablename" "databasename". "tablename" 'databasename. tablename' 'databasename'. 'tablename' 1102A005 where: Syntax Element Description databasename The name of the database containing the table for which the table number will be displayed. tablename The name of the table for which the table number will be displayed. Usage Notes This command is not allowed if the Teradata Database is in Debug-Stop because this command requires sending a message to an awtmain task and receiving a response. At DebugStop, this command would hang waiting for a response. A table is identified in the data dictionary by a table number (tvm.tvmid). Each table number is unique across the whole system, rather than local to a database. Therefore, a table number uniquely identifies a table in the system. The TABLEID command displays the table number of the table specified by databasename and tablename. The output of the TABLEID command is a numeric subtable identifier (tid), which consists of three numbers: • The first two comprise the table number. This pair of numbers is used to uniquely identify a table in the system. • The third is the typeandindex value, which specifies a kind of subtable, such as a table header, data subtable, or a particular index subtable. TABLEID always returns a typeandindex value of zero (0), which specifies the table header. For more information on how to interpret a tid, see “Specifying a Subtable Identifier (tid)” on page 524. 716 Utilities Chapter 14: Filer Utility (filer) TABLEID The TABLEID command also sets the saved context to the located tid. (Use = in place of tid in subsequent commands to reference the found tid.) The following rules apply when specifying databasename and tablename: • A period (.) is required to separate the database name from the table name. • You must use either single ( ' ) or double ( " ) quotation marks when typing a database name and table name. The results are the same. • You can specify a fully qualified table name using any one of the methods suggested in the syntax diagram with the following exceptions: • The object name has an apostrophe, in which case you must specify the object name in double quotes. Valid examples include the following: • tableid "xyz.mark’s table" • tableid "xyz"."mark’s table" Invalid examples include the following: • • tableid 'xyz.mark’s table' • tableid "xyz".'mark’s table' The object name has a period, in which case you must type the fully qualifying tablename in the form of "database"."tablename" or 'database'.'tablename'. Valid examples include the following: • tableid "xyz.0’s"."mark’s table.2.53.00" • tableid 'xyz'.'table.0' Invalid examples include the following: • tableid "xyz.0’s.mark’s table.2.53.00" • tableid 'xyz.0’s.mark’s table.2.53.00' Example 1 The following example shows output generated by TABLEID: Filer ==> tableid "mydatabase.mytable" The table id for MYDATABASE.MYTABLE is 1 1217 0 (0x0001 0x4C1 0x0000) Note: You could get the same results with the following commands: tableid 'mydatabase.mytable' tableid "mydatabase"."mytable" tableid 'mydatabase'.'mytable' Utilities 717 Chapter 14: Filer Utility (filer) TABLEID Example 2 The following example uses the TABLEID command to find a table number, and then uses the table number as part of a tid to display the number of rows in the primary data subtable. tableid "employees.emp" The table id for EMPLOYEES.EMP is 0x0000 0x04A7 0x0000 ( 0 1191 0 ) > table /s 0x0000 0x04A7 p all vproc 0 (0000) TableID: 0000 response 04A7 0400 vproc 1 (0001) [. . .] response ROWS: 0007A10B SECTS: 0001B327 Example 3 The following example shows the table number for the old Transient Journal. With the implementation of WAL, the Transient Journal was moved from table 26 to the WAL log. Therefore the table is always empty, except that space accounting will show WAL log space under table 26. TABLEID "dbc.transientjournal" *** Warning *** The TJ was moved from table 26 to the WAL Log. Table DBC.TRANSIENTJOURNAL is obsolete except the table header is retained for administrative purposes. The table id for DBC.TRANSIENTJOURNAL is 0x0000 0x001A 0x0000 ( 0 26 0 ) 718 Utilities Chapter 14: Filer Utility (filer) TRACEPRINT TRACEPRINT Purpose The TRACEPRINT command dumps the internal trace buffer of the file system. Syntax TRACEPRINT drive TRA LAST number cylinder = = 1102B007 where: Syntax Element Description drive The drive of the entries that are displayed. If omitted, all entries are displayed. cylinder The cylinder of the entries that are displayed. LAST number Only the last number entries are displayed. = Filer will use the most recently saved values for drive or cylinder. This option cannot be used unless input values have already been defined for drive or cylinder. For more information, see “Stored Input Values” on page 517. Example Filer ==> trace last 5 entry PID FILID ----- ----- ---------0546 1094 LOCKCI2 0547 1094 LOCKDB3 0548 1094 LOCKDB4 0549 1094 RFINI1 054A 1094 RFINI2 Utilities D 0 0 0 0 0 CYL --002 002 002 002 002 SECT ---0000 02CC 0000 02CC 0000 LN -08 09 08 09 08 ADDRESS -------80630000 806B0000 80630000 806B0000 80630000 FSGOP ---------ACQUIRE ACQUIRE ALTLOCK RELSTAND RELSTAND ARG D CYL SECT LN ------- - --- ---- -READ READ ACCESS NORMAL NORMAL 719 Chapter 14: Filer Utility (filer) TRASH TRASH Purpose The TRASH command places the currently selected segment into a state of FSGFILEONAME. Syntax TRASH TRAS /Y GS04B071 where: Syntax Element Description /Y Prevents Filer from prompting for confirmation before executing the command. Example DB ==> Trash Are you sure you want to TRASH this (Y/N) ? N TRASH has been cancelled as you requested. 720 Utilities Chapter 14: Filer Utility (filer) UNJOIN UNJOIN Purpose The UNJOIN command removes disks from existing AMPs in the scope. Syntax UNJOIN LAST 1 number number TO number GS04B043 where: Syntax Element Description LAST The last number (or numbers) of the pdisk (or pdisks) to unjoin. If number is not specified, then 1 is the default. number The number (or numbers) of the pdisk (or pdisks) to unjoin. Usage Notes The UNJOIN command is required to run before the Teradata Database starts. After a successful operation, the vconfig.gdo file is updated. Note: For information about the JOIN command, which is used to add disks to existing AMPs, see the platform-dependent Teradata Database Installation/Upgrade/Migration documents. Utilities 721 Chapter 14: Filer Utility (filer) UNJOIN Example Example command entries are shown below: • To unjoin the last pdisk, type the following: unjoin last • To unjoin the last two pdisks, type the following: unjoin last 2 • To unjoin pdisks 2, 3, and 4, type the following: unjoin 2 3 4 722 Utilities Chapter 14: Filer Utility (filer) VPROC or SCOPE VPROC or SCOPE Purpose The VPROC or SCOPE command selects a set of vprocs that Filer will communicate with until Filer quits or a different set of vprocs is selected. Syntax SCOPE SCOPE VPROC ALL number , VPROC ( number ) TO number GS04C055 where: Syntax Element Description ALL Sets the scope to all vprocs. number Numeric identifier of a single vproc. Usage Notes In this mode, all subsequent Filer commands are sent to each vproc selected, and each vproc responds with its answer. After this command is issued, most commands requiring confirmation cannot be used. The SCOPE or VPROC command is not supported when Filer is started from the Debugger. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Example This example shows the scope set to all vprocs. Filer ==> Scope all 4 of 4 amps have been selected This example shows the scope set to vproc 1. Filer ==> vproc 1 Command has been sent to Slave tasks. Thu May 04, 2000 00:29:03 1 of 2 amps have been selected Utilities 723 Chapter 14: Filer Utility (filer) WABC WABC Purpose The WABC (WAL Append Buffer Control) command displays the WABC structure. Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. WABC /S /M /L 1102B115 where: Syntax Element Description /S Displays only the WABC structure. This is the default. /M Displays all the Buffer Control Arrays, in addition to the information displayed by the /S option. /L Displays the Free Cylinder Array, in addition to the information displayed by the /S and /M options. Example 1 The following example displays only the WABC structure. Filer ==> > wabc wabc Command has been sent to Slave tasks. vproc 0 (0000) response WABC Structure AppendBuf FlushedBuf BufferLock AppendLock WriterLock Bufcount 724 : : : : : : 13 13 0xE380BFD8 0xE380BFF0 0xE380BFC0 20 (000D) (000D) (0014) Utilities Chapter 14: Filer Utility (filer) WABC MaxSyncWalWrites PendingWrites FreeCylCount CylAllocCount MiniCylPackSleep, BackgroundWriterTsk AppendWLSN WrittenLogWLSN NTA Number vproc 1 (0001) : : : : : : : : : 5 0 13 14 FALSE FALSE 151297 151297 149449 (0005) (0000) (000D) (000E) (0000) (0000) (0000000000024F01) (0000000000024F01) (00000000000247C9) response WABC Structure AppendBuf FlushedBuf BufferLock AppendLock WriterLock Bufcount MaxSyncWalWrites PendingWrites FreeCylCount CylAllocCount MiniCylPackSleep, BackgroundWriterTsk AppendWLSN WrittenLogWLSN NTA Number : : : : : : : : : : : : : : : 10 10 0xE380BF90 0xE380BFA8 0xE380A010 20 5 0 13 14 FALSE FALSE 151206 151206 149544 (000A) (000A) (0014) (0005) (0000) (000D) (000E) (0000) (0000) (0000000000024EA6) (0000000000024EA6) (0000000000024828) Example 2 The following example displays the WABC structure and all of the Buffer Control Arrays. Some lines of the output were omitted to condense the example. WABC ==> > wabc /m wabc /m Command has been sent to Slave tasks. vproc 0 (0000) response WABC Structure AppendBuf FlushedBuf BufferLock AppendLock WriterLock Bufcount MaxSyncWalWrites PendingWrites FreeCylCount CylAllocCount Utilities : : : : : : : : : : 13 13 0xE380BFD8 0xE380BFF0 0xE380BFC0 20 5 0 13 14 (000D) (000D) (0014) (0005) (0000) (000D) (000E) 725 Chapter 14: Filer Utility (filer) WABC MiniCylPackSleep, BackgroundWriterTsk AppendWLSN WrittenLogWLSN NTA Number : : : : : FALSE FALSE 151297 151297 149449 (0000) (0000) (0000000000024F01) (0000000000024F01) (00000000000247C9) BufControl Array wixappnbufptr[0]: 0x79400000 bufctrl[0] FirstWLSN : 150851 LastWLSN : 150852 Busy : FALSE WritePosted : TRUE NeedsWriting : FALSE CommitPending : FALSE FirstWDBD : FALSE ID : m-3 I/O Queue : -478081016 Write Queue : -478081024 PrevWCIDrv : 0 PrevWCICyl : 0 wixappnbufptr[1]: 0x79420000 bufctrl[1] FirstWLSN : 150981 LastWLSN : 150981 Busy : FALSE WritePosted : TRUE NeedsWriting : FALSE CommitPending : FALSE FirstWDBD : FALSE ID : m-4 I/O Queue : -478081032 Write Queue : -478081040 PrevWCIDrv : 0 PrevWCICyl : 0 wixappnbufptr[2]: 0x79440000 bufctrl[2] FirstWLSN : 150988 LastWLSN : 150988 Busy : FALSE WritePosted : TRUE NeedsWriting : FALSE CommitPending : FALSE FirstWDBD : FALSE ID : m-5 I/O Queue : -478081048 Write Queue : -478081056 PrevWCIDrv : 0 PrevWCICyl : 0 (0000000000024D43) (0000000000024D44) (0000) (0001) (0000) (0000) (0000) (E3811008) (E3811000) (0000) (0000) (0000000000024DC5) (0000000000024DC5) (0000) (0001) (0000) (0000) (0000) (E3810FF8) (E3810FF0) (0000) (0000) (0000000000024DCC) (0000000000024DCC) (0000) (0001) (0000) (0000) (0000) (E3810FE8) (E3810FE0) (0000) (0000) [...Remainder of the output omitted to condense the example...] 726 Utilities Chapter 14: Filer Utility (filer) WABC Example 3 The following example displays the WABC structure, all of the Buffer Control Arrays, and the Free Cylinder Array. Some lines of the output were omitted to condense the example. Filer ==> > wabc /l wabc /l Command has been sent to Slave tasks. vproc 0 (0000) response WABC Structure AppendBuf FlushedBuf BufferLock AppendLock WriterLock Bufcount MaxSyncWalWrites PendingWrites FreeCylCount CylAllocCount MiniCylPackSleep, BackgroundWriterTsk AppendWLSN WrittenLogWLSN NTA Number : : : : : : : : : : : : : : : 13 13 0xE380BFD8 0xE380BFF0 0xE380BFC0 20 5 0 13 14 FALSE FALSE 151297 151297 149449 (000D) (000D) (0014) (0005) (0000) (000D) (000E) (0000) (0000) (0000000000024F01) (0000000000024F01) (00000000000247C9) BufControl Array wixappnbufptr[0]: 0x79400000 bufctrl[0] FirstWLSN : 150851 LastWLSN : 150852 Busy : FALSE WritePosted : TRUE NeedsWriting : FALSE CommitPending : FALSE FirstWDBD : FALSE ID : m-3 I/O Queue : -478081016 Write Queue : -478081024 PrevWCIDrv : 0 PrevWCICyl : 0 wixappnbufptr[1]: 0x79420000 bufctrl[1] FirstWLSN : 150981 LastWLSN : 150981 Busy : FALSE WritePosted : TRUE NeedsWriting : FALSE CommitPending : FALSE FirstWDBD : FALSE ID : m-4 Utilities (0000000000024D43) (0000000000024D44) (0000) (0001) (0000) (0000) (0000) (E3811008) (E3811000) (0000) (0000) (0000000000024DC5) (0000000000024DC5) (0000) (0001) (0000) (0000) (0000) 727 Chapter 14: Filer Utility (filer) WABC I/O Queue Write Queue PrevWCIDrv PrevWCICyl : : : : -478081032 -478081040 0 0 (E3810FF8) (E3810FF0) (0000) (0000) [...Remainder of Buffer Control Array output omitted to condense the example...] FreeCyl Array freecyl[0] Valid Drv Cyl freecyl[1] Valid Drv Cyl freecyl[2] Valid Drv Cyl freecyl[3] Valid Drv Cyl : FALSE : 0 : 5 (0000) (0000) (0005) : FALSE : 1 : 5 (0000) (0001) (0005) : FALSE : 0 : 6 (0000) (0000) (0006) : FALSE : 1 : 6 (0000) (0001) (0006) [...Remainder of Free Cylinder Array output omitted to condense the example...] 728 Utilities Chapter 14: Filer Utility (filer) WAL WAL Purpose The WAL (Write Ahead Logging) command returns a formatted display of WAL log records based on an ordinal record number range, such as the 10th through the 20th WAL log records. If no range is given, all of the records are displayed. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /X, /H, /V) as /dispopt. You can type the options at the beginning or end of the command. WAL /P /S /M /L /X /H /V ordinalrange whereclause 1102A126 where: Utilities Syntax Element Description /P Positions to the WAL log records. Nothing is displayed unless there is a problem. /S Displays a count of the selected WAL log records. /M Displays the type, WLSN, and other generic WAL log record headers, in addition to the information displayed by the /S option. /L Displays the type-specific WAL log record headers for NONTJ and TJ records, in addition to the information displayed by the /M option. /X Displays the change data (before and after images) in hexadecimal, in addition to the information displayed by the /L option. /H Displays the header in hexadecimal, in addition to the information displayed by the /L option. /V Validates the WAL log records instead of displaying them. This option performs as much checking as possible without running SCANDISK, which requires starting the normal file system. See “SCANDISK” on page 668. 729 Chapter 14: Filer Utility (filer) WAL Syntax Element Description ordinalrange Specifies the range of WAL log records to be displayed by ordinal position. If no range is given, all of the records are displayed. This differs from the TABLE command, which requires an ordinalrange argument. For more information, see “Specifying Display Ranges (ordinalrange)” on page 528. The online help lists this option as rangeopt. whereclause Restricts the selection to a subset of the WAL log records within the ordinal range based on the field content of the records. For more information, see “Specifying a WHERE clause” on page 531. Usage Notes The WAL command displays fully formatted WAL log records, including Transient Journal (TJ) subtypes. It displays before/after image content in hexadecimal. WAL formats the WAL log records according to the WAL log record kind. For more information on the WAL log record kinds and sub-kinds, see “Specifying a WHERE clause” on page 531. WAL displays WAL log records by ordinal record number. To choose records based on the WAL log sequence number (WLSN) stored inside the records, use the WREC command. For more information, see “WREC” on page 749. The whereclause for the WAL command is applied in conjunction with the ordinalrange argument. The whereclause is recorded as part of the context and remains active for subsequent DISPLAY, NEXT, and PREV commands. Like the TABLE command, WAL has an initial context and a resulting context. The initial context is used to interpret the ordinalrange argument for the WAL command. The resulting context is produced by executing the WAL command. The initial context is unrelated to prior commands as explained below. The initial context encompasses the first WAL log record to the last, and the ordinalrange for the WAL command is interpreted with respect to this initial context. Therefore, the BEG and END identify the first and last WAL log records. Similar to the TABLE command, positive integers without the BEG/END prefix are considered to be ordinal record numbers, where 1 is the first record. Negative integers without the BEG/END prefix are backwards displacements from the last record, where -1 is the second to last record. Note: This differs from the interpretation of an ordinalrange for the DISPLAY command, where integers without the BEG/END prefix always refer to objects outside the current context, so that positive values refer to objects past the end of the current context, and negative values refer to objects before the beginning of the current context. For more information, see “TABLE” on page 707, “DISPLAY” on page 582, and “Specifying Display Ranges (ordinalrange)” on page 528. 730 Utilities Chapter 14: Filer Utility (filer) WAL The resulting context from a WAL command is a WAL log record or WAL log record range that matches the records selected. The resulting context from a TABLE command is a whole subtable, a subtable range, or null, but never a row range. For the TABLE command, the ordinalrange can restrict the display to a subset of the resulting context, even though this ordinalrange has no affect on the resulting context. The WAL command does not adopt this behavior. Example 1 The following example shows a count of the WAL log records. The WAL command reflects the entire log content, which includes both the Redo records and the TJ records. > WAL /s all WRECS: Utilities 00000025 SECTS: 0000000A 731 Chapter 14: Filer Utility (filer) WCI WCI Purpose The WCI (WAL Cylinder Index) command accesses the WCI of a given cylinder of the WAL log and displays the WCI in accordance with the display options. Warning: The FIX option of the WCI command should be used by trained Teradata personnel only, and the user must be absolutely sure that the option should be used. Inappropriate use of the FIX option may result in data loss. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X, /V) as /dispopt. You can type the options at the beginning or end of the command. WCI drive /P /S /M /L /H /X /V FORCE FIX cylinder = 1102A103 where: 732 Syntax Element Description /P Positions to the WCI. If this cylinder is not a WAL cylinder, an error occurs. Nothing is displayed unless there is a problem. /S Displays the header, trailer, and the first and last WDBDs. /M Displays the same information as the /S option. /L Displays all of the WDBDs, in addition to the information displayed by the /S option. /H Displays the WCI in hexadecimal. /X Displays the timestamp and other details from the WDB for each WDBD, in addition to the information displayed by the /L option. /V Verifies that the WCI is logically correct, but does not display it. FORCE Attempts to format and display the segment as a WCI, even if the segment is not a WCI. If the FORCE option is not used, the command fails on a mismatched block. Utilities Chapter 14: Filer Utility (filer) WCI Syntax Element Description FIX Warning: This option should be used by trained Teradata personnel only, and the user must be absolutely sure that the option should be used. Inappropriate use of this option may result in data loss. Attempts automatic repair of the WCI. You must supply the /V option with the FIX option, and the Teradata Database must be down. drive The drive of the entries displayed. cylinder The cylinder of the entries displayed. = Specifies that Filer should use the most recently saved values for drive and cylinder. This option cannot be used unless input values have already been defined for drive and cylinder. For more information, see “Stored Input Values” on page 517. Example The following example displays a WCI: wci 0 2 Utilities Latest WCI For Drive 0000 FilHeader the for Cyl 000002 WCI Length(in sectors) BlkCode Stamp Version Trailer Version FseHead FreeCount DbNewVer Flags Drv Cyl VprocId Checksum ChecksumSampleCount ChecksumAlgorithm FirstWLSN : : : : : : : : : : : : : : : : 24 (0018) WCI DATA (0003) Thu Oct 02, 2003 01:44:15.05 (5F E5 7B 3F 05) 23362 (5B42) 23362 (5B42) 92 (005C) 5553 (15B1) 48 (0030) 0 (0000) 0 (0000) 2 (00000002) 1 (0001) 12345678 (00BC614E) 42 (002A) 226 (00E2) 941 (00000000000003ad) First 'WDBD' WDBD firstwlsn ---------------00000000000003ad start ---0037 scts ---002c flags ----0000 recs ---0052 checksum -------707E7916 ct -2A ag -E2 Last 'WDBD' WDBD firstwlsn ---------------0000000000000400 start ---0063 scts ---0100 flags ----0000 recs ---0052 checksum -------abcd4321 ct -2A ag -E2 733 Chapter 14: Filer Utility (filer) WCID WCID Purpose The WCID (WAL Cylinder Index Descriptor) command displays the WCID associated with the requested WAL log cylinder. Syntax WCID drive cylinder = 1102A104 where: Syntax Element Description drive The drive. cylinder The cylinder. = Specifies that Filer should use the most recently saved values for drive and cylinder. This option cannot be used unless input values have already been defined for drive and cylinder. For more information, see “Stored Input Values” on page 517. Usage Notes The prompt for this selector looks like this: MI:WCID ==> 734 Utilities Chapter 14: Filer Utility (filer) WCID The commands allowed at this prompt are shown in the following table. Command Type Allowed Commands Common commands PATCH, WRITE, DELETE, DISPLAY, NEXT, and PREV. For more information, see the individual commands. Any Global or Upper-Level Command Global commands include DATE, DISABLE, ENABLE, ERRORS, HELP, INPUT, OUTPUT, QUIT, RADIX, and SHOWDEFAULTS. For global commands, see “Global Commands” on page 537. For upper-level commands, see the following: • “Upper-Level Commands Related to the drive, cylinder, and sectornum Fields” on page 538 • “Upper-Level Commands Related to the tid and rowid Fields” on page 538 • “Upper-Level Commands Not Related to Any Particular Object” on page 538 Example wcid 1 0 WCID drv cyl -- -----01 000000 Utilities firstwlsn ---------------00000000000002ed fl -00 fsec ---0d55 checksum -------a2b37654 ag -2e 735 Chapter 14: Filer Utility (filer) WDB WDB Purpose The WDB (WAL Data Block) command displays data blocks associated with the WAL log. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /H, /X, /V) as /dispopt. You can type the options at the beginning or end of the command. WDB drive /P /S /M /L /H /X /V FORCE cylinder = sectornum = sectorcount = 1102A106 where: Syntax Element Description /P Positions to the WDB. If one does not exist, an error occurs. Nothing is displayed unless there is a problem. /S Displays the header, trailer, and the first and last generic WAL log record headers. /M Displays all of the generic WAL log record headers, in addition to the information displayed by the / S option. /L Displays the type-specific WAL log record headers for NONTJ and TJ records, in addition to the information displayed by the /M option. /H Displays the header followed by the entire WDB in hexadecimal. /X Displays the change data (before and after images) in hexadecimal, in addition to the information displayed by the /L option. /V Verifies that the WDB is logically correct, but does not display it. FORCE Attempts to format and display the segment as a WDB, even if the block type does not indicate a WDB. drive The drive. cylinder The cylinder. sectornum The sector number. 736 Utilities Chapter 14: Filer Utility (filer) WDB Syntax Element Description sectorcount The sector count. = Specifies that Filer should use the most recently saved values for drive, cylinder, sectornum, or sectorcount. This option cannot be used unless input values have already been defined for drive, cylinder, sectornum, or sectorcount. For more information, see “Stored Input Values” on page 517. Usage Notes The checksum in the WDB is intended to cover the time between writing the WDB to disk and having filled the cylinder, finally writing the WCI and its WDBs to disk. The WCI is written once when the cylinder is initialized and once when the cylinder is full. The WCI is not written as each WDBD is added to the WCI in memory. In reading the WDBs in the last log cylinder after a restart that lost cache, no WDBDs with external checksums exist on the disk; therefore, internal checksums in the WDBs are used to validate the WDBs. Example wdb /m 1 0 9f1 WDB location - Drive 0001 FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail DegenHead DegenTail FirstWlsn Prevwdblastwlsn Prevwdbstart Prevwdbsects DbChecksum DbChecksumSampleCnt DbChecksumAlgorithm Flags HomeDiskAddress Drive Cylinder Start VprocId 000000 Start 09F1 WDB : : : : : : : : : : : : : : : : : : : : : : : : 127 (007F) WDB DATA (0006) Thu Jun 12, 2003 22:17:13.36 (59 5E E9 3E 24) 0 (0000) 0 (0000) 3 (0003) 570 (023A) 26 (001A) 26 (001A) NULL (0000) NULL (0000) 171 (00000000000000ab) 0 (00000000) 0 (0000) 0 (0000) 1464837648 (574FA610) 42 (002A) 226 (00E2) 0 (0000) 1 0 2545 1 WREC length wlsn ------ ---------------- Utilities Cyl (09F1) kind ------- 737 Chapter 14: Filer Utility (filer) WDB 0070 0060 0080 0040 738 00000000000000ab 00000000000000ac 00000000000000af 00000000000000ag TJROW WALDELETE WALINSERT WALDUMMYCLR Utilities Chapter 14: Filer Utility (filer) WDBD WDBD Purpose The WDBD (WAL Data Block Descriptors) command shows a formatted display of the WDBDs in the current WCI. Syntax Note: The online help lists the display options (/S, /X, /H) as /dispopt. WDBD /S /X /H LSN = WlsnNum SECTOR = sectornum 1102A107 where: Syntax Element Description /S Displays the WDBDs in a short format. This is the default. /X Displays the WDBDs in an extended format. /H Displays all of the WDBDs, followed by a display of the WDBDs in hexadecimal. LSN = WlsnNum The LSN specification (or LSNSPEC), where WlsnNum is a WAL log sequence number (WLSN). If you provide a LSNSPEC, the WDBD command displays the WDBDs in the current WCI that describe a WDB with any record in LSNSPEC. SECTOR = sectornum The sector specification (or SECTORSPEC), where sectornum is a sector number. If you provide a SECTORSPEC, the WDBD command displays the WDBDs in the current WCI that describe a WDB belonging to sectornum. Usage Notes WDBDs are used to determine which WDBs exists and where they are located on a cylinder. The WDBD command must be invoked from a WCI or WCI:WDBD context. The resulting context is the selected range of WDBDs within the WCI. With no arguments, WDBD displays all WDBDs in the current WCI. Utilities 739 Chapter 14: Filer Utility (filer) WDBD Example 1 The following example shows output from the WDBD command if you do not specify any options. WCI ==> > wdbd wdbd Please Enter <LSN=WlsnNum or SECTOR=sectornum> ==> > lsn = 24665 lsn = 24665 Command has been sent to Slave tasks. vproc 0 (0000) response WDBD num firstwlsn start sect flags recs offset ---- ---------------- ----- ---- ----- ---- -----0001 0000000000024665 0CD7 0001 0000 0001 01D7 WCI:WDBD ==> Example 2 The following example shows a short formatted display of the WDBDs. WCI:WDBD ==> > wdbd /s lsn = 0000000000024F1B wdbd /s lsn = 0000000000024F1B Command has been sent to Slave tasks. vproc 0 (0000) response WDBD num firstwlsn start sect flags recs offset ---- ---------------- ----- ---- ----- ---- -----0003 0000000000024F1B 006F 0001 0000 0003 00DB 740 Utilities Chapter 14: Filer Utility (filer) WDBD Example 3 The following example shows an extended display of the WDBDs. WCI:WDBD ==> > wdbd /x lsn = 0000000000024F1B wdbd /x lsn = 0000000000024F1B Command has been sent to Slave tasks. vproc 0 (0000) response WDBD num firstwlsn start sect flags recs offset ---- ---------------- ----- ---- ----- ---- -----0003 0000000000024F1B 006F 0001 0000 0003 00DB wdblen timestamp ver prvstart prvsect prvwdblastwlsn wdb1stwlsn ---- ---------------------------- ---- -------- ------- ---------------- ---------------0001 Mon May 08, 2006 21:22:53.11 0002 006E 0001 0000000000024F19 0000000000024F1B WCI:WDBD ==> Example 4 The following example shows a formatted display of all the WDBDs, followed by a display of the WDBDs in hexadecimal. WCI:WDBD ==> > wdbd /h lsn = 0000000000024F1B wdbd /h lsn = 0000000000024F1B Command has been sent to Slave tasks. vproc 0 (0000) response WDBD num firstwlsn start sect flags recs offset ---- ---------------- ----- ---- ----- ---- -----0003 0000000000024F1B 006F 0001 0000 0003 00DB 0000: 0010: Utilities Starting Address: 79a601b6 1B 4F 02 00 00 00 00 00.6F 00 01 00 03 00 00 00 00 00 00 00 00 00 00 00 *.O......o.......* *........ * 741 Chapter 14: Filer Utility (filer) WDBREC WDBREC Purpose The WDBREC command displays WAL log records for a WAL data block (WDB). Syntax Note: The online help lists the row options (/S, /M, /L, /H, /X) as /rowopt. WDBREC /S /M /L /H /X 1102B109 where: Syntax Element Description /S or /C Displays a count of the WAL log records in the WDB. /M Displays the generic WAL log record headers. /L Displays the type-specific WAL log record headers for NONTJ and TJ records, in addition to the information displayed by the /M option. /H Displays the WAL log record header in hexadecimal, in addition to the information displayed by the /L option. /X Displays the change data (before and after images) in hexadecimal, in addition to the information displayed by the /L option. Usage Notes The WDBREC command must be invoked from a WDB context (as indicated by the WDB> prompt). Example 1 An example using the /S option is shown below: WDB ==> wdbrec /s there are 742 570 (023A) rows in the current WAL Data Block Utilities Chapter 14: Filer Utility (filer) WDBREC Example 2 An example using the /M option is shown below: WDB ==> wdbrec /m WREC length wlsn ------ ---------------0070 00000000000000ab [...] 0070 00000000000043cd Utilities kind ------TJROW TJROW 743 Chapter 14: Filer Utility (filer) WFIND WFIND Purpose The WFIND command displays the WAL log cylinders containing WAL log records in a specified range of WAL log sequence numbers or, if no range is specified, displays all WAL log cylinders. Syntax Note: The online help lists the display options (/S, /M, /L) as /dispopt. You can type the options at the beginning or end of the command. WFIND /S wlsnrange /M /L 1102B111 where: Syntax Element Description /S Displays the first WCID and first WDBD within the range. /M Displays the first WCID, the first WDBD, all intervening WCIDs, and the last WCID and last WDBD within the range. /L Displays all WCIDs and WDBDs within the range. wlsnrange Specifies one or a range of WAL cylinders and WAL data blocks based on the WAL log sequence number (WLSN) in the record header. To define wlsnrange, use this syntax: wlsn TO wlsn 1102B155 744 Utilities Chapter 14: Filer Utility (filer) WFIND Example The following example finds the first cylinder and WDB for the log. >wfind WCID drv cyl -- -----01 000000 firstwlsn ---------------00000000000003ad WDBD firstwlsn ---------------00000000000003ad Utilities start ---0037 scts ---002c fl -00 fsec ---0d55 flags ----0000 checksum -------a2b37654 recs ---0052 checksum -------707E7916 ct -2A ag -E2 745 Chapter 14: Filer Utility (filer) WFLUSH WFLUSH Purpose The WFLUSH command forces some or all of the WAL log records in memory to disk. Syntax WFLUSH WLSN=wlsn 1102A116 where: Syntax Element Description wlsn Flushes the WAL log to disk, up to and including the memory buffer containing the specified WAL log sequence number (WLSN). Usage Notes Blocks of WAL log records are accumulated in memory buffers. When the current buffer fills, a write is initiated, and a new buffer becomes the current buffer (that is, a “buffer switch” occurs). A transaction can force the log to disk, up to a specified WLSN, to insure that the transaction is recorded safely. You can use the WFLUSH command to force some or all of the buffers to disk manually. If writes are already in progress, WFLUSH waits for those writes to complete. If the current buffer is flushed, a buffer switch occurs. Flushing the WAL log to disk is a very simple, low risk operation. One reason to flush the WAL log to disk is so that you can use normal Filer commands, such as WREC and WAL, to examine recent log records. This might be necessary because Filer does not examine the log buffers when displaying log records. For more information about the WREC or WAL commands, see “WREC” on page 749 or “WAL” on page 729. 746 Utilities Chapter 14: Filer Utility (filer) WMI WMI Purpose The WMI (WAL Master Index) command returns a formatted display of the WMI. Syntax Note: The online help lists the display options (/P, /S, /L, /H, /V) as /dispopt. WMI /P /S /L /H /V 1102A114 where: Syntax Element Description /P Positions to the WMI. Nothing is displayed unless there is a problem. /S Displays the header, trailer, and the first and last WCIDs of the WMI. /L Displays all the WCIDs in the WMI, in addition to the information displayed by the /S option. /H Displays the WMI in hexadecimal. /V Verifies that the WMI is logically correct, but does not display it. Usage Notes The WMI command is also available when Filer is invoked from the System Debugger or Coroner. For information on invoking Filer from the System Debugger or Coroner modes of the Teradata GNU Debugger (gdb), see “Starting and Exiting on MP-RAS” on page 498. Utilities 747 Chapter 14: Filer Utility (filer) WMI Example > wmi /m FilHeader for the Length(in sectors) BlkCode Stamp Version Trailer Version FreeCount RefCount HoleHead HoleTail PosVer WMI : : : : : : : : : : 100 (00000064) WMI (0002) Fri Nov 14, 2003 12:26:23.00 (6F 3A B5 3F 00) 516 (0204) 516 (0204) 1052 (0000041C) 9 (00000009) 10 (0000000A) 10 (0000000A) 414 (019E) All The WCIDs on the WMI WCID drv cyl -- -----00 000001 00 000003 748 firstwlsn ---------------00000000000002ed 00000000000004ed fl -00 00 fsec ---0d55 0d55 checksum -------3daf7345 73adf673 ag -e2 e2 Utilities Chapter 14: Filer Utility (filer) WREC WREC Purpose The WREC command returns a formatted display of WAL log records based on the WAL log sequence number (WLSN) in the record header. If no range is given, all of the records are displayed. Syntax Note: The online help lists the display options (/P, /S, /M, /L, /X, /H, /V) as /dispopt. You can type the options at the beginning or end of the command. WREC /P /S /M /L /X /H /V wlsnrange whereclause 1102A125 where: Utilities Syntax Element Description /P Positions to the WAL log record. Nothing is displayed unless there is a problem. /S Displays a count of the selected WAL log records. /M Displays the type, WLSN, and other generic WAL log record headers, in addition to the information displayed by the /S option. /L Displays the type-specific WAL log record headers for NONTJ and TJ records, in addition to the information displayed by the /M option. /X Displays the change data (before and after images) in hexadecimal, in addition to the information displayed by the /L option. /H Displays the header in hexadecimal, in addition to the information displayed by the /L option. /V Validates the WAL log records instead of displaying them. This option performs as much checking as possible without running SCANDISK, which requires starting the normal file system. See “SCANDISK” on page 668. 749 Chapter 14: Filer Utility (filer) WREC Syntax Element Description wlsnrange Selects one or a range of WAL log records based on the WAL log sequence number (WLSN) in the record header, instead of selecting the records by ordinal position within the log. If you do not specify a wlsnrange, the whole WAL log is displayed. To define wlsnrange, use this syntax: wlsn TO wlsn 1102B155 whereclause Restricts the selection to a subset of the WAL log records within the range based on the field content of the records. For more information, see “Specifying a WHERE clause” on page 531. Usage Notes The wlsnrange selects records based on the WAL log sequence number (WLSN) recorded inside the log records. To select records by ordinal record number (such as 1st, 10th, or 5th WAL log record from the end), use the WAL command, which accepts an ordinalrange argument. For more information, see “WAL” on page 729. The whereclause for the WREC command is applied in conjunction with the wlsnrange. The whereclause is recorded as part of the context and remains active for subsequent DISPLAY, NEXT, and PREV commands. Example 1 The following example formats the Transient Journal (TJ) records: > wrec 3a2d /l WREC length ---0020 wlsn ---------------0000000000003a2d kind ------TJ TJKind: BEG Tran:16383,000049B4 Host#0000 Sess#00000C8D Req#00000411 HReq#00000411 Example 2 The following example shows formatted generic WAL log record headers in hexadecimal: WREC ==> > wrec/h 0000000000B8F93C to 0000000000B8F940 wrec/h 0000000000B8F93C to 0000000000B8F940 Command has been sent to Slave tasks. vproc 750 0 (0000) response Utilities Chapter 14: Filer Utility (filer) WREC RECORD Length WLSN kind ------ ---------------- --------------0048 0000000000B8F93C TJRECORD NewRow Tran: 0000 0001 7112 Req#00000001 TID: 0000 0006 0400 RID: 0000 6555 0A9B 0000 0001 Implicit Write lock using DBID: 0000 0001 0000: 0010: Starting Address: 92ba0078 3C F9 B8 00 00 00 00 00.48 00 01 00 1E 00 1E 00 46 00 0A 00 00 00 01 00.12 71 00 00 01 00 *<.......H.......* *F........q.... * RECORD Length WLSN kind ------ ---------------- --------------0060 0000000000B8F93F UNFSE modinfo action name linwlsn count flag tableid drv cyl sec length u0 u1 tai ------- ---- ---------------- -- ---------- -- ---- ---- -------- ---------------- -------- ---- ---- --- ---00003F9 0001 0000000000B8EF62 01 DELETE 00 0019 0000 00003000 0000000000B8F93D 00000001 0000 0000 0006 0400 Starting Address: 92ba00c0 0000: 3F F9 B8 00 00 00 00 00.60 00 0D 00 20 00 00 00 *?.......`... ...* 0010: F9 03 00 00 01 00 01 00.62 EF B8 00 00 00 00 00 *........b.......* 0020: 93 09 00 01 19 00 00 00.00 00 00 00 00 00 00 00 *................* 0030: 00 30 00 00 3D F9 B8 00.00 00 00 00 01 00 00 00 *.0..=...........* 0040: 00 00 00 00 06 00 00 04.00 00 00 00 00 00 00 00 *................* pid seq transinfo ntaid flg RECORD Length WLSN kind ------ ---------------- --------------0078 0000000000B8F940 DBD modinfo action name linwlsn count flag tableid drv cyl sec length u0 u1 tai ------- ---- ---------------- -- ---------- -- ---- ---- -------- ---------------- -------- ---- ---- --- ---00003F9 0002 0000000000B8EF62 10 UPDATE 00 0019 0000 00003000 0000000000B8F93D 00000002 0004 0000 0006 0400 Starting Address: 92ba0120 0000: 40 F9 B8 00 00 00 00 00.78 00 0A 00 22 00 00 00 *@.......x..."...* 0010: F9 03 00 00 02 00 10 00.62 EF B8 00 00 00 00 00 *........b.......* 0020: 93 09 00 03 19 00 00 00.00 00 00 00 00 00 00 00 *................* 0030: 00 30 00 00 3D F9 B8 00.00 00 00 00 02 00 00 00 *.0..=...........* 0040: 04 00 00 00 06 00 00 04.00 00 00 00 00 00 00 00 *................* pid seq transinfo ntaid There is a total of flg 3 (00000003) wal records in the selected range Example 3 The following example shows a WAL log record for a row insert to a DB. The example uses the /L option to display the non-TJ Field1 header in addition to the basic WAL log record header displayed by the /M option. The example further assumes that the DB had checksums in the DB and DBD, so WREC also shows a checksum for the DB in the WAL log record. > wrec 3a2d /l WREC length ---0020 wlsn ---------------0000000000003a2d kind ------REDOROW Status -------Pending PrevWLSN: 0000000000003a20 UndoNxtWLSN: 0000000000000000 NTATransNo:0000000000edcba TransNo:0232,000abcde Flags:CHECKSUMPRESENT BlockID: Length:0000C800 Drive:01 Cylinder:00003a Sector:0002 Utilities 751 Chapter 14: Filer Utility (filer) WREC Checksum:7654adfe ct:11 ag:02 REDO-ACTION: INSERT Example 4 The following example shows a Compensation Log Record (CLR). The non-zero value for the UndoNxtWLSN field is the only indication that this is a CLR. > wrec 4a2d /l WREC length ---0020 wlsn ---------------0000000000004a2d kind ------REDOROW Status -------Pending PrevWLSN: 0000000000004a20 UndoNxtWLSN: 0000000000003a20 NTATransNo: 0000000000edcba TransNo: 0232,000abcde Flags:CHECKSUMPRESENT BlockID: Length:0000C800 Drive:01 Cylinder:00003a Sector:0002 Checksum:7654adfe ct:11 ag:02 REDO-ACTION: DELETE Example 5 The following example shows a TJ record using the /X option to display the record body. > wrec 3a2d to 0000000000003a2e /x WREC length ---0020 wlsn ---------------0000000000003a2d kind ------TJ TJKind: BEG Tran:16383,000049B4 Host#0000 Sess#00000C8D Req#00000411 HReq#00000411 Content 0000: 10 00 E2 E6 DD 78 00 00.01 00 00 C0 04 00 00 00 *.....x..........* ... WREC length ---0020 wlsn ---------------0000000000003a2e kind ------TJ TJKind: BEG Tran:16384,000049B4 Host#0000 Sess#00000C8E Req#00000411 HReq#00000411 Content 0000: 10 00 E2 E6 DD 78 00 00.01 00 00 C0 04 00 00 00 *.....x..........* ... 752 Utilities Chapter 14: Filer Utility (filer) WSUMMARY WSUMMARY Purpose The WSUMMARY command scans the WAL log and provides a list of table identifiers referenced by non-TJ WAL records within a specified range of WAL log sequence numbers (WLSNs). Syntax WSUMMARY wlsnrange 1102A195 where: Syntax Element Description wlsnrange Selects one or a range of WAL log records based on the WAL log sequence number (WLSN) in the record header. If wlsnrange is not specified, WSUMMARY retrieves table IDs from all the WAL records. To define wlsnrange, use this syntax: wlsn TO wlsn 1102B155 Example 1 Filer ==> wsummary Command has been sent to Slave tasks. vproc 0 (0000) response There is a total of non-TJ count TJ count Utilities 417 (000001A1) wal records in the selected range 411 (0000019B) records 6 (00000006) records 753 Chapter 14: Filer Utility (filer) WSUMMARY Number of non-TJ records with NULL tableID 23 (00000017) Following Table IDs found from the Non-TJ wal
© Copyright 2026 Paperzz