Search code examples
databasemetadataddlhana

Last modification time for table DDL metadata


Is there a system view in SAP HANA that contains last modification time for a table? The time should contain timestamp when table DDL was changed, so I am interested particularly in table metadata last modification time.

For example I'd like to know when a column was added to the table or when a column was removed from the table.

The question isn't about SYS.M_TABLE_STATISTICS that contains information about last DML statement for the table.


Solution

  • You can use new system view M_EXECUTED_STATEMENTS. It monitors all DDL changes to the tables including:

    • All SQL statements starting with CREATE, DROP, ALTER, and RENAME. For example, CREATE TABLE, CREATE USER and ALTER TABLE.

    • All SQL statements starting with TRUNCATE, GRANT, REVOKE, LOAD, EXPORT, IMPORT, and COMMENT.

    • The SET SYSTEM LICENSE and UNSET SYSTEM LICENSE ALL statements.

    It is enabled by default globally and was added in HANA SPS 11 exactly for that aim, i.e. for tracking invalid metadata issues.