DB2 9.5 Backups to EMC Networker

by bitznbitez

Working with third party backup solutions in db2 can be a bit of a challenge at times.   About a year ago I setup a EMC Networker backup environment for DB2 9.5 running on Redhat.

For this example I will call the database ‘quotes’.   Names have been changed to protect the innocent and all that.

First you need to work with your backup administrator to get access to the EMC Networker backup environment and to get the xbsa_config file created.   In this case the xbsa_config file was created in the top level of the db2 instance owner directory, but it could be anywhere.   The parts of the xbsa_config file the dba supplies are as follows.

DB2_VENDOR_LIB_PATH=/usr/lib/libnsrdb2.so
DB2_USR=db2inst1
DB2_NODE_NAME=blackwater_luw
DB2_ALIAS=quotes
DB2INSTANCE=db2inst1
INSTHOME=/home/db2inst1
DB2_APPLY_NW_LEVELS=TRUE
DB2_OPTIONS=DB2BACKUP_ONLINE,DB2BACKUP_DB
DB2_NUM_BUFFERS=4
DB2_SESSIONS=2
DB2_PARALLELISM=2
DB2_PSWD=********

The DB2_PSWD is actually displayed as an encrypted value I have used *** to obfusicate.  It is generated with the nsrdb2sv -p password -f filename command, per the documentation though I never ran that command, it was done by our backup administrator.   You only need the password if you are having the backup environment start the backups for you.  If you initiate your backups from the db2 side this value is not used, per the documentation.

At this point you should validate that you can in fact backup to Networker.   It makes sense to test that now before turning on log backups, even though you will need to do another backup again after you turn on log backups.   Nothing worse than being in a backup pending situation if your networker config isn’t working.

db2 "backup db quotes load /usr/lib/libnsrdb2.so options @/home/db2inst1/xbsa_config compress"

Assuming that worked then we turn on log file archiving as follows

db2 "update db cfg for quotes using LOGARCHMETH1 'VENDOR:/usr/lib/libnsrdb2.so'"
db2 "update db cfg for quotes using LOGARCHOPT1 @/home/db2inst1/xbsa_config"

Now rerun a offline backup again….

db2 "backup db quotes load /usr/lib/libnsrdb2.so options @/home/db2inst1/xbsa_config compress"

If that works generate some traffic so log files get backed up.   Validate that this is successful.   Then test the restore and rollforward….

db2 "restore db quotes load /usr/lib/libnsrdb2.so options @/home/db2inst1/xbsa_config_sam taken at <timestamp of backup here> without prompting"
db2 "rollforward database quote to <timestamp to roll forward to here> using local time and stop;"

If all went well then you are now using EMC Networker.  If it didn’t and you get errors like SQL2025, 2062, 2071, 2079 etc you will need to consult the EMC Networker Module for DB2 Administration Guide which has some explination.   These are errors from the backup software passed through the database.   Additionally changing the DEBUG level of various variables in the xbsa_config file will give you additional info but be warned 9 is the highest and can generate an enormous amount of data.   Here is an example.

NSR_DB2SV_DEBUG_LEVEL=9
NSR_DB2SV_DEBUG_FILE=/home/db2inst1/nsrdb2debug.log
NSR_LIBNSRDB2_DEBUG_LEVEL=9
NSR_LIBNSRDB2_DEBUG_FILE=/home/db2inst1/nsrdebug.log
NSR_DB2UEXT2_DEBUG_LEVEL=9
NSR_DB2UEXT2_DEBUG_FILE=/home/db2inst1/nsrdb2uext2.log
NSR_DEBUG_FILE=/home/db2inst1/nsrdebug1.log

If you still cannot figure it out between yourself and your backup administrator you will likely need to engage support from the EMC side and/or the IBM DB2 side.

Best of luck!

Advertisements