75 ways to demystify DB2: #30: Techtip: Do we need exclusive database connection while restoring just logs?
Swati Thorve 270004FTYS Visits (6929)
No, you don't. Few days back, customer asked me "Why DB2 needs exclusive connection while retrieving just logs? We do understand that during restore DB2 may need exclusive connection but we are trying to restore just logs here".
This is my repro of what customer was saying:
db2 backup database DSTEST97 online include logs
db2 restore database DSTEST97 logs from /home/db2v97 taken at 20150416113124 logtarget /tmp
Answer to this is, like all other backup and restore operations, default log retrieval is also a offline process which needs exclusive connection. One can exclusively specify 'online' in command to make sure logs are retrieved offline and no exclusive connection is required.
db2 restore database DSTEST97 logs online from /home/db2v97 taken at 20150416113124 logtarget /tmp
That made it work! Hope you can use this next time while retrieving logs. Let me know if you have any questions on this.