473,503 Members | 13,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HADR and Archived Logs

Here is the situation....
We have Primary Server A linked to Standby Server B via HADR.

Primary Server A has recently installed LOGARCHMETH1 to archive logs
and a 2nd homegrown script that compresses the archived logs once in
the archive log directory.

Standby Server B has our old script that moves logs from active to
archive directories and then compresses them every 30 minutes.
The Problem....
Back on our old method of our home grown script moving active to
archive logs every 30 minutes, if we fell out fo sync for 2 hours
because of a network hiccup we could move any archived logs back to
the active log directory on the primary server. We would lightup HADR
and it would catch-up. This prevented us from taking an online backup,
SFTP'ing it over,restoring, and rolling forward HADR Logs.

With LOGARCHMETH1, this doesn't always work as LOGARCHMETH1 will re-
archive the logs too quickly. (i.e. I move over 5 logs, and 2 are read
over to the Standby server - but LOGARCHMETH1 archives off logs 3,4,5
before we complete).
Our Question ...
Because everything is in DB's hands - Log Archiving, HADR, etc.
Shouldn't DB2 be smart enough to know if the Standby HADR server is
trying to rollforward and we need archived Primary Server Logs - to go
to the Primary Archive directory?

Am I missing a setting?
Could it be because LOGARCHMETH1 is not set on the Standby server?
Am I asking too much fo DB2?
Any input would be appreciated.

May 2 '07 #1
4 5481

I had to read this a couple times and think I understand now, but
let's just check if that's so.

Problem restated: User performs additional manipulation of log files
after DB2 finishes archiving them (namely, compressing them). This
means that log files in the archive location are not directly usable
by DB2. When such files need to be retrieved for later use by DB2,
the user must intervene to decompress the files and return them to the
active log path, rather than allowing DB2 to retrieve the log files in
the normal way from the log archive. The user observes that after
decompressing some log files and copying the result to the active log
path, they disappear before they can be used by DB2.

Is that reasonably close?

Further questions: Given log files need decompressing when moved from
archive location to active log path, have you somehow prevented DB2
from retrieving log files from the archive on its own? The intended
design is for DB2 to retrieve log files upon need. I would expect
that it should try and do so, for example, when the HADR standby
requests log pages from the primary from such a log file, which it
should do in Remote Catchup state. For the compression to not cause
problems, you've either got to have hooked into the log retrieve step
of DB2 to do the decompression any time DB2 retrieves a log file, or
you've got to have avoided DB2 retrieving log files on its own.

As to the disappearing log files, likely they are not "re-archived" by
DB2, as DB2 would know they've already been archived. However, DB2
may have cleaned them up from the active log path due to it having the
impression that they are not needed there. This may be due to the
fact that you're placing the files in the active path outside DB2's
knowledge. Unless you've prevented DB2 from retrieving the log files
again later (when it actually wants to read from them), DB2 should go
ahead and re-retrieve those log files at that time. What happens
after the log files you've place disappear from the primary's active
log path? Is there some complaint later from HADR about a missing
log?

Regards,
- Steve P.
--
Steve Pearson, DB2 for Linux, UNIX, and Windows, IBM Software Group
"Portland" Development Team, IBM Beaverton Lab, Beaverton, OR, USA
May 2 '07 #2
On May 2, 1:57 pm, "Steve Pearson (news only)" <stevep...@my-deja.com>
wrote:
I had to read this a couple times and think I understand now, but
let's just check if that's so.

Problem restated: User performs additional manipulation of log files
after DB2 finishes archiving them (namely, compressing them). This
means that log files in the archive location are not directly usable
by DB2. When such files need to be retrieved for later use by DB2,
the user must intervene to decompress the files and return them to the
active log path, rather than allowing DB2 to retrieve the log files in
the normal way from the log archive. The user observes that after
decompressing some log files and copying the result to the active log
path, they disappear before they can be used by DB2.

Is that reasonably close?

Further questions: Given log files need decompressing when moved from
archive location to active log path, have you somehow prevented DB2
from retrieving log files from the archive on its own? The intended
design is for DB2 to retrieve log files upon need. I would expect
that it should try and do so, for example, when the HADR standby
requests log pages from the primary from such a log file, which it
should do in Remote Catchup state. For the compression to not cause
problems, you've either got to have hooked into the log retrieve step
of DB2 to do the decompression any time DB2 retrieves a log file, or
you've got to have avoided DB2 retrieving log files on its own.

As to the disappearing log files, likely they are not "re-archived" by
DB2, as DB2 would know they've already been archived. However, DB2
may have cleaned them up from the active log path due to it having the
impression that they are not needed there. This may be due to the
fact that you're placing the files in the active path outside DB2's
knowledge. Unless you've prevented DB2 from retrieving the log files
again later (when it actually wants to read from them), DB2 should go
ahead and re-retrieve those log files at that time. What happens
after the log files you've place disappear from the primary's active
log path? Is there some complaint later from HADR about a missing
log?

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

You are dead on in your assessment.
As for HADR, it does complain about not being able to read logs (or
pages) I can't remember and unfortunately don't have a fresh error log
(I will look though). I assumed this meant that the log was not in the
active log directory - but it may mean that it couldn't read the
compressed logs in the archived log directory.

Now that I confirmed your interpritation is correct, any advice?

Thanks in advance.

-Mike

May 3 '07 #3
Without a detailed look at your situation I can't say for sure, but
what may have happened is that DB2 did retrieve the compressed log
files but then didn't like them. You may want to engage IBM support
for a closer examination of your situation.

If I were to consider post-processing log files like this, I'd also
want to ensure that when DB2 requested them that the files were
transformed back the way DB2 expects them. I'd rather not require
some human intervention to convert back log files and place them in
the proper path, as that seems less easy from the administration
perspective and more error prone.

One way to go would be to use a user exit. Set LOGARCHMETH1 to
USEREXIT instead of DISK (assume this is your current), and define a
user exit program that performs the two steps you need: copy+compress
on the archiving side, and decompress+copy on the retrieval side.
Some documentation is here:
http://publib.boulder.ibm.com/infoce...c/r0000235.htm
and fairly complete sample/template user exit programs ship with DB2.
The disk sample may be very close to what you'd need; comments inside
it suggest how to customize/build/install for your environment, and
adding your compression/decompression steps to it may be about the
only other thing you'd need to do.

Another way may be to use some built-in capability of TSM or a VENDOR
archiving facility that may compress/decompress for you when you store/
retrieve using it. The latter is only my speculation; I don't know
what all may be available there, but wouldn't be surprised if some
storage facilities could do that. Of course, that may not be
something you have on hand or can easily add.

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

May 3 '07 #4
Hmmm, looks like you were right - same answer from IBM when I opened a
PMR.
Thanks for the advice. It was very much appreciated.

-Mike

May 3 '07 #5

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

Similar topics

2
5027
by: bwmiller16 | last post by:
Folks - OpSys: RH Linux, AS3 DB: UDB 8.2.0 (FP7 Stinger) HW: 2 X-series We setup a HADR pair and they went into PEER state (after we backed-up the DB on primary and restored the DB on the...
4
4625
by: Joachim Klassen | last post by:
DB2 V8.2 FP10 on Windows I tested the following HADR scenario: - a new tablespace on a new filesytem is created on the primary System - the replay on standby fails because of lacking permissions...
16
21692
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 error. SQL1768N Unable to start HADR. Reason code...
6
21815
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 and did a db2 deactivate and things sort of went...
3
6250
by: Laurence | last post by:
Hi folks, How to remove the transaction logs which are out of date in HADR environment? DB2 command PRUNE, it can only run on primary database but cannot run on standby database. Because the...
0
1247
by: darsie | last post by:
Hi guys, I need help on this logging topic on HADR. I got a db2 v 8.2 running on two servers, which are on HADR. Firstly, I am just wondering how come db2 generates lots of logs around...
0
1268
by: Joachim Klassen | last post by:
Hi all, Platform DB2 V9.1 FP3 on AIX V5.3, HADR is configured and running. LOGARCHMETH1 is TSM , FAILARCHPATH is set to a local filesystem. Szenario: TSM Server is unavailable for some time,...
0
1881
by: Steve Pearson (news only) | last post by:
On Mar 31, 12:05 am, Joachim Klassen <JoKlas...@email.comwrote: An answer from elsewhere in DB2 development: DB2 is supposed to move files from the FAILPATH to TSM when TSM is available...
1
3134
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 without the PEER_WINDOW i.e. set to 0 and...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7296
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
405
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.