NetBackup102 AdminGuide DB2
NetBackup102 AdminGuide DB2
NetBackup102 AdminGuide DB2
Administrator's Guide
Release 10.2
NetBackup™ for DB2 Administrator's Guide
Last updated: 2023-03-16
Legal Notice
Copyright © 2023 Veritas Technologies LLC. All rights reserved.
Veritas, the Veritas Logo, Veritas Alta, and NetBackup are trademarks or registered trademarks
of Veritas Technologies LLC or its affiliates in the U.S. and other countries. Other names may
be trademarks of their respective owners.
This product may contain third-party software for which Veritas is required to provide attribution
to the third party (“Third-party Programs”). Some of the Third-party Programs are available
under open source or free software licenses. The License Agreement accompanying the
Software does not alter any rights or obligations you may have under those open source or
free software licenses. Refer to the Third-party Legal Notices document accompanying this
Veritas product or available at:
https://www.veritas.com/about/legal/license-agreements
The product described in this document is distributed under licenses restricting its use, copying,
distribution, and decompilation/reverse engineering. No part of this document may be
reproduced in any form by any means without prior written authorization of Veritas Technologies
LLC and its licensors, if any.
The Licensed Software and Documentation are deemed to be commercial computer software
as defined in FAR 12.212 and subject to restricted rights as defined in FAR Section 52.227-19
"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, et seq.
"Commercial Computer Software and Commercial Computer Software Documentation," as
applicable, and any successor regulations, whether delivered by Veritas as on premises or
hosted services. Any use, modification, reproduction release, performance, display or disclosure
of the Licensed Software and Documentation by the U.S. Government shall be solely in
accordance with the terms of this Agreement.
http://www.veritas.com
Technical Support
Technical Support maintains support centers globally. All support services will be delivered
in accordance with your support agreement and the then-current enterprise technical support
policies. For information about our support offerings and how to contact Technical Support,
visit our website:
https://www.veritas.com/support
You can manage your Veritas account information at the following URL:
https://my.veritas.com
If you have questions regarding an existing support agreement, please email the support
agreement administration team for your region as follows:
Japan [email protected]
Documentation
Make sure that you have the current version of the documentation. Each document displays
the date of the last update on page 2. The latest documentation is available on the Veritas
website:
https://sort.veritas.com/documents
Documentation feedback
Your feedback is important to us. Suggest improvements or report errors or omissions to the
documentation. Include the document title, document version, chapter title, and section title
of the text on which you are reporting. Send feedback to:
You can also see documentation information or ask a question on the Veritas community site:
http://www.veritas.com/community/
https://sort.veritas.com/data/support/SORT_Data_Sheet.pdf
Contents
Feature Description
Media and device All the devices supported by Media Manager are available to
management NetBackup for DB2.
Scheduling facilities NetBackup scheduling facilities on the primary server can be used
to schedule automatic and unattended DB2 backups.
This feature also lets you choose the times when these operations
can occur. For example, to prevent interference with normal daytime
operations, you can schedule your database backups to occur only
at night.
Multiplexed backups NetBackup for DB2 lets you take advantage of NetBackup’s
and restores multiplexing capabilities. Multiplexing directs multiple data streams
to one backup device, thereby reducing the time necessary to
complete the operation.
Introduction to NetBackup for DB2 10
Features of NetBackup for DB2
Feature Description
Transparent DB2 and All backups and restores run simultaneously and transparently
regular file system without any action from the NetBackup administrator.
backup and restore
The database administrator can run database backup and restore
operations
operations through NetBackup. An administrator or any other
authorized user can use NetBackup to run database backups and
restores.
Sharing the same It is possible to share the same devices and media that is used for
storage units that are other backups or to give DB2 exclusive use of certain devices and
used for other file media. NetBackup for DB2 can use Media Manager, disk, and
backups Media Server Deduplication Pool (MSDP) storage units.
Centralized and From the NetBackup primary server, you can schedule database
networked backup backups or start them manually for any client. The DB2 databases
operations can also reside on hosts that are different from the devices on which
NetBackup stores the backups.
■ NetBackup web UI
A database administrator can also use the IBM DB2 control center
or command-line processor to start user-directed backup and restore
operations.
Parallel backup and NetBackup for DB2 supports the parallel backup and restore
restore operations capabilities of DB2. For example, this permits the user to run more
than one tape device at a time for a single DB2 backup or restore.
This usage can reduce the time necessary to complete the
operation.
Database delete Database delete requests are accepted and processed. When
requests accepted and NetBackup receives a delete image request, it searches the
processed NetBackup catalog. If the image is found and it is not on a legal
hold, the image is removed from the NetBackup catalog.
Introduction to NetBackup for DB2 11
NetBackup for DB2 overview
Network (TCP/IP)
NetBackup software:
– NetBackup master server
– NetBackup media server
(if the system is a media server)
Component Description
NBDB2 vendor I/O The DB2 BACKUP and RESTORE commands use the NBDB2 vendor
library I/O library to send data buffers between a DB2 database and
NetBackup.
On Windows: install_path\NetBackup\bin\nbdb2.dll
On UNIX: /usr/openv/netbackup/bin
Component Description
User exit program The NetBackup for DB2 user exit program, db2uext2, provides
one method for backing up and restoring the DB2 archive log files.
Use this method at the following times:
The user exit program backs up and restores the archive logs as
files. The file is called db2uext2.64. NetBackup for DB2 supports
this method for protecting the archive logs on all supported DB2
releases.
On Windows: %DB2_INSTANCE%\bin\db2uext2.exe
On UNIX: $DB2_INSTANCE/sqllib/adm/db2uext2.
Sample configuration The installation software installs the following sample files:
file (db2.conf) and
■ A sample configuration file (db2.conf file). The db2.conf file
script files
includes specifications for backups and restores, and it provides
information on policies and schedules. The NetBackup for DB2
library and user exit program use the information in this file.
■ Sample backup and restore scripts. NetBackup can invoke a
script to perform a scheduled backup or restore of a DB2
database. The scripts contain DB2 BACKUP or RESTORE
commands for use with NetBackup.
On Windows: install_path\NetBackup\dbext\db2\samples
On UNIX:
/usr/openv/netbackup/ext/db_ext/db2/scripts.
To use the sample files, copy the sample files to working directories
and modify them for your own use.
Introduction to NetBackup for DB2 14
NetBackup for DB2 overview
LOGARCHMETH1=LOGRETAIN LOGARCHMETH1=VENDORlibrary
LOGARCHMETH1=USEREXIT
USEREXIT=ON
USEREXIT=YES
LOGRETAIN=ON
LOGRETAIN=RECOVERY
When VENDOR is used, archive logs are backed up by means of the NetBackup for
DB2 vendor library. The full specification for this archive log method is as follows:
On Windows: LOGARCHMETH1=VENDOR:install_path\NetBackup\bin\nbdb2.dll
On UNIX: LOGARCHMETH1=VENDOR:/usr/openv/netbackup/bin/library
For library, specify an operating system-specific library.
See “About the NetBackup for DB2 components” on page 12.
Introduction to NetBackup for DB2 15
NetBackup for DB2 overview
When a user exit program is used, archive logs are backed up by means of the
NetBackup for DB2 user exit program. The DB2 syntax that defines the user exit
program includes the USEREXIT, LOGRETAIN, and LOGARCHMETH1 keywords that are
specified in a configuration parameter.
See “NetBackup for DB2 overview” on page 11.
See “Creating a db2.conf file (vendor method)” on page 50.
See “Configuring a policy to back up the archive logs” on page 43.
Chapter 2
Installing NetBackup for
DB2
This chapter includes the following topics:
Step 1 Verify the installation prerequisites. See “Verifying the operating system and platform
compatibility” on page 17.
http://www.netbackup.com/compatibility
Step 2 Verify that the primary server has a valid See “License for NetBackup for DB2” on page 19.
license for NetBackup for DB2 and any
NetBackup options or add-ons.
Step 3 Specify a log archive method. See “About log archiving” on page 19.
Step 4 (UNIX) specify the DB2 home path. See “Specifying the DB2 home path (UNIX)” on page 22.
Step 5 Add a new database instance. See “About adding new DB2 instances” on page 23.
server requirements
Note: To use NetBackup for DB2 with Snapshot Client, you must have a license
for NetBackup Snapshot Client.
Verify that the following requirements are met for the NetBackup server:
■ The NetBackup server software is installed and operational on the NetBackup
server.
See the NetBackup Installation Guide.
■ Make sure that you configure any backup media that the storage unit uses. The
number of media volumes that are required depends on several things:
■ The devices that are used and storage capacity of the media.
■ The sizes of the databases that you want to back up.
■ The amount of data that you want to archive.
■ The size of your backups.
■ The frequency of backups or archives.
■ The length of retention of the backup images.
See the NetBackup Administrator’s Guide, Volume I.
client requirements
Verify that the following requirements are met for the NetBackup clients:
■ The NetBackup client software is installed on the computer that has the
databases you want to back up.
If the database is clustered, you must use the same version of NetBackup on
each node in the cluster.
■ To use the new features that are included in NetBackup for DB2 in , you must
upgrade your NetBackup for DB2 clients to . The media server must use the
same version as the NetBackup for DB2 client or a higher version than the client.
Note: In a DB2 EEE environment, install the NetBackup client software on every
node and client that DB2 uses.
The following topics describe the archive methods and how to specify an archive
method in DB2.
See “Using the VENDOR archive method” on page 20.
See “Using the user exit archive method” on page 21.
The terms “VENDOR” and “user exit” describe the methods that DB2 supports for
log archiving. Ensure that you understand how the terms are used in this manual.
See “About NetBackup for DB2 terminology” on page 14.
See “Planning the installation of NetBackup for DB2 ” on page 16.
See “Verifying the operating system and platform compatibility” on page 17.
See “About the NetBackup for DB2 components” on page 12.
On UNIX: LOGARCHMETH1=VENDOR:/usr/openv/netbackup/bin/library
For the library name, refer to the following topic.
See “About the NetBackup for DB2 components” on page 12.
3 Verify your DB2 configuration to ensure that the appropriate log archiving
method for your site is enabled.
If necessary, edit your DB2 configuration specifications to specify the log
archiving method.
See “Using the user exit archive method” on page 21.
Installing NetBackup for DB2 21
About log archiving
4 Verify your DB2 configuration to ensure that the appropriate log archiving
method for your site is enabled.
If necessary, edit your DB2 configuration specifications to specify the log
archiving method.
See “Using the VENDOR archive method” on page 20.
See “NetBackup for DB2 overview” on page 11.
See “About NetBackup for DB2 terminology” on page 14.
See “About adding new DB2 instances” on page 23.
See “Using the VENDOR archive method” on page 20.
See “About log archiving” on page 19.
install_path\NetBackup\dbext\DB2\db2uext2.exe
DB2 expects the db2uext2 executable to reside in the DB2 installation location.
If you reinstall or move the DB2 installation, manually copy db2uext2.exe from
the NetBackup location into the DB2 location.
■ On UNIX, if you install a new DB2 instance after you install NetBackup, you
need to add this new instance to the NetBackup configuration. This action
ensures that all new DB2 instances are included in backup operations.
See “Specifying the DB2 home path (UNIX)” on page 22.
See “Using the user exit archive method” on page 21.
See “NetBackup for DB2 overview” on page 11.
See “About NetBackup for DB2 terminology” on page 14.
Chapter 3
Configuring NetBackup for
DB2
This chapter includes the following topics:
■ About backing up archive log files with the user exit program
Task Description
Configure a backup policy for a DB2 A backup policy for a database defines the backup
database criteria for a specific group of one or more clients.
To back up the database environment, you must
define at least one DB2 policy with the appropriate
schedules.
8 When you have added all the schedules, clients, and backup selections you
need, click OK.
Attribute Description
Policy type Determines the types of clients that can be backed up with the policy. For DB2 databases,
select the policy type DB2.
Keyword phrase For NetBackup for DB2, the Keyword phrase entry is ignored.
Snapshot Client and This group contains the options that enable backups with Snapshot Client.
Replication Director
See “NetBackup for DB2 with Snapshot Client features” on page 89.
schedule. A NetBackup client must be in at least one policy but can be in more than
one.
For a NetBackup for DB2 policy, clients you want to add must have the following
items installed or available:
■ DB2
■ NetBackup client or server
■ The backup or restore scripts
To add clients to a policy
1 Open the policy you want to edit or create a new policy.
To access the Policy dialog box, double-click the policy name in the Policies
list in the NetBackup web UI.
2 Click the Clients tab and click New.
3 Type the name of the client and select the hardware and operating system of
the client.
If DB2 is installed in a cluster, specify the virtual name of the DB2 server as
the client name.
Note: If you installed NetBackup on more than one node in the DB2 cluster,
you must perform additional configuration.
See “Reviewing the auto-discovered mappings in Host Management”
on page 38.
Note: Add the server names to the master server before you configure the server
list on the client.
Configuring NetBackup for DB2 29
About configuring a backup policy for DB2
Note: If you installed NetBackup on more than one node in the DB2 cluster,
you must perform additional configuration. You must approve each
validAuto-Discovered Mapping that NetBackup discovers in your environment.
See “Reviewing the auto-discovered mappings in Host Management”
on page 38.
See “About backing up archive log files with the user exit program” on page 41.
See “Configuring a policy to back up the archive logs” on page 43.
See “About backing up archive log files with the user exit program” on page 41.
See “NetBackup for DB2 backup types” on page 36.
See “Configuring the logon account for the NetBackup Client Service for NetBackup
for DB2 ” on page 59.
number_of_sessions The number of backup sessions between the backup server and
NetBackup on the client. Each separate session starts a new backup
job on the client.
Configuring NetBackup for DB2 31
About adding backup selections to a DB2 policy
number_of_policies The number of policies of any type that can back up this client at the
same time. This number can be greater than one. For example, a client
can be in two policies to back up two different databases. These backup
windows can overlap.
Note: Enter a large enough value for the Maximum jobs per client attribute to
meet the number of jobs that DB2 runs. You may need to experiment with different
values at your site.
Note: All scripts must be stored and run locally. One recommendation is that scripts
should not be world-writable. Scripts are not allowed to be run from network or
remote locations. Any script that is created and saved in the NetBackup db_ext
(UNIX) or dbext (Windows) location needs to be protected during a NetBackup
uninstall.
For more information about registering authorized locations and scripts, review the
knowledge base article:
Registering authorized locations used by a NetBackup database script-based policy
Configuring NetBackup for DB2 32
About adding backup selections to a DB2 policy
Add scripts to the backup selections list only if you want to set up a policy for
automatic backups. These scripts are run for manual backups and for automatic
schedules as specified under the Schedules tab. NetBackup runs the scripts in
the order that they appear in the backup selections list.
See “About NetBackup for DB2 shell scripts” on page 60.
See “Adding a script to the backup selections list in the NetBackup Administration
Console” on page 32.
Note: Be sure to specify the correct script name in the backup selections list to
prevent an error or a wrong operation.
4 In the Script box, type the full path name of a script on the client.
For example:
/backup_scripts/db/cold_backup.sh
C:\backup_scripts\db\cold_backup.cmd
Note: Be aware of what may happen if an automatic schedule invokes a script that
a user authored. NetBackup does not provide safeguards to prevent an automatic
backup schedule from running a restore or a recovery script.
Table 3-3 Example settings for a NetBackup for DB2 application backup
schedule
Retention 2 weeks
00:08:00 - 22:00:00
Table 3-4 Example settings for NetBackup for DB2 automatic backup
schedules
18:00:00 - 22:00:00
Property Description
Type of backup Specifies the type of backup that this schedule can control. The selection list shows only
the backup types that apply to the policy you want to configure.
Property Description
Schedule type You can schedule an automatic backup in one of the following ways:
■ Frequency
Frequency specifies the period of time that can elapse until the next backup operation
begins on this schedule. For example, assume that the frequency is 7 days and a
successful backup occurs on Wednesday. The next full backup does not occur until the
following Wednesday. Typically, incremental backups have a shorter frequency than full
backups.
■ Calendar
The Calendar option lets you schedule the backup operations that are based on specific
dates, recurring week days, or recurring days of the month.
Retention The retention period for an application backup type schedule refers to the length of time
that NetBackup keeps backup images for stream-based backups. The retention period for
an automatic backup type schedule refers to the length of time that NetBackup keeps backup
images for non-stream-based backups (Example: snapshot). The DB2 database also has
retention settings for backup images in the DB2 catalog. As a general recommendation, the
NetBackup retention of a backup image should be longer than the database retention of the
same backup image.
The type of schedule you select affects the retention period as follows:
■ Frequency-based scheduling
Set a retention period that is longer than the frequency setting for the schedule. For
example, if the frequency setting is set to one week, set the retention period to be more
than one week. The NetBackup scheduler compares the latest record of the automatic
backup schedule to the frequency of that automatic backup schedule. This comparison
is done to determine whether a backup is due. So if you set the retention period to expire
the record too early, the scheduled backup frequency is unpredictable. However, if you
set the retention period to be longer than necessary, the NetBackup catalog accumulates
unnecessary records.
■ Calendar-based scheduling
The retention period setting is not significant for calendar-based scheduling.
Multiple copies If you want to specify multiple copies of a backup for the policy, configure Multiple copies
on the application backup schedule. If using Snapshot Client, also specify Multiple copies
on the automatic schedule.
Automatic Full Backup An Automatic full backup contains a copy of all the data. A full
backup is not the same as a whole database backup. Full means
that the backup is not one of the incremental backup types.
This type of backup takes less space and time than a cumulative
incremental backup. The backup includes only the data that
changed since the last backup of any type.
This backup takes less time and space than a full backup; it contains
only the data that changed since the last full backup.
Configuring NetBackup for DB2 38
Performing a manual backup
Note: For the types of backup schedules, the information in this topic pertains to
stream-based backups. If you use the Snapshot Client option, some of the
information in that table may differ.
More information about backup schedules and Snapshot Client features is available.
See “NetBackup for DB2 with Snapshot Client features” on page 89.
See “About schedule properties ” on page 35.
See “About backup schedules and scripts” on page 32.
See “About backups from the NetBackup master server” on page 66.
See “Configuring the logon account for the NetBackup Client Service for NetBackup
for DB2 ” on page 59.
client01.lab04.com client01
client01.lab04.com clustername
client01.lab04.com clustername.lab04.com
client02.lab04.com client02
client02.lab04.com clustername
client02.lab04.com clustername.lab04.com
Configuring NetBackup for DB2 40
Reviewing the auto-discovered mappings in Host Management
4 When you finish approving the valid mappings for the hosts, click on the Hosts
tab at the bottom of the Hosts pane.
For hosts client01.lab04.com and client02.lab04.com, you see Mapped
Host Names/IP Addresses that are similar to the following:
5 If you need to add a mapping that NetBackup did not automatically discover,
you can add it manually.
Table 3-7 Example mapped host names for a DB2 cluster environment
Cluster with two nodes Physical name of Node 1 Virtual name of DB2 server
Do not specify ARCFUNC SAVE or ARCFUNC COPY if the VENDOR DB2 configuration
parameter is in effect. In environments with VENDOR in effect, NetBackup ignores
the information that pertains to these commands.
Whether to specify ARCFUNC SAVE or ARCFUNC COPY depends on the amount of user
intervention you intend to provide.
Determine which command to use, as follows:
Configuring NetBackup for DB2 42
About backing up archive log files with the user exit program
■ If you specify ARCFUNC SAVE, NetBackup backs up the archive logs according
to the policy and schedule you specify.
If DB2 later issues a ROLLFORWARD request, the user exit program looks for the
archive logs on a backup volume. At restoration time, no user intervention is
required. The sequential recovery can be slow if there are numerous, large log
files.
■ If you specify ARCFUNC COPY, NetBackup copies the archive logs to the location
that is specified on the ARCDIR statement in the db2.conf file.
The disk to which the archive logs are copied eventually fills with archived log
files. Most users want to configure a user archive schedule so they can archive
the entire ARCDIR directory to NetBackup volumes.
This method requires some user intervention during the recovery. Specifically,
you must restore these files before the roll-forward operation. Advanced users
prefer this approach because of performance and flexibility benefits.
For information about how to restore files to disk, see the NetBackup
Administrator’s Guide, Volume I.
See “DB2 objects in the backup window” on page 42.
See “Configuring a policy to back up the archive logs” on page 43.
See “Configuring a policy to archive the archive logs” on page 44.
See “Configuring a policy to back up the configuration files” on page 29.
Object Description
DB2 resource If NetBackup for DB2 is detected on the client, the browser window
displays the DB2 resource. This resource is the top-level DB2 object
in the browser. DB2 is the DB2 resource.
Database You cannot select a database for backup directly, but by selecting all
partitions below it, you can effectively select the whole database. If you
select the database for backup, you cannot select other databases. If
you select objects within the database, you cannot select objects within
other databases at the same time.
Configuring NetBackup for DB2 43
About backing up archive log files with the user exit program
Object Description
Partition The partition is the highest selectable DB2 object. A partition represents
a collection of storage within a database in which tablespaces are
stored. Partitions contain tablespaces and log folders. Within a database,
you can select one or more partitions.
The display includes only partitions that reside on the same NetBackup
client. It does not display other partitions on remote hosts. For more
information, see the Caution that follows this table.
See “About backing up archive log files with the user exit program” on page 41.
See “Configuring a policy to back up the archive logs” on page 43.
See “Configuring a policy to archive the archive logs” on page 44.
See “Configuring a policy to back up the configuration files” on page 29.
Note: If you installed NetBackup on more than one node in the DB2 cluster,
you must perform additional configuration. You must approve each valid
Auto-Discovered Mapping that NetBackup discovers in your environment.
See “Reviewing the auto-discovered mappings in Host Management”
on page 38.
For more information on user archive schedules, see the NetBackup Administrator’s
Guide, Volume I.
You do not need to perform this procedure if you use the VENDOR method to back
up your archive log files.
To configure a policy to back up the archive logs
1 Log on to the master server as administrator (Windows) or root (UNIX).
2 Start the NetBackup Administration Console .
3 If your site has more than one master server, choose the one on which you
want to add the policy.
4 Create a new MS- Windows (Windows) or Standard (UNIX) policy type.
5 Specify the attributes for the policy.
6 On the Schedules tab, create a User Archive schedule.
This schedule must encompass all of the time periods during which DB2 can
call the user exit program.
No backup selections list is necessary for this policy because it has a User
Archive schedule. It is not an automatic schedule.
7 Specify the clients to be backed up.
The clients must have the following installed:
■ DB2
■ NetBackup for DB2
If the client is installed in a DB2 cluster, add the virtual host name to the client
list.
Note: If you installed NetBackup on more than one node in the DB2 cluster,
you must perform additional configuration. You must approve each valid
Auto-Discovered Mapping that NetBackup discovers in your environment.
See “Reviewing the auto-discovered mappings in Host Management”
on page 38.
See “Configuring the logon account for the NetBackup Client Service for NetBackup
for DB2 ” on page 59.
Creating a db2.conf file for use with the user exit program
The NetBackup for DB2 configuration file, db2.conf, consists of a series of keywords
and values. This file defines how to back up the database and the archive logs. It
must be created on each NetBackup for DB2 client.
The installation package installed a file named db2.conf that you can customize.
The following procedures show you how to customize this file. Follow the instructions
in this section if you use the user exit program to perform backups.
To create a db2.conf file for use with the user exit program
1 Before you create the db2.conf file, you need to create the policies to back
up the archive logs and the configuration files.
See “Configuring a policy to back up the archive logs” on page 43.
See “Configuring a policy to archive the archive logs” on page 44.
See “Configuring a policy to back up the configuration files” on page 29.
2 Log on to a client computer.
3 Copy the sample db2.conf file from its location in the sample directory to its
active location.
Its location in the sample directory is as follows:
Windows: install_path\NetBackup\dbext\db2\samples
UNIX: /usr/openv/netbackup/ext/db_ext/db2/scripts
The active location for the db2.conf file is as follows:
Windows: install_path\NetBackup\dbext\db2\db2.conf
UNIX: $DB2_Instance_Home/db2.conf
Configuring NetBackup for DB2 47
Configuring the run-time environment
4 In the db2.conf file, create an object identifier for backing up the database.
This object identifier starts with the following keyword lines:
DATABASE SAMPLE
OBJECTTYPE DATABASE
...
5 In the db2.conf file, create an object identifier for backing up the archive logs.
The form depends on how the archive logs are backed up, as follows:
■ If you use ARCFUNC SAVE:
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
SCHEDULE USER_BACKUP_SCHED_LOGSCHED
In the POLICY line, specify the name of the MS- Windows or Standard policy
for backing up the archive logs.
In the SCHEDULE line, specify the User Backup schedule that you created
earlier for backing up the archive logs.
See “Example db2.conf file using ARCFUNC SAVE” on page 48.
■ If you use ARCFUNC COPY:
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
In the ARCDIR line, specify the full path to the location of the archive logs.
In the RETDIR line, specify the full path to the location from which the archive
logs are retrieved. Typically, the RETDIR location is the same as the ARCDIR
location.
See “Example db2.conf file using ARCFUNC COPY” on page 49.
6 You may need to add other entries to the db2.conf file.
See “Keywords for the db2.conf file” on page 54.
Configuring NetBackup for DB2 48
Configuring the run-time environment
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
SCHEDULE Default-Application-Backup
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_Log_Policy
SCHEDULE User
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR C:\MyLogs\arcdir\
#RETDIR C:\MyLogs\arcdir\
#ARCDIR /home/db2inst1/arcdir
Configuring NetBackup for DB2 49
Configuring the run-time environment
#RETDIR /home/db2inst1/arcdir
ENDOPER
See “Creating a db2.conf file for use with the user exit program” on page 46.
See “Example db2.conf file using ARCFUNC COPY” on page 49.
See “Keywords for the db2.conf file” on page 54.
See “Creating a db2.conf file (vendor method)” on page 50.
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
SCHEDULE Default-Application-Backup
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
#POLICY DB2_Log_Policy
#SCHEDULE User
#ARCFUNC SAVE
ARCFUNC COPY
ARCDIR C:\MyLogs\arcdir\
RETDIR C:\MyLogs\arcdir\
ARCDIR /home/db2inst1/arcdir
RETDIR /home/db2inst1/arcdir
Configuring NetBackup for DB2 50
Configuring the run-time environment
ENDOPER
See “Creating a db2.conf file for use with the user exit program” on page 46.
See “Example db2.conf file using ARCFUNC SAVE” on page 48.
See “Keywords for the db2.conf file” on page 54.
See “Creating a db2.conf file (vendor method)” on page 50.
DATABASE SAMPLE
OBJECTTYPE DATABASE
. . .
Configuring NetBackup for DB2 51
Configuring the run-time environment
5 In the db2.conf file, create an object identifier for backing up the archive logs.
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_TYPE_POL_LOGPOL # a DB2 type policy
SCHEDULE DEFAULT-APPLICATION-BACKUP
In the POLICY line, specify the name of a DB2 policy. This policy can be the
same policy that you use to back up the database.
In the SCHEDULE line, specify a Default-Application-Backup schedule.
6 You may need to add other entries to the db2.conf file.
See “Keywords for the db2.conf file” on page 54.
7 Save and close the db2.conf file.
8 Repeat this procedure on each client computer.
See “Example db2.conf file (vendor method)” on page 51.
See “Creating a db2.conf file for use with the user exit program” on page 46.
See “Example db2.conf file using ARCFUNC SAVE” on page 48.
See “Example db2.conf file using ARCFUNC COPY” on page 49.
See “Configuring the logon account for the NetBackup Client Service for NetBackup
for DB2 ” on page 59.
DATABASE SAMPLE
OBJECTTYPE DATABASE
Configuring NetBackup for DB2 52
Configuring the run-time environment
POLICY DB2_DB_Policy
SCHEDULE Default-Application-Backup
ENDOPER
#DATABASE SAMPLE
#OBJECTTYPE ARCHIVE
#POLICY DB2_Log_Policy
#SCHEDULE User
#ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
#ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_ARCH_Policy
SCHEDULE Default-Application-Backup
ENDOPER
CLIENT_NAME=client_name
CLIENT_NAME=client_name
■ ARCFUNC SAVE
■ ARCFUNC COPY
■ PARTITIONTYPE RAW
■ RETDIR
Table 3-9 describes the keywords and values that are used.
Configuring NetBackup for DB2 55
Configuring the run-time environment
CATALOG_HOST The catalog name under which backup images are cataloged.
For UNIX: Lets you set the permissions on a backup image at backup
BKUP_IMAGE_PERM time. Possible values are the following:
DATABASE db_name DB2 database name. No default. Required for all definitions
except OBJECTTYPE ALTERNATE.
Configuring NetBackup for DB2 56
Configuring the run-time environment
Table 3-9 Keyword value pairs for the db2.conf file (continued)
FORCE_BACKUP_CLIENT The local client name. The client name is needed when DB2
performs an archive backup immediately following an
alternate restore from another client. This client name allows
the backup to be taken using the correct client name for the
local host. The CLIENT_NAME still references the source
client that is used to select the backup images that the restore
needs.
NODE number Specifies the DB2 node number that must match the local
node in order for the other keywords and values to be used.
Do not specify this keyword unless you operate within a DB2
Enterprise Extended Edition (EEE) environment. Not required.
No default.
Table 3-9 Keyword value pairs for the db2.conf file (continued)
PARTITIONTYPE RAW Specifies the NetBackup search for the archive log files that
are backed up from a raw partition during a restore. Not
Required. For the POLICY, specify the name of a DB2 policy.
This policy can be the same as the one that you use to back
up the database. In the SCHEDULE line, specify an Application
Backup schedule.
RETDIR dir Full path to the location from which the archive logs are
retrieved. No default.
SCHEDULE sched_name NetBackup schedule name in the policy. The default is the
first schedule of the correct type in the policy.
See “Specifying the master server for a NetBackup for DB2 client” on page 28.
See “Creating a db2.conf file for use with the user exit program” on page 46.
See “Example db2.conf file using ARCFUNC SAVE” on page 48.
See “Example db2.conf file using ARCFUNC COPY” on page 49.
See “NetBackup for DB2 environment variables” on page 58.
Note: Only the NetBackup backup and restore scripts use the environment variables
in the following table. These variables are unknown to the DB2 backup and restore
commands. For example, the backup command and the restore command do not
process the DB2_POLICY variable. Instead, the scripts use the POLICY name. This
policy is defined in the $DB2_INSTANCE_HOME/db2.conf file (UNIX) or the
install_path\NetBackup\dbext\db2\db2.conf file (Windows).
DB2_POLICY Name of the NetBackup for DB2 policy from which the Automatic Backup was started.
This policy name is not necessarily the same policy name that is in the db2.conf file.
This variable is set only if the backup is initiated from the server, either automatically
by the NetBackup scheduler or manually through the administrator interface.
DB2_SCHED Name of the NetBackup schedule. Enabled only if the backup is initiated from the
server, either automatically by the NetBackup scheduler or manually through the
administrator interface.
DB2_USER_INITIATED Set to 1 if this backup is a user-initiated backup type (Application Backup backup).
DB2_CATALOG_HOST The catalog name under which backup images are cataloged.
For more information about the syntax, refer to the sample DB2 backup scripts that
are installed on the client.
Configuring the logon account for the NetBackup Client Service for
NetBackup for DB2
Because the NetBackup Client Service is started by default under the SYSTEM
account, you also must give special attention to database user authentication. The
SYSTEM account does not have permission to connect to the target database if you
use OS authentication instead of passwords.
If you use OS authentication, run the NetBackup Client Service under an account
that has SYSADM, SYSCTRL, or SYSMAINT privileges for DB2. The account name
must comply with the DB2 naming rules.
Configuring NetBackup for DB2 60
About NetBackup for DB2 shell scripts
For more information on naming rules and authentication, see your DB2
documentation.
To configure the logon account for the NetBackup Client Service for
NetBackup for DB2
1 In the Windows Services application, open the NetBackup Client Service
entry.
2 On the Log On tab, provide the following:
■ Provide the account name that has SYSADM, SYSCTRL, or SYSMAINT
privileges.
■ Type the password.
Shell scripts Sample backup and recovery shell scripts are installed on the client
with the NetBackup for DB2 agent. Modify these scripts to meet your
individual requirements.
Shell scripts the user writes, must conform to DB2 syntax. On UNIX,
they must conform to the UNIX shell syntax.
Note: Be aware of what may happen if an automatic schedule invokes
a script that a user authored. NetBackup does not provide safeguards
to prevent an automatic backup schedule from running a restore or a
recovery script.
■ db2_backup_db_online.cmd
■ db2_restore_db.cmd
■ db2_mpp_backup_offline.cmd
■ db2_mpp_restore_db.cmd
On UNIX, the NetBackup for DB2 installation software includes the following scripts:
■ db2_backup
■ db2_restore
■ db2_all_backup_mpp
■ db2_all_restore_mpp
Note: Always specify the correct script when configuring automatic backups or
when starting operations through NetBackup. NetBackup for DB2 does not generate
an error if a restore script is used for a backup operation or a backup script is used
for a restore operation.
Script parameters
The NetBackup for DB2 scripts read parameters from the environment when they
perform backup and restore operations.
The parameters can come from the following sources:
■ Environment variables
■ UNIX: NetBackup bp.conf
■ NetBackup db2.conf
Parameters from these sources can be evaluated within the scripts. For example,
the DB2_POLICY value is the name of the policy that is used to perform the backup.
See “Creating a db2.conf file for use with the user exit program” on page 46.
See “Creating DB2 scripts manually” on page 61.
Configuring NetBackup for DB2 63
About NetBackup for DB2 shell scripts
Shell script storage DB2 scripts must reside on the NetBackup client. Backup scripts
are associated with a policy by specifying the file name (including
path) in the policy file or script list. For server-directed or scheduled
backups, each client in the policy’s client list must have a copy of
the script with the same name in the same location.
Shell script storage in The shell scripts pertain to NetBackup for DB2 environments that
a NetBackup cluster are not installed in a cluster.
If you operate within a NetBackup cluster, make sure that the restore
shell scripts reside in a file system that is shared between all nodes
in the cluster.
Note: Always specify the correct DB2 script when you configure automatic backups
or when operations start through NetBackup. NetBackup for DB2 does not generate
an error if a restore DB2 script file is used for a backup operation. Also, NetBackup
for DB2 does not generate an error when a backup DB2 script is used for a restore
operation.
■ Issue a DB2 command from the DB2 control center or command-line processor.
The DB2 BACKUP and RESTORE commands use the policies, schedules, and
settings that are specified in the following sources:
■ The NetBackup for DB2 vendor I/O library.
On UNIX, this library is named nbdb2.ext, where ext differs depending on
your platform.
On Windows, this library is named nbdb2.dll.
■ The NetBackup for DB2 configuration file. This file is named db2.conf.
■ Run a script from the operating system command line. You can create these
scripts manually.
■ Use the scripts that are specified in policies. When you back up a NetBackup
policy, it uses the scripts that are specified in the policy.
■ You can specify a catalog name during a database copy backup and an archive
log backup.
The main types of DB2 backups are as follows:
database backup A copy of the entire DB2 database or tablespace. This backup
is accomplished by issuing a DB2 BACKUP DATABASE
database copy
command. A database backup can be initiated through
NetBackup by an automatic backup of a DB2 policy, manual
backup of a DB2 policy, or user-directed backup.
archive log backup An archive log backup is a backup of an archive log file for
DB2. If VENDOR is enabled in the DB2 configuration files,
NetBackup for DB2 backs up the archive logs along with the
database files. If the user exit program is enabled in the DB2
configuration file, you need a separate policy and schedule
to back up the archive logs.
For information on which files to back up, see your IBM DB2
documentation.
Format Description
For lib, specify the same path as shown for the preceding format
(Format 1).
Table 4-2 lists the command options when used in a NetBackup for DB2
environment.
Performing backups and restores of DB2 69
About user-directed backups
Option Purpose
LOAD NBDB2_library_path Instructs DB2 to use the NBDB2 vendor library when it
performs the backup.
OPEN number SESSIONS Specifies the number of concurrent data streams used
for writing data. Use this option if you have multiple
backup devices available, or you have multiplexing
enabled in NetBackup.
WITH number BUFFERS Use this option when opening multiple sessions. See
OPEN number SESSIONS. The number of buffers must
be twice the number of sessions.
BUFFER size Use this option to increase or decrease the buffer size,
if necessary. Increased size can benefit performance,
but decreased size might be necessary if using numerous
buffers. DB2 recommends that the size be a multiple of
the extent size. The DB2 DFT_EXTENT_SZ setting
defines the default extent size.
Option Purpose
OPTIONS "options-string" Specifies the options that are to be used for the backup
operation. The string passes to the vendor support library,
for example nbdb.so, exactly as it was entered, without
the quotes.
-t 18 This example searches all DB2 backup images for a client named camel, which is also the master
server. The information comes from the NetBackup catalog on the master server. The user exit
program backs up the archive files.
The bplist -t 18 option specifies the DB2 backup type. The bplist output shows the DB2
database backup images that are stored in the NetBackup database.
Windows:
UNIX:
Where:
0 is the type of backup taken. Zero (0) indicates a full database backup. Three (3) indicates a
tablespace backup.
node0000 is the node number. In non-partitioned database systems, the node number is always
zero (node0000). In partitioned database systems, the number is nodexxxx, where xxxx is the
number assigned to the node in the db2nodes.cfg file.
20091202105150 is the timestamp, which includes the date (year, month, day) and time (hour,
minute, second).
1 is the session number. This file extension identifies the session number that was specified on
the DB2 BACKUP command.
Performing backups and restores of DB2 72
About browsing DB2 backup images with bplist
-k This example searches all DB2 backup images for a client named cow, which is also the master
DB2_Log_Policy server. The information comes from the NetBackup catalog on the master server. This example
assumes that the user exit program is used to back up the archive files.
The -k DB2_Log_Policy option specifies the files that are backed up with this policy. The
policy name originates from the settings in the db2.conf file for archive log files. The bplist
output shows the list of DB2 archive log files that are stored in NetBackup.
Windows:
UNIX:
-k log_policy This example uses bplist to search the DB2 archive log files for a client named cow. The -k
log_policy option specifies the files that are backed up with this policy. The VENDOR is set
and the user exit program is not used to back up the archive logs:
Example
location:C:\DB2\SAMPLE\LOGFILE\node0000\db2v864d\C0000000_S0000000.LOG
Example location:/DB2/SAMPLE/LOGFILE/node0000/db2v864d/C0000000_S0000000.LOG
Where:
You can find more information on the bplist command in the NetBackup
Commands Reference Guide.
If you use a non-root service user account, specific access must be allowed for that
user when you add files to the /usr/openv/netbackup/db/altnames directory.
The service user account must have full access to these files through the ownership
or group and the permissions. For example, if the service user is svcname and its
group is srvgrp, the file can have permissions of 400. If the file owner is for a
different user and group, the file permissions must allow access to the service user.
For example, 777. Equivalent permission settings must be used in a Windows
environment.
Windows:
■ If the catalog name is equal to the name of the client performing the restore, no
special setup is needed.
■ If the primary and the client are the same server and if the catalog name does
not equal the name of the client performing the restore, update the db2.conf
as follows:
■ DATABASE and ARCHIVE stanzas:
■ If the client is a different server than where the backup has occurred and if the
catalog name does not equal the name of the client performing the restore:
■ db2.conf
UNIX:
■ If the catalog name is equal to the name of the client performing the restore, no
special setup is needed.
Performing backups and restores of DB2 75
Performing a database restore
■ If the catalog name does not equal the client name performing the restore,
update the db2.conf as follows:
■ db2.conf
Where db_name is the name of the DB2 database you are to restore.
UNIX: db2 restore db db_name load /usr/openv/netbackup/bin/lib
Where:
UNIX: bprestore
/vedb2/db2/v8/db2V82d/NODE0000/SQL0001/SQLOGDIR/S00009.LOG
Option Purpose
LOAD NBDB2_Library_Path Instructs DB2 to use the NBDB2 vendor library when you
perform the restore.
OPEN number SESSIONS Specifies the number of concurrent data streams used
for writing data. Use this option if you have multiple
backup devices available or if you have multiplexing
enabled in NetBackup.
WITH number BUFFERS Use this option when opening multiple sessions. See
OPEN number SESSIONS.
BUFFER size Use this option to increase or decrease the buffer size if
necessary. Increased size can benefit performance, while
decreased size may be necessary if you use numerous
buffers. DB2 alters the actual size to be a multiple of the
size that is used during the backup.
INCREMENTAL When you use this option, DB2 may not read the entire
image from NetBackup media. Consequently, NetBackup
logs an error in the activity monitor, which can safely be
ignored.
Option Purpose
HISTORY FILE When you use this option, DB2 may not read the entire
image from NetBackup media. Consequently, NetBackup
logs an error in the activity monitor, which can safely be
ignored.
OPTIONS "options-string" Specifies the options to be used for the restore operation.
The string passes to the vendor support library, for
example nbdb2.so, exactly as it was entered, without
the quotes.
For example, assume that you have two NetBackup clients, grade7 and grade8.
Instances class1 and class2 are on grade7. Instance class1 is on grade8.
Figure 4-1 illustrates this example.
Instance: class2
Databases: eng1, art1
The following list shows some of the types of restores you can perform with alternate
restore procedures:
Performing backups and restores of DB2 82
About an alternate restore
■ You can restore database eng1 from instance class2 on client grade7 into
instance class1 on client grade8. Database eng1 can retain its name because
it is unique to instance class1.
■ You can restore database math1 from instance class1 on client grade7 into
instance class1 on client grade8. During the restore, you need to rename math1
to math2 because class1 on grade8 already has a database named math1.
Without renaming, the existing database math1 would be overwritten.
■ You can restore database art1 from instance class2 on client grade7 into
instance class1 on client grade7. During the restore, you need to rename art1
to art2 because instance class1 already has a database named art1. Without
renaming, the existing database art1 would be overwritten.
See “Preparing the master server for an alternate restore” on page 82.
See “Performing the alternate restore on the clients” on page 83.
See “Restoring the transaction logs” on page 87.
See “Performing a database restore” on page 73.
See “About an alternate restore” on page 80.
See “NetBackup for DB2 backup overview” on page 64.
■ Windows: install_path\NetBackup\db\altnames\dest_client_name
■ UNIX: /usr/openv/netbackup/db/altnames/dest_client_name
Where dest_client_name is the name of a client that is allowed to be a
destination client for alternate restores. For example, client1.
3 After creating a dest_client_name file, add the name of the NetBackup for DB2
source client to the dest_client_name file. For example, add the following line
to this file:
client2
The following example shows the definition that is needed to define the new
database:
DATABASE NEWSAMPL
OBJECTTYPE DATABASE
POLICY db2-bkup
SCHEDULE Default-Application-Backup
CLIENT_NAME Client1 # Restore to (and backup from) local host
ENDOPER
The following example shows the definition that is needed to define the old
database:
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY db2-bkup
SCHEDULE Default-Application-Backup
CLIENT_NAME Client2 # Restore from backup of remote host
ENDOPER
The following example shows the definition that is needed to define the new
archive log files:
DATABASE NEWSAMPL
OBJECTTYPE ARCHIVE
POLICY db2_archive
SCHEDULE Default-Application-Backup
#SCHEDULE User # Swap '#' on SCHEDULE for user-exit
CLIENT_NAME Client1 # Restore to (and backup from) local host
ARCFUNC SAVE
ENDOPER
The following example shows the definition that is needed to define the old
archive log files:
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY db2_archive
SCHEDULE Default-Application-Backup
#SCHEDULE User # Swap '#' on SCHEDULE for user-exit
CLIENT_NAME Client2 # Restore from backup of remote host
Performing backups and restores of DB2 85
About an alternate restore
ARCFUNC SAVE
ENDOPER
Where:
db_being_restored Specify the name of the database that was backed up.
new_db_name Specify the name for the new database. If the name of
the new database matches the name of a database
presently included in the new instance, the new database
overwrites the existing database.
For example:
Windows:
UNIX:
UNIX:
For example:
3 If the directory into which you restored the log files is not correct for the
destination database, move the logs to the proper location.
4 Verify that the correct owner and group permissions are enabled on the log
directory.
See “Preparing the master server for an alternate restore” on page 82.
See “About an alternate restore” on page 80.
See “Performing the alternate restore on the clients” on page 83.
See “Performing a database restore” on page 73.
See “NetBackup for DB2 backup overview” on page 64.
the NetBackup catalog. These requests may also come from the DBA when
command-line options are used. For compliance reasons, you may want to prevent
the expiration of images in the NetBackup catalog from a database request by using
a bp.conf entry on the primary server.
To prevent the expiration of backup images, use the following bp.conf entry on
the primary server:
Note: The normal image expiration (retention) and the bpexpdate command are
unaffected by this setting.
In a clustered primary server environment, these settings should be set and match
in all the primary server bp.conf files.
The following is an example of a log entry when a status code of 1420 is produced.
The bpdb2 log message for DB2:
Table 5-1 Snapshot Client features used with NetBackup for DB2
Feature Description
Snapshot backup A snapshot backup occurs when NetBackup and DB2 coordinate
to create a point-in-time disk image of the database for backup.
This process is nearly instantaneous; so user access to the
database is not interrupted during the backup. The snapshot can
then be backed up to storage and or retained for instant recovery.
Instant recovery This feature enables instant recovery of the database from a
previously created snapshot. It combines snapshot technology with
the ability to do rapid disk-based restores.
Off-host backup The off-host backup shifts the burden of reading the snapshot to a
separate host. The database host is only involved in performing
the snapshot. The snapshot is mounted, read, and transferred to
storage by an alternate client.
Proxy operations A proxy backup or restore is a special type of operation where DB2
does not read or write the database files. Instead, NetBackup for
DB2 acts as a proxy and performs all of the data movement.
NetBackup coordinates with DB2 to ensure that the correct files
are in the correct state for the operation.
Backups and restores remain tightly integrated with DB2 and its
catalog, greatly simplifying administration tasks.
File-based operations DB2 provides the list of files that require backup or restore to
NetBackup for DB2 with Snapshot Client. It then acts as a proxy
to perform the data movement.
Table 5-1 Snapshot Client features used with NetBackup for DB2
(continued)
Feature Description
bpdb2proxy This NetBackup for DB2 command is used in backup and restore
scripts to initiate snapshot backup and restore.
Note: NetBackup for DB2 does not support the USE SNAPSHOT
parameter on the DB2 BACKUP DATABASE command.
The NetBackup for DB2 agent uses DB2 APIs to put the data files into a quiesced
mode. NetBackup then creates a snapshot of the files. After the snapshot is created,
NetBackup for DB2 uses the DB2 APIs to take the data files out of quiesced mode.
The data files are in quiesced mode only for the period of time it takes to create a
snapshot.
See “NetBackup for DB2 with Snapshot Client features” on page 89.
See “About configuring NetBackup for DB2 block-level incremental backups on
UNIX” on page 105.
See “How Snapshot Client software affects backup types” on page 114.
■ Reruns the transactions from the log files (performs the roll-forward operation).
■ Enables user connections to the database (brings the database online).
See “About the sequence of a NetBackup for DB2 backup operation with Snapshot
Client methods ” on page 92.
See “Performing NetBackup for DB2 restores with Snapshot Client methods”
on page 116.
Note: Before you can perform the very first snapshot backup, DB2 requires a
stream-based backup of the database.
DB2 performs only conventional backups for transaction logs; use either the user-exit
or VENDOR method. You cannot use Snapshot Client methods for transaction logs.
Snapshot backups and log archiving require different configurations. When you
configure NetBackup for DB2 with Snapshot Client backups, be sure to configure
the policies to allow both kinds of backups.
See “How Snapshot Client software affects backup types” on page 114.
DB2 Server
VENDOR log
archive method
Control commands
Data
NetBackup
Figure 5-2 NetBackup for DB2 with Snapshot Client file-based backup or
restore
DB2 Server
Control commands
List of files
User-exit log
Data
archive method
NetBackup
The agent groups the database files into three streams and initiates a file-based
backup for each stream. After the backup is done, DB2 starts a conventional backup
of the transaction logs using either the user-exit or vendor method.
Issue this command on each node of the database.
Using Snapshot Client with NetBackup for DB2 96
About configuring Snapshot Client with NetBackup for DB2
Note: If the policy used by the backup is not configured for Snapshot Client, the
backup fails.
■ DB2 does not support snapshot backups of database transaction logs. If DB2
is configured to use the user exit program, review the following topic:
See “About backing up archive log files with the user exit program” on page 41.
information. Familiarize yourself with this information before you configure any
snapshot backups.
The following list highlights some of the requirements that pertain to database
agents:
■ Snapshot Client backups do not back up all database objects. Your backup
configuration must include schedules to perform snapshot and stream-based
backups. This configuration ensures that the entire database can be restored
successfully.
■ On UNIX, the user identification and group identification numbers (UIDs and
GIDs) associated with the files to be backed up must be available. The UID and
GID must be available to both the primary client and the alternate backup client.
The UID on the primary client and the alternate backup client must be the same.
Similarly, the GID on the primary client and the alternate backup client must be
the same.
■ Ensure that the data files reside on a volume or a file system that does not
contain archive logs, control files, or executables.
■ Allocate a different set of volumes or file systems to the DB2 executables versus
the configuration files and transaction logs.
One reason to have two different volumes is to separate the data files from the
other files. If the logs are configured on the same volumes as the data files, the
volumes the logs are temporarily frozen while NetBackup takes the snapshot.
The logs and the database activity may freeze until the logs become accessible
again.
Another reason for writing the data files to their own repository is because it is
required for an instant recovery point-in-time rollback. Only data files can exist
on the volume that you want to restore.
■ The hardware and software that is required for the appropriate snapshot method
must be installed and configured correctly.
■ NetBackup Snapshot Client must be installed and configured correctly, and the
primary server must have a valid license for this option.
■ To perform off-host backups, specify the off-host in the backup policy and ensure
that host has the software and permissions to mount the snapshot.
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
SCHEDULE Default-Application-Backup
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_Log_Policy
SCHEDULE User
ARCFUNC SAVE
#ARCFUNC COPY
Using Snapshot Client with NetBackup for DB2 101
Restoring NetBackup for DB2 from a snapshot backup
#ARCDIR C:\MyLogs\arcdir\
#RETDIR C:\MyLogs\arcdir\
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
SCHEDULE Full
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_Log_Policy
SCHEDULE User
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR C:\MyLogs\arcdir\
#RETDIR C:\MyLogs\arcdir\
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER
■ See “About restoring individual files from a NetBackup for DB2 snapshot backup”
on page 102.
■ See “About NetBackup for DB2 restores of volumes and file systems using
snapshot rollback” on page 102.
■ See “Performing a NetBackup for DB2 point-in-time rollback restore from a
SnapVault backup (UNIX)” on page 103.
■
About NetBackup for DB2 restores of volumes and file systems using
snapshot rollback
You can request that an entire volume or an entire file system be restored from an
instant recovery Snapshot backup. This type of a restore is called a point in time
rollback. All the data in the snapshot is restored; single file restore is not available
in a rollback.
You can perform a snapshot rollback from an instant recovery backup that was
made with the following methods:
■ UNIX: VxFS_Checkpoint snapshot
■ vxvm snapshot
■ FlashSnap snapshots
Using Snapshot Client with NetBackup for DB2 103
Restoring NetBackup for DB2 from a snapshot backup
Where:
-options <options string> Specifies the options that are to be used for the restore
operation. Currently, the only option is
DB2_RESTORE_PRIORITY. By default, the preset priority
for restore jobs is 90000, which is the highest preset job
priority of any other NetBackup job. The available range
is 0 - 99999. The higher the number, the greater the job
priority.
See “About restoring individual files from a NetBackup for DB2 snapshot backup”
on page 102.
See “Troubleshooting NetBackup for DB2 rollback restores” on page 105.
See “How Snapshot Client software affects scripts” on page 115.
require that any change in the database—no matter how small—requires that the
entire database is backed up. With BLI backup, only modified blocks (or file) need
to be backed up.
BLI backups support the other features of NetBackup for DB2, including policy types
and schedules. It also remains tightly integrated with DB2 and its catalog, which
greatly simplifies administration tasks.
See “How BLI works with NetBackup for DB2 (UNIX)” on page 106.
See “Configuration requirements for BLI backups with NetBackup for DB2”
on page 108.
See “Configuring policies for BLI backups with NetBackup for DB2” on page 108.
You can take a Storage Checkpoint while the database is online or offline. To take
a Storage Checkpoint while the database is online, you must enable archive logging.
During the creation of the Storage Checkpoint, all tablespaces are placed in backup
mode.
/usr/openv/netbackup/ext/db_ext/NODATA_CKPT_PROXY
If the agent finds this file during run time, it uses Nodata Storage Checkpoint, and
it keeps the database containers in quiesced (write suspend). The database
containers are kept in this mode for the duration of the backup.
Note: BLI is not currently supported for DB2 Snapshot backups on Microsoft
Windows clients, the examples in this section use UNIX Bourne shell syntax. Modify
as appropriate if using a different shell.
The following three options describe how to initiate DB2 BLI incremental backups.
Some of these options also contain examples of a policy setup that you use and
how to modify the backup script.
The policy only has one db2.conf file, and it is set for stream-based backups.
The backup script sets and exports the appropriate environment variables before
the backup is initiated.
DB2_INCR=0
DB2_CINC=0
Using Snapshot Client with NetBackup for DB2 112
About configuring NetBackup for DB2 block-level incremental backups on UNIX
DB2_FULL=0
if [ <some_condition> ]; then
DB2_INCR=1
DB2_SCHED="Diff"
elif [ <some_other_condition> ]; then
DB2_CINC=1
DB2_SCHED="Cum"
else
DB2_FULL=1
DB2_SCHED="Full"
fi
DB2_POLICY=DB2_Policy
DB2_SCHEDULED=1
/usr/openv/netbackup/bin/bpdb2proxy <options>
Schedule: Diff
Type: INCR (1)
Schedule: Default-Application-Backup
Type: UBAK DB2 (2)
The policy has three db2.conf files, one for each type of automatic backup schedule.
The backup script copies the correct db2.conf file into place before the backup is
initiated.
if [ <some_condition> ]; then
cp db2.conf.with_diff_sched $DB2_Instance_Home/db2.conf
elif [ <some_other_condition> ]; then
cp db2.conf.with_cum_sched $DB2_Instance_Home /db2.conf
else
cp db2.conf.with_full_sched $DB2_Instance_Home /db2.conf
fi
/usr/openv/netbackup/bin/bpdb2proxy <options>
See “Configuring policies for BLI backups with NetBackup for DB2” on page 108.
See “About the types of NetBackup for DB2 BLI backups” on page 110.
See “About configuring the db2.conf for a snapshot policy” on page 100.
Using Snapshot Client with NetBackup for DB2 114
About Snapshot Client effects
Full backup The automatic backup schedule types automatically start the
backups by running the NetBackup for DB2 scripts. They also store
Differential incremental
the snapshot backups.
backup,
Note: For most snapshot types, any automatic backup schedule
Cumulative incremental
(full, cumulative, or differential) results in a full volume snapshot.
backup
BLI is the only snapshot method that can perform an incremental
backup.
See “About NetBackup for DB2 with Snapshot Client operations” on page 91.
See “How Snapshot Client software affects schedule properties” on page 114.
Property Description
Application Schedules:
Multiple Copies For snapshot backup, configure Multiple copies on the automatic
backup schedule.
NetBackup for DB2 performs backups with Snapshot Client in the following ways:
■ User-directed, from the command line or the script as a DB2 user (with the
bpdb2proxy command)
Windows:install_path\NetBackup\bin\bpdb2proxy
-backup -d dbalias -u user -p password
UNIX: /usr/openv/netbackup/bin/bpdb2proxy
-backup -d dbalias -u user -p password
Server-directed backups The following describes the process for configuring policies
for DB2 backups with Snapshot Client.
See “Performing NetBackup for DB2 restores with Snapshot Client methods”
on page 116.
See “How Snapshot Client software affects backup types” on page 114.
Restore using the command Use the bpdb2proxy command. You must be the DB2 user
line (user-directed) to use the bpdb2proxy command. When performing a
restore, specify the -restore option with bpdb2proxy.
Note: The backup image you restore with bpdb2proxy
must be from a Snapshot Client method backup, otherwise,
the restore fails.
Windows: install_path\NetBackup\bin\bpdb2proxy
-restore -d dbalias -u user -p password
UNIX: /usr/openv/netbackup/bin/bpdb2proxy
-restore -d dbalias -u user -p password
Restore from a snapshot See “About NetBackup for DB2 restores of volumes and file
backup systems using snapshot rollback” on page 102.
See “Performing NetBackup for DB2 backups with Snapshot Client methods”
on page 115.
Chapter 6
Troubleshooting
NetBackup for DB2
This chapter includes the following topics:
■ Enabling the debug logs for a NetBackup for DB2 client automatically (Windows)
install_path\NetBackup\logs\README.debug file
UNIX:
/usr/openv/netbackup/logs/README.debug file
install_path\NetBackup\logs\mklogdir.bat
Or, you can manually create the directories for the log files you want created.
install_path\NetBackup\logs\bpubsdb2
■ bphdb
For any backup that is initiated from an automated schedule on the master
server.
install_path\NetBackup\logs\bphdb
■ bpdb2
For any backup or restore of the database and or LOGARCHMETH2=VENDOR
log backups.
install_path\NetBackup\logs\bpdb2
■ bpbkar
For any snapshot backup and or user-exit log backup.
install_path\NetBackup\logs\bpbkar
■ tar
For any snapshot restore and or user-exit log restore.
install_path\NetBackup\logs\tar
2 Verify the user or group that the DB2 process (process that loads bpdb2) has
appropriate permissions to write to the following directories if they exist. If the
following directories do not exist, the directories are created automatically with
the correct permissions.
install_path\NetBackup\logs\user_ops
install_path\NetBackup\logs\user_ops\dbext
install_path\NetBackup\logs\user_ops\dbext\logs
Also verify that the user or group that the DB2 process runs as has appropriate
permissions to write to the log directories in step 1.
Troubleshooting NetBackup for DB2 121
Enabling the debug logs manually (UNIX)
3 On the NetBackup server or servers, create the debug log directories for the
legacy processes that interact with the DB2 agent.
On the master server:
install_path\NetBackup\logs\bprd
install_path\NetBackup\logs\bptm
4 The debug logs for unified processes on the server and the client hosts are
created automatically by NetBackup.
NetBackup writes unified logs to install_path\NetBackup\logs.
For information on how to use logs and reports, see the NetBackup
Troubleshooting Guide.
/usr/openv/netbackup/logs/bpubsdb2
■ bphdb
For any backup that is initiated from an automated schedule on the master
server.
/usr/openv/netbackup/logs/bphdb
■ bpdb2
For any backup or restore of the database and or LOGARCHMETH2=VENDOR
log backups.
/usr/openv/netbackup/logs/bpdb2
■ bpbkar
For any snapshot backup and or user-exit log backup.
Troubleshooting NetBackup for DB2 122
About the NetBackup for DB2 log files
/usr/openv/netbackup/logs/bpbkar
■ nbtar
For any snapshot restore and or user-exit log restore.
/usr/openv/netbackup/logs/tar
2 Verify the user or group that the DB2 process (process that loads bpdb2) has
appropriate permissions to write to the following directories if they exist. If the
following directories do not exist, the directories are created automatically with
the correct permissions.
/usr/openv/logs/user_ops
/usr/openv/logs/user_ops/dbext
/usr/openv/logs/user_ops/dbext/logs
Also verify that the user or group that the DB2 process runs as has appropriate
permissions to write to the log directories in step 1.
3 On the NetBackup server or servers, create the debug log directories for the
legacy processes that interact with the DB2 agent.
On the master server:
/usr/openv/logs/bprd
/usr/openv/logs/bptm
4 The debug logs for unified processes on the server and the client hosts are
created automatically by NetBackup.
NetBackup writes unified logs to /usr/openv/logs.
For information on how to use logs and reports, see the NetBackup
Troubleshooting Guide.
Unless it is redirected elsewhere, NetBackup writes DB2 script errors to this file.
■ mmddyy.log
This log contains debugging information for the bphdb process. bphdb is the
NetBackup database backup binary. It is invoked when an automatic backup
schedule is run. NetBackup for DB2 uses this client process for DB2 script
execution.
Unless it is redirected elsewhere, NetBackup writes DB2 script errors to this file.
■ log.mmddyy
This log contains debugging information for the bphdb process. bphdb is the
NetBackup database backup binary. It is invoked when an automatic backup
schedule is run. NetBackup for DB2 uses this client process for DB2 script
execution.
This log contains debugging information and execution status for the NetBackup
for DB2 client process.
Note: Information from both the Verbose and the Database debug settings is logged
to the same file, mmddyy.log
VERBOSE = X
Note: This change may delay detecting problems during subsequent backups.
Consider putting the original value back in place once any restore that requires a
change is complete.
Troubleshooting NetBackup for DB2 126
Minimizing the loading and unloading of tapes for database backups
See “About false restore failures reported in the activity monitor” on page 127.
See “About the NetBackup for DB2 log files” on page 122.
See “Setting the debug level on a UNIX client” on page 124.
See “Performing a database restore” on page 73.
See “Using DB2 to perform a restore” on page 73.
See “About the error message codes” on page 127.
300 Message: ERR - No match for a database image file was found based
on the following criteria.
Cause: The restore criteria of database name, instance, type, and backup
time object cannot be found in the NetBackup database.
Action: Use bplist to make sure that the image you want to restore
exists. Make sure that the correct instance is used.
Make sure that the correct values are set in db2.conf. Also, on UNIX
check the values in bp.conf.
If logging is enabled, check the current log file in the following directory
for more information:
Windows: install_path\NetBackup\logs\bpdb2\
UNIX: /usr/openv/NetBackup/logs/bpdb2
Action: This error should not occur under typical operations. If logging is
enabled, check the current log file in the following directory for more
information:
Windows: install_path\NetBackup\logs\bpdb2\
UNIX: /usr/openv/NetBackup/logs/bpdb2
Cause:
Action: Make sure that the file exists and is properly configured.
If logging is enabled, check the current log file in the following directory
for more information:
Windows: install_path\NetBackup\logs\bpdb2\
UNIX: /usr/openv/NetBackup/logs/bpdb2
Troubleshooting NetBackup for DB2 129
About the error message codes
Action: Make sure that the action parameters are used properly.
Cause: NetBackup server and the NetBackup for DB2 shared library
(UNIX) DB2 DLL (Windows) or are not at the same level.
Action: Make sure that the NetBackup and the NetBackup for DB2 shared
library (UNIX) or the DB2 DLL (Windows) are at the same level. Check
the log file in the following directory:
Windows: install_path\NetBackup\logs\
UNIX: /usr/openv/NetBackup/logs/bpdb2
Check the version number of the shared library and the version number
for NetBackup. If they are not the same, install the same level.
Action: Make sure that the directory is accessible with read and write
permissions. Make sure that the file exists and has read permission.
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
435 Message: ERR - RETDIR field needs to contain a valid file when
OBJECTTYPE is equal to ARCHIVE: string.
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
Windows: install_path\NetBackup\dbext\db2.conf
UNIX: $HOME/db2.conf
505 Message: The input parameters supplied by DB2 are not valid.
Cause: This error can occur when you use an unsupported version of
DB2.
Action: Check that the NetBackup client and server settings are configured.
Also verify that the db2.conf file exists and that it is configured.
See “Creating DB2 scripts for a DB2 EEE environment” on page 138.
■ Include only one Application Backup schedule type. Delete the schedule
called Default-Application-Backup.
For complete instructions on how to create this type of schedule, see the
following:
See “Configuring automatic backup schedules” on page 34.
■ In the client list, include all clients you want to back up, including the DB2
catalog node.
■ Create a Standard type policy with a User Backup type schedule if the following
apply:
■ The user exit program for logging is turned on in DB2 UDB.
■ The client is a UNIX machine.
See “About backing up archive log files with the user exit program” on page 41.
■ If you use the VENDOR method, see the following:
See “Creating a db2.conf file (vendor method)” on page 50.
See “Configuring NetBackup for DB2 in an EEE environment” on page 136.
See “Overview of installation and configuration for a DB2 EEE (DPF) environment”
on page 135.
See “Adding a NetBackup for DB2 policy” on page 26.
Configuration for a DB2 EEE (DPF) environment 138
Backing up archive logs in a DB2 EEE environment
Note: Proper backup and restore of the catalog partition is the user’s responsibility.
Generally, it is recommended that the catalog partition is the first node backed up
and the first partition restored. For more information, see your DB2 documentation.
use by DB2. The user exit program resides in the DB2 database directory as
db2uext2.
The use of the NetBackup user exit program is required because it automatically
archives log files to a storage unit. It also enables on-demand recovery of log files
by DB2.
Take precautions when installing SAP to prevent overwriting the NetBackup user
exit program. Always preserve the NetBackup db2uext2 file before installing SAP
and restore afterwards.
See “Backup and restore of DB2 databases used by SAP” on page 140.
See “Archive and restore of DB2 log files used by SAP” on page 140.
See “Backup of SAP files” on page 141.
See “About NetBackup for DB2 with SAP” on page 139.
Note: Do not use SAP CCMS, sapdba, brbackup, or brrestore commands to initiate
backups or restores. They do not invoke NetBackup.
Note: SAP must not be running when you attempt to restore the database.
See “Archive and restore of DB2 log files used by SAP” on page 140.
See “Backup of SAP files” on page 141.
See “Installation of the DB2 user exit program” on page 139.
See “About NetBackup for DB2 with SAP” on page 139.
Note: Do not use SAP CCMS, sapdba, brarchive commands, or the SAP Logfile
Management window in the DB2 Control Center for log file archival. They depend
on the SAP user exit program for proper operation.
■ On Windows:
C:\Program Files\Veritas\NetBackup\bin>nbsetconfig
nbsetconfig> DB_SCRIPT_PATH=c:\db_scripts
nbsetconfig> DB_SCRIPT_PATH=e:\oracle\fullbackup\full_rman.sh
nbsetconfig>
<ctrl-Z>
Note: Review the NetBackup Command Reference Guide for options, such
as reading from a text file and remotely setting clients from a NetBackup server
using bpsetconfig. If you have a text file with the script location or authorized
locations listed, nbsetconfig or bpsetconfig can read from that text file. An
entry of DB_SCRIPT_PATH=none does not allow any script to execute on a client.
The none entry is useful if an administrator wants to completely lock down a
server from executing scripts.
Register authorized locations 144
Registering authorized locations used by a NetBackup database script-based policy