NetBackup AdminGuide DB2 Unix
NetBackup AdminGuide DB2 Unix
Release 7.0
Symantec NetBackup for DB2 Administrator's Guide
The software described in this book is furnished under a license agreement and may be used
only in accordance with the terms of the agreement.
Legal Notice
Copyright © 2009 Symantec Corporation. All rights reserved.
Symantec, the Symantec Logo, and NetBackup are trademarks or registered trademarks of
Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be
trademarks of their respective owners.
This Symantec product may contain third party software for which Symantec 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. Please see the Third Party Legal Notice Appendix
to this Documentation or TPIP ReadMe File accompanying this Symantec product for more
information on the Third Party Programs.
Portions of this software are derived from the RSA Data Security, Inc. MD5 Message-Digest
Algorithm. Copyright 1991-92, RSA Data Security, Inc. Created 1991. All rights reserved.
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
Symantec Corporation and its licensors, if any.
THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS,
REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT,
ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO
BE LEGALLY INVALID. SYMANTEC CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL
OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING,
PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED
IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE.
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, "Rights in
Commercial Computer Software or Commercial Computer Software Documentation", as
applicable, and any successor regulations. 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.
Symantec Corporation
350 Ellis Street
Mountain View, CA 94043
http://www.symantec.com
Technical Support
Symantec Technical Support maintains support centers globally. Technical
Support’s primary role is to respond to specific queries about product features
and functionality. The Technical Support group also creates content for our online
Knowledge Base. The Technical Support group works collaboratively with the
other functional areas within Symantec to answer your questions in a timely
fashion. For example, the Technical Support group works with Product Engineering
and Symantec Security Response to provide alerting services and virus definition
updates.
Symantec’s maintenance offerings include the following:
■ A range of support options that give you the flexibility to select the right
amount of service for any size organization
■ Telephone and Web-based support that provides rapid response and
up-to-the-minute information
■ Upgrade assurance that delivers automatic software upgrade protection
■ Global support that is available 24 hours a day, 7 days a week
■ Advanced features, including Account Management Services
For information about Symantec’s Maintenance Programs, you can visit our Web
site at the following URL:
www.symantec.com/techsupp/
Customer service
Customer service information is available at the following URL:
www.symantec.com/techsupp/
Customer Service is available to assist with the following types of issues:
■ Questions regarding product licensing or serialization
■ Product registration updates, such as address or name changes
■ General product information (features, language availability, local dealers)
■ Latest information about product updates and upgrades
■ Information about upgrade assurance and maintenance contracts
■ Information about the Symantec Buying Programs
■ Advice about Symantec's technical support options
■ Nontechnical presales questions
■ Issues that are related to CD-ROMs or manuals
Maintenance agreement resources
If you want to contact Symantec regarding an existing maintenance agreement,
please contact the maintenance agreement administration team for your region
as follows:
Symantec Early Warning Solutions These solutions provide early warning of cyber attacks, comprehensive threat
analysis, and countermeasures to prevent attacks before they occur.
Managed Security Services These services remove the burden of managing and monitoring security devices
and events, ensuring rapid response to real threats.
Consulting Services Symantec Consulting Services provide on-site technical expertise from
Symantec and its trusted partners. Symantec Consulting Services offer a variety
of prepackaged and customizable options that include assessment, design,
implementation, monitoring, and management capabilities. Each is focused on
establishing and maintaining the integrity and availability of your IT resources.
Educational Services Educational Services provide a full array of technical training, security
education, security certification, and awareness communication programs.
To access more information about Enterprise services, please visit our Web site
at the following URL:
www.symantec.com
Select your country or language from the site index.
Contents
About configuring snapshot backups with NetBackup for DB2 ............ 101
Configuration requirements for snapshot backups with
NetBackup for DB2 ......................................................... 101
Configuring the DB2 policy with Snapshot Client backup
methods ....................................................................... 102
Configuring a snapshot policy for NetBackup for DB2 ................. 103
Restoring from a snapshot backup ................................................. 106
About restoring individual files from a snapshot backup .............. 106
About restoring volumes and file systems using snapshot
rollback ........................................................................ 106
Performing a snapshot rollback restore from the Java or Windows
interface ....................................................................... 107
Performing a snapshot rollback restore from the command
line .............................................................................. 108
Troubleshooting rollback restores ........................................... 109
About configuring block-level incremental backups .......................... 109
How does BLI work? .............................................................. 109
About the Storage Checkpoint facility ...................................... 110
Configuration requirements for BLI backups ............................. 112
Configuring policies for BLI backups ........................................ 113
About Snapshot Client effects ....................................................... 114
About the types of backups ..................................................... 114
About schedule properties for Snapshot Client backups ............... 115
About templates and scripts ................................................... 116
Using NetBackup for DB2 with Snapshot Client ................................ 116
Performing backups .............................................................. 116
Performing restores .............................................................. 117
Feature Description
Media and device All devices supported by Media Manager are available to
management NetBackup for DB2.
Scheduling facilities NetBackup scheduling facilities on the master 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.
14 Introduction to NetBackup for DB2
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 used for other
storage units used for backups or to give DB2 exclusive use of certain devices and media.
other file backups NetBackup for DB2 can use Media Manager, disk, and PureDisk
storage units.
Centralized and From the NetBackup master 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.
Graphical user NetBackup provides the following graphical user interfaces for
interfaces client users and administrators:
A database administrator can also use the IBM DB2 control center
or command line processor to start user-directed backup and
restore operations.
Templates The NetBackup for DB2 database wizards can create backup and
recovery templates. You can launch the backup wizard and the
recovery wizard from the Backup, Archive, and Restore interface.
The wizards generate platform-independent templates that
contain configuration information that the software uses when
performing backups and restores. Because the wizard-generated
templates do not support all the features native to DB2, you may
want to write a customized backup or restore script in an
operating-system defined scripting language. You can use a
template as the base for a script.
Introduction to NetBackup for DB2 15
NetBackup for DB2 overview
Feature Description
Parallel backup and NetBackup for DB2 supports the parallel backup and restore
restore operations capabilities of the DB2 commands. For example, this permits the
user to run more than one tape device at a time for a single DB2
backup or restore, thereby reducing the time necessary to complete
the operation.
RECOVER DATABASE (DB2 8.2 and later) – User exit program (db2uext2.64)
RESTORE DATABASE
Additional required NetBackup software:
– NetBackup Client
Network (TCP/IP)
NetBackup software:
– NetBackup master server
– NetBackup media server
(if the system is a media server)
The installation program installs the vendor library in the following location:
/usr/openv/netbackup/bin
The name of the vendor library differs, depending on your platform as follows:
Platform Name
You specify the library as the argument to the LOAD parameter of the DB2 BACKUP
and RESTORE commands.
object in the Backup, Archive, and Restore interface. After you supply information
about the operation, the wizard creates a template that you can run immediately
or store on the server (for backup templates). You can use the stored backup
templates in scheduled backups through a NetBackup policy. You can also use
them to perform manual backups on the NetBackup for DB2 client.
/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.
Table 1-3 DB2 Syntax for Log Archiving and NetBackup for DB2 Terminology
NetBackup for DB2 uses the term "user NetBackup for DB2 uses the term
exit" to describe these DB2 settings: "VENDOR" to describe this DB2 setting:
LOGARCHMETH1=LOGRETAIN LOGARCHMETH1=VENDOR:.../library
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:
LOGARCHMETH1=VENDOR:/usr/openv/netbackup/bin/library
■ Verifying the operating system and platform compatibility for NetBackup for
DB2
To add a NetBackup for DB2 license key with the get_license_key command
1 From the master server or media server, run the following command:
/usr/openv/netbackup/bin/admincmd/get_license_key
2 When the system prompts you, type the host name of the NetBackup master
server.
■ NetBackup for DB2 backs up and restores the archive log files as a byte stream.
This method uses the DB2 backup API and the DB2 restore API.
26 Installing NetBackup for DB2
About log archiving
■ Directories for the user exit program to use when it copies the archive
logs. You may also want to create a separate NetBackup Standard policy
for backing up these directories.
■ Modify an existing NetBackup Standard policy with a user backup schedule.
Include the archive log directories..
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.
■ About backing up archive log files with the user exit program
■ Environment variables
■ Creating a backup template using the NetBackup for DB2 backup wizard
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.
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 in order to back up two different databases.
These backup windows can overlap.
32 Configuring NetBackup for DB2
About configuring a backup policy for a DB2 database
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.
3 If your site has more than one master server, choose the one on which you
want to add the policy.
4 (Windows) In the left pane, right-click Policies and choose New Policy.
5 (Java interface) In the left pane, click Policies. In the All Policies pane,
right-click the master server, and click New Policy.
6 In the Add a New Policy dialog box, in the Policy name box, type a unique
name for the new policy.
7 Click OK.
8 In the Add New Policy dialog box, in the Policy type list, select DB2.
The database agent policy type does not appear in the drop-down list unless
your master server has a license key for the database agent.
9 Complete the entries on the Attributes tab.
See “About policy attributes for NetBackup for DB2” on page 33.
10 Add other policy information as follows:
■ Add schedules.
See “About adding schedules to a NetBackup for DB2 policy” on page 34.
■ Add clients.
See “Adding clients to a NetBackup for DB2 policy” on page 39.
■ Add templates or scripts to the backup selections list.
See “Adding backup selections to a DB2 policy” on page 40.
11 When you have added all the schedules, clients, and backup selections you
need, click OK.
Table 3-1 Policy attribute descriptions for NetBackup for DB2 policies
Attribute Description
Policy type Determines the types of clients that can be in the policy. In some cases the policy type
determines the types of backups that NetBackup can perform on those clients. To use the
DB2 database agent, you must define at least one policy of type that is DB2.
34 Configuring NetBackup for DB2
About configuring a backup policy for a DB2 database
Table 3-1 Policy attribute descriptions for NetBackup for DB2 policies
(continued)
Attribute Description
Keyword phrase For NetBackup for DB2, the Keyword phrase entry is ignored.
See “About NetBackup for DB2 with Snapshot Client” on page 95.
Table 3-2 Example settings for an NetBackup for DB2 Application Backup
schedule
Retention 2 weeks
00:08:00 - 22:00:00
Table 3-3 Example settings for NetBackup for DB2 automatic backup schedules
18:00:00 - 22:00:00
Automatic Full Backup An Automatic full backup contains a copy of all the data. Note
that a full backup is not the same as a whole database backup.
"Full" is an indicator 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 type of backup takes less time and space than a full backup.
The backup contains only the data that changed since the last full
backup.
To help guard against such mistakes, use a template instead of a script whenever
possible. When a template runs, it detects the backup type on the schedule. You
are responsible for specifying a template with the correct operation type (backup
or restore) in the policy.
Property Description
Type of backup Specifies the type of backup that this schedule controls. The selection list shows only the
backup types that apply to the policy you want to configure.
See “About the NetBackup for DB2 backup types” on page 36.
Schedule type You can schedule a backup in one of the following ways:
■ Frequency
This setting is used only for scheduled backups. It is not used for user-directed backups.
Frequency specifies the period of time that can elapse until the next backup or archive
operation begins on this schedule. For example, assume that the frequency is seven
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
This setting is used only for scheduled backups. It is not used for user-directed backups.
The Calendar option allows you to schedule backup operations that are based on specific
dates, recurring week days, or recurring days of the month.
Configuring NetBackup for DB2 39
About configuring a backup policy for a DB2 database
Property Description
Retention The retention period for an Application Backup schedule refers to the length of time that
NetBackup keeps backup images (stream-based backups). The retention period for an
automatic schedule controls how long NetBackup keeps records of when scheduled backups
occurred (proxy backups). For example, if your database is backed up once every Sunday
morning, you should select a retention period of at least 2 weeks.
The retention period is affected by the type of schedule you select, 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 to determine
whether a backup is due. This means that 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.
3 Type the name of the client and press Enter (Windows) or click Add (Java).
If DB2 is installed in a NetBackup cluster, specify the virtual DB2 name as
the client name.
4 (Windows) To add another client, repeat step 2 and step 3.
5 (Java) To add another client, repeat step 3.
6 If this client is the last client you want to add, click OK.
7 (Java) In the Policy dialog box, click Close.
Note: Be sure to specify the correct template and script names in the backup
selections list to prevent an error or possibly a wrong operation. Make sure that
the template or script resides on the client before you try to add it to the backup
selections list.
To add a template to the backup selections list from the Java interface
1 Open the Policy dialog box.
To access the Policy dialog box, double-click the policy name in the Policies
list in the NetBackup Administration Console.
2 Click the Backup Selections tab.
3 Click New.
4 From the Script or Template list, select a template or type the name of a
template.
Include the .tpl extension. Do not include the full path. For example,
weekly_full_backup.tpl.
5 Click Add to add the template to the list.
6 Click OK.
To add a script to the backup selections list from the Java interface
1 Open the Policy dialog box.
To access the Policy dialog box, double-click the policy name in the Policies
list in the NetBackup Administration Console.
2 Click the Backup Selections tab.
3 Click New.
4 In the Script or Template 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
To add a template to the backup selections list from the Windows interface
1 In the Policy dialog box, click the Backup Selections tab.
To access the Policy dialog box, double-click the policy name in the Policies
list in the NetBackup Administration Console.
2 Click New.
Alternatively, you can type the name of the template with the .tpl extension.
Do not include the full path. For example, weekly_full_backup.tpl.
4 From the Template list, choose the correct template.
5 Click OK.
6 Click OK.
To add a script to the backup selections list from the Windows interface
1 In the Policy dialog box, click the Backup Selections tab.
To access the Policy dialog box, double-click the policy name in the Policies
list in the NetBackup Administration Console.
2 Click New.
3 Click the Remote Folder button.
Alternatively, you can type the full path name of the script on the client. For
example:
/backup_scripts/db/cold_backup.sh
C:\backup_scripts\db\cold_backup.cmd
Note: Add the server names to the master server before you configure the server
list on the client. To add server names on the client, see the following topic:
See “Specifying the NetBackup master server from the client” on page 61.
44 Configuring NetBackup for DB2
About backing up archive log files with the user exit program
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.
46 Configuring NetBackup for DB2
About backing up archive log files with the user exit program
Object Description
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.
7 On the Clients tab, add the clients you want to back up.
The clients must have the following installed:
■ DB2
■ NetBackup DB2
If the client is installed in a NetBackup cluster, add the virtual host name to
the client list.
8 Note the name of this policy.
9 When you configure the db.conf file, specify the name of the policy you created
in this procedure.
See “Creating a db2.conf file (user exit program)” on page 49.
/usr/openv/netbackup/ext/db_ext/db2/scripts
$DB2_Instance_Home/db2.conf
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
50 Configuring NetBackup for DB2
Configuring the runtime environment
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.
■ If you use ARCFUNC COPY:
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
ARCDIR /home/db2inst1/arcdir
RETDIR /home/db2inst1/arcdir
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.
■ The DB2_Log_Policy backs up the archive logs. This policy has a user backup
schedule named User. The second entry in the example file specifies this policy
and its user backup schedule.
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
ENDOPER
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
52 Configuring NetBackup for DB2
Configuring the runtime environment
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
ENDOPER
/usr/openv/netbackup/ext/db_ext/db2/scripts
$DB2_Instance_Home/db2.conf
Configuring NetBackup for DB2 53
Configuring the runtime 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.
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 “Keyword summary” on page 54.
7 Save and close the db2.conf file.
8 Repeat this procedure on each client computer.
See “Example db2.conf file (with VENDOR method)” on page 53.
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 /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
#ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_ARCH_Policy
SCHEDULE Default-Application-Backup
ENDOPER
Keyword summary
Rules are available on how to specify keywords in the db2.conf file.
The rules are as follows:
■ A db2.conf file consists of a series of entries that define a policy and a schedule
that are based upon an OBJECTTYPE.
■ Specify a different POLICY name for the DATABASE object. Also specify a policy
name for ARCHIVE object when you use ARCFUNC SAVE.
■ Within a definition, OBJECTTYPE is a required keyword. POLICY is required for
the DATABASE object. It is also required for the ARCHIVE object if you use ARCFUNC
SAVE or if you use the VENDOR method. POLICY is not required if you use ARCFUNC
COPY.
All other keywords are optional.
■ Terminate each entry with an ENDOPER keyword.
■ Within a definition, the keyword value pairs can appear in any order.
■ The keywords are not case sensitive, but their values are.
■ Entries are not nested.
Configuring NetBackup for DB2 55
Configuring the runtime environment
■ When a pound character (#) appears in the first column, the line is treated as
a comment.
The db2.conf file accepts the keywords that are described in this topic. If VENDOR
is configured in your DB2 environment, NetBackup for DB2 ignores certain the
following keywords and keyword phrases.
The following keywords and keyword phrases are ignored:
■ ARCDIR
■ ARCFUNC SAVE
■ ARCFUNC COPY
■ PARTITIONTYPE RAW
■ RETDIR
Table 3-7 describes the keywords and values that are used.
Table 3-7 Keyword value pairs for the db2.conf file (continued)
NODE number Specifies the DB2 node number. Do not specify this
keyword unless you operate within a DB2 Enterprise
Extended Edition (EEE) environment. Not required.
No default.
PARTITIONTYPE RAW Specifies that NetBackup search for 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 a Default-Application-Backup
schedule.
Table 3-7 Keyword value pairs for the db2.conf file (continued)
CLIENT_NAME=client_name
CLIENT_NAME=client_name
Environment variables
The NetBackup automatic scheduler creates the environment variables in the
following table when it executes a NetBackup for DB2 backup-restore template
or script. You can use the DB2_FULL, DB2_INCR, and DB2_CINC variables within a
script to specify a backup type.
Note: Only NetBackup’s backup and restore templates and scripts use the
environment variables in the following table. These variables are unknown to the
DB2 backup and restore commands. For example, the backup and restore
commands do not process the DB2_POLICY variable. Instead, the templates and
scripts use the POLICY name. This policy is defined in the
$DB2_INSTANCE_HOME/db2.conf file.
Environment Purpose
variable
BKUP_IMAGE_PERM Lets you set the permissions on a backup image at backup time.
Possible values are the following:
USER - set the permissions to 600. Only the original user who
backed up the data has access to the backup images.
GROUP - set the permissions to 660. Anyone from the same group
as the original user who backed up the data has access to the
backup images.
ANY - set the permissions to 664. Anyone has access to the backup
images.
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY db2-bkup
BKUP_IMAGE_PERM USER
SCHEDULE Default-Application-Backup
ENDOPER
You can also specify the keyword by using the OPTIONS directive
on the DB2 backup command. For example:
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.
Environment Purpose
variable
Templates
The NetBackup for DB2 backup wizard creates backup templates. This wizard is
initiated from the NetBackup Backup, Archive, and Restore interface.
See “Creating a backup template using the NetBackup for DB2 backup wizard”
on page 61.
The NetBackup for DB2 backup wizard does not support all of the commands and
options that are provided by DB2. If a template does not provide all of the required
functionality, you must write a script.
Configuring NetBackup for DB2 61
Specifying the NetBackup master server from the client
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 are written by the user and must conform to DB2 and UNIX shell
syntax.
See “Creating DB2 scripts manually” on page 64.
NetBackup for DB2 also provides a utility, bpdbsbdb2, that can generate a shell
script from a backup wizard template. This allows you to create a template with
the wizard and then generate a shell script from it. You can then run the shell
script or modify the shell script further.
See “Creating shell scripts using bpdbsbdb2” on page 63.
$NBU_HOME/bp.conf
Note: Because the Backup, Archive, and Restore interface only displays local or
resident partitions, templates that are created on the local client do not back up
partitions on remote hosts. Create additional templates for the other remote
partitions by running the wizard on those clients. To back up the entire EEE/DPF
configuration, specify multiple templates in the policy backup selections list.
/usr/openv/netbackup/bin/jbpSA &
Creating a backup template with the NetBackup for DB2 Backup Wizard
After you select the DB2 objects to back up, use the NetBackup for DB2 Backup
Wizard to create a backup template for that DB2 element. The following procedure
uses the Backup, Archive, and Restore interface on the NetBackup for DB2 client.
To create a backup template by using the NetBackup for DB2 Backup Wizard
1 When you log on to NetBackup, log on as the DB2 user.
2 In the Backup, Archive and Restore interface, select the DB2 object(s) you
want to back up.
3 Click Actions > Backup.
The NetBackup for DB2 backup wizard displays the following screens for you
to enter information about the backup operation you want to perform:
Configuring NetBackup for DB2 63
Creating shell scripts using bpdbsbdb2
■ Welcome
■ Database Login
■ Initial Settings
■ Backup Options
■ Template Summary
Click Help on the wizard panel for more information.
4 When you complete the wizard, the Template Complete screen appears. You
can save the template for later use, run the template immediately, or both.
Click Help for details about saving and running the template you created.
5 When you are satisfied with the template, click Finish to save, run, or save
and run the template you created.
When you run a backup template from the wizard, NetBackup performs a full
backup.
where:
Caution: It is the user's responsibility to review and customize any and all scripts
that are generated from templates. Generated scripts are intended to be modified
for the user's environment and preferences. For example, settings such as
passwords or catalog partition numbers are not generated in the template-to-script
conversion, so they require manual editing. In addition, generated scripts do not
handle all possible error and failure cases and should be used at your own risk.
Scripts that are generated for UNIX are intended to be run by an authorized DB2
user.
Script execution permissions should be reviewed and modified as desired by the
user.
For security purposes, user names and passwords are not included in generated
scripts. They must be added if needed.
The DB2 QUIESCE command is generated when the Disconnect users and prohibit
access template option is specified. However, this command fails if your version
is before DB2 V8.1.
When attempting a point-in-time restore, customize the time value. The command
DB2 RESTORE ... TAKEN AT strictly interprets the specified time and succeeds
only if a backup image with the same time exists. For more information, see your
IBM DB2 documentation. This limitation does not exist for templates, which search
for an appropriate image.
If a template enables roll-forward recovery, then roll-forward commands are
generated for all partitions that are specified in the template, whether or not that
partition is configured for roll-forward recovery.
If a script performs a roll-forward recovery, customize the DB2NODE variable. In
single partition environments, this variable can typically be empty (for example,
"DB2NODE="). In a multiple partition environment, set this variable to the catalog
partition number.
■ db2_restore
■ db2_all_backup_mpp
■ db2_all_restore_mpp
/usr/openv/netbackup/ext/db_ext/db2/scripts
Note: Be sure to modify these scripts for your environment. Do not store your
scripts in the sample directory because they are lost if you upgrade or reinstall.
Always relocate your scripts to a safe location. For clustered environments, this
location must be available after a failover.
Although each script can have multiple DB2 commands operations, a separate
script is required for each type of operation. For example, you need separate
scripts for backups and restores.
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 templates and scripts read parameters from the
environment when they perform backup and restore operations.
The parameters can come from the following sources:
■ Environment Variables
■ 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 used to perform the backup.
See “Configuring the runtime environment” on page 48.
Templates
The backup wizard saves a backup template to a location specific to NetBackup
on the current NetBackup master server. NetBackup retrieves a backup template
from the master server as part of a backup (server-directed, scheduled, or
user-directed) and runs it on the client. A backup template is associated with a
policy by specifying its name in the policy file or script list. Because backup
templates are stored on the server in a known location, server-directed and
scheduled backups use the same copy of the template for each client in the policy
client list.
The recovery wizard saves a restore template to a user-specified location on the
client. The location that is specified should include a fully qualified path to a
directory where the user has write access.
See “Using the NetBackup for DB2 recovery wizard” on page 80.
Templates store the encrypted passwords that are decrypted at runtime.
Shell scripts
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.
Configuring NetBackup for DB2 67
Storing templates and scripts in a NetBackup cluster
■ Performing a backup
■ Browsing backups
■ Performing a restore
Caution: Always specify the correct DB2 script or template when configuring
automatic backups or when starting operations through NetBackup. NetBackup
for DB2 does not generate an error if a restore DB2 script file is used for a backup
operation or a backup DB2 template or script is used for a restore operation.
Performing a backup
This section describes the different ways you can perform a backup and explains
the relationships between settings.
70 Performing backups and restores of DB2
Performing a backup
■ By running a script from the operating system command line. You can create
scripts from scratch, or you can base a script on a template that you created
earlier.
■ Through templates that are initiated from the template wizards or Template
Administration interface.
■ Through templates and scripts that are specified in policies. When you back
up a NetBackup policy, it uses the templates and scripts that are specified in
the policy.
The main types of DB2 backups are as follows:
■ A database backup is a copy of the entire DB2 database or tablespace. This
backup is accomplished by issuing a DB2 BACKUP DATABASE command. A
database backup can be initiated through NetBackup by an automatic backup
of a DB2 policy, a manual backup of a DB2 policy, or a user-directed 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.
■ A configuration file backup is a backup of the DB2 configuration files that you
need to recover the database in the case of a disaster.
You can use a Standard policy with a User Backup schedule to back up the
files.
For information on which files to back up, see your IBM DB2 documentation.
Delete Removes the selected template. You must be the root user or the
template creator to delete a template.
Rename Changes the name of the selected template. You must be the root user
or the template creator to rename a template.
The templates that are created by the NetBackup for DB2 template generation
wizard are stored in a predetermined location on the master server.
See “Creating a backup template using the NetBackup for DB2 backup wizard”
on page 61.
To use the DB2 template administration interface
1 Start the NetBackup Backup, Archive, and Restore interface.
For example, type the following from the command line:
/usr/openv/netbackup/bin/jbpSA &
2 In the Backup, Archive, and Restore interface, choose Actions > Administer
Database Templates > DB2.
The DB2 Template Administration window appears.
The Select Template list shows the names and descriptions of the DB2 backup
templates that are stored on the current master server.
3 Select the name of the backup template you want to run.
4 Click Run.
5 Type your User Name and Password.
6 Click OK.
7 Click Run.
The template runs a full backup. Incremental backups are only available
through the NetBackup scheduler.
You can use the View Status tool to see the status of the backup. Click File >
View Status.
Using bpdbsbdb2
The bpdbsbdb2 command runs a backup template that is created by the NetBackup
for DB2 Backup Wizard. At the command prompt, issue the bpdbsbdb2 in the
following format:
For lib, specify the same path as shown for the preceding format (Format 1).
The db2.conf file specifies several variables that the backup operation uses. You
can override the policy name and schedule name variables directly on the command
line by using the OPTIONS entry. The following example overrides the policy
name and the schedule name:
For more information on the DB2 BACKUP DATABASE command, see your DB2
documentation.
Table 4-1 lists the command options when used in a NetBackup for DB2
environment.
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 options that are to be used for the backup
operation. The string passes to the vendor support
library, for example TSM, exactly as it was entered,
without the quotes.
Browsing backups
This section describes how to browse backup images. You can also use the DB2
LIST HISTORY command.
In this example, the DB2 resource is expanded down to the tablespace level. You
can select a tablespace or tablespaces, a partition or partitions, or one entire
database (by selecting all of its partitions) for the restore.
Example 1
The -t 18 option on this command specifies the DB2 backup type. The bplist
output shows the DB2 database backup images that are stored in the NetBackup
database.
Table 4-2 shows how to interpret one of the lines from the listing.
(Filename)
■ node0000
Node number. In non-partitioned database systems, 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.
■ 0
Last archive log number.
■ 19991202105152
Timestamp. Includes the date (year, month, day) and time
(hour, minute, second).
Performing backups and restores of DB2 79
Browsing backups
■ 1
Session number. This file extension identifies the session
number that was specified on the DB2 BACKUP command.
Example 2
This example uses bplist to search for all DB2 archive log file backups. The -k
DB2_Log_Policy option specifies 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.
Example 3
This example uses bplist to search for DB2 archive log files. The -k log_policy
option specifies files that are backed up with this policy. The output format in the
following example differs from the previous examples because for this database,
the VENDOR archive log method is enabled in DB2:
Performing a restore
As the DB2 user, you can initiate a database restore with the DB2 Control Center
or command-line processor.
A NetBackup task can execute a restore template or script containing the necessary
DB2 commands to perform the restore. You can use the NetBackup for DB2
recovery wizard to create restore templates, or write scripts that contain the
commands to perform a restore.
4 Click OK.
5 Click the Restore Files tab.
6 Expand the DB2 resource in the left pane to view a DB2 instance hierarchy.
7 Select a node in the left pane to view details in the right pane.
If the DB2 node is not visible, it is possible that your NetBackup for DB2 client
does not have the appropriate policy type specified.
■ Welcome
■ Database Login
■ Time Periods
■ Restore Options
■ Recovery Options
If you need an explanation of any of the fields on the wizard screens or more
details, click Help on the wizard screen.
6 Run the template immediately after the wizard finishes, to save the template
locally, or both. For explanations of your choices, click Help.
Template execution does not support the use of local time when performing
a roll-forward. The roll-forward time that is specified in the template is passed
to DB2, and it is interpreted as GMT by DB2. For more information, see the
ROLLFORWARD command in your DB2 documentation.
Using bpdbsbdb2
The bpdbsbdb2 command lets you run a recovery template that the NetBackup
Recovery wizard creates.
At the command line, type the following:
/usr/openv/netbackup/bin/bpdbsbdb2 -restore -r \
-t /db2/restore_templates/full_restore.tpl
Where:
To restore a DB2 database when the archive logs are in a non-standard location
1 Restore the database.
Issue the DB2 RESTORE DATABASE command to restore the database itself. For
example:
where:
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.
Performing backups and restores of DB2 87
Performing a restore
Option Purpose
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.
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-2 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:
■ 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.
90 Performing backups and restores of DB2
Performing an alternate restore
■ /usr/openv/netbackup/db/altnames/dest_client_name
client2
4 Edit the bp.conf file to change the information for the CLIENT_NAME and
SERVER entries.
The following example shows the keyword that are needed to define the new
database:
DATABASE NEWSAMPL
OBJECTTYPE DATABASE
POLICY db2-bkup
SCHEDULE Default-Application-Backup
CLIENT_NAME Client1
ENDOPER
The following example shows the keyword that are needed to define the old
database:
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY db2-bkup
SCHEDULE Default-Application-Backup
CLIENT_NAME Client1
ENDOPER
The following example shows the keyword that are needed to define the new
data archive log files:
DATABASE NEWSAMPL
OBJECTTYPE ARCHIVE
POLICY db_a_db2
SCHEDULE Default-Application-Backup
92 Performing backups and restores of DB2
Performing an alternate restore
#SCHEDULE User
CLIENT_NAME Client1
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER
The following example shows the keyword that are needed to define the old
data archive log files:
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY db_a_db2
SCHEDULE Default-Application-Backup
#SCHEDULE User
CLIENT_NAME Client1
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
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:
For example:
For example:
mkdir /db/db2_v5/home/db2inst1/NODE0000/SQL00001/SQLOGDIR
bprestore /db/db2_v5/home/db2inst1/NODE0000/SQL00001
/SQLOGDIR/S00001.LOG
3 (Optional) Move the logs to the correct directory for the destination database.
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.
Chapter 5
Using Snapshot Client with
NetBackup for DB2
This chapter includes the following topics:
■ About supported platforms for NetBackup for DB2 with Snapshot Client
DB2 can back up DB2 objects by taking snapshot images of the component files.
Later, it backs up the snapshot version to the storage unit.
Snapshot backup captures the data at a particular instant without causing
significant client downtime. Client operations and user access continue without
interruption during the backup. The resulting capture or snapshot can be backed
up without affecting the performance or availability of the database.
Proxy copy
A proxy copy is a special type of backup in which the NetBackup for DB2 agent
manages the control of the data transfer. During the backup and restore operations,
the proxy copy enables the agent to manage the entire data movement between
the disks that contain the data files and the storage devices that are managed by
NetBackup.
Backups and restores remain tightly integrated with DB2 and its catalog, greatly
simplifying administration tasks.
Using Snapshot Client with NetBackup for DB2 97
About NetBackup for DB2 with Snapshot Client
File-based operations
In a file-based operation, DB2 provides the list of files that require backup or
restore to NetBackup for DB2 with Snapshot Client. NetBackup for DB2 with
Snapshot Client performs the data movement.
Figure 5-1 represents a file-based backup or restore.
Figure 5-1 NetBackup for DB2 with Snapshot Client file-based backup or restore
DB2 Server
Control commands
List of files
Data Data
NetBackup
Stream-based operations
Stream-based operations are the standard NetBackup implementation of
conventional NetBackup for DB2 backup and restores. In a stream-based backup,
NetBackup moves the data that is provided by the server process. NetBackup
captures the data stream content that is provided by DB2. If the user has specified
multiple streams, then NetBackup for DB2 opens multiple streams and NetBackup
catalogs them as separate images.
Figure 5-2 represents a stream-based backup or restore.
98 Using Snapshot Client with NetBackup for DB2
About supported platforms for NetBackup for DB2 with Snapshot Client
DB2 Server
DB2 database disk DB2 database
disk
Control commands
Data
NetBackup
The agent checks that the policy it uses for the backup is configured with the
appropriate Snapshot Client attributes. The agent then initiates file-based backups
of the DB2 files and uses the NetBackup Snapshot Client interface to perform the
data movement.
The NetBackup for DB2 agent uses DB2 APIs to put the data files into quiesce/write
suspend 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
quiesce/write suspend mode. The data files that are backed up are in quiesce/write
suspend mode only for the period of time it takes to create a snapshot of the data.
NetBackup for DB2 cannot use Snapshot Client methods to back up individual
tablespaces or container files.
DB2 performs only conventional backups for transaction log files. You cannot use
Snapshot Client methods for transaction logs backed up with either the user exit
program or the VENDOR method.
File-based and stream-based backups require different configurations. When you
configure NetBackup for DB2 with Snapshot Client backups, be sure to configure
policies that allow both kinds of backups.
See “About Snapshot Client effects” on page 114.
The agent splits the files into three streams and initiates a file-based backup for
each stream. After the proxy backup is done, DB2 starts a non-proxy conventional
backup of the transaction logs.
Issue this command on each node of the database.
Using Snapshot Client with NetBackup for DB2 101
About configuring snapshot backups with NetBackup for DB2
Note: The UID number can be different than the GID number.
■ Allocate at least two different volumes or file systems for database activities,
as follows:
102 Using Snapshot Client with NetBackup for DB2
About configuring snapshot backups with NetBackup for DB2
■ Allocate one or more volumes or file systems to the database data files.
■ Allocate a different set of volumes or file systems to the DB2 executables,
configuration files, and the 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 (or file systems)
as the data files, the logs are temporarily frozen while NetBackup takes the
snapshot. The process cannot access the logs when the database is active, so
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 or file system that is being restored.
■ 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 license key for this option must be registered.
■ To perform off-host backups, perform any special configuration that is
required.
Use Alternate If you select Alternate client, also specify the name of the client
client (UNIX and to perform the backup. This option may require additional
Windows clients) configuration. The alternate client must be a client that shares
the disk array.
Use Data mover If you click Data mover, also select one of the following possible
(UNIX clients data movers:
only).
NetBackup Media Server
You can perform a snapshot rollback from an instant recovery backup that was
made with the following methods:
■ VxFS_Checkpoint snapshot
■ vxvm snapshot
■ FlashSnap snapshots
See the NetBackup Snapshot Client Administrator’s Guide.
The following considerations are relevant for NetBackup for DB2 restores:
■ Snapshot rollback overwrites the entire volume.
■ With NetBackup for DB2, snapshot rollback always performs file verification.
The agent checks for the following:
■ The requested files (number and names) are identical to those in the
snapshot
■ The primary volume does not contain any files that were created after the
snapshot was made
If verification fails, the rollback aborts with 249.
■ Use snapshot rollback with database files only. Database files and archive logs
should exist on different file systems or volumes.
4 Select Actions > Select Restore Type > Point in Time Rollback.
5 Use the NetBackup for DB2 recovery wizard for the restore.
See “Performing a restore” on page 80.
where:
in quiesce/write suspend mode for only a few seconds while the Storage Checkpoint
is created, so the extra archive log space used is very small.
However, space in the file system is needed to keep a copy of the original block
of data that changed. If the workload is light during the backup or if the backup
window is relatively short (such as for incremental backups), an additional 10%
of the file system size is usually sufficient. If the database has a heavy workload
while a full backup is running, the file systems may require more space.
While archive log mode is required when the database is online, this mode provides
the best recoverability for taking offline Storage Checkpoints, too.
/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 data files in quiesce/write suspend mode for the duration of the
backup.
Automatic Full Backup For file-based proxy copy backups, the automatic backup schedule
types serve the following purposes:
Automatic Differential
Incremental Backup, ■ Automatically start the backups by running the NetBackup for
DB2 scripts or templates.
Automatic Cumulative
■ Control file-based snapshot backups of the database objects.
Incremental Backup
Snapshot backups do not support BLI functionality. Database
headers are always updated when a checkpoint of the database is
performed. An incremental backup that copies each changed file
in its entirety is likely to include all of a database’s files. In effect,
the backup is then a full backup.
Property Description
For proxy backups, NetBackup uses the retention period for the
automatic type of backup to specify how long to keep proxy
file-based backup images.
For proxy backups, NetBackup for DB2 with Snapshot Client uses
the retention period for the automatic type of backup to specify
how long to keep proxy file-based backup images.
Multiple copies For proxy file-based backups, configure Multiple copies on the
automatic backup schedule.
116 Using Snapshot Client with NetBackup for DB2
Using NetBackup for DB2 with Snapshot Client
Performing backups
NetBackup for DB2 performs backups with Snapshot Client in the following ways:
■ Server-directed, both automatic and scheduled from the master server
■ User-directed, by template creation and execution on the client
■ User-directed, from the command line as a DB2 user (with the bpdb2proxy
command)
All of these methods require a DB2 policy with Snapshot Client configuration.
Server-directed backups
The configuration procedures in this chapter describe the process for configuring
policies for DB2 backups with Snapshot Client.
See “Configuring the DB2 policy with Snapshot Client backup methods” on page 102.
These policies specify Snapshot Client backups for the DB2 database.
Using Snapshot Client with NetBackup for DB2 117
Using NetBackup for DB2 with Snapshot Client
Performing restores
Perform NetBackup for DB2 Snapshot Client restores from the DB2 client. The
following sections describe the restore methods.
Note: The backup image you restore with bpdb2proxy must be from a Snapshot
Client method backup, otherwise, the restore fails.
118 Using Snapshot Client with NetBackup for DB2
Using NetBackup for DB2 with Snapshot Client
Use the bpdb2proxy command in the following format to restore a DB2 database
with a Snapshot Client method:
/usr/openv/netbackup/logs/README.debug file
Troubleshooting NetBackup for DB2 121
Enabling the debug logs for a NetBackup UNIX/Linux client
/usr/openv/netbackup/logs/bpbackup
/usr/openv/netbackup/logs/bpbkar
/usr/openv/netbackup/logs/bpdb2
/usr/openv/netbackup/logs/bpdbsdb2
/usr/openv/netbackup/logs/bphdb
/usr/openv/netbackup/logs/bprestore
/usr/openv/netbackup/logs/bpubsdb2
/usr/openv/netbackup/logs/dbclient
/usr/openv/netbackup/logs/tar
/usr/openv/netbackup/logs/backint
chmod 777 /usr/openv/netbackup/logs/backint
For example:
cd /usr/openv/netbackup/logs
mkdir bphdb
2 The user_ops, each of the log directories, and any subdirectories should have
777 permissions. They must exist and be accessible for the applications to
operate correctly.
For example:
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.
About the backint directory on the NetBackup for DB2 database client
The /usr/openv/netbackup/logs/backint directory contains execution logs.
The following execution log exists:
■ log.mmddyy
This log contains debugging information and execution status for the
NetBackup for DB2 client process.
log.mmddyy
This log contains debugging information and execution status for the NetBackup
for DB2 backup and recovery wizards and for the bpdbsbdb2 command line utility.
This log also contains the debugging information and execution status information
that is generated when a DB2 template is run from an automatic schedule (when
bphdb invokes bpdbsbdb2 to run the template).
VERBOSE = X
300
Message:
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 the image you want to restore exists. Make sure the
correct instance is used.
Make sure the correct values are set in db2.conf and bp.conf.
If logging is enabled, check the current log file in the following directory for more
information:
/usr/openv/netbackup/logs/bpdb2
305
Message:
Cause:
Multiple DB2 backup images were found in the NetBackup database that matched
the restore criteria of database name, instance, type, and backup time.
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:
/usr/openv/netbackup/logs/bpdb2
126 Troubleshooting NetBackup for DB2
About the error message codes
310
Message:
Cause:
Unable to read configuration file /usr/openv/netbackup/bp.conf.
Action:
Make sure the file exists and is properly configured.
If logging is enabled, check the current log file in the following directory for more
information:
/usr/openv/netbackup/logs/bpdb2
330
Message:
Cause:
Invalid option(s) encountered for action.
Action:
Make sure the action parameters are used properly.
335
Message:
Cause:
NetBackup server and the NetBackup for DB2 shared library are not at the same
level.
Action:
Make sure that the NetBackup and the DB2 shared library are at the same level.
Check the log file in the following directory:
/usr/openv/netbackup/logs/bpdb2
Troubleshooting NetBackup for DB2 127
About the error message codes
Check the version number of the shared library and the version number for
NetBackup. If they are not the same, install the same level.
380
Message:
Cause:
db2.conf read status error.
Action:
Make sure the directory is accessible with read and write permissions. Make sure
the file exists and has read permission.
385
Message:
Cause:
Found multiple DATABASE entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
Action:
Remove the extra DATABASE entry.
390
Message:
Cause:
Found multiple OBJECTTYPE entries before an ENDOPER entry was encountered in
the following file:
128 Troubleshooting NetBackup for DB2
About the error message codes
$HOME/db2.conf
Action:
Remove the extra OBJECTTYPE entry.
395
Message:
Cause:
Found multiple POLICY entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
Action:
Remove the extra POLICY entry.
400
Message:
Cause:
Found multiple SCHEDULE entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
Action:
Remove the extra SCHEDULE entry.
405
Message:
Troubleshooting NetBackup for DB2 129
About the error message codes
Cause:
Found multiple ARCFUNC entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
Action:
Remove the extra ARCFUNC entry.
410
Message:
Cause:
Found multiple ARCDIR entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
Action:
Remove the extra ARCDIR entry.
415
Message:
Cause:
Found multiple RETDIR entries before an ENDOPER entry was encountered in the
following file:
$HOME/db2.conf
130 Troubleshooting NetBackup for DB2
About the error message codes
Action:
Remove the extra RETDIR entry.
420
Message:
Cause:
Policy name or schedule name is not specified in the POLICY or SCHEDULE entry
in the following file:
$HOME/db2.conf
Action:
Add an appropriate policy name or schedule name to the POLICY or SCHEDULE
entry.
425
Message:
Cause:
Invalid ARCDIR is specified in db2.conf.
Action:
Add an appropriate directory name to the ARCDIR entry.
430
Message:
Cause:
Troubleshooting NetBackup for DB2 131
About the error message codes
$HOME/db2.conf
Action:
Add an ARCDIR field with an appropriate directory name to the following file:
$HOME/db2.conf
435
Message:
Cause:
RETDIR field does not contain a valid file.
Action:
RETDIR field must contain a valid file when OBJECTTYPE ARCHIVE is specified in
the following file:
$HOME/db2.conf
440
Message:
Cause:
Found OBJECTTYPE ARCHIVE but no ARCFUNC in the db2.conf file.
Action:
Specify a copy or save parameter for ARCFUNC if OBJECTTYPE ARCHIVE is also
specified.
445
Message:
132 Troubleshooting NetBackup for DB2
About the error message codes
Cause:
Invalid OBJECTTYPE entry in the following file:
$HOME/db2.conf
Action:
Add the appropriate object type to the following file:
$HOME/db2.conf
450
Message:
Cause:
OBJECTTYPE entry is not specified in the following file:
$HOME/db2.conf
Action:
Add the appropriate object type to the following file:
$HOME/db2.conf
455
Message:
Cause:
POLICY entry is not specified in the following file:
$HOME/db2.conf
Action:
Add the appropriate policy name to the POLICY entry in the following file:
$HOME/db2.conf
Troubleshooting NetBackup for DB2 133
About the error message codes
502
Message:
Cause:
Internal communication between DB2 and NetBackup failed.
505
Message:
Cause:
This error can occurr when you use an unsupported version of DB2.
507
Message:
Cause:
NetBackup encountered errors in preparing for the requested operation. This can
result from improper configuration.
510
Message:
Cause:
NetBackup encountered errors in reading configuration settings.
Action:
Check that the NetBackup client and server settings are configured. Also verify
that the db2.conf file exists and that it is configured.
511
Message:
134 Troubleshooting NetBackup for DB2
About the error message codes
Cause:
NetBackup encountered errors in preparing for the requested operation. This
error can result from improper configuration.
513
Message:
Cause:
NetBackup encountered errors when attempting to start the requested operation.
This error can indicate a problem in obtaining necessary resources.
514
Message:
Cause:
NetBackup encountered errors when attempting to create a backup image.
515
Message:
Cause:
NetBackup encountered errors when attempting to access a backup image.
516
Message:
Cause:
NetBackup encountered errors when attempting to locate a backup image.
Troubleshooting NetBackup for DB2 135
About the error message codes
518
Message:
Cause:
NetBackup encountered errors when writing a backup image.
520
Message:
Cause:
NetBackup encountered errors when reading a backup image.
523
Message:
Cause:
NetBackup encountered errors when attempting to close the backup image.
524
Message:
Cause:
NetBackup encountered errors when attempting to complete the requested
operation.
526
Message:
Cause:
136 Troubleshooting NetBackup for DB2
About the error message codes
528
Message:
Cause:
NetBackup encountered errors when attempting to expire an incomplete backup
image. This error typically indicates that the previous operation has failed, and
DB2 is attempting to delete any incomplete images.
Appendix A
Configuration for a DB2 EEE
(DPF) environment
This appendix includes the following topics:
For complete instructions on how to create this type of schedule, see the
following:
See “Configuring an Application Backup schedule” 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 userexit 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 44.
■ If you use the VENDOR method, see the following:
See “Creating a db2.conf file (vendor method)” on page 52.
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.
The use of the NetBackup user exit program is required because it automatically
archives log files to a storage unit and because it enables on-demand recovery of
log files by DB2.
142 Using NetBackup for DB2 with SAP®
Backup and restore of DB2 databases
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.
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.
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.
A backup
Application Backup schedule archive log 70
configuring 34 automatic
environment variables 60 configure scripts 65
for block-level incremental backups 113 using scripts 71
overview 34, 36 database 70
retention 35 manual 71
with Snapshot Client 102 partitions 71
ARCDIR keyword 55 tablespaces 71
ARCFUNC COPY keyword 51, 55 user-directed 71
ARCFUNC SAVE keyword 50, 55 with Snapshot Client methods 99, 116
ARCHIVE LOG command 17 wizard
archive logs invoking 116
backing up 25, 70 BACKUP command 17
configuring policies 46 BACKUP DATABASE command 15, 70, 74–75
keywords for backing up in db2.conf 44 backup media required 23
overview 18 Backup Selections list
restoring 84 adding scripts 41
restoring from a raw partition 56 adding selections 41–42
automatic backup adding templates 41–42
create scripts 65 overview 40
overview 71 backups
policy 71 manual 43
automatic backup schedule wizard
configuring 35 invoking 62
Automatic Cumulative Incremental Backup schedule block-level incremental backup
overview 37 configuring 113
Snapshot Client effects 115 overview 109
Automatic Differential Incremental Backup schedule bp.conf
overview 37 client file 57
Snapshot Client effects 115 DB2 script parameters 66
Automatic Full Backup schedule 36–37 in a cluster 57
Snapshot Client effects 115 user file 58
with Snapshot Client 102 variables 66
bpdb2proxy command 108, 117
bpdbsbdb2
B command syntax 73
Backup running a backup template 73
Archive running a recovery template 82
and Restore interface. See invoking. See bpdbsbdb2 command 63
overview bphdb
log 122
144 Index
K NODE keyword 56
keywords
ARCDIR 55 O
ARCFUNC COPY 51, 55 OBJECTTYPE ALTERNATE keyword 56
ARCFUNC SAVE 50, 55 OBJECTTYPE ARCHIVE keyword 56
DATABASE 55 OBJECTTYPE DATABASE keyword 56
db2.conf 55 OBJECTTYPE TABLESPACE keyword 56
DESTALIAS 55 offhost backup. See Snapshot Client
DESTINST 55 configuration 101
ENDOPER 56 configuring 104
NODE 56 overview 96
OBJECTTYPE ALTERNATE 56 optimizing file restores 124
OBJECTTYPE ARCHIVE 56
OBJECTTYPE DATABASE 56
OBJECTTYPE TABLESPACE 56
P
PARTITIONTYE RAW 84 parameters for scripts 66
PARTITIONTYPE RAW 56 partitions
POLICY 56 backing up 71
RETDIR 56 PARTITIONTYPE RAW keyword 56, 84
SCHEDULE 57 point in time rollback 106
SRCALIAS 57 policy configuration
SRCINST 57 adding clients 39
summary 54 attributes 33
backup selections list 40
for archive logs 46
L for configuration files 48
license keys, adding 24 for databases 32
log files for Snapshot Client 103, 113
archiving 44 overview 32
schedules 34
M testing 43
manual backup of a policy 71 POLICY keyword 56
master server processes
specifying 43, 61 log files for NetBackup processes 122
maximum jobs per client 31 scheduling (nbpem
multiple copies feature 39, 115 nbjm. See nbrb
multiplexing proxy copy 96
overview 13
multistreamed backups 100 Q
QUIESCE command 64
N
NBDB2 vendor I/O library R
overview 15–16 raw partitions 84
settings 70 RECOVER DATABASE command 15
nbjm scheduling process 121 Recovery Wizard
nbpem scheduling process 121 also see wizard 80
nbrb scheduling process 121 overview 80
NET_BUFFER_SZ file 124 use with Snapshot Client 116
Nodata Storage Checkpoint 111 remote folder button 42
146 Index
S T
SAP tablespaces
using NetBackup for DB2 with 141 backup 70–71
SCHEDULE keyword 57 templates
schedules administration 72
adding 34 administration interface 70
automatic backup 71 advantages over scripts 37
frequency 38 backups
properties 38 creating 63
properties for Snapshot Client 115 creating scripts from templates 63
retention for Snapshot Client 115 overview 14, 60
types of schedules 34 recovery 80
scripts running from Backup
cautions for using 37, 65 Archive. See and Restore
creating 61, 63 running with bpdpsbdb2 73
creating from templates 64 storing 66
creating manually 64 use with Snapshot Client 117
errors in executing 65 TERMINATE command 17
examples 18, 64 testing policy configuration 43
modifying 65 timeout failures
parameters 66 minimizing 123
scheduler 71 transaction logs
storing 66 see archive logs 113
type of operation 65 troubleshooting
server-directed backups 116 false restore failures reported 124
snapshot backup 96, 101–102, 106
configuration 101 U
configuration requirements 101
unified logging 121
database objects included 102
user exit program
overview 96
archive log backup 25, 44, 70
policy configuration 102
overview 17–18
restore method 106
policies needed 26, 46–47
Index 147
V
variables
environment 58
for scripts 66
VENDOR method for archive logging
db2.conf keywords needed 55
overview 18, 70
policies needed 25
specifying in DB2 25
used with BACKUP DATABASE command 74
Veritas Storage Foundation 112
VxFS_Checkpoint snapshot 107
vxvm snapshot 107
W
Windows interface 30
wizard
backup 18, 60
overview 14, 18
recovery 18, 80
use with Snapshot Client 116