Search code examples
transactionssql-deleterestoreauditdb2-luw

After successful db2 restore, some tables might have incomplete data loaded?


Two weeks ago, I took db backup(db2 luw - 5tb) and restored it to new server. However three days ago, developer claimed that one of his table data was incompletely restored.

The earliest full backup is one week ago. But all transaction log is in server disk. Can I read transaction log with any tool?

how can I found deletion (350k rows in 4.5 million row ) query or is it possible restore is problematic?


Solution

  • You may get the corresponding records about your table from the database transaction log, if you have non-empty result of the following query for your MYSCHEMA.MYTABLE table.

    SELECT 1 
    FROM SYSCAT.TABLES 
    WHERE TABSCHEMA = 'MYSCHEMA' AND TABNAME ='MYTABLE' AND DATACAPTURE = 'Y';
    

    You may use whatever replication tool which is able to use Db2 as source in this case, if such a tool is able to capture all table changes from some point in past.
    If the result of the query above is empty, then the corresponding log records are not "propagatable" which means, that it's not possible to parse them.
    More detailed info is here: Db2 log records.