You can use the DB_HISTORY() administrative view to access the contents of the database history file. This method is an alternative to using the LIST HISTORY CLP command or the C history APIs.
A database connection is required to use this function.
Deletes and updates to the database history file can be done only through the PRUNE HISTORY or UPDATE HISTORY commands.
SELECT * FROM TABLE(DB_HISTORY()) AS LIST_HISTORY
To hide the syntax of the administrative view, you can create a view as follows:
CREATE VIEW LIST_HISTORY AS
SELECT * FROM TABLE(DB_HISTORY()) AS LIST_HISTORY
SELECT * FROM LIST_HISTORY
or SELECT dbpartitionnum FROM LIST_HISTORY
or SELECT dbpartitionnum, start_time, seqnum, tabname, sqlstate
FROM LIST_HISTORY
For a list of columns and column data types returned by the DB_HISTORY administrative view, see DB_HISTORY administrative view.