Db2

 View Only

 How to convert HADR standby db to a standalone db

Ondřej Žižka's profile image
Ondřej Žižka posted Wed August 06, 2025 09:08 AM

Hello,

A customer has a Db2 LUW HADR with Pacemaker (v11.5.8). They had an issue with the database (not sure exactly what happened), so they decided to restore a snapshot backup (made by Veeam). Since that time, the primary database is in an inconsistent state, and it is only possible to read from a standby replica (as it was configured with the DB2_HADR_ROS).

They asked to somehow save the database...

I tried the following commands to remove the standby database from the HADR configuration, but it looks like the log file is missing, and without it, it is not possible to continue.
Is there a way to step out of the HADR standby configuration and enable writes (backups, db2look) to the database?

Thank you for any advice.

[db2inst1@dbnode2 ~]$ db2 activate db storedb

DB20000I  The ACTIVATE DATABASE command completed successfully.

[db2inst1@dbnode2 ~]$ db2 update db cfg for storedb using HADR_LOCAL_HOST NULL
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W  One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.

[db2inst1@dbnode2 ~]$ db2 update db cfg for storedb using HADR_REMOTE_HOST NULL
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W  One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.

[db2inst1@dbnode2 ~]$ db2 update db cfg for storedb using HADR_REMOTE_INST NULL
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W  One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.

[db2inst1@dbnode2 ~]$ db2 update db cfg for storedb using HADR_REMOTE_SVC NULL
DB20000I  The UPDATE DATABASE CONFIGURATION command completed successfully.
SQL1363W  One or more of the parameters submitted for immediate modification
were not changed dynamically. For these configuration parameters, the database
must be shutdown and reactivated before the configuration parameter changes
become effective.

[db2inst1@dbnode2 ~]$ db2 deactivate database storedb
DB20000I  The DEACTIVATE DATABASE command completed successfully.

[db2inst1@dbnode2 ~]$ db2 stop hadr on database storedb
DB20000I  The STOP HADR ON DATABASE command completed successfully.

[db2inst1@dbnode2 ~]$ db2 rollforward db storedb stop
SQL1265N  The archive log file "S0060848.LOG" is not associated with the
current log sequence for database "storedb" on database partition "0" and log
stream "0".

[db2inst1@dbnode2 ~]$ db2 backup database storedb to /dev/null
SQL1015N  The database is in an inconsistent state.  SQLSTATE=55025

[db2inst1@dbnode2 ~]$ db2look -d storedb -createdb
-- No userid was specified, db2look tries to use Environment variable USER
-- USER is: DB2INST1

SQL1117N  A connection to or activation of database "storedb" cannot be made
because of ROLL-FORWARD PENDING.  SQLSTATE=57019
[db2inst1@dbnode2 ~]$
Mark Barinstein's profile image
Mark Barinstein

Hello,

Where is this log file S0060848.LOG?
Is this file in an active or archive log path?
Have you tried "db2 rollforward db storedb stop noretrieve", If it's in the archive log path?
Did you copy it manually to some log path on this server?