Why a tablespace is being marked offline during rollfowrad, after a DB2 database restore is done
Biswarup(Bis)Mukherjee 120000HKTY Visits (11378)
One reason why a tablespace might get marked offline after a db2 database restore might be due to issues with tablespace container filesystem or, anything related to access to filesystem containing containers of the tablespace. For this kind of reason it will show I/O messages in the db2diag.log. This can happen both during restore as well as during rollforward.
But, another common reason why a tablesapce get marked offline during rollforward could be due to the fact while running of the backup of that specific image there might be a LOAD job running in the source database with COPY YES option. When load copy is used it's important to preserve the load copy files to use those during any rollforward using the logs from the time of the running of the source load job.
When COPY YES option is used the load don't log the majority of transaction, instead rely on the load copy files for recovery.
So, if a rollforward is run after restore using the same set of log files it's important to provide the load copy backup files during the running of the rollforward.
In summary, to use any transaction log file which is saved during a time period when a load with COPY YES was run, it's important to preserve the load copy files from that time as those will be needed along with the transaction log files to perform any recovery from that period of time.
$ db2 "rollforward database MYDB to end of logs overflow log path (/mypath/logs) noretrieve "
SQL1271W Database "MYDB" is recovered but one or more table spaces are
Before running the rollforward please put the load copy files from source place to the place where rollforward is being run under "/DI