472,351 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,351 software developers and data experts.

HADR - recovery

I have two questions about HADR recovery. I am running db2 v8 fp12.

1) If the primary suddenly crashes would you always want to switch the
standby to the primary by force...or would there be times when you
would want to make it a standard? (and why)

2) Let us say the primary suddenly crashes (someone pulled the power
cable) and you switch the standby to primary by force. Then you bring
the primary back up and issue a START as STANDBY. If you are in
near-sync mode, wouldnt there be a good chance the two databases could
be out of sync? For instance, the old primary sent logs data to the
standby and crashed prior to the COMMIT. That transaction would be on
the Standby as completed but not on the old primary. So the question
is...does this old primary need to have a db restore done? I noticed
an old discussion on HADR that seemed to imply you could just bring
this old primary up as standby now and it will automagically recover.
Can anyone briefly (but indepthly) discribe how you typically verify db
integrity and recovery actions.

Thanks!

Dec 4 '06 #1
6 3289
"shorti" <lb******@juno.comwrote in message
news:11**********************@80g2000cwy.googlegro ups.com...
>I have two questions about HADR recovery. I am running db2 v8 fp12.

1) If the primary suddenly crashes would you always want to switch the
standby to the primary by force...or would there be times when you
would want to make it a standard? (and why)
1. It is always preferable to do a regular takeover (without force) if that
will work. However, if the primary server goes down and the two servers are
in "disconnected" state, then you must do a takeover by force for it take
affect.
2) Let us say the primary suddenly crashes (someone pulled the power
cable) and you switch the standby to primary by force. Then you bring
the primary back up and issue a START as STANDBY. If you are in
near-sync mode, wouldnt there be a good chance the two databases could
be out of sync? For instance, the old primary sent logs data to the
standby and crashed prior to the COMMIT. That transaction would be on
the Standby as completed but not on the old primary. So the question
is...does this old primary need to have a db restore done? I noticed
an old discussion on HADR that seemed to imply you could just bring
this old primary up as standby now and it will automagically recover.
Can anyone briefly (but indepthly) discribe how you typically verify db
integrity and recovery actions.

Thanks!
2. I am not sure about this one, so someone else can answer.
Dec 5 '06 #2
will work. However, if the primary server goes down and the two servers are
in "disconnected" state, then you must do a takeover by force for it take
affect.
You said "MUST do a takeover by force". Does this mean you cannot stop
hadr on the
Standby and have it run as a standard? Or does this mean you would
never want to
stop hadr and have it run as a standard?

This is actually a third question but related to this one...If it is
the Standby that crashed
it is my understanding that the Primary would receive an sql error when
it times out
trying to communicate with the Standby that is no longer there. When
this occurs do
you want to issue a PRIMARY BY FORCE or do you stop HADR and let this
side run
as a STANDARD?

The reason these scenarios are not clear is because I was reviewing the
recommended
procedure to do a rolling upgrade and it shows the Primary being
changed from ACTIVE
PRIMARY to ACTIVE STANDARD, then the ACTIVE STANDBY changed to INACTIVE
STANDBY then finally INACTIVE STANDARD. I was curious if it is common
to move
to a non-HADR mode.

Dec 5 '06 #3
"shorti" <lb******@juno.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
You said "MUST do a takeover by force". Does this mean you cannot stop
hadr on the
Standby and have it run as a standard? Or does this mean you would
never want to
stop hadr and have it run as a standard?
To be honest, I am not sure because I can't imagine why you want to do that.
Just issue the takeover by force.

If you stop hadr on standby (without a takeover to primary), the standby
database (even if hadr is stopped) might still be in rollforward pending
state (but not 100% sure about this).
>
This is actually a third question but related to this one...If it is
the Standby that crashed
it is my understanding that the Primary would receive an sql error when
it times out
trying to communicate with the Standby that is no longer there. When
this occurs do
you want to issue a PRIMARY BY FORCE or do you stop HADR and let this
side run
as a STANDARD?
If the standby crashes, the servers are in disconnected state, and the
primary is still hadr primary (you don't need to do anything). Applications
do not get any SQL errors, and you just keep on going.
>
The reason these scenarios are not clear is because I was reviewing the
recommended
procedure to do a rolling upgrade and it shows the Primary being
changed from ACTIVE
PRIMARY to ACTIVE STANDARD, then the ACTIVE STANDBY changed to INACTIVE
STANDBY then finally INACTIVE STANDARD. I was curious if it is common
to move
to a non-HADR mode.
I have not tried the approach recommended above. Occasionally, I have done
"db2stop force" on the standby, then made changes to standby, then db2start,
then activate database, and then let it catch up with primary (assuming that
the catch up info is still available in the logs on the primary).

At any rate, the procedures for a rolling upgrade are not the same as for a
crash. If the standby crashes, you don't need to do anything until you try
and bring the standby back on-line in peer state.
Dec 5 '06 #4
1) If the primary suddenly crashes would you always want to switch the
standby to the primary by force...or would there be times when you
would want to make it a standard? (and why)
Well...what is the goal you're trying to achieve?

Expected response in an HADR environment is to failover (take over by
force on standby). Another possibly sensible response under some
circumstances would be to simply repair/restart the primary in-place,
i.e., normal recovery w/o performing failover.

Presumably the "it" to which you refer is the existing standby, and I'm
not able to quickly imagine a case where one would prefer to convert
the standby to standard (i.e., issue stop hadr) in response to failure
of the primary. A cleaner approach if you have some reason to seek
that end would be to issue takeover by force followed by stop hadr. As
long as the original primary hasn't rejoined the pair in the meanwhile,
this would have the same logical result but the takeover provides a
cleaner way to finish the "rollforward" activity of the standby. If
you issue the stop hadr first, you'll anyway need to issue a
rollforward..and stop command to bring the ex-standby out of
rollforward mode.

2) Let us say the primary suddenly crashes (someone pulled the power
cable) and you switch the standby to primary by force. Then you bring
the primary back up and issue a START as STANDBY. If you are in
near-sync mode, wouldnt there be a good chance the two databases could
be out of sync?
No, shouldn't be. If the primary was in Peer state and operating under
NEARSYNC mode when it failed, then the only way there could be loss of
consistency would be if the standby suffered a concurrent failure and
lost some log data that was in the standby's memory but not yet written
to the standby's log file on disk.

For instance, the old primary sent logs data to the
standby and crashed prior to the COMMIT. That transaction would be on
the Standby as completed but not on the old primary.
Nope. If the commit didn't make it to the standby, then the standby
would roll back the transaction on takeover.

So the question
is...does this old primary need to have a db restore done? I noticed
an old discussion on HADR that seemed to imply you could just bring
this old primary up as standby now and it will automagically recover.
Yes, with the caveats described above -- primary crashed in peer state,
standby didn't also fail concurrently. Btw, the latter is a NEARSYNC
requirement; in SYNC mode, the standby can also have failed.

Regards,
- Steve P.
--
Steve Pearson, IBM DB2 for Linux, UNIX, and Windows, IBM Software Group
DB2 "Portland" Development Team, IBM Beaverton Lab, Beaverton, OR, USA

Dec 14 '06 #5
The reason these scenarios are not clear is because I was reviewing the
recommended
procedure to do a rolling upgrade and it shows the Primary being
changed from ACTIVE
PRIMARY to ACTIVE STANDARD, then the ACTIVE STANDBY changed to INACTIVE
STANDBY then finally INACTIVE STANDARD. I was curious if it is common
to move
to a non-HADR mode.
We generally only recommend using STOP HADR when one no longer wants
the current incarnation of HADR. I don't believe our rolling upgrade
procedure recommends that and I'm curious what you're looking at.
Here's an example pointer to rolling upgrade in our docs:

http://publib.boulder.ibm.com/infoce...c/t0011766.htm

Regards,
- Steve P.
--
Steve Pearson, IBM DB2 for Linux, UNIX, and Windows, IBM Software Group
DB2 "Portland" Development Team, IBM Beaverton Lab, Beaverton, OR, USA

Dec 14 '06 #6
So the question
is...does this old primary need to have a db restore done? I noticed
an old discussion on HADR that seemed to imply you could just bring
this old primary up as standby now and it will automagically recover.

Yes, with the caveats described above -- primary crashed in peer state,
standby didn't also fail concurrently. Btw, the latter is a NEARSYNC
requirement; in SYNC mode, the standby can also have failed.
Uh, to clarify, my "yes" is an affirmation of the discussion implying
that the old primary could be reintegrated as new standby by issuing
"start hadr .. as standby" and would automatically resynchronize. That
is, under the described conditions, a restore would *not* be required.

Regards,
- Steve P.
--
Steve Pearson, IBM DB2 for Linux, UNIX, and Windows, IBM Software Group
DB2 "Portland" Development Team, IBM Beaverton Lab, Beaverton, OR, USA

Dec 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bruce M | last post by:
Is there a way to run the db2-generated HADR-create script outside of DB2CC beyond the obvious? My DB2CC generates the HADR script and then abends...
4
by: db2group88 | last post by:
we are using db2 udb v8.2 on windows. all our tables are created with not logged initially property, So if i want to activate HADR (high...
1
by: bwmiller16 | last post by:
Folks - Linux RH3, UDB 8.2 FP9. I've got two tiny test boxes that I'm setting up to get a simple HADR configuration built. When I start the...
13
by: m0002a | last post by:
I am trying to determine whether LOB's are replciated using HADR. The following documentation from the on-line manuals...
6
by: m0002a | last post by:
I have sucessfully set up an HADR pair of databases. Everthing works fine for the primary and secondary HADR databases, and manual takeover works...
16
by: gumby | last post by:
I'm having trouble getting HADR to work with the sample databases on two HS20 xSeries blades, Red Hat ES4 up3, DB2 8.2.4, getting the following...
8
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration...
6
by: shorti | last post by:
db2 8.1 fix pack 12 on AIX 5.3 This is a newly configured HADR machine. The HADR was up and running. I was 'playing' around some on the standby...
1
by: agentlease | last post by:
Hi, Testing the above without TSA or HA, just plain HADR performing manual db2 TAKEOVER HADR ......................... etc. I am testing...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.