Error "0xe0000340 - The Database script returned an error" is reported in the job log when performing a restore and rollforward operation of all of the tablespaces of a DB2 database.
Final error: 0xe0000340 - The Database script returned an error. Refer to the Database script output section in job logs for more details.
If all of the tablespaces of a DB2 database are backed up, and a restore and rollforward operation is attempted from this backup, the job may fail with the error above and below. (Fig. 1)
The system catalog tablespace "syscatspace" contains all of the system catalog information for the tables. Syscatspace needs to be rolled forward first, and then the other tablespaces must be rolled forward.
When the restore operation is run from a tablespace level backup, perform the rollforward for the syscatspace tablespace first and then for other tablespaces.
Execute the rollforward operation as a DBA operation. The sequence of the recovery process should be as follows:
1. Select all tablespaces, uncheck the rollforward option and run the restore job.
2. Run the rollforward operation as a DBA initiated operation:
rollforward syscatspace to point in time / end of logs. e.g. db2 => rollforward database UEXIT to end of logs and complete Tablespace (SYSCATSPACE) online
3. Perform rollforward of all other tablespaces.
e.g. db2 => rollforward database UEXIT to end of logs and complete tablespace (SYSTOO LSPACE,USERSPACE1) online
Refer to IBM DB2 documentation for more information on DBA-initiated operations.