A Collection of assorted Teradata Tools
Project description
tdtools
tdtools is 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 by Teradata Inc.
- Most of the functionality provided byt the tools rely on information contained in Teradata Data Dictionary tables and view. Therefore,
SELECT
access toDBC
objects is required.
Requirements
The latest version of Python3 series is always recommended. However, at least one prior-to-latest version of Python3 will be supported.
tdtools depends on tdtypes (for Teradata metadata information) and yappt (for formatting output). These packages and their dependencies will be downloaded and installed automatically if you use the standard python installer, pip
, to install tdtools.
Installation
Use Python's pip
utility to install tdtools
.
$ pip install -U tdtools
Or
C:\>python -m pip install -U tdtools
Available Tools
Following is a brief description of each tool. Use --help
command-line option to show detailed description of all supported options.
Command | Purpose |
---|---|
dbtree |
Print Teradata database hierarchy. |
tbtree |
Print Teradata Tree hierarchy (reverse View hierarchy) |
updviewrefs |
Maintain View hierarchy as static data in a table (needed for tbtree ) |
tptload |
Generate (and optionally run) TPT load script. |
tptexp |
Generate (and optionally run) TPT export script. |
helpstats |
Print current statistics information for Teradata objects (Table or Join-Index). |
tdrights |
Print Teradata permissions on objects or to users/roles |
All show* utilities generate Teradata object DDLs.
Command | Object Type |
---|---|
showdb |
Database or user |
showgrant |
Grants to user/role |
showprof |
Profile |
showrole |
Role |
showstats |
Statistics definition |
showtvm |
Wrapper around Teradata SHOW <object> commands |
showzone |
Zone |
All ls* utilities print Teradata object information. Currently supported commands are:
Command | Objects |
---|---|
lstb |
Tables |
lsvw |
Views (optionally lists dependent objects hierarchy) |
lsmc |
Macros |
lspr |
Stored Procedures |
lsfn |
Functions |
lsji |
Join Indexes |
lsdb |
Databases |
lsus |
Users |
lspf |
Profiles |
lsrl |
Roles |
lsrm |
Role Members |
Customization
You can optionally supply tdconn_site.py
module 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 by tdtypes module (see tdtypes documentation for details).
A custom tdconn_site.py
module must supply at least two functions.
dbconn_args(parser)
which should accept ArgumentParser object and add any custom command-line options to theparser
object.dbconnect(args)
which overrides the default function with the same name that is provided by tdtypes package, but must accept an argument which will be the result ofArgumentParser.parse_args()
.
Known Issues
- There 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.
Support
Report bugs using issue tracker. I'll try to provide a fix as soon as I can. If you already have a fix, send me a pull request.
Contributions
Feel 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file tdtools-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: tdtools-0.8.1-py3-none-any.whl
- Upload date:
- Size: 62.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7cfedb877e72883bc7511a6ea23c0dd5972de953a5ccff58c1a486f33eb700 |
|
MD5 | 1d935741da2936677e5cc6c9f93012de |
|
BLAKE2b-256 | 4fb65b99196aee4122bdf6bdc62067f22cea1ed72b0a68eb5673b8362b27dbb9 |