How to backup DB2

randyman

ADSM.ORG Member
Joined
Jul 26, 2006
Messages
168
Reaction score
1
Points
0
Location
Louisville, KY
Website
Visit site
TSM Server is windows 2003 running TSM 5.5.2. Have a windows client with DB2 database. How do I backup the DB2 databases?
 
I don't know much at all DB2...I'm struggling with this...can anyone give me a little more guidance. Am I only installing the baclient? Is there no TDP to install and configure?
 
What am I missing here? I've followed the instructions in the doc. How do you configure the db2 for a nightly backup? Do I need a seperate TSM node, scheduler service, schedule to kick off a command etc?
 
Hi,

when your DB2 is configured, you can create a script containing something like:

db2 backup db <DBNAME> use tsm

Then define a schedule with action type "command" and use the script as an object.

Harry
 
Does anyone have the script/command file that they use to backup their db2 dabases that they would like to share? Much thanks!

I'm struggling to get it to work. here's what I've come up with so far. We use circular logging.

set logfile="C:\program files\tivoli\tsm\api\db2full.log"

echo ==================================================== >> %logfile%
echo DB2 Server Name: SETL200_DB2 >> %logfile%
echo %date% %time% >> %logfile%

echo ======= Performing online backup of databases ======= >> %logfile%

REM # xmeta DB backup
echo ======= xmeta DB backup =======>> %logfile%
db2 backup database xmeta use tsm >> %logfile%

REM # iadb backup
echo ======= iadb BACKUP =======>> %logfile%
db2 backup database iadb use tsm >> %logfile%

REM # Perform TSM backup of DB2 transaction logs

REM xmeta Transaction Logs
echo ======= Transaction Log Backup for xmeta ======= >> %logfile%
echo ======= c:\progra~1\tivoli\tsm\baclient\dsmc incr D:\DB2\NODE0000\SQL00001\SQLOGDIR\ >> %logfile%
c:\progra~1\tivoli\tsm\baclient\dsmc incr D:\DB2\NODE0000\SQL00001\SQLOGDIR\ >> %logfile%

REM iadb Transaction Logs
echo ======= Transaction Log Backup for iadb ======= >> %logfile%
echo ======= c:\progra~1\tivoli\tsm\baclient\dsmc incr D:\DB2\NODE0000\SQL00002\SQLOGDIR\ >> %logfile%
c:\progra~1\tivoli\tsm\baclient\dsmc incr D:\DB2\NODE0000\SQL00002\SQLOGDIR\ >> %logfile%

REM # Delete any backups older than 14 days
echo ======= Delete any backups older than 14 days >> %logfile%
db2adutl delete full older than 14 days without prompting database xmeta >> %logfile%
db2adutl delete full older than 14 days without prompting database iadb >> %logfile%

echo ======= End of process =======>> %logfile%
 
To get it "working", I use that losely, I added the "db2 force application all" at the begining of the above script to force all applications off the databases.

Here's my issues now:

1. When I try to backup the transaction logs using the script I get the following error: ANS0101E Unable to open English message repository 'dscenu.txt'. - I have put the file in the api directory and there is one in the baclient directory....????

2. I get this warning in my log:
Warning: There are no file spaces created by DB2 on the TSM server
Warning: No DB2 backup images found in TSM for any alias.
- When checking the backup using the db2util query command, I get the same thing. ????

Any help would be appreciated.
 
for the error, try to cd into directory before runing command, inside script.
For db2 backup, to have this script work, you need to put your databases in archive logging mode, or you need to quiesce database before backup, and do "offline" backup.
I am not very sure what is the point of backing up open transaction log files, but maybe this is ok, I do not know.
What else you can do, if your database is in archive log mode, you can point your archive logs to have primary location going directly to TSM.
 
did you set the password to the same as node password with dsmapipw ?
usually I update db cfg for db and set ARCHLOGMETHOD1 to TSM, this puts DB into rollforward mode, then stop db2,do a full offline backup, start db2 and online backups are now possible.
Just get it working manually prior to your script ;
become db2 admin user
db2
backup db mydb online use tsm include logs

(also your logs will archive into TSM automatically when the log dirs get a certain number of logs written)
 
Back
Top