Package: tdtools
tdtoolstdtoolsis a collection of POSIX style command-line tools that provide an alternate way to access system information (metadata) from Teradata. Of course, most of the information can also be obtained by querying Teradata's Dictionary tables and views (DBC.%).NOTES:I originally developed these tools for my personal use. I am making them open-source in the hope that someone else might find them useful. These tools do not come with any expressed or implied warranty.These tools are not endorsed byTeradata Inc.Most of the functionality provided byt the tools rely on information contained in Teradata Data Dictionary tables and view. Therefore,SELECTaccess toDBCobjects is required.RequirementsThe latest version ofPython3series is always recommended. However, at least one prior-to-latest version of Python3 will be supported.tdtoolsdepends ontdtypes(for Teradata metadata information) andyappt(for formatting output). These packages and their dependencies will be downloaded and installed automatically if you use the standard python installer,pip, to installtdtools.InstallationUse Python'spiputility to installtdtools.$ pip install -U tdtoolsOrC:\>python -m pip install -U tdtoolsAvailable ToolsFollowing is a brief description of each tool. Use--helpcommand-line option to show detailed description of all supported options.CommandPurposedbtreePrint Teradata database hierarchy.tbtreePrint Teradata Tree hierarchy (reverse View hierarchy)updviewrefsMaintain View hierarchy as static data in a table (needed fortbtree)tptloadGenerate (and optionally run) TPT load script.tptexpGenerate (and optionally run) TPT export script.helpstatsPrint current statistics information for Teradata objects (Table or Join-Index).tdrightsPrint Teradata permissionsonobjects ortousers/rolesAllshow*utilities generate Teradata object DDLs.CommandObject TypeshowdbDatabase or usershowgrantGrants to user/roleshowprofProfileshowroleRoleshowstatsStatistics definitionshowtvmWrapper around TeradataSHOW <object>commandsshowzoneZoneAllls*utilities print Teradata object information. Currently supported commands are:CommandObjectslstbTableslsvwViews (optionally lists dependent objects hierarchy)lsmcMacroslsprStored ProcedureslsfnFunctionslsjiJoin IndexeslsdbDatabaseslsusUserslspfProfileslsrlRoleslsrmRole MembersCustomizationYou can optionally supplytdconn_site.pymodule to allow custom run-time option(s) to be added to all of the above tools. This modifies how the tools obtain a Teradata connection. This feature builds on customization offered bytdtypesmodule (seetdtypesdocumentation for details).A customtdconn_site.pymodule must supply at least two functions.dbconn_args(parser)which should acceptArgumentParserobject and add any custom command-line options to theparserobject.dbconnect(args)which overrides the default function with the same name that is provided bytdtypespackage, but must accept an argument which will be the result ofArgumentParser.parse_args().Known IssuesThere was a defect in certain earlier releases of Teradata Database that caused views based on NOPI tables to be not detected correctly. A patch is available from Teradata that fixes this defect.SupportReport bugs usingissue tracker. I'll try to provide a fix as soon as I can. If you already have a fix, send me a pull request.ContributionsFeel free to fork this repository and enhance it in a way you see fit. If you feel your changes will benefit more people, send me a pull request.