Db2 – Apply DB2 logs from production to DR

db2db2-9.5

Is it possible to Apply DB2 9.5 logs files from Production site to DR site? Or do I have to do Backup/Restore and rollforward …?

I copied log files from production site to DR and issued the following command:

rollforward db DBNAME to end of logs and stop overflow log path (/home/db2inst1/logs) noretrieve

Got the error:

DB is not in Rollforward Pending

Best Answer

As the error says, the database must be in the Rollforward pending state for you to use the rollforward command. However, while in this state the database is not accessible.

You don't explain what it is that you are trying to achieve so it's hard to provide a precise solution. If this is a one-time activity you will need to restore your DR database from a backup and run rollforward. If your intent is to keep the DR database up to date on an ongoing basis, consider setting up HADR, which automates the process of transferring and applying logged changes to the standby database.