Hi Sahan,
If you are sure that the online backup is consistent (online backup should include logs required for restore), this should work:
#Example of online backup
db2 backup db testdb online to "/db2/backup" include logs
#For eg. create overflow dir (or use any other):
mkdir -p /db2/logs_tmp
#Restore
db2 restore db testdb from '/db2/backup' taken at 20240906225454 into testdb1 logtarget '/db2/logs_tmp'
#Check rollforward status:
db2 rollforward db testdb1 query status
#Finish rollforward using logs from backup:
db2 "rollforward db testdb1 to end of backup and stop overflow log path (/db2/logs_tmp)"
#Activate db and test
db2 activate db testdb1
BR,
Ivan
------------------------------
Ivan Milojevic
Belgrade
------------------------------
Original Message:
Sent: Wed September 25, 2024 10:00 AM
From: Sahan Mendis
Subject: Restoring an online database backup without logs or corrupted logs.
Hi Guys,
I am testing a scenario where I can restore an online database backup without any archived logs in a test environment. Is there any way to restore the backup image. It is okay if the last uncommitted transactions are not restored. I tried every option on restore command and roll forward command. I even tried to recreate an empty log file and put it into the log overflow path without any success.
Thanks!
Sahan
------------------------------
Sahan Mendis
------------------------------