If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Anyone using "log shipping" method of HA?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-06-05, 19:01
tmullins tmullins is offline
Registered User
 
Join Date: Aug 2003
Posts: 68
Anyone using "log shipping" method of HA?

I want to implement "log shipping" method as a hot standby. This is not for high availability, but more for disaster recovery.

Has anyone set this up? What method are you using to transfer the logs over? Any help with this is much appreciated.




-terrence
Reply With Quote
  #2 (permalink)  
Old 01-08-05, 01:19
chavadb2 chavadb2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 138
We currenly use this for our DR. What we do is, use userexit program to transfer logs from production to tsm. At the DR side we run a script to extract and apply the logs from tsm every 2 hours. The dr is always in rollforward mode. Both DR and Prod should point to same tsm server. This is what you are looking for?
Reply With Quote
  #3 (permalink)  
Old 01-10-05, 18:34
tmullins tmullins is offline
Registered User
 
Join Date: Aug 2003
Posts: 68
Yes - I'm looking for something similar to this. Only, I want the logs transfered and to the bkup server and applied as soon as they're completed.

Can the userexit program be a unix shell script? or a perl script?
Reply With Quote
  #4 (permalink)  
Old 01-11-05, 06:21
msundaram msundaram is offline
Registered User
 
Join Date: Jun 2003
Location: Chennai
Posts: 26
logshipping using shell script

We had the similar kind of environment. We have archive directory in primary db system and retrieve directory in DR db system. shell script will move the files from archive direvtory to retrieve directory. User exit program running on the DR site will rollforward to end of logs without complete.

HOpe it helps you.
__________________
MS
Reply With Quote
  #5 (permalink)  
Old 01-11-05, 11:50
chavadb2 chavadb2 is offline
Registered User
 
Join Date: Aug 2004
Posts: 138
userexit comes with IBM samples.here are the steps u need to follow

MAkesure you have tsm configured first..then
1. cp sqllib/samples/c/db2uext2.ctsm to a work directory and call it db2uext2.c
2. chmod 750 db2uext2.c
3. vi db2uext2.c and change the following lines:
from: #define AUDIT_ERROR_PATH "/u/" /* path must end with a slash */
to: #define AUDIT_ERROR_PATH "Whatever U need" /* path must end with a slash */


5. after saving that file in step 4, run the following at the command line:
if AIX: cc_r -o db2uext2 db2uext2.c /usr/tivoli/tsm/client/api/bin/libApiDS.a -I/usr/tivoli/tsm/client/api/bin/sample

if Sun: /opt/SUNWspro/bin/cc -o db2uext2 db2uext2.c /opt/tivoli/tsm/client/api/bin/libApiDS.so -I /opt/tivoli/tsm/client/api/bin/sample

5. move the result file db2uext2 to the sqllib/adm directory.

6. The above steps complile the user exit program for tsm. It requires that you have a c compiler installed on your unix lpar/domain.

7. Set the following two db cfg parameters:
update db cfg for x using LOGRETAIN RECOVERY
update db cfg for x using USEREXIT ON
Reply With Quote
  #6 (permalink)  
Old 01-13-05, 19:17
tmullins tmullins is offline
Registered User
 
Join Date: Aug 2003
Posts: 68
Quote:
Originally Posted by chavadb2
userexit comes with IBM samples.here are the steps u need to follow

MAkesure you have tsm configured first..then
1. cp sqllib/samples/c/db2uext2.ctsm to a work directory and call it db2uext2.c
2. chmod 750 db2uext2.c
3. vi db2uext2.c and change the following lines:
from: #define AUDIT_ERROR_PATH "/u/" /* path must end with a slash */
to: #define AUDIT_ERROR_PATH "Whatever U need" /* path must end with a slash */


5. after saving that file in step 4, run the following at the command line:
if AIX: cc_r -o db2uext2 db2uext2.c /usr/tivoli/tsm/client/api/bin/libApiDS.a -I/usr/tivoli/tsm/client/api/bin/sample

if Sun: /opt/SUNWspro/bin/cc -o db2uext2 db2uext2.c /opt/tivoli/tsm/client/api/bin/libApiDS.so -I /opt/tivoli/tsm/client/api/bin/sample

5. move the result file db2uext2 to the sqllib/adm directory.

6. The above steps complile the user exit program for tsm. It requires that you have a c compiler installed on your unix lpar/domain.

7. Set the following two db cfg parameters:
update db cfg for x using LOGRETAIN RECOVERY
update db cfg for x using USEREXIT ON


And therein lies the problem. I'm using version 8.1 for Linux, and we have no compiler on our production servers. Does the userexit program have to be a "c" program? Can it be a a shell script or perl script?

This is turning out to be more dificult the I imagined.
Reply With Quote
  #7 (permalink)  
Old 01-14-05, 13:24
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Do you intend to move to Version 8.2 (has loads of goodies) .. It is Fixpak 7a on Versioon 8.1 ... With 8.2 you do not need a userexit program ... Specify loagarchmeth1 as disk:/logarchdir1, then you will have your logs archived to the specified directory ...

Also, 8.2 comes with HADR which can be used for DR purposes ... It costs $$$, but easier to setup, test and more reliable ...

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On