Hello everybody,
I need to monitor daily the tables record count of several dbs.
Is there a way to get the tables list with relative record count simultaneously???
Thanks
|
0
|
|
|
|
|
1
|
The short answer is: Not easily. The record counts of the tables are embedded statistics information collected by Teradata. Which means it is only as accurate as the most recent time that you have collected statistics on a column, set of columns, or an index on that table. There is a view maintained and created by Dieter Noeth in the attachment section on the TeradataForum website that will yield a plethora of information on Teradata statistics. (I'd include the SQL here, but it is rather lengthy and proper attribution is warranted.) You should be able to find what you need in the view definition. I have used this view to do almost exactly what you are trying to accomplish, and plan to blog about it soon. Alternatively, you could rely on the law of averages and determine the average size a row consumes based on the record length itself and any secondary indexes that are defined currently on the table by looking at the current table size based on DBC.TableSize divided by the current number of records in the table. Then on a daily basis track the delta in the perm size of the table and derive the number of records. It is important to know that as column or indexing changes on the tables so will your calculate to derive the number of records. |
||
|
|