After restore the database sometimes face error during the connect the database.
SQL1117N A connection to or activation of database "<DBNAME>" cannot be made because of ROLL FORWARD PENDING. SQLSTATE=57019
For resolve this error should be follow below steps :
Step 1 : Verify if rollforward is currently pending for the database, by running the following command.
$db2 get db cfg for <dbname> | grep -i rollforward
#output
Rollforward pending = DATABASE
Step 2: If the Roll forward is currently pending, one of the ways to resolve the issue is to perform a manual roll forward of transaction logs on the BigSQL Head node , using following commands :
A) Perform manual roll forward till the end of transaction logs
$db2 "rollforward db <dbname> to end of logs on dbpartitionnum (0)"
#output
Rollforward Status
Input database alias = <dbname>
Number of members have returned status = 1
Member ID = 0
Rollforward status = DB working
Next log file to be read = <number>.LOG
Log files processed = -
Last committed transaction = 2019-12-02-09.35.56.000000 UTC
DB20000I The ROLLFORWARD command completed successfully.
B) Mark the roll forward as complete
$db2 "rollforward db <dbname> complete on dbpartitionnum (0)"
#output
Rollforward Status
Input database alias = <dbname>
Number of members have returned status = 1
Member ID = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = -
Last committed transaction = <datewithtimestamp>
DB20000I The ROLLFORWARD command completed successfully.
C) After performing the steps A & B , if successful the rollforward pending configuration for the database will be set to Not Pending.
$db2 "rollforward db <dbname> to end of logs on dbpartitionnum (0)"
#output
Rollforward Status
Input database alias = <dbname>
Number of members have returned status = 1
Member ID = 0
Rollforward status = not pending