Upgrade database failed with SQL1704N Database upgrade failed. Reason code "2"
db2scope 310002R9XW Visits (1479)
It is important to check database is eligible to be upgraded BEFORE actually issuing upgrade database command:
db2ckupgrade YourDB -l /tmp
If you find any errors returned by the above command, fix the errors found until db2ckupgrade reports you can upgrade database.
If you have already issued upgrade database command and errors are returned in the process of database upgrade,
chances are database files such as database configuration file, history file, or log control files(LFHs) are already modified.
You may need to restore the database in the previous version and correct the error before you can upgrade database.
The following is a case that upgrade database failed with error SQL1704N(Reason Code "2"):
$ db2 upgrade database YourDB
SQL1704N Database upgrade failed. Reason code "2".
Diagnostic log file "db2diag.log" reports detailed reason for the failure. The following is an example:
<timestamp> LEVEL: Error
The above message shows database was not consistent and needs Crash Recovery before it can be upgraded.
To resolve the problem, restore the database in the previous version and restart the database to finish
Crash Recovery, then proceed to check whether database can be upgraded before upgrading the