Find recently modified tables in Db2 database

The query below lists all tables that was modified in the last 30 days.

Query

select tabschema as schema_name,
       tabname as table_name,
       alter_time as modify_date
from syscat.tables
where type in ('T')
      and alter_time > current date - 30 DAYS
      and tabschema not like 'SYS%'
order by alter_time desc;

Columns

  • database_name - schema name
  • table_name - table name
  • modify_date - last modify time of table by ALTER statement

Rows

  • One row: represents one table in a schema
  • Scope of rows: all tables which was last modified in the last 30 days in all schemas
  • Ordered by: modify time descending

Sample results