cancel
Showing results for 
Search instead for 
Did you mean: 

Archive log for DB2

ronny_nch
Level 3

Hi Guys,

Anyone can guide me on how to manage DB2 archive log with Netbackup? I need to manage the log because they grow alot. Can we configure in netbackup to remove the log once the backup successfully completed?

 

rgds,

Ronny

8 REPLIES 8

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Hi

 

Check page 51 of this guide http://www.symantec.com/docs/TECH52807

 

I've assumed you're running 6.5 which is not too new, and not too old. If you're not, please look for the appropriate DB2 guide on the symantec support site.

ronny_nch
Level 3

Hi Riaan,

 

Thanks for your reply.

I read the documents. It seems that I need to create another directory for the logs to be copied to. Is this necessary since the backup is to the tape.

 

rgds,

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Hi,

 

Sorry I'm not too familiar with DB2 so I've just been reading up on it now. Are you currently using the vendor or user_exit method, or how is the backups configured? Just trying to wrap my head around these concepts.

 

It seems the arcdir can be the same as retdir, but for testing I would keep them seperate, just to ensure you dont delete / archive active logs.

 

And what version of DB2 do you have?

ronny_nch
Level 3

I am not so sure whether I am using Vendor or User Exit method, since I am not the one who implement this. However, in netbackup there's a separate policy for the archive log backup and the backup selection is set to the archive log directory, instead of a script.

 

The DB version is 9.5.

 

Any idea?

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Can you post the contents of your db2.conf? It should be in the $DB2_Instance_Home folder.

ronny_nch
Level 3

Hi,

Below is the db2.conf.

bash-3.00# more db2.conf
# $Header: db2.conf,v 1.5 2007/04/12 14:05:29 $
#
# ***************************************************************************
# * $Copyright: Copyright 1993 - 2008 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 bwp
OBJECTTYPE DATABASE
POLICY SAP-PRD-BIS_db2_daily
SCHEDULE bwp-Application-Backup
ENDOPER

#
# 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-NT" (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 SAMPLE
##OBJECTTYPE ARCHIVE
##POLICY DB2_Log_Policy
##SCHEDULE User
##ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
##ENDOPER


# --------------------------------------------------------------
# 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 bwp
OBJECTTYPE ARCHIVE
POLICY SAP-PRD-BIS_db2_daily
SCHEDULE bwp-db2_archivelog-backup
ENDOPER

RiaanBadenhorst
Level 6
Partner    VIP    Accredited Certified

Hi,

 

Looks like you might be using the VENDOR method, you can check it (LOGARCHMETH1) with this command get db cfg for <db-alias> (i found that on the net, so don't shout if it doesn't work :)

 

Then i also found this, which sorta explains a bit more on how logging works in DB2 and what to LOGARCHMETH1 settings does.

 

I would check the setting and then decide if you want to use the user_exit method

levy
Level 3

Hi !

How to restore only one/multiple archivelogs - hot backup DB2?

I have the same problem on this user:

https://www-secure.symantec.com/connect/forums/nb-6-db2-restore-using-logarchmeth1vendor

 

thx for all