get the list of db2 tables which have been changed since a particular timestamp say since 20120801185856 timestamp

拜拜、爱过 提交于 2019-12-03 17:20:03

If you're on DB2 for Linux/Unix/Windows, this query should get what you need:

SELECT TRIM(TABSCHEMA) || '.' || TRIM(TABNAME),
       MAX(CREATE_TIME,ALTER_TIME)
FROM SYSCAT.TABLES
ORDER BY 2 DESC

If you're on the mainframe, this one should do you:

SELECT RTRIM(CREATOR) || '.' || RTRIM(NAME),
       MAX(CREATEDTS,ALTEREDTS)
FROM SYSIBM.SYSTABLES
ORDER BY 2 DESC

However, neither of these will show deleted tables, as they're removed from the system catalog when they are dropped.

I would rather suggest a delete trigger recording to a table the details at which a table's delete operation has taken place.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!