The one other thing I forgot to mention: Practice your recovery plan too! The restore from an incremental is pretty much like from a full, but you want to do it in test before your'e in a prod recovery in the early morning hours!
So how does one recover from an incremental strategy? Say the strategy is as follows:
1. Week 1 : Full Online a
2.db is autoloaded and load files saved as fs backups
3. Week 2 : Cumulative Incremental online b
4.db is autoloaded and load files saved as fs backups
5. Week 3 : Cumulative Incremental online c
6.db is autoloaded and load files saved as fs backups
7. Week 4 : Cumulative Incremental online d
A failure at point 2 is a no-brainer. How about at points 4, 6 and 8. Lets take the worst case, a failure at point 8.
My understanding is that the restore command has to run for tmstmp d to get the recovery history file, then tmstmp a and then tmstmp d again. Is that correct?
And what would we need to do about the logs? If we have to rollforward through the logs, then all tablespaces will be marked as drop pending. Will appreciate if anyone can shed some light on this.
The history is used in an incremental automatic restore... I think it would depends on what type of failure you are recovering from if you can use this,
i.e. table corruption vs. full disk system failure.
Recovery at 4, 6, and 8 should all be the same as long as these are incrementals and not deltas.
automatic: db2 restore db dbname incremental automatic taken at ##### , where #### is the timestamp of the incremental at 3, 5, or 7.
Then as far as rolling forward, not sure why it would be in drop pending... as long as you roll forward to the end of logs, it won't be in in any state other than consistent, and if you do roll to a specific time,
it should just be in backup pending...
either way, probably good idea to take a new full on or offline backup to reset your stage in the incremental backups.
If for some reason you cannot do an automatic incremental the manual works too:
again, assuming these are incrementals and not deltas or tablespace backups, you just need to do 2 restore commands before rolling forward:
db2 restore db dbname incremental taken at #### , where #### is the timestamp of the most recent incremental
db2 restore db dbname incremental taken at #### , where tinmestamp is the last full
Thanks for your input/feedback and contribution to my questions on DB2 backup and recovery. As always we all make this one of the very best DBA forums on the net. When I learn new things on DB2 I will add my experiences as well.