cancel
Showing results for 
Search instead for 
Did you mean: 

RESTATING DB2 database PRIMARY ON HADR

Former Member
0 Kudos

Hi Experts,

We have our production db2 database on HADR in super async mode. we want to restart the primary machine as part of planned maintenance activity.

Can i go ahead and restart the primary or do i need to stop the standby also. Is there any order to stop and start the primary and standby. Please suggest me..

If i only restart primary i want execute below commands.

STOP CI and APPS

db2 force applications all

db2 deactivate db SIS

db2 terminate

db2stop force

db2 connect to db SID

Then restart primary DB and CI VM's

db2start

db2 activate db SID

start CI and APPS

Thanks

Venkat R

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Venkat R,

I am not sure if you used SA MP of IBM Tivoli to manage your database HADR, if so, after
you stopped your primary database manually, SA MP will try to start the primary database
by itself again and again.

If you didn't us SA MP of IBM Tivoli to manage HADR and the HADR is managed by yourself manually, I think you could refer to following steps to restart your primary database server:


logon primary database server with db2<sid>:

db2 force applications all

db2 deactivate db <SID>

db2 stop HADR on db <SID>

db2 terminate

db2stop force

After the database was stopped, you could restart the primary server.

and then you could restart the primary database like following:

db2start

db2 start hadr on db <SID> as primary

db2 activate db <SID>

After these you could start the SAP (CI) in this primary database server again.

While if you used SA MP of IBM Tivoli to manage HADR, please don't use the steps that I have
provided and contact us again, we will need more info to check the issue further. Thank you.

Regards
Alfred

former_member264034
Active Contributor
0 Kudos

Hi Venkat,

HADR commands please see the following document:

Welcome to Wikis

"It is recommended to shutdown primary database first, then the standby database,

so that all primary data will be replicated to the standby.

Standby database startup does not wait for a connection to the primary. Thus it

is recommended to start the standby first, then the primary."

•Once an HADR primary or standby dbactivate db" command. Database does
not shut
down when the last client disconnects. Explicit "deactivate db"
command is needed to shutdown HADR databases (primary or standby).
•Use "activate db"
and "deactivate db"
command to activate and deactivate primary and standby, even though
"start hadr" command implicitly activates a
database.
Use "start hadr" command only if you need HADR
specific functionality such as changing role, or starting primary by
force.
Avoiding unnecessary use of HADR commands minimizes the risk of
unintentional
role change.

"Stop hadr" command does not deactivate
database. In fact, it is not even allowed on an online standby
database. On a
primary database, it stops HADR operations, changes role to standard,
but leave
the database online. There is no impact to client transactions.

Kind Regards,
Aidan