473,739 Members | 8,690 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 5523

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
5054
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 standby). We created our tables and started importing thousands of rows into on the primary-side.
4
4647
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 - the tablespace is backed up on the primary system - tables are created in the new tablespace and data is inserted (and a couple of logs are archived) - Takeover is done by the standby
16
21795
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 = "7" - The primary database failed to establish a connection to its standby database within the HADR timeout interval. What things should I check besides the remote host and remote service parameters on the standby database, which seem to be...
6
21952
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 down hill from there. Though the Standby machine seemed to know it was a standby it would not connect to the primary. I could not even do a db2 get snapshot to view the hadr status on the machine. I was wanting to do a few HADR tests before I...
3
6285
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 database conection is not permitted on standby database. USEREXIT, I don't know whether it can run on standby database or
0
1261
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 midnight on the primary database and the log files generated are not reflected on the standby server. Secondly, How does the log shipping on db2 works. Is it done per transaction and stored in memory or the standby machine get the log changes from...
0
1277
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, DB2 primary archives its logs to FAILARCHPATH as expected. Now the HADR Standby goes down. While the standby is unavailable the primary continues work and archives some log files to FAILARCHPATH
0
1897
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 again (this should also happen if DB2 is recycled with files in FAILPATH. We have recently found a bug where files are left in the failpath and never moved to the archive location. So this is a known problem.
1
3146
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 HADR_SYNCMODE = SYNC. A quick question, say the primary and standby database servers are in PEER state and the primary database server suddenly crashes through a
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6754
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3280
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.