Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to backup DB2 archive log files !! Please advice

Status
Not open for further replies.

polani

Instructor
Jun 4, 2003
159
CA
Hi guys!!

Guys!!

I am completely new to DB2 database adminsitration as i came from Progress DBA background ....

Here i have Five DB2 instances running on different AIX servers. Solution also comprised of TSM and my earlier DB2 DBA was taking so called " Online Db2 backup " using tsm.

I reviewed the info on web and found that userexit should be ON , if you want to take backups of archive log files to TSM. In our case, following are DB2 parameters:
--------------------------------------------------------------
Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00002/SQLOGDIR/
Overflow log path (OVERFLOWLOGPATH) =
Mirror log path (MIRRORLOGPATH) =
First active log file = S0000783.LOG
Block log on disk full (BLK_LOG_DSK_FUL) = NO
Percent of max active log space by transaction(MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0

Group commit count (MINCOMMIT) = 1
Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF

Auto restart enabled (AUTORESTART) = ON
Index re-creation time (INDEXREC) = SYSTEM (RESTART)
Default number of loadrec sessions (DFT_LOADREC_SES) = 1
Number of database backups to retain (NUM_DB_BACKUPS) = 10
Recovery history retention (days) (REC_HIS_RETENTN) = 366

TSM management class (TSM_MGMTCLASS) = db2mgtclass
TSM node name (TSM_NODENAME) = asd_node1
TSM owner (TSM_OWNER) =
TSM password (TSM_PASSWORD) = *****

------------------------------------------------------------------

I have also checked in TSM config and found db2mgtclass is pointing to one tape storage pool in TSM Server.


Now it seems from above configuration , that userexit is off so it means that earlier they are just taking online backups of Db2 database ( but not backing up archive log files to TSM which are very important for DB recovery.. Please correct me if i am wrong in understanding ....)

SO What should be done now to backup archive log files also to tapes.. I am not interested in using userexit & TSM integration as it will require TSM advance skills which i dont have!!!

Can i write a shell script on Unix which simply moves new archive log files from production Server to another server automatically as new archive files are created ( from where it is backed up to TSM or to some other tape drive )???? please advice

This script can be run on every let's say two minutes interval on Production Server!!

I appreciate all u experienced guys inputs


Thanks in Advance


Polani

Here comes polani Once again!!!

P690 Certified Specailist
HACMP & AIX Certified Specailist
AIX & HACCMP Instructor
 
Hi Guys

I am waiting for any body help me on this query...

I appreciate , if any one could help me out with his DB2 experience.


Regards

Polani

Here comes polani Once again!!!

P690 Certified Specailist
HACMP & AIX Certified Specailist
AIX & HACCMP Instructor
 
It depends on which version of db2 you are running. With 8.1, the USEREXIT parameter became irrelevant for TSM a couple of releases ago. Our "oldest" systems are at FP7 and they don't need it. I think the change came some time after FP4a.

Hope this helps.

ChrisW
 
Hi

My DB2 version is 8.1.3

Kindly tell me whether it is possible to check whether DB2 logs are also being backuped to tsm or not


I will appreciate your hekp and support.

Polani

Here comes polani Once again!!!

P690 Certified Specailist
HACMP & AIX Certified Specailist
AIX & HACCMP Instructor
 

DATABASE SERVER:-
You can write a smiple script like below for taking the backup of log files using TSM.

#!/usr/bin/ksh

db2 connect to <databasename>
db2 get db cfg |grep 'Path to log files'|awk '{print $6}' >/tmp/logpath
LOGPATH=`cat /tmp/logpath`
dsmc arch $LOGPATH -subdir=yes >/tmp/tsmlogbkp.log

TSM SERVER:-
You can create a new TSM schedule to call this script from TSM schedular.

Hope this helps.



aixnag
IBM Certified Specialist - P-series AIX 5L Administration
IBM Certified Specialist - AIX V4 HACMP
IBM eServer Certified Specialist – p690 Technical Support
IBM Certified Solutions Expert - DB2 UDB V7.1 Database Administration for Unix, Linux, Windows and OS/2
 
Hi aixnag!

Thanks for ur help.

Infact taking archive from TSM may be one of the possible solution....but first thing which i want to check whether my DB2 log files are already being backed up to TSM or not.

Which means
that when i run

db2 "backup db qaldb user db2inst using db2inst online use tsm "

is this command only taking backups of database or also DB2 Log files ....

If log files are already being backed up then i have to not to worry about OS solutions

This is my first query!!

Kindly guide me!!

Regards

Polani


Here comes polani Once again!!!

P690 Certified Specailist
HACMP & AIX Certified Specailist
AIX & HACCMP Instructor
 
Polani,

db2 "backup db qaldb user db2inst using db2inst online use tsm "

The above command takes backup of database only.

For taking log files backup, you can follow steps which i have mentioned in previous post

aixnag
IBM Certified Specialist - P-series AIX 5L Administration
IBM Certified Specialist - AIX V4 HACMP
IBM eServer Certified Specialist – p690 Technical Support
IBM Certified Solutions Expert - DB2 UDB V7.1 Database Administration for Unix, Linux, Windows and OS/2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top