SAP DB2 Archive Backup

How can we backup the archive logs of SAP DB2 to Netbackup.

I have searched a lot but couldnt find much in this regard.

We have configured the db2.conf with the policy and Schedule details and we are using the Vendor Method to backup DB2.

The database backups are running fine but in db2diag.log there is a constant message of log backup failure.

Except from changing the db2.conf and mentioning the LOGARCHMETH1 with VENDOR:/usr/openv/netbackup/bin/nbdb2.sl64.

Do i need to do something else for the archive log to backup automatically to Netbackup.

I have done this in TSM and Commvault and we generally update one more parameter ofVENDOROPT for the archive to automatically get transfered to the backup storage.

 

 

Tags (4)
3 Replies
Highlighted

Re: SAP DB2 Archive Backup

Have you checked the Version 8 documentation? Specifically the DB2 guide? There is information in there about user-directed backups for logs.

https://www.veritas.com/support/en_US/article.000116412

Highlighted

Re: SAP DB2 Archive Backup

I did check it...but isnt userexit prograrm used to do archive log backups outside the knowledge of DB2.

Hence can we do a point in time restore at once or do we need to restore once databsse and then the logs.

Highlighted

Re: SAP DB2 Archive Backup

Hi @67532,

I was searching in my notes and I found an old document about configure db2+sap.

So I needed to translate from portuguese to english, so sorry for some mistake...

I hope can help you.

Did you already check these questions below?

Is the S.O supported according NetBackup Software Compatibility List?
Is the DB2 supported according NetBackup Database and Application Agent Compatibility?
Is the reverse IP added on DNS server? If not add it and clean the NBU host cache.

###################### Clening Host Cache

Unix
install_path/usr/openv/netbackup/bin)# ./bpclntcmd -clear_host_cache

Windows
install_path\Program Files\Veritas\NetBackup\bin>bpclntcmd -clear_host_cache

####################### Create db2.conf file

In this step you will need to configure db2.conf on the client with DB2, to set DB2 variables and policies for backup. The DBA needs to provide the Home Directory of the DB2 instance. This is usually the DB2 user's home. The db2.conf file created will be located in the DB2 user home directory

A) Running the script db2_config

root@server(/usr/openv/netbackup/bin)# ./db2_config

Please specify the DB2 instance home path name:
/db2/db2xpto

Do you have other DB2 instances? (y/n) [n]

Linking /db2/db2xpto/sqllib/adm/db2uext2 to /usr/openv/netbackup/bin/db2uext2.64.

Copying /usr/openv/netbackup/ext/db_ext/db2/scripts/db2.conf to /db2/db2xpto/db2.conf.

root@server(/usr/openv/netbackup/bin)#

######################Steps to configure Archive Logs

A) Configure backup of bank archives logs in OBJECTTYPE ARCHIVE - (XPTO in this case);

B) Configure POLICY parameter for database archive (In this case saperpxpto_DB2_LOG);

C) Configure SCHEDULE parameter (In this case Default-Application-Backup).

i.e

# $Header: db2.conf,v 1.7 2014/07/09 14:32:14 $
#
# ***************************************************************************
# * Copyright 2014 Symantec Corporation, All Rights Reserved
# ***************************************************************************
#
# The following settings are used by NetBackup to backup/restore a DB2 database.
#
# Reminders:
# 1) The specified policy must have a type of "DB2".
# 2) The specified schedule must be defined for this policy.
# 3) The DB2 database host must be entered as a client for this policy.
#
#DATABASE XPTO
#OBJECTTYPE DATABASE
#POLICY saperpxpto_ONLINE_DB2
#SCHEDULE Default-Application-Backup
#ENDOPER
#
Backup/Restore DB2 Veritas Confidential Página 15 de 29
Backup/Restore DB2
# The following settings are used by NetBackup to backup/restore DB2 log files.
#
Reminders:
# 1) DB2 transcation logs can be backed up/restored using either
# (a) DB2 User Exit Program
# The specified policy must have a type of "Standard" (for UNIX DB2
# host) or "MS-Windows" (for Windows DB2 host).
#
# (b) LOGARCHMETH1 can be configured to use NetBackup.
# (When LOGARCHMETH1 = "VENDOR:NetBackup for DB2 agent")
# This option is possible only for versions 8.2 and above.
# The specified policy must have a type of DB2.
#
# 2) The specified schedule must be defined for this policy.
# 3) The DB2 database host must be entered as a client for this policy.
#
# ---------------------
# DB2 User Exit Program
# ---------------------
# If DB2 log file archiving is enabled (DB2 USEREXIT ON), DB2 will invoke
# the NetBackup user-exit program to backup & restore DB2 archive log files.
# Using ARCFUNC SAVE causes log files to be archived to NetBackup storage,
# as specified by the policy storage-unit setting.
# Using ARCFUNC COPY causes log files to be archived to a disk directory.
# Use ARCDIR to specify the destination directory for log file backup.
# Use RETDIR to specify the source directory for log file restore.
#
#DATABASE XPTO
#OBJECTTYPE ARCHIVE
#POLICY saperpxpto_DB2_LOG
#SCHEDULE Default-Application-Backup
#ARCFUNC SAVE
##ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
#ENDOPER
Backup/Restore DB2 Veritas Confidential Página 16 de 29
Backup/Restore DB2
# --------------------------------------------------------------
# LOGARCHMETH1 = "VENDOR.." parameter for versions 8.2 and above
# Policy is of type DB2.
# --------------------------------------------------------------
#
# Comment the above DB2 User Exit section when using LOGARCHMETH1 = "VENDOR.."
#
DATABASE XPTO
OBJECTTYPE ARCHIVE
POLICY saperpxpto_DB2_LOG
SCHEDULE Default-Application-Backup
ENDOPER

####################### Adjust Variable LOGARCHMETH1 (DB2)

Ask your DB2 administrator, the following change in DB2 configuration:

A)- Change LOGARCHMETH1 variable in DB2

UPDATE DB CFG FOR MYDB USING LOGARCHMETH1 VENDOR:[NetBackup library filename]
The following string is used for DB2 in AIX VENDOR:/usr/openv/netbackup/bin/nbdb2.sl64

####################### Adjust NetBackup Settings

From Attributes Tab

- Check if policy Type setting is DB2;

 

Regards,

 

Thiago