Find recently created tables in Teradata database

Query below lists all tables Teradata databases that were created within the last 60 days

Query

select DataBaseName,
       TableName,
       CreateTimeStamp,
       LastAlterTimeStamp
from DBC.TablesV
where CreateTimeStamp > CURRENT_TIMESTAMP - INTERVAL '60' DAY
      and DatabaseName NOT IN ('All', 'Crashdumps', 'DBC', 'dbcmngr',
          'Default', 'External_AP', 'EXTUSER', 'LockLogShredder', 'PUBLIC',
          'Sys_Calendar', 'SysAdmin', 'SYSBAR', 'SYSJDBC', 'SYSLIB', 
          'SystemFe', 'SYSUDTLIB', 'SYSUIF', 'TD_SERVER_DB', 'TD_SYSFNLIB',
          'TD_SYSGPL', 'TD_SYSXML', 'TDMaps', 'TDPUSER', 'TDQCD',
          'TDStats', 'tdwm', 'SQLJ', 'SYSSPATIAL')
      and TableKind = 'T'
order by CreateTimeStamp desc,
         DatabaseName,
         TableName;

Columns

  • DataBaseName - database name
  • TableName - table name
  • CreateTimeStamp - datetime when table was created
  • LastAlterTimeStamp - datetime when table was last altered

Rows

  • One row represents one table in a database
  • Scope of rows: all tables databases that were created within the last 60 days
  • Ordered by table creation date (descending), database name, table name

Sample results

Comments are only visible when the visitor has consented to statistics cookies. To see and add comments please accept statistics cookies.
0
There are no comments. Click here to write the first comment.