Question

I have three different databases for my different environments (hsprd, hstst,hstrn). hsprd is my production environment with live data.

Every so often, a request comes through to restore production data to hstrn or hstst. I typically run this command (after stopping, then dropping the db):

db2 restore db hsprd taken at 20140331180002 to /dbs into hstrn newlogpath /dbs/log/hstrn without rolling forward;

When running this, I receive this message:

SQL2537N Roll-forward is required following the Restore.

Could someone advise how to fix this?

Thanks.

edit: My backups are here:

(/home/dbtmp/backups)> ll                            
total 22791416
-rwxrwxr-x    1 hsprd    cics     11669123072 Mar 31 18:03 HSPRD.0.hsprd.NODE0000.CATN0000.20140331180002.001

After restoring my database and omitting without rolling forward, I receive this message when trying to query the database:

SQL1117N A connection to or activation of database "HSTRN" cannot be made because of ROLL-FORWARD PENDING. SQLSTATE=57019

When I try to rollforward, with this command, I receive this response:

(/home/dbtmp/backups)> db2 rollforward db hstrn to end of backup and complete;
SQL4970N  Roll-forward recovery on database "HSTRN" cannot reach the specified 
stop point (end-of-log or point-in-time) on database partition(s) "0". 
Roll-forward recovery processing has halted on log file "S0006353.LOG".
Was it helpful?

Solution

The first error suggests that you are restoring an online backup, which must be rolled forward. Alternatively, use an offline backup image, then you can include the without rolling forward option.

The second error means that you need to issue the ROLLFORWARD command before you can use the database restored from an online backup.

Finally the third error means that the ROLLFORWARD command is unable to find the logs required for it to succeed. Assuming the logs are included in the backup image, you'll need to specify the LOGTARGET option on the RESTORE command to extract them, presumably to the NEWLOGPATH location.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top