Db2 rollforward "to end of backup" vs. "to end of logs"?
On Db2 Enterpise Server Edition v11.1 single patitioned database on Linux/Intel using LOGARCHMETH1 I executed backup and restore commands:
db2 "backup database mydb online to /path/to/backup include logs without prompting"
Then on identical Linux/Db2 computer:
db2 "restore database mydb from /path/to/backup into mydb logtarget /path/to/logs"
What is the difference between "end of backup" and "end of logs"?
db2 "rollforward database mydb to end of backup and stop overflow log path (/path/to/logs)"
db2 "rollforward database mydb to end of logs and stop overflow log path (/path/to/logs)"
Regards
Solution 1:
to end of backup and stop: it will apply only the transaction logs backuped during the online backup (it will apply only the log generated during the backup to have a coherent database).
to end of logs and stop: will apply all transaction log that it find
Solution 2:
You must rollforward the database restored from an online backup to so called minimum recovery time at least. It corresponds to the point in time, when the database backup used for the recent database restore ended.
The END OF BACKUP clause is a convenient way (especially in a partitioned database environment, where different database partitions are backed up independently and may finish at different times) to specify such a point in time for the database restored. You can't rollforward the database to some point in time earlier than this one.
When END OF LOGS is used, then Db2 tries to use every accessible transaction log produced after end of the backup to recover as much transactions as possible.