Symantec NetBackup ™ for DB2 Administrator's Guide Windows
Release 7.0
Symantec NetBackup for DB2 Administrator's Guide Thesoftware descri Thesoftware described bed in this this boo book k is fur furnis nished hed under under a licens license e agree agreemen mentt and may be used used only in accordance with the terms of the agreement. Documentation version 7.0
Legal Notice Copyright © 2009 Symantec Corporation. All rights reserved. Symantec, the Symantec Logo, and NetBackup are trademarks or registered trademarks of Syma Symant ntec ec Co Corp rpor orat atio ion n or its its affi affili liat ates es in the the U. U.S. S. and and ot othe herr coun countr trie ies. s. Ot Othe herr name namess may may be trademarks of their respective owners. This Symantec product may contain third party software for which Symantec is required to prov provid ide e attr attrib ibut utio ion n to the the thir third d par party ty (“Thi Third rd Party Party Progra Programs ms”). Some Some of th the e Th Thir ird d Part Party y Progra Pro grams ms are availa availableunder bleunder ope open n source source or fre free e softwa software re licens licenses.The es.The Licen License se Agreem Agreemen entt accompanying the Software does not alter any rights or obligations you may have under those tho se opensource or freesoftwa freesoftware re lice license nses. s. Please Please seethe Third Third Party Party Legal Legal Notice Notice Appendi Appendix x to this this Doc Docume umenta ntatio tion n or TPI TPIP P ReadMe ReadMe Fil File e accomp accompany anying ing this this Symant Symantec ec produc productt for more more information on the Third Party Programs. Portions Portio ns of this this sof softwa tware re are derive derived d from from the RSA Dat Data a Securi Security, ty, Inc. Inc. MD5 Mes Messag sage-D e-Dige igest st 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. 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. THEDOCUMENTATIO THEDOCUMENT ATION N IS PRO PROVID VIDED ED"ASIS" "ASIS" ANDALL EXPRES EXPRESS S OR IMP IMPLIE LIED D CON CONDIT DITION IONS, S, 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 LEGALLY INVA INVALID. LID.SYMAN SYMANTEC TEC CORPORATI CORPORATION ON SHALLNOT BELIABL BE LIABLE E FOR FORINCID INCIDENTAL ENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION I NFORMATION CONTAINED IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE. The Licensed Licensed Soft Software ware and Docu Document mentatio ation n are deemed deemed to be commerci commercial al computer computer software software as defin defined ed in FAR12.21 FAR12.212 2 andsubject andsubject to res restri tricte cted d rig right htss as defin defined ed in FARSection FARSection 52. 52.22 227-1 7-19 9 "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. regulations. Any use, modification, reproduction rele release, ase, perfor per forman mance, ce, dis displa play y or dis disclo closur sure e of theLicensed theLicensed Softwa Software re and Docume Documenta ntatio tion n by the U.S. 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 function functionalit ality. y. The Technic Technical al Suppor Supportt group group also also creates creates content content for our online online Knowledge Base. The Technical Support group works collaboratively with the other functional areas within Symantec to answer your questions in a timely fashio fas hion. n. Forexa For examp mple, le,the theTec Techni hnical calSup Suppo port rt group group works works wit with h Produc Productt Engine Engineeri ering ng and Symant Symantec ec Securi Security ty Respon Response se to provid provide e alerti alerting ng servic services es and virus virus definit definition ion updates. Symantec’s maintenance offerings include the following: ■
A range of support support options that give you the flexibility to select the right amount of service for any size organization
■
Telephone and Web-based Web-based support that provides provides rapid response response and
■
up-to-the-minute information Upgrade assurance assurance that delivers delivers automatic software software upgrade protection protection
■
Global support support that is available 24 hours a day, 7 days a week
■
Advanced features, including Account Account Managem Management ent Services
For inform informatio ation n about about Symant Symantec ec’s Main Mainte tena nanc nce e Pr Prog ogra rams ms,, yo you u ca can n visi visitt ou ourr Web Web site at the following URL: www.symantec.com/techsupp/
Contacting Technical Support Custom Cus tomers ers with with a curren currentt mainte maintenan nance ce agreem agreement ent may access access Techni Technical cal Sup Suppor portt information at the following URL: www.symantec.com/techsupp/ Before contacting Technical Support, make sure you have satisfied the system requ require ireme ment ntss that that are are li list sted ed in your your prod produc uctt do docu cume ment ntat atio ion. n. Al Also so,, yo you u shou should ld be at the comput computer er on which which the proble problem m occur occurred red,, in case case it is nec necess essary ary to replic replicate ate the problem. When you contact Technical Support, please have the following information available: ■
Product release level
■
Hardware information
■
Available memory, memory, disk space, and NIC information
■
Operating system
■
Version and patch level
■
Network topology
■
Router, gateway, and IP address information information
■
Problem description: ■
Error messages messages and log files
■
Troubleshooting that was performed before contacting Symantec
■
Recent software configuration changes changes and netw network ork changes
Licensing and registration If your your Symant Symantec ec produc productt requir requires es regist registrat ration ionor or a licens license e key, key, access accessour ourtec techni hnica call support Web page 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 regarding product product licensing or serialization
■
Product registration updates, such as address or name changes changes
■
General product product information (features, (features, language av availability, ailability, local dealers) dealers)
■
Latest information about produc productt updates and upgrades upgrades
■ ■
Information about upgrade assurance assurance and maintenance maintenance contracts Information about about the Symantec Symantec Buying Programs
■
Advice about about Symantec's technical support 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: Asia-Pacific and Japan
[email protected]
Europe, Middle-East, and Africa
[email protected]
North America and Latin America
[email protected]
Additional enterprise services Symantec Symant ec offers offers a compre comprehen hensiv sive e set of servic services es that that allow allow you you to max maximi imize ze your your invest inv estmen mentt in Sy Syman mantec tec produc products ts and to develo develop p your your knowle knowledge dge,, expert expertise ise,, and global insight, which enable you to manage your business risks proactively. Enterprise services that are available include the following: Symante Syma ntecc Early Early Warning Warning Solution Solutionss These These soluti solutions ons provid provide e ear early ly war warnin ning g of cyber cyber att attack acks, s, compre comprehen hensiv sive e threat threat analysis, and countermeasures to prevent attacks before they occur. Managed Security Services
These servic These services es remo remove ve the burden burden of managin managing g and monitor monitoring ing securit security y devices devices and events, ensuring rapid response to real threats.
Consulting Services
Symantec Consulting Services provide on-site technical expertise from Symante Syma ntecc and its trus trusted ted part partner ners. s. Symante Symantecc Consul Consultin ting g Service Servicess off offer er a variety variety of prepackaged and customizable options that include assessment, design, implementa imple mentation tion,, monitorin monitoring, g, and managemen managementt capabilitie capabilities. s. Each is focused focused on establis esta blishin hing g and main maintain taining ing the integrit integrity y and availabi availabilityof lityof your your IT resource resources. s.
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
Technical Support ........................................................................ ............................................................................................... ....................... 4 4 Chap Ch apte terr 1
Intr Introd oduc ucti tion on to NetB NetBac acku kup p fo forr DB2 DB2 ................................. ................................. 13 13 Features of NetBackup for DB2 DB2 .................................... ....................................................... ................... 13 13 NetBackup for DB2 overview overview .......................................................... .......................................................... 15 15 About the NetBackup for DB2 components .................................. components .................................. 16 16 About NetBackup for DB2 terminology terminology ....................................... ....................................... 18
Chap hapte terr 2
Inst Insta allin lling g NetB etBacku ackup p for for DB2 DB2 ....................................... ........................................... .... 21 21 About installing the NetBackup for DB2 agent ................................... agent ................................... 21 21 Verifying the operating system and platform compatibility for NetBackup for DB2 DB2 ................................................................. ................................................................. 22 22 NetBackup server and client software requirements for NetBackup for DB2 DB2 ........................................................... ........................................................... 23 23 DB2 server software requirements for NetBackup for DB2 ............. DB2 ............. 23 23 Requirements for installing NetBackup for DB2 in a NetBackup cluster ........................................................................ cluster ........................................................................... ... 23 Configu Con figurati ration on and licens licensing ing require requiremen ments ts for NetBack NetBackup up for DB2 with Snapshot Client Client ........................................................ ........................................................ 24 Adding the NetBackup for DB2 license key key ........................................ ........................................ 24 24 About log archiving archiving ...................................................................... ...................................................................... 24 24 Using the VENDOR archive method method ........................................... ........................................... 25 25 Using the user exit archive method method ........................................... ........................................... 25 25 Adding new DB2 instances instances ............................................................. ............................................................. 26 26
Chap hapte terr 3
Conf Config igur urin ing g NetB etBackup ckup fo forr DB2 DB2 ....................................... ....................................... 27 27 Overview of NetBackup for DB2 configuration ................................... configuration ................................... 28 28 About user interface terminology terminology .................................................... .................................................... 28 28 Configuring the Maximum jobs per client client ......................................... ......................................... 28 28 Formula for Maximum jobs per client client ........................................ ........................................ 29 29 About configuring a backup policy for a DB2 database ........................ database ........................ 29 29 Adding a new NetBackup for DB2 policy policy ..................................... ..................................... 30 About policy attributes for NetBackup for DB2 ............................ DB2 ............................ 31 31 About adding schedules to a NetBackup for DB2 policy ................. policy ................. 31 31
8
Contents
About the NetBackup for DB2 backup types ................................ types ................................ 33 33 About backup schedules, templates, and scripts ........................... scripts ........................... 35 35 About backup schedules and Snapshot Client features .................. features .................. 35 35 About NetBackup for DB2 schedule properties ............................. properties ............................. 35 35 Adding clients to a NetBackup for DB2 policy .............................. policy .............................. 36 36 Adding backup selections to a DB2 policy ................................... policy ................................... 37 37 Testing configuration settings settings ........................................................ ........................................................ 40 40 Specifying the master server for a NetBackup for DB2 client ................ client ................ 41 41 About backing up archive log files with the user exit program .............. program .............. 41 41 DB2 objects in the Backup window window ............................................. ............................................. 42 42 Configuring a policy to back up the archive logs logs ........................... ........................... 43 43 Configuring a policy to archive the archive logs ........................... logs ........................... 44 44 Configuring a policy to back up the configuration files ........................ files ........................ 45 45 Configuring the runtime environment environment ............................................. ............................................. 46 46 Creating a db2.conf file (user exit program) ................................. program) ................................. 46 46 Creating a db2.conf file (vendor method) method) .................................... .................................... 49 Keyword summary summary ................................................................. ................................................................. 51 Configuring the log on account for the NetBackup Client Service .......... Service .......... 54 54 Environment variables variables .................................................................. .................................................................. 55 55 Creating templates and shell scripts scripts ................................................ ................................................ 56 56 Understanding templates and shell scripts ................................. scripts ................................. 56 56 Specifying the NetBackup master server from the client client ...................... ...................... 57 57 Creating a backup template using the NetBackup for DB2 backup wizard ........................................................................... wizard .................................................................................. ....... 57 57 Browsing for the DB2 instance to back up up ................................... ................................... 57 Crea Creati ting ng a ba back ckup up te temp mpla late te with with the the NetB NetBac acku kup p for for DB2 DB2 Ba Back ckup up Wizard .......................................................................... Wizard ............................................................................ 58 Creating shell scripts using bpdbsbdb2 bpdbsbdb2 ............................................. ............................................. 59 59 Creating DB2 scripts manually manually ....................................................... ....................................................... 60 Modifying DB2 backup and install scripts ................................... scripts ................................... 61 61 Script parameters parameters .................................................................. .................................................................. 61 Storing templates and scripts scripts ................................... ......................................................... ...................... 62 62 Templates ............................................................................ Templates .............................................................................. 62 Shell scripts scripts .......................................................................... .......................................................................... 62 62 Storing templates and scripts in a NetBackup cluster .......................... cluster .......................... 62 62
Chap Ch apte terr 4
Perf Perfor ormi ming ng ba back ckup upss and and rest restor ores es of DB2 DB2 ...................... ...................... 65 65 Overview of using NetBackup for DB2 DB2 .............................................. .............................................. 65 65 Performing a backup backup .................................................................... .................................................................... 65 Performing a backup from the NetBackup master server ............... server ............... 66 66 Performing a user-directed backup from the NetBackup for DB2 client .......................................................................... client ................................................................................... ......... 67
Contents
Running a NetBackup for DB2 backup template ........................... template ........................... 67 67 Using DB2 template administration administration ........................................... ........................................... 68 68 Using bpdbsbdb2 ................................... .................................................................... ................................. 69 69 Using DB2 to perform a backup backup ................................................ ................................................ 69 69 Browsing backups backups ........................................................................ ........................................................................ 72 Using the Backup, Archive, and Restore interface to t o browse browse ........... ........... 72 72 Using bplist to browse browse ............................................................. ............................................................. 73 73 Performing a restore restore ..................................................................... ..................................................................... 75 75 Using the NetBackup for DB2 recovery wizard ............................. wizard ............................. 76 76 Using DB2 to perform a restore restore ................................................. ................................................. 78 78 Performing an alternate restore restore ...................................................... ...................................................... 83 83 When to use an alternate restore restore .............................................. .............................................. 83 83 Preparing the master server for an alternate restore .................... restore .................... 85 85 Performing the alternate restore on the clients ............................ clients ............................ 86 86 Restoring the transaction logs logs .................................................. .................................................. 89 89
Chap Ch apte terr 5
........... 91 91 Usin Using g Snap Snapsh shot ot Clie Client nt wi with th Ne NetB tBac acku kup p fo forr DB2 DB2 ........... About NetBackup for DB2 with Snapshot Client ................................. Client ................................. 91 91 About the snapshot backup backup ...................................................... ...................................................... 91 91 About instant recovery recovery ............................................................ ............................................................ 92 92 About the off-host backup backup ....................................................... ....................................................... 92 Proxy copy copy .......................................................................... ............................................................................ .. 92 92 File-based operations operations .............................................................. .............................................................. 92 92 Stream-based operations operations ......................................................... ......................................................... 93 93 About supported platforms for NetBackup for DB2 with Snapshot Client .............................................................................. Client ................................................................................... ..... 94 94 About NetBackup for DB2 with Snapshot Client operations .................. operations .................. 94 94 About the sequence of a backup operation .................................. operation .................................. 95 95 About the sequence of a restore operation .................................. operation .................................. 95 95 About database objects supported by advanced backup methods ......................................................................... methods ......................................................................... 95 About multistreaming and DB2 backups ..................................... backups ..................................... 96 96 Example: multiple channels for a DB2 command with proxy method .......................................................................... method .......................................................................... 96 About configuring snapshot backups with NetBackup for DB2 .............. DB2 .............. 96 96 Configuration requirements for snapshot backups with NetBackup for DB2 DB2 ........................................................... ........................................................... 97 97 Configuring the DB2 policy with Snapshot Client backup methods ......................................................................... methods ......................................................................... 98 Configuring a snapshot policy for NetBackup for DB2 ................... DB2 ................... 98 98 Restoring from a snapshot backup backup .................................... ................................................. ............. 101 101 About restoring individual files from a snapshot backup .............. backup .............. 102 102
9
10
Contents
About restoring volumes and file systems using snapshot rollback ........................................................................ rollback ........................................................................ 102 Perfor Per formin ming g a snapsh snapshot ot rollba rollback ck res restor tore e from from theJav the Java a or Window Windowss interface ....................................................................... interface ....................................................................... 103 Performing a snapshot rollback restore from the command line ........................................................................... line .............................................................................. ... 103 Troubleshooting rollback restores restores ........................................... ........................................... 104 104 About Snapshot Client effects effects ....................................................... ....................................................... 104 104 About the types of backups backups ..................................................... ..................................................... 104 104 About schedule properties for Snapshot Client backups ............... backups ............... 105 105 About templates and scripts scripts ................................................... ................................................... 106 106 Using NetBackup for DB2 with Snapshot Client ................................ Client ................................ 106 106 Performing backups backups .............................................................. .............................................................. 106 106 Performing restores restores .............................................................. .............................................................. 107 107
Chap Ch apte terr 6
Trou Troubl bles esho hoot otin ing g NetB NetBac acku kup p fo forr DB2 DB2 ............................ ............................ 109 NetBackup debug logs and reports reports ................................................. ................................................. 109 109 Enabling the debug logs for a NetBackup Windows client automatically ...................................................................... automatically ...................................................................... 110 Enabling the debug logs for NetBackup for DB2 for Windows manually ......................................................................... manually ............................................................................ ... 111 About the NetBackup for DB2 log files files ............................................ ............................................ 111 111 About the bphdb directory on the Windows database client .......... client .......... 112 112 bpdbsbdb2 directory on the client client ............................................ ............................................ 112 112 Setting the debug level on a Windows client .................................... client .................................... 112 112 About NetBackup server reports reports .................................................... .................................................... 113 113 Minimizing timeout failures on large database restores ..................... restores ..................... 113 113 Using NET_BUFFER_SZ to speed up a slow restore ........................... restore ........................... 114 114 About false restore failures reported in the t he activity monitor monitor ............... ............... 114 114 About the error message codes codes ...................................................... ...................................................... 115 115 300 ............................................................................ 300 .................................................................................... ........ 115 305 ............................................................................ 305 .................................................................................... ........ 115 310 ............................................................................ 310 .................................................................................... ........ 116 330 ............................................................................ 330 .................................................................................... ........ 116 335 ............................................................................ 335 .................................................................................... ........ 116 380 ............................................................................ 380 .................................................................................... ........ 117 385 ............................................................................ 385 .................................................................................... ........ 117 390 ............................................................................ 390 .................................................................................... ........ 117 395 ............................................................................ 395 .................................................................................... ........ 118 400 ............................................................................ 400 .................................................................................... ........ 118 405 ............................................................................ 405 .................................................................................... ........ 118 410 ............................................................................ 410 .................................................................................... ........ 119
Contents
415 ............................................................................ 415 .................................................................................... ........ 119 420 ............................................................................ 420 .................................................................................... ........ 120 425 ............................................................................ 425 .................................................................................... ........ 120 430 ............................................................................ 430 .................................................................................... ........ 120 435 ............................................................................ 435 .................................................................................... ........ 121 440 ............................................................................ 440 .................................................................................... ........ 121 445 ............................................................................ 445 .................................................................................... ........ 121 450 ............................................................................ 450 .................................................................................... ........ 122 455 ............................................................................ 455 .................................................................................... ........ 122 502 ............................................................................ 502 .................................................................................... ........ 122 505 ............................................................................ 505 .................................................................................... ........ 123 507 ............................................................................ 507 .................................................................................... ........ 123 510 ............................................................................ 510 .................................................................................... ........ 123 511 ............................................................................ 511 .................................................................................... ........ 123 513 ............................................................................ 513 .................................................................................... ........ 124 514 ............................................................................ 514 .................................................................................... ........ 124 515 ............................................................................ 515 .................................................................................... ........ 124 516 ............................................................................ 516 .................................................................................... ........ 124 518 ............................................................................ 518 .................................................................................... ........ 124 520 ............................................................................ 520 .................................................................................... ........ 125 523 ............................................................................ 523 .................................................................................... ........ 125 524 ............................................................................ 524 .................................................................................... ........ 125 526 ............................................................................ 526 .................................................................................... ........ 125 528 ............................................................................ 528 .................................................................................... ........ 126
Appe Ap pend ndix ix A
Conf Configu igura rati tion on fo forr a DB2 DB2 EEE EEE (DPF (DPF)) environment ...................................... ................................................................. ........................... 127 Overview configuration for ........................................................ a DB2 EEE (DPF) environment .............. environment .............. 127 127 Installing of NetBackup for DB2 DB2 .................................... .................... 128 128 Configuring NetBackup for DB2 DB2 ..................................... .................................................... ............... 128 128 Adding NetBackup policies for DB2 EEE environment ....................... environment ....................... 128 128 Backing up archive logs in a DB2 EEE environment ........................... environment ........................... 129 129 Creating DB2 templates or scripts for a DB2 EEE environment ............ environment ............ 130 130
Appe Ap pend ndix ix B
Usin Using g NetB NetBac acku kup p for for DB2 DB2 with with SA SAP® P® ............................. ............................. 131 131 About NetBackup for DB2 with SAP SAP ............................................... ............................................... 131 131 Installation of the DB2 user exit program program ........................................ ........................................ 131 Backup and restore of DB2 databases databases ....................................... ............................................. ...... 132 132 Archive and restore of DB2 log files files ............................................... ............................................... 132 132 Backup of SAP files files ................................... ..................................................................... .................................. 132 132
Index ............................................................................ ................................................................................................................... ....................................... 133 133
11
12
Contents
Chapter
1
Introduction to NetBackup for DB2 This chapter includes the following topics: ■
Features of NetBackup for DB2 DB2
■
NetBackup for DB2 DB2 overview overview
Features of NetBackup for DB2 Table 1-1 1-1 shows shows NetBackup for DB2 ’s main features and introduces some terms used in this documentation. Table 1-1
NetBackup for DB2 features and descriptions
Feature
Description
Media and device management
All devices supported by Media Manager are available to NetBackup for DB2.
Scheduling facilities
NetBackup NetBac kup schedu schedulin ling g facili facilitie tiess on the master master server server can be used used to schedule automatic and unattended DB2 backups. This fea This featur ture e als also o let letss you cho choosethe osethe times times when when these these operat operation ionss can occur. For example, to prevent interference with normal daytime operations, you can schedule your database backups to occur only at night.
Multiplexed backups and restores
NetBackup for DB2 lets you take advantage of NetBackup’s multiplexing capabilities. Multiplexing directs multiple data stream str eamss to one back up device device,, thereb thereby y reducin reducing g thetime necess necessary ary to complete thebackup operation.
14
Introduction to NetBackup for DB2 Features of NetBackup for DB2
Table 1-1
NetBackup for DB2 features and descriptions (continued)
Feature
Description
Transparent DB2 and
All backups and restores run simultaneously and transparently
regular file system backup and restore operations
without any action from the NetBackup administrator. The databa database se adm admini inistr strato atorr can run databas database e backup backup and restor restore e operations through NetBackup. An administrator or any other authorized user can use NetBackup to run database backups and restores.
Sharing the same storage units used for other file backups
It is possible to share the same devices and media used for other backup bac kupss or to giv give e DB2exclusiv DB2exclusive e useof certai certain n device devicess andmedia. andmedia. NetBackup for DB2 can use Media Manager, disk, and PureDisk storage units.
Centralized and networked backup
From the NetBackup master server, you can schedule database backup bac kupss or sta start rt the them m manual manually ly forany cli clien ent. t. TheDB2 databa databases ses
operations
can also reside on hosts that are different from the devices on which NetBackup stores the backups.
Graphical user interfaces
NetBackup provides the following graphical user interfaces for client users and administrators: ■
Backup, Archive, and Restore user inte interface rface
■
NetBackup Administration Administration Console Console for Java
■
NetBackup Administration Administration Console Console for Windows
A database administrator or NetBackup administrator can start backup or restore operations for DB2 from the NetBackup graphical user interface on the master server. A dat databa abase se adm admini inistr strato atorr canalso usethe IBM DB2control DB2control center 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 recove rec overy ry wiz wizard ard fro from m the Backup Backup,, Arc Archiv hive, e, and Restor Restore e int interf erface ace.. 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 r estore script in an operating-system defined scripting language. You can use a template as the base for a script.
Introduction to NetBackup for DB2 NetBackup for DB2 overview
Table 1-1
NetBackup for DB2 features and descriptions (continued)
Feature
Description
Parallel backup and
NetBackup for DB2 supports the parallel backup and restore
restore operations
capabi cap abilit litiesof iesof the. Forexample,this Forexample,this permit permitss theuser to runmore than than on one e tape tape devi device ce at a ti time me fo forr a si sing ngle le DB2 DB2 ba back ckup up or re rest stor ore, e, thereby reducing the time necessary to complete the operation.
Compression
Compressionincreas Compres sionincreases es backup backup performa performance nce over over the networkand networkand reduce red ucess thesize of thebackup thebackup image image that that NetBac NetBackupwrite kupwritess to the storage unit.
For more information on general NetBackup terminology, see the NetBackup Administrator s Guid Guide, e, Volu Volume me I . ’ ’
NetBackup for DB2 overview NetBackup for DB2 integrates the database backup and recovery capabilities of DB2 with the backup and recovery management capabilities of NetBackup. The server that hosts the DB2 database must be a NetBackup client. It also must have NetBackup for DB2 licensed. Figure 1-1 1-1 shows shows the hardware components and software components for a NetBackup for DB2 environment.
15
16
Introduction to NetBackup for DB2 NetBackup for DB2 overview
Figure 1-1
NetBackup for DB2 components
System hosting the DB2 database NetBackup for DB2 supplies: DB2 database
–
NBDB2 Vendor I/O Library
GUI for browsing databases and creating backup and restore templates
–
DB2 database software supplies: –
Commands: BACKUP DATABASE,
–
Sample configuration file ( db2.conf )
–
Sample script files
RECOVER DATABASE (DB2 8.2 and later) RESTORE DATABASE
Additional required NetBackup software: –
NetBackup Client
Network (TCP/IP)
NetBackup master server or remote media server
Storage unit
NetBackup software: –
NetBackup master server
–
NetBackup media server (if the system is a media server)
About the NetBackup for DB2 components The following topics describe the main NetBackup components in a NetBackup for DB2 environment: ■
See “About the NBDB2 vendor I/O library” on page 16.
■
See “About the user exit program” on page 17.
■
See “About the backup wizard and recovery wizard” on page 17.
■
See “Sample configuration file (db2.conf) and script files ” on page 18.
About the NBDB2 vendor I/O library The DB2 BACKUP and RESTORE commands use the NBDB2 vendor I/O library to send data buffers between a DB2 database and NetBackup.
Introduction to NetBackup for DB2 NetBackup for DB2 overview
The vendor library is install_path\NetBackup\bin\nbdb2.dll. For example:
C:\Program Files\Veritas\NetBackup\bin\nbdb2.dll.
Table 1-2
Vendor libraries
Platform
Name
64-bit Solaris SPARC and 64-bit Linux x86
nbdb2.so64
64-bit AIX and HP-UX PARISC
nbdb2.sl64
64-bit Linux Itanium, HP Itanium, and IBM pSeries
nbdb2.so
You spec You specif ify y the the li libr brar ary y as the the argu argume ment nt to the the LOAD pa para rame mete terr of the the DB2 DB2 BACKUP and RESTORE commands.
About the user exit program The NetBackup for DB2 user exit program, db2uext2.exe, provides one method for backing up and restoring the DB2 archive log files. This method is used at the following times: ■
Wh When en the the DB2 DB2 BACKUP or ROLLFORWARD co comm mman ands ds ar are e us used ed to ba back ck up or re rest stor ore e databases.
■
When the user user exits the database with the DB2 TERMINATE or DISCONNECT command.
■ ■
When the log file fills and DB2 starts writing transactions transactions to another log log file. The DB2 A ARCH RCHIVE IVE LOG command is issued.
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. The user exit program resides in %DB2_INSTANCE%\bin\db2uext2.exe. Other methods are available for backing up archive log files. See “ About log archiving” on page 24.
About the backup wizard and recovery wizard NetBackup NetBack up for DB2pro DB2 provid vides es wizard wizardss that that enable enable you youto to create create backup backup and recove recovery ry templates. You invoke the wizards by browsing for and selecting a DB2 database
17
18
Introduction to NetBackup for DB2 NetBackup for DB2 overview
objectt in the Back objec Backup, up, Ar Arch chive ive,, and Resto Restore re interf interfac ace. e. After After you you supp supply ly inf infor ormat mation ion abou aboutt the the op oper erat atio ion, n, the the wiza wizard rd crea create tess a temp templa late te that that you you ca can n run run imme immedi diat atel ely y 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.
Sample configuration file (db2.conf) and script files The installation software installs the following sample files: ■
A sample sample configuration file (db2.conf file) The db2.conf file includes specifications for backups and restores, and it provid pro vides es informa information tionon on policie policiess and schedul schedules. es. The NetB NetBack ackup up for DB2 library library and user exit program use the information in i n 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. Alternatively, users can use the NetBackup for DB2 wizards to create backup and restore templates. You can use the templates in place of scripts, and you can convert templates into scripts.
The installation software writes these sample files to the following location: install_path\NetBackup\dbext\db2\samples
To use the sample files, copy the sample files to working directories and modify them for your own use.
About NetBackup for DB2 terminology DB2 suppo DB2 supports rts the follow following ing method methodss for archiv archiving ing its log files: files: throug through h a user user exit exit program and through a vendor library. DB2 supports backing up the archive log files by using a vendor library in its 8.2 and later releases. NetBackup for DB2 supplies a user exit program and a library to t o support both of these methods. The DB2 syntax for specifying these archive log methods differs from release to release. This manual uses the terms "user exit" and "VENDOR" to differentiate the methods. Table show owss the the DB2 DB2 synt syntax ax yo you u ca can n us use e to sp spec ecif ify y thes these e me meth thod odss with within in DB DB2 2 Table 1-3 sh and indicates the term this manual uses to describe each method.
Introduction to NetBackup for DB2 NetBackup for DB2 overview
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=USEREXIT USEREXIT=ON USEREXIT=YES LOGRETAIN=ON LOGRETAIN=RECOVERY
LOGARCHMETH1=VENDOR:...\library
When VENDOR is used, archive logs are backed up by means of the NetBackup for DB2 DB 2 vendo vendorr lib librar rary. y. The full full spec specifi ifica catio tion n for for this this arc archiv hive e log log method method is as follo follows ws:: LOGARCHMETH1=VENDOR:install_path\NetBackup\bin\nbdb2.dll
When a user exit program is used, archive logs are backed up by means of the NetBackup NetBac kup for DB2 user user exit exit progra program. m. The DB2 DB2 synta syntax x for speci specifyi fying ng the user user exit exit program includes the USEREXIT and LOGRETAIN keywords that are specified in a configuration parameter.
19
20
Introduction to NetBackup for DB2 NetBackup for DB2 overview
Chapter
2
Installing NetBackup for DB2 This chapter includes the following topics: ■
About installing the NetBackup for DB2 agent
■
Verif ying g the op opera eratin ting g sys system tem and pla platfo tform rm co compa mpatibi tibilit lity y for Net NetBac Backup kup for Verifyin DB2
■
Adding the NetBackup for DB2 license key
■
About log archiving
■
Adding new DB2 DB2 instances instances
About installing the NetBackup for DB2 agent Every NetBackup server includes the NetBackup client software by default. Therefore you can use NetBackup for DB2 on a NetBackup server or client (if NetBackup for DB2 is supported on that platform). Perform the following tasks before you use NetBackup for DB2: ■
Verify the ins installation tallation prerequisites. ■
See “ Verifying the operating system and platform compatibility for NetBackup for DB2” on page 22.
■
See “ NetBackup server and client software requirements for NetBackup for DB2” on page 23.
■
See “DB2 serv server er soft softwar ware e requ requirem irements ents for NetB NetBack ackup up for DB2” on pa page ge 23 23..
■
Require uiremen ments ts for forins instal tallin ling g Net NetBac Backup kupfor forDB DB2 2 in a NetB NetBack ackup up clu cluste sterr” See “Req on page 23.
22
Installing NetBackup for DB2 Verifying the operating system and platform compatibility for NetBackup for DB2
■
Configur iguratio ation n and lice licensin nsing g requ requirem irements ents for NetB NetBack ackup up for DB2 with See “Conf Snapshot Client” on page 24.
■
Add the license license key for NetBackup fo forr DB2. See “Adding the NetBackup for DB2 license key” on page 24.
■
Specify a log archive method. See “About log archiving” on page 24.
Verifying the operating system and platform compatibility for NetBackup for DB2 Verify that the NetBackup for DB2 agent is supported on your operating system or platform. To verify operating system and compatibility
Symantec Support Web page: page: 1 Go to the Symantec http://www.symantec.com/business/support/index.jsp Product ct Finder Finder box, type NetBa NetBackup ckup 2 In the Produ
Enterp Enterprise rise Serve Server r and click
the > icon. Compatibility y List. 3 From the list on the right, click on Compatibilit
4 In the list of documents, click on the following document: NetBackup (tm) x.x Database Database Agent Software Compatibility List (Updated date_updated ) For x.x , look for the current release. For date_updated , look for the most recent date. supported cluster environments for for NetBackup for DB2, 5 For information on supported see the following document: NetBackup (tm) Enterprise Server x.x / / Enterprise Server x.x Cluster Cluster Compatibility List (Updated date_updated ) For inf inform ormati ation on on suppo support rt for Snapsh Snapshot ot Client Client,, see the follow following ing docume document: nt: 6 For NetBackup (tm) x.x Snapshot Snapshot Client (Advanced Client) OS, Arrays, and Database Agent Compatibility (Updated date_updated )
Installing NetBackup for DB2 Verifying the operating system and platform compatibility for NetBackup for DB2
NetBack NetB ackup up serv server er and and clie client nt softw software are requ requir irem emen ents ts for NetB NetBack ackup up for for DB2 Verify that the following requirements are met for the NetBackup server and client software: NetBackup kup ser server ver softwa software re is instal installed led and operat operation ional al on the NetBac NetBackup kup ■ The NetBac server. The NetBackup server platform can be any that NetBackup supports. See the NetB NetBacku ackup p Installat Installation ion Guide . ■
The NetBackup client client software is installed on the computer that has the databases you want to back up.
■
Make sure that you configure configure any backup media media that the storage unit uses. The number of media volumes that are required depends on several things: ■
The devices used
■
The sizes of the databases that you want to back up
■
The amount of data that you want to archive archive
■
The size of your your bac backups kups
■
The frequency of backups backups or a archives rchives
See the NetBackup Administrator s Guid Guide, e, Volu Volume me I . ’ ’
DB2 server software requirements for NetBackup for DB2 Verify the following regarding the DB2 server software on the NetBackup server or client: ■
DB2 server software must be installed and operational. operational.
■
One or more more DB2 instances must exist. Note: In a DB2 EEE environment, install the NetBackup client software on every node and client that DB2 uses.
Requ Re quir irem emen ents ts for for insta installi lling ng NetB NetBac acku kup p for for DB2 DB2 in a NetB NetBack ackup up cluste clusterr If you plan to use the database agent software on a NetBackup server configured in a NetBackup cluster, verify the following requirements: ■
Your cluster environment is supported by NetBackup: NetBackup: ■ See “ Verifying the operating system and platform compatibility for NetBackup for DB2” on page 22.
23
24
Installing NetBackup for DB2 Adding the NetBackup for DB2 license key
■
The NetBackup server server software is installed and and configured to work work in a NetBackup cluster. See the NetB NetBacku ackup p Installat Installation ion Guide . See the NetBackup NetBackup High Availab Availability ility Guide .
■
The DB2 server software software is installed and operational operational on each no node de to which NetBackup can failover.
■
On each node where NetBackup server resides, resides, add the license key key for the database agent.
Config Conf igur urat ation ion and and li lice cens nsin ing g requ requir irem emen ents ts for NetB NetBac acku kup p for for DB2 DB2 with with Snapshot Client To use NetBackup for DB2 with Snapshot Client, you must have a license for NetBackup Snapshot Client.
Adding the NetBackup for DB2 license key To us use e NetB NetBac acku kup p for for DB2, DB2, add add a va vali lid d lice licens nse e ke key y for for it on the the mast master er or the the medi media a server. More information is available on how to add license keys. See the NetBackup Administrator s Guid Guide, e, Volu Volume me I . ’ ’
In a NetBackup cluster, add the key on each node where the NetBackup server is installed. To add a NetBackup for DB2 license key in the NetBackup Administration Console
open the NetBackup Administration 1 On the master or the media server, open Console. Help lp > Li Licen cense se Keys Keys. 2 Choose He
3 Click the New icon. 4 Type the license key and click Add.
About log archiving DB2 can write database archive logs by using several different methods. For a roll-f rol l-forw orward ard recove recovery, ry, younee you need d both both the dat databa abase se itself itself and the arc archiv hive e logs logs from from the ba back ckup up media. media. TheDB The DB2 2 pa param ramete eters rs that that spec specify ify an archiv archive e logmethod logmethod includ include e the LOGRETAIN, USEREXIT, and LOGARCHMETH1 keywords. The foll The follow owin ing g to topi pics cs desc descri ribe be the the arch archiv ive e me meth thod odss and and how how to sp spec ecif ify y an arch archiv ive e method in DB2.
Installing NetBackup for DB2 About log archiving
See “ Using the VENDOR archive method” on page 25. See “ Using the user exit archive method ” on page 25. 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 18.
Using the VENDOR archive method Only the DB2 8.2 release lets you use the VENDOR log archive method. If you use this method, note the following: ■
The archive logs are are backed up as part part of the database, so you do do not need a separate NetBackup policy for them.
■
NetB NetBac acku kup p for for DB2 DB2 ba back ckss up and and re rest stor ores es the the arch archiv ive e log log file filess as a by byte te stre stream am.. This method uses the DB2 backup API and the DB2 restore API.
To use the VENDOR archive method
1 Quiesce the DB2 database. Perform this procedure and the configuration procedures at a time when minimal changes are made to the DB2 database. follows: 2 Specify the archive method. The syntax is as follows: LOGARCHMETH1=VENDOR:install_path\NetBackup\bin\nbdb2.dll
configuration nfiguration to ensure that the appropriate log log archiving 3 Verify your DB2 co method for your site is enabled. If necessary, edit your DB2 configuration specifications to specify the log archiving method.
Using the user exit archive method NetBackup for DB2 includes a user exit program that you can use to back up the archive logs. Any DB2 release lets you use this log archive method. The syntax for specifying the user exit method depends on the DB2 release. If your DB2 configuration uses the USEREXIT or LOGRETAIN keywords in its configuration parameters, note the following: ■
NetBackup for DB2 DB2 backs up and re restores stores the archive log files as individual files.
■
DB2 supports this archive method only for backward co compatibility. mpatibility.
25
26
Installing NetBackup for DB2 Adding new DB2 instances
To use the user exit archive method
1 Quiesce the DB2 database. Perform this procedure and the configuration procedures at a time when minimal changes are made to the DB2 database. 2 Specify the archive method. The method you use to specify these parameters and the syntax for these parameters depends on the DB2 version level. For more information on the effects of these parameters within DB2, or on the specific syntax for these parameters, see your DB2 documentation.
3 If your DB2 configuration uses the USEREXIT or LOGRETAIN keywords in its configuration parameters, configure one of the following: ■
A separa separate te NetBac NetBackup kup MS-Win MS-Window dowss po polic licy y that that inc includ ludes es the archiv archive e logs. logs.
■
Directories for the user exit program program to use when it co copies pies the archive logs. You may also want to create a separate NetBackup MS-Window MS-Windowss policy for backing up these directories.
■
Modify an existing NetBackup NetBackup MS-Windows MS-Windows policy with a user ba backup ckup schedule. Include the archive log directories.
configuration nfiguration to ensure that the appropriate log log archiving 4 Verify your DB2 co method for your site is enabled. If necessary, edit your DB2 configuration specifications to specify the log archiving method.
Adding new DB2 instances At installation, the NetBackup for DB2 installation software writes the user exit program to the following location: install_path\NetBackup\dbext\DB2\db2uext2.exe
For example: C:\Program Files\IBM\SQLLIB\bin\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.
Chapter
3
Configuring NetBackup for DB2 This chapter includes the following topics: ■
for DB2 configuration Overview of NetBackup for
■
About user interface terminology
■
Configuring the Maximum jobs per client client
■
About configuring a backup policy for a DB2 database database
■
Testing configuration settings
■
Specifying the master server for for a NetBackup for DB2 client client
■
About backing up archive log log files with the user exit program program
■
Configuring a policy policy to back up the configuration configuration files
■
Configuring the runtime environment environment
■
Configuring the log log on account account for the NetBackup NetBackup Client Service Service
■
Environment variables
■
Creating templates templates and shell scripts scripts
■
Specifying the NetBackup master master server from the client
■
Creating a backup template template using the NetBackup for for DB2 backup wizard wizard
■
Creating shell scripts using using bpdbsbdb2 bpdbsbdb2
■
Creating DB2 scripts manually
28
Configuring NetBackup for DB2 Overview of NetBackup for DB2 configuration
■
Storing templates and scripts
■
Storing templates and scripts in a NetBackup cluster
Overview of NetBackup for DB2 configuration Before attempting to configure NetBackup for DB2, complete the installation procedure. See “ About installing the NetBackup for DB2 agent” on page 21. After you complete the installation, follow the procedures in this chapter to configure your environment.
About user interface terminology You Youca can n pe perfo rform rm ma many ny confi nfigu gurat ration ionste ps type in this thi s top topic ic from fro mailabl theNet the NetBa Back ckup ups Admin Ad minist istrat ration ionCon Conso sole leof onthe themas theco master terser server ver.steps . Thetyp The e of conso console le av avail able e depend dep ends on your master server’s platform. NetBackup supports a Java interface for both Windows and UNIX master servers. In addition, NetBackup supports a Windows interface for Windows master servers. The Java and Windows interfaces are nearly identical. If interface differences exist in the configuration procedures, the term “Windows” or “ Java” appears in the procedure to differentiate between the two interfaces.
Configuring the Maximum jobs per client The follow following ing proced procedure ure shows shows how to setthe set the Maximumjobsperclient attribute. To configure the maximum jobs per client the left ft pane pane of theNet the NetBa Back ckup up Admin Adminis istra tratio tion n Conso Console le,, ex expa pand nd NetBackup 1 In thele Manageme Mana gement nt > Host Properties Properties. Master er Server Server. 2 Select Mast
pane, double-click double-click the server server icon. 3 In the right pane, Globall Attribute Attributess. 4 Click Globa Maxim ximum um jobs jobs per clien clientt value to 99. 5 Change the Ma
The Maxi Maximum mum jobs per client client spe specif cifies ies the maximu maximum m number number of concur concurren rentt backups that are allowed per client. The default is 1. See “ Formula for Maximum jobs per client” on page 29.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
Formula for Maximum jobs per client You can use the following formula to calculate a smaller value for the Maximum jobs per client setting: number_of_sessions X number_of_policies number_of_policies Maximum jobs per client = number_of_sessions
Refer to the following definitions: 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 sam e tim time. e. Thi Thiss num numbercan bercan be greate greaterr than than one. one. Forexample,a Forexample,a cli client ent can be in two policies in order to back up two different databases. These backup windows can overlap.
Note: Enter a large enough value for the Ma Maxim ximum um jobs jobs per per cli client ent attribute to meet me et thenum the numbe berr of jobs jobs that that DB DB2 2 runs. runs. Yo You u may may need need to ex expe perim riment entwi with th dif diffe feren rentt values at your site.
Abo bout ut co conf nfig igur urin ing g a ba back ckup up po poli licy cy fo forr a DB DB2 2 da data taba base se A backup policy for a database defines the backup criteria for a specific group of one or more clients. These criteria include the following: ■
Storage unit unit and media to use
■
Policy attributes
■
Backup schedules
■
Clients to be backed backed up up
■
Backup templates templates or script script files to be run run on the clients
To back up a database environment, define at least one DB2 policy with the appropriate schedules. A configuration can have a single policy that includes all clients, or there can be many policies, some of which include only one client. Most requirements for database policies are the same as for file system backups. In addition to the policy attributes for this database agent, other attributes are available that you should consider. See the NetBackup Administrator s Guide uide,, Volu Volume me I . ’ ’
29
30
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
To add and configure a policy, see the following topics: ■
See “Adding a new NetBackup for DB2 policy” on page 30.
■
See “About policy attributes for NetBackup for DB2” on page 31.
■
See “About adding schedules to a NetBackup for DB2 policy” on page 31.
■
See “Adding clients to a NetBackup for DB2 policy” on page 36.
■
See “Adding backup selections to a DB2 policy” on page 37.
Adding a new NetBackup for DB2 policy This topic describes how to add a new backup policy for a database. To add a new NetBackup for DB2 policy
master server as administrator (Windows) or or root (UNIX). (UNIX). 1 Log on to the master
2 Start the NetBackup Administration Console. has as more than one master server, server, choose the one on which you 3 If your site h want to add the policy. Policy. 4 (Windows) In the left pane, right-click Policies and choose New Policy
left pane, pane, cclick lick Policies . In the All Policies Policies pane, 5 (Java interface) In the left right-click the master server, and click New Policy Policy. Add d a New New Poli Policy cy dialog box, in the Poli Policy cy name box, type a unique 6 In the Ad
name for the new policy.
7 Click OK. Policy dialog box, in the Poli Policy cy type list, select DB2. 8 In the Add New Policy
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 31. policy information as follows: 10 Add other policy ■
Add schedules. See “About adding schedules to a NetBackup for DB2 policy” on page 31.
■
Add clients. See “Adding clients to a NetBackup for DB2 policy” on page 36.
■
Add templates or scripts to the backup selections selections list.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
See “ Adding backup selections to a DB2 policy” on page 37. added all the schedules, schedules, clients, and backup selections selections you 11 When you have added need, click OK.
About policy attributes for NetBackup for DB2 With a few exceptions, NetBackup manages a database backup like a file system backup. Other policy attributes vary according to your specific backup strategy and system configuration. For more information on policy attributes, see the NetBackup Administrator s Guid Gu ide, e, Volu Volume me I . ’ ’
Table 3-1
Policy attribute descriptions for NetBackup for DB2 policies
Attribute
Description
Policy Poli cy 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.
Keyword Keyw ord phras phrase e
For NetBackup for DB2, the Keyw Keyword ord phrase phrase entry is ignored.
Snapshot Snaps hot Client Client
This option enables backups with Snapshot Client. See “ About NetBackup for DB2 with Snapshot Client” on page 91.
About adding schedules to a NetBackup for DB2 policy Each policy has its own set of schedules. These schedules initiate automatic backups andofspecify whenApplication a user can initiate A database these types schedules: Backup operations. and automatic backup.backup has
Configuring an Application Backup schedule A databa database se backup backup requir requires es an Applic Applicati ation on Backup Backup schedu schedule. le. You cannot cannot perfor perform m backups if this type of schedule is not included in the policy. The database agent automatically creates this schedule and names it Default-Application-Backup. The backu backup p windo window w foran for an Appl Applica icatio tion n Backu Backup p schedu schedule le mus mustt encomp encompass ass the tim time e period during which all scheduled jobs and unscheduled jobs can occur. This window wind ow is necessa necessary ry because becausethe the Applic Applicatio ation n Backup Backup schedul schedule e starts starts the pro proces cesses ses thatt are requir tha required ed for all databa database se backup backups, s, includ including ing those those starte started d automa automatic ticall ally. y. You can choose to set the window for the Application Backup schedule for 24 hours per day, seven days per week. This window ensures that your operations are never locked out due to the Application Backup schedule.
31
32
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
To configure an Application Backup schedule
1 In the Policy dialog box, click the Schedules tab. To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console . 2 Double-click the schedule that is named Default-Application-Backup. other ther properties properties for the sschedule. chedule. 3 Specify the o See “ About NetBackup for DB2 schedule properties” on page 35.
Example Application Backup schedule for NetBackup for DB2 Note: Specify the Application Backup schedule name in the install_path\NetBa \NetBackup\d ckup\dbext\d bext\db2\db b2\db2.conf 2.conf file on the client.
Assume the following: ■
Users perform database database backup operations during business hours, 08:00 08:00 to 13:00.
■
The automatic backups that use this policy start between between 18:00 and 22:00.
In this scenario, the Application Backup schedule must have a start time of 0800 and a duration of 14 hours. 3-2 shows shows example settings for an Application Backup schedule. Table 3-2 Table 3-2
Example settings for an NetBackup for DB2 Application Backup schedule
Schedule option
Setting
Retention
2 weeks
Backup window
Sunday through Saturday 00:08:00 - 22:00:00
Configuring automatic backup schedules If yo you u plan plan to have have Ne NetB tBac acku kup p perf perfor orm m auto automa mati ticc ba back ckup ups, s, or if yo you u us use e Snap Snapsh shot ot Client features, you need one or more automatic backup schedules. To configure an automatic backup schedule
1 On the Policy dialog box, click the Schedules tab. 2 Click New.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
unique ique name name for for the schedule. 3 Specify a un Type e of ba backu ckup p. 4 Select the Typ
See “ About the NetBackup for DB2 backup types” on page 33. other ther properties properties for the sschedule. chedule. 5 Specify the o See “ About NetBackup for DB2 schedule properties” on page 35.
6 Click OK.
Example automatic backup schedule for NetBackup for DB2 Table 3-3 3-3 shows shows example settings for automatic backup schedules. Table 3-3
Example Example settings settingsfor for NetB NetBacku ackup p for DB2 auto automati maticc backu backup p sche schedule duless
Type of backup
Schedule property
Setting
Automati Auto matic c Full Back Backup up
Retention (proxy backup only)
2 weeks
Frequency
Every week
Backup window
Sunday, 18:00:00 - 22:00:00
Retention (proxy backup only)
1 week
Frequency
Every day
Backup window
Sunday through Saturday
Automatic Differential Incremental Backup, Automatic Cumulative Incremental Backup
18:00:00 - 22:00:00
About the NetBackup for DB2 backup types Each database agent has a unique set of backup schedules. Table 3-4 shows 3-4 shows the DB2 backup schedules you can specify.
33
34
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
Table 3-4
DB2 backup types
Backup type
Description
Application Backup
The Application Backup schedule enables user-controlled NetBackup operations from the client. These operations include those tho se ini initia tiated ted from from theclient theclient and those those initia initiatedby tedby an automa automatic tic schedule on the master server. NetBackup uses the Application Backup schedule when the user starts a backup manually. Configure at least one Application Backup schedule for each database policy. The Default-Application-Backup schedule is configured automatically as an Application Backup schedule.
Automati Auto maticc Ful Fulll Backup 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" "Fu ll" is an indic indicato atorr that that thebackup thebackup is notone of theincremen theincremental tal backup types. To perform a stream-based Automatic full backup , also specify an Automatic Full Backup schedule for scheduled NetBackup operations. Snapshot Client only supports this type of backup and the Block-Level Incremental (BLI) Backup . Automa omatic tic Dif Differ ferent ential ial increm increment ental al backup backup is an increm increment ental al Automatic Differe Automatic Differential ntial An Aut back backup up that that is not not cumu cumula lati tive ve.. Th The e ba back ckup up cont contai ains ns a copy copy of the the incremental backup databa dat abase se dat data a tha thatt has change changed d since since the most most recent recent backup backup,, ful fulll or otherwise. This type of backup corresponds to the INCREMENTAL INCREM ENTAL DELTA option of the DB2 BACKUP command. 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 is supported only for stream-based backups and for Block-Level Incremental (BLI) Backups . Automatic Cumulative An Automatic Cumulative incremental backup is an incremental incremental backup backup that is cumulative. The backup contains a copy of the database data that changed since the most recent full backup. This type of backup corresponds to the INCREMENTAL option of the DB2 BACKUP command. Automatic Cumulative Incremental backups are supported only for stream-based backups and Block-Level Incremental (BLI) Backups . This type of backup takes less time and space than a full backup. The backup backup con contai tains ns only only thedata that that change changed d since since the las lastt ful fulll backup.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
About backup schedules, templates, and scripts 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, for example, from running a restore or recovery script. To help help gu guar ard d agai agains nstt such such mist mistak akes es,, us use e a temp templa late te inst instea ead d of a scri script pt when whenev ever er possible. When a template runs, it detects the backup type on the schedule. You are respo responsi nsible ble for specif specifyin ying g a templa template te with with the correc correctt operat operation ion type type (back (backup up or restore) in the policy.
About backup schedules and Snapshot Client features The information in this topic t opic for types of backup schedules pertains to st stre ream am-b -bas ased ed ba back ckup ups. s. If yo you u us use e the the Snap Snapsh shot ot Clie Client nt op opti tion on,, be awar aware e that that some some of the information in that table may differ if you use certain Snapshot Client features. More information backup schedules and Snapshot Client features is available. See “ About NetBackup for DB2 with Snapshot Client” on page 91.
About NetBackup for DB2 schedule properties This topic describes the schedule properties that have a different meaning for database backups than for file system backups. Other schedule properties vary according to your specific backup strategy and system configuration. Additional information about other schedule properties is i s available. See the NetBackup Administrator s Guide uide,, Volu Volume me I . ’ ’
Table 3-5
Description of schedule properties
Property
Description
Type Typ e of bac backup kup
Sp Spec ecif ifie iess the the type type of back backup up th that at th this is sc sche hedu dule le cont contro rols ls.. Th The e se sele lect ctio ion n list list sh show owss on only ly th the e backup types that apply to the policy you want to configure. See “ About the NetBackup for DB2 backup types ” on page 33.
35
36
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
Table 3-5
Description of schedule properties (continued)
Property
Description
Schedule Schedu le type
You can schedule a backup in one of the following ways: ■
Frequency
This setti This setting ng is use used d only only forsche forschedul duled ed backup backups. s. It is no nott used used fo forr us userer-dir direct ected ed backu backups. ps. Frequency spe specif cifiesthe iesthe per period iod of tim time e that that can elapseuntil elapseuntil thenext backup backup or archiv archive e 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 setti This setting ng is use used d only only forsche forschedul duled ed backup backups. s. It is no nott used used fo forr us userer-dir direct ected ed backu backups. ps. The Calendar opt option ion allowsyou allowsyou to sch schedu edule le backup backup operati operationsthat onsthat are based based on specif specific ic dates, recurring week days, or recurring days of the month. Retention
Th The e rete retent ntio ion n peri period od for for an Appli Applica cati tion on Back Backup up sc sche hedu dule le re refe fers rs to th the e le leng ngth th of ti time me th that at NetBackup keeps backup images (stream-based backups). The retention period for an automat aut omatic ic sch schedu edule le control controlss howlong NetBac NetBackup kupkee keeps ps recordsof recordsof when when schedul scheduled ed backups 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 ex exam ampl ple, e, if th the e freq freque uenc ncy y se sett ttin ing g is se sett to on one e we week ek,, se sett the the re rete tent ntio ion n pe peri riod od to be more 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 rec ord too early, earperiod ly, the sch schedu eduled led bac backup kupnecessary, fre freque quency ncy is unpred unp redict ictabl able. e. Howeve However, r, if you set the retention to be longer than the NetBackup catalog accumulates unnecessary records.
■
Calendar-based scheduling The retention period setting is not significant for calendar-based scheduling.
Multiple Mult iple copies copies
If youwant to spe specif cify y multip multiple le cop copiesof iesof a backupfor backupfor thepolicy, thepolicy, config configure ure Multiplecopies on the Application Backup schedule.
Adding clients to a NetBackup for DB2 policy The client list contains a list of the clients on which your scripts are run during an automatic backup. A NetBackup client must be in at least one policy but can be in more than one.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
For a NetBackup for DB2 policy, clients you want to add must have the following software installed: ■
DB2
■
NetBackup client or server The backup or restore script(s), script(s), unless you use templates
■
To add clients to a NetBackup for DB2 policy
1 In the Policy dialog box, click the Clients tab. To acce access ss the the Policy di dial alog og bo box, x, doub double le-c -cli lick ck the the po poli licy cy na name me in the the Policies list in the NetBackup Administration Console.
2 Click New. press Enter (Windows) or click Add (Java). 3 Type the name of the client and press If DB2 is installed in a NetBackup cluster, specify the virtual DB2 name as the client name. and step 3 step 3.. step 2 and 4 (Windows) To add another client, repeat step 2 add another client, repeat repeat step 3 step 3.. 5 (Java) To add lient is the last client you want to add, click click OK. 6 If this cclient
7 (Java) In the Policy dialog box, click Close.
Adding backup selections to a DB2 policy The backup selections list in a database policy has a different meaning than that for non-da non-datab tabase ase po polic licies ies.. For exampl example, e, in a Standa Standard rd or MS-Win MS-Windo dows ws po polic licy, y, the list contains files and directories to be backed up. In a database policy, you specify templates or scripts to be run.
About templates or scripts rules Observe the following rules when you use templates or scripts: ■
Make sure the scripts reside on each client client in the client list. list. Scripts can reside in any location. Make sure that NetBackup can access the location you choose and that NetBackup can run the scripts. Note that templates do not reside on the clients. Templates reside on the NetBackup master server.
■
NetBackup installs sample scripts when when you install the software; software; you can modify these scripts for your own use.
37
38
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
Write the scripts to a location outside of the original installation location. In this way future NetBackup installations do not overwrite your site ’s scripts. ■
If you use NetBackup NetBackup for DB2 in a NetBackup NetBackup server clus cluster, ter, make sure that the scripts reside in a location that is available after a failover.
Add templates or scripts to the backup selections list only if you want to set up a policy for automatic backups. These templates or scripts are run for manual backups and for automatic schedules as specified under the Schedules tab. NetB Ne tBac acku kup p runs runs the the te temp mpla late tess or scri script ptss in the the or orde derr that that the the temp templa late tess or scri script ptss appear in the backup selections list. See “ Creating templates and shell scripts” on page 56.
Adding templates or scripts to the backup selections list The foll The follow owin ing g proc proced edur ures es de desc scrib ribe e how how to add add temp templa late tess or scri script ptss to the the ba back ckup up selections list with the Java interface and the Windows interface. 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. Script ipt or Templ Template ate list, select a template or type the name of a 4 From the Scr
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.
Configuring NetBackup for DB2 About configuring a backup policy for a DB2 database
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. In the the Scri Script pt or Te Temp mpla late te bo box, x, type type the the full full pa path th name name of a scri script pt on the the clie client nt.. 4 In For example: /backup_scripts/db/cold_backup.sh C:\backup_scripts\db\cold_backup.cmd
5 Click Add to add the script to the list. 6 Click OK. To add a template to the backup selections list from the Windows interface
Policy olicy dialog dialog box, click click the Backup Selections tab. 1 In the P 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 Template button.
Al Alte tern rnat ativ ivel ely, y, yo you u ca can n ty type pe the the name name of the the temp templa late te with with the the .tpl .tpl ex exte tens nsio ion. n. Do not include the full path. For example, weekly_full_backup.tpl. 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
Policy olicy dialog dialog box, click click the Backup Selections tab. 1 In the P To access the Policy dialog box, double-click the policy name in the Policies list in the NetBackup Administration Console.
2 Click New.
39
40
Configuring NetBackup for DB2 Testing configuration settings
Remote te Folder Folder button. 3 Click the Remo
Al Alte tern rnat ativ ivel ely, y, yo you u ca can n ty type pe the the full full pa path th name name of the the scrip scriptt on the the clie client nt.. Fo Forr example: /backup_scripts/db/cold_backup.sh C:\backup_scripts\db\cold_backup.cmd
and select select the script file. 4 Navigate to and
5 Click OK. 6 Click OK.
Testing configuration settings After Aft er youcon you config figure urethe the master masterser server verfor forNet NetBac Backup kupfor forDB DB2, 2, test test theco the confi nfigur gurati ation on settings. Perform a manual backup (or backups) with the automatic backup schedules you created. A description of status codes and other troubleshooting information is available. See the NetBack NetBackup up Troubles Troubleshooti hooting ng Guide . To test the configuration settings
(Windows) or root (UNIX). 1 Log onto the master server as administrator (Windows)
2 Start the NetBackup Administration Console. In the left pane, click Policies.
3 policy you want to test. 4 Click the policy Actio tions ns > Manua Manuall Backup Backup. 5 Select Ac
The Schedules pan pane e contai contains ns thenam the name e of an automa automatic tic sched schedule ule(or (orsc sched hedule ules) s) co conf nfig igur ured ed for for the the poli policy cy that that you you wa want nt to test. test. The The Clients pan pane e contai contains ns the name of the client(s) listed in the policy that you want to test. Manual al Backup Backup dialog box. 6 Follow the directions in the Manu
check eck the status of the back backup, up, click click Acti Activity vity Monitor Monitor in the NetBackup 7 To ch Administration Console. The Activity Monitor and the script output indicate the status of the backup operation. For more information, see the Troubleshooting chapter. chapter.
Configuring NetBackup for DB2 Specifying the master server for a NetBackup for DB2 client
Specif Spec ifyi ying ng th the e ma mast ster er se serv rver er fo forr a Ne NetB tBac acku kup p fo forr DB DB2 2 client Af Afte terr yo you u add add yo your ur NetB NetBac acku kup p for for DB2 DB2 clie client nt to a po poli licy cy,, sp spec ecif ify y the the ma mast ster er se serv rver er for the client in the NetBackup Administration Console. 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 57. To specify the master server in the NetBackup Administration Console
the le left ft pa pane ne,, ex expa pand nd NetBackupManagement>HostProperties>Clients . 1 In the NetBackup for DB2 cclient lient name in the Clients list. 2 Double-click the NetBackup
3 Click Servers. correct server server displays displays in the Mas Master ter Server Server box. 4 Verify that the correct If the the co corr rrec ectt se serv rver er do does es not not disp displa lay, y, clic click k the the se serv rver er name name in the the Additional Servers list, and click Make Master Master. Alternatively, click Add to add a new server name to the list.
5 Click OK.
About backing up archive log files with the user exit program You can configure the user exit program to back up the archive logs. (The user exit program is db2uext2.exe). The backup can be configured in one of the following ways: ■
Save archive log files directly directly with NetBac NetBackup. kup. To back back up archiv archive e logfiles in this this way way,, co confi nfigur gure e an MS-Win MS-Window dowss or Standa Standard rd policy with a User Backup schedule. See “Configuring a policy to back up the archive logs” on page 43. Then The n speci specify fy the ARCFUN ARCFUNC C SAVE key keywo words rds in the co confi nfigur gurati ation on file, file, db2.conf. See “Creating a db2.conf file (user exit program)” on page 46.
■
Copy archive log files to another directory for later backup by NetBackup. NetBackup. To back back up archiv archive e logfiles in this this way way,, co confi nfigur gure e an MS-Win MS-Window dowss or Standa Standard rd policy with a User Archive schedule (this schedule is optional) See “Configuring a policy to back up the archive logs” on page 43.
41
42
Configuring NetBackup for DB2 About backing up archive log files with the user exit program
Specify the AR ARCFU CFUNC NC COPY COPY keywords in the db2.conf file. See “Creating a db2.conf file (user exit program)” on page 46. You Yo u can can coor coordi dina nate te th the e copy copy of the the log log file filess to a dire direct ctor ory y with with a user user ar arch chiv ive. e. In this case, the user exit program copies the file to an archive directory. To free disk space, later you can perform a user archive to archive all the files in the ARCDIR directory. Do not specify ARCFUN ARCFUNC C SAVE or ARCFUNC ARCFUNC COPY if the VEND VENDOR OR DB2 configuration parame par ameter ter is in effect effect.. In enviro environme nments nts with with VENDOR in effect effect,, NetBac NetBackup kup ignore ignoress the information that pertains to these commands. Whether to specify ARCFUN ARCFUNC C SAVE or AR ARCFU CFUNC NC COP COPY Y depends on the amount of user intervention you intend to provide. Determine which command to use, as follows: ■
If you specify ARCFUNC ARCFUNC SAVE, NetBackup backs up the t he archive logs according to the policy and schedule you specify. If DB DB2 2 la late terr is issu sues es a ROLLFORWARD re requ ques est, t, the the us user er ex exit it pr prog ogra ram m look lookss for for the archive logs on a backup volume. At restoration time, no user intervention is requ re quir ired ed.. The The se sequ quen enti tial al reco recove very ry ca can n be slow slow if ther there e are are nume numero rous us,, larg large e log log files.
■
If you you spe specif cify y ARCFU ARCFUNC NC COPY, NetBac NetBackup kup copies copies the arc archiv hive e logs logs to the locati location on 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 method requires requires some some user user interve interventio ntion n during during the reco recovery very.. Specifi Specifical cally, ly, you must restore these files before the roll forward. Advanced users prefer this approach because of performance and flexibility benefits. For information about how to restore files to t o disk, see the NetBackup Administrator's Administrator 's Guide .
DB2 objects in the Backup window 3-6 explains explains the DB2 object types displayed. Table 3-6 Table 3-6
DB2 database objects in the backup window
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.
Configuring NetBackup for DB2 About backing up archive log files with the user exit program
Table 3-6
DB2 database objects in the backup window (continued)
Object
Description
Instance
The second-level object is a DB2 instance. An instance represents a collection of DB2 databases.
Database
You cannot select a database for backup directly, but by selecting all partitions below it, you can effectively select the whole database. If youselectt thedatabase youselec thedatabase forbackup, forbackup, youcannot youcannot se selec lectt other other databa databases ses.. If you select objects within the database, you cannot select objects within other databases at the same time.
Partition
The partition is the highest selectable DB2 object. A partition represents a collection of storage within a database in which tablespace table spacess are stored. stored. Partitions Partitions contain contain tablespace tablespacess and log folde folders. rs. Within a database, you can select one or more partitions. DB2 EEE/DPF environments generally consist of multiple partitions. Other DB2 UDB environments consist of a single partition, which is usually represented as partition zero (0). The displa display y includ includes es only only partiti partitionsthat onsthat resideon resideon thesame NetBac NetBackup kup client. It does not display other partitions on remote hosts. For more information, see the Caution that follows this table.
Tablespace
A tablespace is a logical entity representing a collection of physical storage containers. Tablespaces are comprised of containers, which repres rep resen entt data databas base e storag storage e units. units. A tables tablespac pace e is thelowest-l thelowest-leve evell DB2 object that you can select in the browser.
Configuring a policy todeback up the archive logs This Th is topi topicc desc scri ribe bess how how to crea create te a poli policy cy to ba back ck up the the arch archiv ive e log log file filess dire direct ctly ly to tape. Follow these instructions if you want to use the user exit program with the ARCFUN ARCFUNC C SAVE command. 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
master server as administrator (Windows) or or root (UNIX). (UNIX). 1 Log on to the master
2 Start the NetBackup Administration Console . your ur si site te has has more more than than on one e mast master er serv server er,, ch choo oose se the the on one e wher where e yo you u want want 3 If yo to add the policy. policy licy type. 4 Create a new MS-Windows (Windows) or Standard (UNIX) po
43
44
Configuring NetBackup for DB2 About backing up archive log files with the user exit program
5 Specify the attributes for the policy. Backup schedule. 6 On the Schedules tab, create a User Backup
This Th is sche schedu dule le must must en enco comp mpas asss all all of the the tim time e pe peri riod odss duri during ng whic which h DB DB2 2 ca can n call the user exit program. No backup selections list is necessary for this policy because it has a User Backup schedule. It is not an automatic schedule.
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 i nstalled in a NetBackup cluster, add the virtual host name to the client list.
8 Note the name of this policy. When en you you co conf nfig igur ure e the the db db.c .con onff file file,, spec specif ify y the the name name of thepolicy thepolicy you you cr crea eate ted d 9 Wh in this procedure. See “ Creating a db2.conf file (user exit program)” on page 46.
Configuring Config uring a policy to archive archive the archive archive logs This topic describes how to create a policy to archive the archive log entries in the ARCDIR directory. Follow these instructions if you want to t o use the user exit program with the AR ARCFU CFUNC NC COPY COPY command. When NetB When NetBac acku kup p perf perfor orms ms an arch archiv ive, e, it de dele lete tess the the on onli line ne file filess af afte terr are are ba back cked ed up successfully. For more Formor e inform informati ation on on user user archiv archive e sched schedule ules, s, see seethe the NetBackup NetBackupAdministrat Administrator or s Guide . ’ ’
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
master server as administrator (Windows) or or root (UNIX). (UNIX). 1 Log on to the master
2 Start the NetBackup Administration Console . has as more than one master server, server, choose the one on which you 3 If your site h want to add the policy. policy type. 4 Create a new MS-Windows (Windows) or Standard (UNIX) policy
Configuring NetBackup for DB2 Configuring a policy to back up the configuration files
5 Specify the attributes for the policy. Archive schedule. 6 On the Schedules tab, create a User Archive
This Th is sche schedu dule le must must en enco comp mpas asss all all of the the tim time e pe peri riod odss duri during ng whic which h DB DB2 2 ca can n 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. lients to be backed up. 7 Specify the cclients The clients must have the following installed: ■
DB2
■
NetBackup for DB2
If the client is installed in a NetBackup cluster, add the virtual host name to the policy.
Con Co nfi figu guri ring ng a po poli licy cy to bac ack k up the con onfi figu gura rattio ion n files iles This topic shows how to create an automatic backup policy to back up the configuration files. If you want users to be able to back up configuration files manually, you also must create a User Backup schedule. To back up configuration files
policy. 1 Create an MS-Windows (Windows) or Standard (UNIX) policy.
2 Specify the attributes for the policy. 3 On the Schedules tab, create a full backup schedule. Backup up Selection Selectionss list, add an entry that includes the full path name 4 In the Back
of the directory that contains the configuration files.
5 Specify the clients to back up. The clients must have the following installed: ■
DB2
■
NetBackup for DB2
If the client is installed in a NetBackup cluster, add the virtual host name to the client list.
45
46
Configuring NetBackup for DB2 Configuring the runtime environment environment
Configuring the runtime environment This to This topi picc de desc scri ribe bess how how to crea create te a db2.conf file file for for yo your ur en envi viro ronm nmen entt and and how how to configure the bp.conf file in a cluster environment. It also shows the environment variables that NetBackup creates.
Creating Creati ng a db2.conf db2.conf file (user exit program) The NetBackup for DB2 configuration file, db2.conf, consists of a series of ke keyw ywor ords ds and va valu lues. es. This This file file de defin fines es howto back back up theda the datab tabas ase e and and thearc the archiv hive e logs. It must be created on each NetBackup for DB2 client. The instal installat lation ion packag package e instal installed led a file file named named db2.conf tha thatt you can custom customize ize.. 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 45.
2 Log on to a client computer. Copy the sample sample db2.conf fi file le from from its loca locatio tion n in the the sa samp mple le dire direct ctor ory y to its 3 Copy active location. Its location in the sample directory is as follows: install_path\NetBackup\dbext\db2\samples
The active location for the db2.conf file is as follows: install_path\NetBackup\dbext\db2\db2.conf
i dentifier for backing up the database. 4 In the db2.conf file, create an object identifier This object identifier starts with the following keyword lines: DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE DATABASE DATABASE ...
Configuring NetBackup for DB2 47 Configuring the runtime environment
i dentifier for backing up the archive 5 In the db2.conf file, create an object identifier logs. The form depends on how the archive logs are backed up, as follows: ■
ARCFUNC C SAVE: If you use ARCFUN DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY POL ICY WIN_TY WIN_TYPE_ PE_POL POL_LO _LOGPO GPOL L # an MSMS-Win Window dows-N s-NT T typ type e pol policy icy SCHEDULE USER_BACKUP_SCHED_LOGSCHED
Inthe POLICY lin line, e, specif specify y the name name of the MSMS-Wind Windows ows or Standa Standard rd policy 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 ARCFUN ARCFUNC C COPY: DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE ARCDIR C:\MyLogs\a C:\MyLogs\arcdir\ rcdir\ RETDIR C:\MyLogs\a C:\MyLogs\arcdir\ rcdir\
In th the e ARCDIR li line ne,, spec specif ify y the the full full pa path th to the the loca locatio tion n of the the arch archiv ive e logs 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. other entries to the db2.conf file. 6 You may need to add other See “ Keyword summary” on page 51.
7 Save and close the db2.conf file. each client client com computer. puter. 8 Repeat this procedure on each See “ Example db2.conf file (with ARCFUNC SAVE)” on page 47. See “ Example db2.conf file (with ARCFUNC COPY)” on page 48.
Example db2.conf file (with ARCFUNC SAVE) Assume that you need to back up a database named SAMPLE and its archive logs. USEREXIT is enable enabled d for for da datab tabase ase SAMPLE. The po polic licies ies for da datab tabas ase e SAMPLE include the required schedules for the backups.
48
Configuring NetBackup for DB2 Configuring the runtime environment environment
The policies are as follows: ■
The DB2_DB_Policy backs up the database. This policy has an application backup bac kup schedu schedule le and an automa automatic tic backup backup schedu schedule. le. The fir first st defini definitio tion n in the example db2.conf file file specifi specifies es this pol policy icy and its applica application tionbac backup kup schedu schedule, le, which whi ch is named named Default-Application-Backup. Theaut The automa omatic tic backupsched backupschedule ule is not specified in db2.conf.
■
The DB2_Log_Policy ba back ckss up th the e ar arch chiv ive e logs logs.. This This poli policy cy ha hass a user user ba back ckup up schedule schedul e named User. Thesec The secon ond d en entry try in theexa the examp mple le file file spec specifi ifies es thi thiss po polic licy y and its user backup schedule. DATABASE DATABA SE SAMPLE OBJECTTYPE OBJECT TYPE DATABASE DATABASE POLICY DB2_DB DB2_DB_Polic _Policy y SCHEDULE Default-Application-Backup ENDOPER DATABASE DATABA SE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY DB2_Lo DB2_Log_Poli g_Policy cy SCHEDULE SCHEDU LE User ARCFUNC ARCFUN C SAVE #ARCFUNC #ARCFU NC COPY #ARCDIR #ARCDI R C:\MyLogs\ar C:\MyLogs\arcdir\ cdir\ #RETDIR #RETDI R C:\MyLogs\ar C:\MyLogs\arcdir\ cdir\ #ARCDIR #ARCDI R /home/db2ins /home/db2inst1/arc t1/arcdir dir #RETDIR #RETDI R /home/db2ins /home/db2inst1/arc t1/arcdir dir ENDOPER
Example db2.conf file (with ARCFUNC COPY) Assume that you need to back up a database named SAMPLE and its archive logs. enabled d for for da datab tabase ase SAMPLE. The po polic licies ies for da datab tabas ase e SAMPLE include USEREXIT is enable the required schedules for the backups. The policies are as follows: ■
The DB2_DB_Policy backs up the database. This policy has an application backup bac kup schedu schedule le and an automa automatic tic backup backup schedu schedule. le. The fir first st defini definitio tion n in the example db2.conf file file specifi specifies es this pol policy icy and its applica application tionbac backup kup schedu schedule, le,
Configuring NetBackup for DB2 49 Configuring the runtime environment
which is named which named Default-Application-Backup. Theaut The automa omatic tic backupsched backupschedule ule is not specified in db2.conf. ■
The AR ARCFU CFUNC NC COPY COPY command copies the archive logs to the ARCDIR directory. DATABASE DATABA SE SAMPLE OBJECTTYPE OBJECT TYPE DATABASE DATABASE POLICY DB2_DB_Poli DB2_DB_Policy cy SCHEDULE Default-Application-Backup ENDOPER DATABASE DATABA SE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE #POLICY #POLIC Y DB2_Log_Poli DB2_Log_Policy cy #SCHEDULE #SCHED ULE User #ARCFUNC #ARCFU NC SAVE ARCFUNC ARCFUN C COPY ARCDIR C:\MyLogs\a C:\MyLogs\arcdir\ rcdir\ RETDIR C:\MyLogs\a C:\MyLogs\arcdir\ rcdir\ ARCDIR /home/db2in /home/db2inst1/ar st1/arcdir cdir RETDIR /home/db2in /home/db2inst1/ar st1/arcdir cdir ENDOPER
Creating a db2.conf file (vendor method) The NetBackup for DB2 configuration file, db2.conf, consists of a series of ke keyw ywor ords ds and va valu lues. es. This This file file de defin fines es howto back back up theda the datab tabas ase e and and the ar arch chive ive logs. It must be created on each NetBackup for DB2 client. The instal installat lation ion packag package e instal installed led a file file named named db2.conf tha thatt you can custom customize ize.. The following procedures show you how to customize this file. Follow the instructions in this section if you use the vendor method to perform backups. To create a db2.conf file for use with the vendor method
Befo fore re yo you u crea create te the the db db2. 2.co conf nf file file,, yo you u need need to cr crea eate te the the poli polici cies es to ba back ck up 1 Be the configuration files. See “ Configuring a policy to back up the configuration files ” on page 45.
2 Log into a client computer.
50
Configuring NetBackup for DB2 Configuring the runtime environment environment
Copy the sample sample db2.conf fi file le from from its loca locatio tion n in the the sa samp mple le dire direct ctor ory y to its 3 Copy active location. Its location in the sample directory is as follows: install_path\NetBackup\dbext\db2\samples
The active location for the db2.conf file is as follows: install_path\NetBackup\dbext\db2\db2.conf
i dentifier for backing up the database. 4 In the db2.conf file, create an object identifier This object identifier starts with the following keyword lines: DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE DATABASE DATABASE . . .
i dentifier for backing up the archive 5 In the db2.conf file, create an object identifier logs. DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY POL ICY DB2_TY DB2_TYPE_ PE_POL POL_LO _LOGPO GPOL L # a DB2 typ type e pol policy icy 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 51.
7 Save and close the db2.conf file. procedure on on each each client computer. 8 Repeat this procedure See “ Example db2.conf file (with VENDOR method)” on page 50.
Example db2.conf file (with VENDOR method) Assume that you need to back up a database named SAMPLE and its archive logs. The VENDOR method is enabled for database SAMPLE. The policies for database SAMPLE specify the required schedules for the backups.
The policies are as follows:
Configuring NetBackup for DB2 51 Configuring the runtime environment
■
The DB2_DB_Policy backs up the database. This policy has an application backup bac kup schedu schedule le and an automa automatic tic backup backup schedu schedule. le. The fir first st definit definition ion in the example db2.conf file file specifi specifies es this pol policy icy and its applica application tionbac backup kup schedu schedule, le, which whi ch is named named Default-Application-Backup. Theaut The automa omatic tic backupsched backupschedule ule is not specified in db2.conf.
■
The DB2_ARCH_Policy bac backs ks up the arc archiv hive e logs logs.. Thi Thiss po polic licy y has an appl applica icatio tion n backup back up schedule schedulenamed named Default-Application-Backup.Thethirdentryinthe example file specifies this policy and its application backup schedule.
DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE DATABASE DATABASE POLICY DB2_DB_Polic DB2_DB_Policy y SCHEDULE Default-Application-Backup ENDOPER
#DATABASE SAMPLE #DATABASE SAMPLE #OBJECTTYPE #OBJEC TTYPE ARCHIVE ARCHIVE #POLICY #POLIC Y DB2_Log_Pol DB2_Log_Policy icy #SCHEDULE #SCHED ULE User #ARCFUNC #ARCFU NC SAVE #ARCFUNC #ARCFU NC COPY #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir #ENDOPER DATABASE DATABA SE SAMPLE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY DB2_ARCH_Pol DB2_ARCH_Policy icy 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 file co cons nsist istss of a se serie riess of entrie entriess that that de defin fine e a po polic licy y anda sched schedule ule that are based upon an OBJECTTYPE.
■
Specify Specify a differ different ent POLICY na name me for for the the DATABASE obj object ect.. Also Also speci specify fy a policy policy ARCFUNC C SAVE. name for ARCHIVE object when you use ARCFUN
52
Configuring NetBackup for DB2 Configuring the runtime environment environment
■
With Within in a defini definitio tion, n, OBJECTTYPE is a re requ quir ired ed ke keyw ywor ord. d. POLICY is re requ quir ired ed for for the DATABASE obje object ct.. It is al also so re requi quire red d for for the the ARCHIVE obje object ct if you you us use e ARCFUNC SAVE orifyouusethe VENDOR method. POLICY is not not re requ quir ired ed if you you us use e ARCFUNC COPY. All other keywords are optional.
■
Terminate each each entry with an ENDOPER keyword.
■
Within a definition, the keyw pairs can appear in any order. keyword ord value value pairs
■
The keywords are not case sensitive, but their values values are.
■
Entries are not nested.
■
When a pound character character (#) appears in the first column, the line is treated as a comment.
The db2.conf file file acce accept ptss the the ke keyw ywor ords ds that that are are de desc scri ribe bed d in this this topi topic. c. 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
■
ARCFUN ARCFUNC C SAVE
■
ARCFUN ARCFUNC C COPY
■
PARTIT PARTITIONTY IONTYPE PE RAW
■
RETDIR
3-7 describes the keywords and values that are used. Table 3-7 describes Table 3-7
Keyword value pairs for the db2.conf file
Keyword value
Description
ARCDIR dir
Full path to the location of the archive logs. No default. Required if ARCFUN ARCFUNC C COPY is also specified.
ARCFUNC SAVE ARCFUNC ARCFUNC ARCFUN C COPY
ARCFUNC SAVE saves archive logs to/from ARCFUNC NetBackup. ARCFUNC COPY copies archive logs to/from ARCFUNC ARCDIR/RETDIR directories.
You must must specif specify y eit eithe herr ARCFUN ARCFUNC C SAVE or ARCFUNC COPY if OBJECT OBJECTTYPE TYPE ARCHI ARCHIVE VE is also specified.
Configuring NetBackup for DB2 53 Configuring the runtime environment
Table 3-7
Keyword value pairs for the db2.conf file (continued)
Keyword value
Description
CLIENT_NAMEclient_name
An alternate client Windows server. Use this option when you restore a DB2 database from one Windows server to an alternate client Windows server.
DATABASE db_name
DB2 database name. No default. Required only for alternate restores.
DESTALIAS src_db_name DESTINST src_inst_name
DESTALIAS specifies the database alias name of the destination database for an alternate restore. DESTINST specifies the instance name of the destination instance for an alternate restore.
No default. Required only for alternate restores. ENDOPER
Sign Si gnal als s the the en end d of a de defi fini niti tion on.. Requ Requir ired ed at the the en end d of each definition.
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.
OBJECTTYPE OBJECTTYPE OBJECTTYPE OBJECT TYPE OBJECTTYPE OBJECT TYPE OBJECTTYPE OBJECT TYPE
ALTERNATE ALTERNATE ARCHIVE ARCHIVE DATABASE DATABASE TABLESPACE TABLESPACE
Specify OBJEC OBJECTTYPE TTYPE ALTERN ALTERNATE ATE to note that the succee suc ceedin ding g lines lines pertai pertain n to a perfor performin ming g an alt altern ernate ate restore. Specify OBJEC OBJECTTYPE TTYPE DATABA DATABASE SE or OBJECTTYPE TABLESPACE for DB2 policies. Specify OBJECTTYPE ARCHIVE for MS-Windows-NT policies. One of OBJECT OBJECTTYPE TYPE ALTERN ALTERNATE ATE, OBJECTTYPE ARCHIVE, OBJECT OBJECTTYPE TYPE DATABA DATABASE SE, or OBJECTTYPE TABLESPACE is required in all db2.conf files. OBJECTTYPE OBJEC TTYPE ALTERN ALTERNATE ATE is required if you want to
perform an alternate restore. PARTITIONTY PARTIT IONTYPE PE 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 Default-Application-Backup -Backup schedule.
54
Configuring NetBackup for DB2 Configuring the log on account for the NetBackup Client Service
Table 3-7
Keyword value pairs for the db2.conf file (continued)
Keyword value
Description
POLICY pol_name
Name of a NetBackup policy. If not specified, NetBackup uses the first DB2 policy that is found in the configuration on the NetBackup master server. If OBJECT OBJECTTYPE TYPE ARCHI ARCHIVE VE is specified, specify the name of the MS-Windows-NT or a Standard policy. This This po poli licy cy is only only re requ quir ired ed if you you us use e ARCF ARCFUNC UNC SAV SAVE E. If OBJECT OBJECTTYPE TYPE DATAB DATABASE ASE or OBJECTTYPE TABLESPACE is specified, then a DB2 policy must be specified.
RETDIR RET DIR dir
Full path to the location from which the archive logs are retrieved. No default. ARCFUNC C COPY is also specified. Required if ARCFUN
SCHEDULE sched_name
SRCALIAS src_db_name SRCINST src_inst_name
NetBackup schedule name in policy. The default is the first application backup in the policy. SRCALIAS specifies the database alias name of the source database for an alternate restore. SRCINST specifies the instance name of the source instance for an alternate restore.
No defaults. Required only for alternate restores.
Configuring the log on account for the NetBackup Client Service 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 t he target database if you use OS authentication instead of passwords. If you use OS authentication, run the NetBackup client service under an account thatt has SYSAD tha SYSADM, M, SYSCTR SYSCTRL, L, or SYSMAI SYSMAINT NT privil privilege egess for DB2. DB2. The acc accoun ountt name name must comply with the DB2 naming rules. For more information on naming rules and authentication, see your DB2 documentation.
Configuring NetBackup for DB2 Environment variables
To configure the log on account for the NetBackup Client Service
1 Open the Windows Services application. NetBacku ackup p Client Client Service Service entry. 2 Double-click on the NetB Log g On tab. 3 Click on the Lo
SYSADM, SYSCTRL, or SYSMAINT SYSMAINT privileges. 4 Type the account name with SYSADM,
5 Type the password. 6 Stop and start the NetBackup Client Service. Services control panel application. 7 Close the Services
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 enviro env ironme nment nt variab variables les in the follow following ing table. table. These These variab variables les are unknow unknown n 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 install_path\NetBackup\dbext\db2\db2.conf file.
Table 3-8 describes 3-8 describes the DB2 environment variables. DB2 environment variables Table 3-8 Environment variable
Purpose
DB2_POLICY
Name of the Net Name NetBac Backup kup for DB2 pol policy icy fro from m which which the Automa Automatic tic Backup Bac kup was starte started. d. This This policy policy nam name e is not ne neces cessar sarily ily the same same poli policy cy name name th that at is in th the e db2.conf fi file le.. Th This is va vari riab able le is se sett on only ly if the bac backup kup is ini initia tiated ted from from the server server,, ei eithe therr automa automatic ticall ally y by the Net NetBac Backup kup schedu scheduler ler or manual manually ly throug through h the admini administr strato atorr interface.
DB2_SERVER
Name of the NetBackup server.
55
56
Configuring NetBackup for DB2 Creating templates and shell scripts
Table 3-8
DB2 environment variables (continued)
Environment variable
Purpose
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 ad ministrator interface.
DB2_SCHEDULED
Set to 1 if this backup is a scheduled backup type (Automatic Backup).
DB2_USER_INITIATED Set Set to 1 if this this back backup up is a us user er-i -ini niti tiat ated ed ba back ckup up ty type pe (A (Appl pplic icat atio ion n Backup backup). DB2_FULL
Set to 1 for an Automatic full backup .
DB2_INCR
Set to 1 for an Automatic Differential incremental backup .
DB2_CINC
Set to 1 for an Automatic Cumulative incremental backup .
Creating templates and shell scripts To perform a scheduled NetBackup for DB2 backup, you must create a template or shell script. The template or shell script controls the backup job on the NetBackup for DB2 client. You add this template or shell script to the Backup Sele Se lect ctio ions ns li list st in the the NetB NetBac acku kup p for for DB2 DB2 poli policy cy on the the mast master er se serv rver er.. You You ca can n also also use the template or shell script to manually start a backup on the client.
Understanding templates and shell scripts
The following sections describe templates and shell scripts.
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 57. The NetB The NetBac acku kup p for for DB2 DB2 ba back ckup up wiza wizard rd do does es not not supp suppor ortt all all of the the co comm mman ands ds and and op opti tion onss that that are are prov provid ided ed by DB2. DB2. If a temp templa late te do does es not not pr prov ovid ide e all all of the the re requ quir ired ed functionality, you must write a script.
Configuring NetBackup for DB2 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 shell syntax. See “ Creating DB2 scripts manually” on page 60. 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 59.
Specifying the NetBackup master server from the client To ensure that the templates you create are saved to and run from the correct master server, specify the master server on the client. You can select the master server in the Backup, Archive, and Restore interface. To select the master server in the Backup, Archive, and Restore interface
Backup,, Archiv Archive, e, and Restor Restore e interfa interface, ce,cli click ck File>SpecifyNetBackup 1 In the Backup Machi Ma chines nes and Policy Policy Type Type. Serv rver er to use use for for back backup upss and and re rest stor ores es list, select the master server. 2 In the Se
3 Click OK.
Creating a backup template usin ing g the NetBackup for DB2 backup wizard Use the DB2 backup wizard to create the backup template. You can access this wizard from the Backup, Archive, and Restore interface.
Browsing for the DB2 instance to back up Youcan You canbro browse wsethe the DB2 DB2 enviro environme nment nt in theBac the Backup kup,, Archiv Archive, e, and Restor Restore e interfa interface ce on the NetBackup for DB2 client.
57
58
Configuring NetBackup for DB2 Creating a backup template using the NetBackup for DB2 backup wizard
Note: Because the Backup, Archive, and Restore interface only displays local or resident partitions, templates that are created on the t he local client do not back up partitions on remote hosts. Create additional templates for the other remote
part partiti ition onss by runn ruspecify nnin ing g the th e wiza wizard rd on thos those e clie cl nts. s.policy To ba back ck up the thselections e en enti tire re EEE/ EElist. E/DP DPF F configuration, multiple templates inient t he the backup To browse for a DB2 instance
Archive, and Restore interface from the Windows Start 1 To start the Backup, Archive, menu, choose choose All Programs Programs> > Symantec SymantecNetB NetBacku ackup p > Backup, Backup, Archive, Archive,and and Restore. Selec lectt for Backup Backup button. 2 Click the Se
pane, ne, expand the DB2 resource to view a DB2 DB2 instance hierarchy. hierarchy. 3 In the left pa pane to v view iew details in the right right pane. 4 Select a node in the left pane The following figure shows a DB2 instance hierarchy. When Whe n yousel you select ectany any parent parent databa database se object object,, NetBac NetBackup kup forDB2 for DB2 automa automatic ticall ally y selects all the child objects beneath it. See Table 3-6 See Table 3-6 for for a description of the database object types in the backup window.
Crea Cr eati ting ng a back backup up temp templa late te with with the the NetB NetBac acku kup p for for DB2 DB2 Ba Back ckup up Wiza Wizard rd After you select the DB2 objects to back up, use the NetBackup for DB2 Backup Wizar Wiz ard d to create createa a backu backup p templ template atefo forr that that DB2 DB2 eleme element. nt. The The fol follo lowi wing ng pr proc oced edure ure uses us es the the Ba Back ckup up,, Ar Arch chiv ive, e, and and Rest Restor ore e inte interf rfac ace e on the the NetB NetBac acku kup p for for DB2 DB2 clie client nt.. To create a backup template by using the NetBackup for DB2 Backup Wizard
1 Log on to Windows as the DB2 user. Backup, ackup, Archive Archive and Restore interface, select the DB2 object(s) object(s) you 2 In the B want to back up. Action ionss > Backup Backup. 3 Click Act
The NetBac NetBackup kup for DB2 DB2 backup backup wizard wizard displa displays ys the follow following ing screen screenss for you you to enter information about the backup operation you want to perform: ■
Welcome
■
Database Login
■
Initial Settings
■
Backup Options
Configuring NetBackup for DB2 59 Creating shell scripts using bpdbsbdb2
■
Template Summary
Click Help on the wizard panel for more information. When en yo you u co comp mple lete te the the wiza wizard rd,, the the Temp Templa late te Comp Comple lete te scre screen en appe appear ars. s. You You 4 Wh 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. you u are satisfied with the template, click Finish to save, run, or save 5 When yo and run the template you created. When yo When you u run run a ba back ckup up te temp mpla late te fr from om the the wiza wizard rd,, NetB NetBac acku kup p pe perf rfor orms ms a full full backup.
Creating shell scripts using bpdbsbdb2 bpdbsbdb2 is a NetBackup for DB2 command that initiates initi ates template-based,
user-directed backup and recovery. It also generates DB2 shell scripts from templates created by the backup wizard. To create a shell script, issue this command with the following options: bpdbsb bpd bsbdb2 db2 -backu -backup p -g script_file_name -t template_name
where: script scr ipt fil filee nam name e
Generates a shell script from a template. Enclose script_file_name in in quotation marks (" ") if it contains space characters. Do not use this option with this command’s -r (for "run") option. See “ Using bpdbsbdb2” on page 78.
template_name
Identifies the template. bpdbsbdb2 retrieves backup templates from a known location on the master server. Specify only the file name.
Caution: It is the the us user er's 's resp respon onsi sibi bili lity ty to re revi view ew and and cu cust stom omiz ize e any any and and all all scri script ptss thatt are genera tha generated ted from from templa templates tes.. Genera Generated ted script scriptss are intende intended d to be mod modifi ified ed for the user's environment and preferences. For example, settings such as passwo pas swords rds or catalo catalog g partiti partition on number numberss are notgen not genera erated ted in thetem the templa platete-toto-scr script ipt co conv nver ersi sion on,, so they they requ requir ire e manu manual al ed edit itin ing. g. In addi additio tion, n, ge gene nera rated ted scrip scripts ts do not not
handle all possible error and failure cases and should be used at your own risk.
60
Configuring NetBackup for DB2 Creating DB2 scripts manually
Use th Use the e DB2CMD com comman mand d proces processor sorto to run scripts scriptstha thatt yougen you genera erated ted for Window Windows. s. This processor is provided with DB2, DB2CM DB2CMD D C:\TE C:\TEMP\SCR MP\SCRIPT.CM IPT.CMD D. For more information, see the DB2 Co Comm mmand andss User User s Guid Guide e . ’ ’
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 DB2 QUIESCE co comma mmand nd is ge gener nerate ated d when when the Disconnectusersandprohibit access template option is specified. However, this command fails if your version is before DB2 V8.1. Whenatte When attempti mpting ng a point-i point-in-ti n-time me restore restore,, custom customize ize the time timeval value. ue. The com command mand DB DB2 2 RE REST STOR ORE E .. ... . TA TAKE KEN N AT strictly interprets the specified time and succeeds on only ly if a ba back ckup up imag image e with with the the sa same me time time ex exis ists ts.. Fo Forr more more info inform rmat atio ion, n, se see e yo your ur IBMDB2 IBM DB2doc docume umenta ntation tion.. This This limita limitation tiondoe doess not notexis existt for templa templates tes,, which which sea search rch for an appropriate image. If a template enables roll-forward recovery, then roll-forward commands are ge gene nera rate ted d for for al alll parti partiti tion onss that that are are sp spec ecif ifie ied d in the the templ templat ate, e, whet whethe herr or not not that that partition is configured for roll-forward recovery. If a script performs a roll-forward recovery, customize the DB2NODE variable. In singl sin gle e partit partition ion enviro environme nments nts,, this this variab variable le ca can n typica typically lly be emp empty ty (for (for exampl example, e, "DB2NODE="). In a multiple partition environment, set this variable to the catalog partition number.
Creating DB2 scripts manually The NetBackup for DB2 installation software includes the following scripts: ■
db2_backup_db_offline.cmd
■
db2_backup_db_online.cmd
■
db2_restore_db.cmd
■
db2_mpp_backup_offline.cmd
■
db2_mpp_restore_db.cmd
After installation, they reside in the following location: install_path\NetBackup\dbext\db2\samples\
By default, install_path is C:\P C:\Program rogram Files Files\VERIT \VERITAS AS.
Configuring NetBackup for DB2 Creating DB2 scripts manually
Note: Be sure to modify these scripts for your environment. Do not store your scripts in the sample directory because they are lost if i f 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 whenstart when starting ing operation operationss through through NetBacku NetBackup. p. NetBacku NetBackup p for DB2 DB2does doesnot not generate generate an erro errorr if a rest restor ore e scri script pt is used used for for a ba back ckup up op oper erat atio ion n or a ba back ckup up scri script pt is us used ed for a restore operation.
Modifying Modifyi ng DB2 backup and install scripts The follow procedure describes how to modify scripts. Special configuration is required for a DB2 EEE (DPF) environment. See “ Overview of configuration for a DB2 EEE (DPF) environment” on page 127. To modify the DB2 backup and install scripts
scripts to a different directory on your client in a safe 1 Copy the example scripts location. locatio n. In cluste clustered red enviro environme nments nts,, this this loc locati ation on should should be ava availa ilable ble after after a failover.
2 Use a text editor such as Notepad to open the script. 3 Follow the instructions in the script. scripts ripts that you you just created created by starting a manual manual backup of this 4 Test the sc policy. See “ Testing configuration settings” on page 40.
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 db2.conf
61
62
Configuring NetBackup for DB2 Storing templates and scripts
Para Parame mete ters rs from from thes these e sour source cess ca can n be ev eval alua uate ted d with within in the the scrip scripts ts.. Fo Forr ex exam ampl ple, e, the DB2_POLICY value is the name of the policy used to perform the backup. See “ Configuring the runtime environment” on page 46.
Storing templates and scripts The following sections explain how to store templates and scripts.
Templates The backup wizard saves a backup template to a location specific to NetBackup on the curren currentt NetBac NetBackup kup master master server server.. NetBac NetBackup kup retrie retrieves ves a backup backup templa template te from the master server as part of a backup (server-directed, scheduled, 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 sche schedu dule led d ba back ckup upss us use e the the sa same me co copy py of the the temp templa late te for for ea each ch clie client nt in the the po poli licy cy 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 76. 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 wit h a polic policy y by speci specify fying ing the file file name name (incl (includi uding ng pa path) th) in the po polic licy y file file or scrip scriptt 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. See “ Adding backup selections to a DB2 policy” on page 37. The backup processes and recovery processes sometimes require passwords for DB2 database access and system user accounts.
Sto torrin ing g te temp mpla lattes an and d sc scrrip ipts ts in a Ne NetB tBac acku kup p cl clus uste terr Te Temp mpla late tess and and sh shel elll sc scri ript ptss perta pertain in to NetB NetBac acku kup p for for DB2 DB2 en envi viro ronm nmen ents ts that that are are not installed in a cluster.
See “ Templates” on page 62.
Configuring NetBackup for DB2 Storing templates and scripts in a NetBackup cluster
See “ Shell scripts” on page 62. If you operate within a NetBackup cluster, make sure that the restore templates and shell scripts reside in a file system that is shared between all nodes in the cluster.
63
64
Configuring NetBackup for DB2 Storing templates and scripts in a NetBackup cluster
Chapter
4
Performing backups and restores of DB2 This chapter includes the following topics: ■
NetBackup for DB2 DB2 Overview of using NetBackup
■
Performing a backup
■
Performing a user-directed user-directed backup from the NetBackup NetBackup for DB2 client
■
Browsing backups
■
Performing a restore
■
Performing an alternate restore
Overview of using NetBackup for DB2
When installation and configuration are complete, you can start DB2 backups and restores through NetBackup or you can run DB2 commands directly.
Caution: Always specify the correct DB2 script or template when configuring automatic backups or when starting operations through NetBackup. NetBackup for for DB2 DB2 does does no nott ge gene nera rate te an erro errorr if a re rest stor ore e DB2 DB2 scri script pt file file is used used for for a ba back ckup up operation or a backup DB2 template or script is used for a restore operation.
PerformingTh aisbackup This se sect ctio ion n desc descri ribe bess the the di diff ffer eren entt ways ways yo you u ca can n pe perf rfor orm m a ba back ckup up and and ex expl plai ains ns
the relationships between settings.
66
Performing backups and restores of DB2 Performing a backup
NetBackup for DB2 provides the following ways to perform backups: ■
By issuing a DB2 command from the DB DB2 2 control center or ccommand-line ommand-line proces pro cessor sor.. The DB2 BACKUP and RESTORE com command mandss use the pol policie icies, s, schedul schedules, es, and settings that are specified in the t he following sources: ■ The NetBackup NetBackup for DB2 DB2 vendo vendorr I/O library. library. This library is named nbdb2.dll. ■
The NetBackup for DB2 configuration configuration file. This file is named db2.conf.
■
By running a script from the operating operating system command command line. You can 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 wizard wizardss or Template Administration interface.
■
Through templates and scripts that are specified in policies. When you bac back k 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 D DB2 B2 database or tablespace. tablespace. This backup is accomplished by issuing a DB2 BACKUP DATABA DATABASE SE command. A data databa base se ba back ckup up ca can n be in initi itiat ated ed thro throug ugh h NetB NetBac acku kup p by an auto automa mati ticc ba back ckup up of a DB2 policy, a manual backup of a DB2 policy, or a user-directed backup.
■
An archive log backup backup is a backup of an archive log fil file e for DB2. If VENDOR VENDOR is en enabl abled ed in the DB2 DB2 co confi nfigu gura ratio tion n files, files, NetBa NetBack ckup up for for DB2 DB2 backs backs up the thearc archiv hive e logs along with the database files. If the user exit program is enabled in tthe he DB2 DB 2 co conf nfig igur urat atio ion n fi file le,, yo you u need need a sepa separa rate te poli policy cy and and sche schedu dule le to ba back ck up the the archive logs.
■
A co conf nfig igur urat atio ion n fi file le ba back ckup up is a ba back ckup up of the the DB2 DB2 co conf nfig igur urat atio ion n file filess that that yo you u need to recover the database in the case of a disaster. You can use an Windows policy with a User Backup schedule to back up the files. For information on which files to back up, see your IBM DB2 documentation.
Performing Perfor ming a backup from the NetBac NetBackup kup master server The following sections describe automatic and manual backups.
Automatic backup of a DB2 policy The most convenient way to back up your database is to set up schedules for
The most convenient way to back up your database is to set up schedules for automatic backups.
Performing backups and restores of DB2 Performing a user-directed backup from the NetBackup for DB2 client
When the NetBackup scheduler invokes a schedule for an automatic backup, the DB2 scripts run as follows: ■
In the same order as they appear in the file list
■
On all clients that are listed in the client list
The DB2 scripts initiate the database backup. Further information is available on how to add a new schedule or change an existing schedule for automatic backups. See “ Overview of using NetBackup for DB2” on page 65. When a backup template is run from a NetBackup schedule, the schedule determines the backup type (automatic full, automatic cumulative incremental, or automatic differential incremental). The following information applies only if you use the user exit program to back up the archive logs: ■
If an online backup backup of a partition is requested, requested, the user exit program m must ust be enabled. If not, an offline partition backup is attempted. An offline backup is also attempted if the database is in backup-pending mode.
■
If a tablespace backup backup is requested, the user exit program program must be enabled. If not,, templa not template te execut execution ion fails fails becaus because e DB2 does does not suppor supportt offlin offline e tab tables lespac pace e backups.
More information is available for templates. See “ Running a NetBackup for DB2 backup template” on page 67.
Manual backup of a DB2 policy The administrator on the master server can use the NetBackup administrator’s interface to manually execute an Automatic Backup schedule for a DB2 policy. See “ Testing configuration settings” on page 40.
Performing a user-directed backup from the NetBackup for DB2 client The following sections describe user-directed backups.
Running a NetBackup for DB2 backup template When you run a template, NetBackup for DB2 processes database partitions
67
sequentially, in the order that is listed in the template summary. All tablespaces
68
Performing backups and restores of DB2 Performing a user-directed backup from the NetBackup for DB2 client
residing with the same partition are processed together. Consider, for example, if tables tablespace pace T1 res reside idess in partiti partition on P1, and tablesp tablespace acess T2 and T3 res reside idein in partiti partition on P2. The processing order is as follows: ■ Process tablespace T1 in partition P1 . ■
Process tablespaces T2 and T3 in partition P2.
A failur failure e in proces processin sing g a reques requestt immedi immediate ately ly stops stops templa template te execut execution ion.. Theerr The error or condition must be resolved before the template can be re-run. Except where noted, all DB2 warnings are treated as DB2 errors; they cause template execution to fail. Ifthe Disconnectusersandprohibitaccess temp templat late e option optionis is select selected, ed, the system system issues the DB2 QUIESCE command before it performs the backup or restore. In ve vers rsio ions ns be befo fore re DB2 DB2 V8.1 V8.1,, this this feat featur ure e is not not avai availa labl ble; e; inst instea ead, d, the the Abortifusers are connected connected option is enforced.
Users must Users must have have sufficie sufficient nt DB2 permiss permissions ionsto to browse browse DB2 databas databases es and perform perform backup bac kup,, restor restore, e, and roll-f roll-forw orward ard operat operation ions. s. Ref Refer er to the follow following ing DB2 databa database se manager configuration settings: SYSADM, SYSCTRL, and SYSMAINT.
Using DB2 template administration The DB2 Template TemplateAdmi Administ nistratio ration n interfac interface e is availab available le in the NetBacku NetBackup p Backup Backup,, Archive Arc hive,, and Restore Restoreinte interfa rface. ce. The DB2 template templateadm adminis inistrat tration ion window windowpro provid vides es the following functions:
Run Edit
Processes the selected template. Changes the contents of an existing template. The selected template is loaded into the NetBackup for DB2 template generation wizard.
Delete
Removes the selected template. You must be the root user or the template creator to delete a template.
Rename
Chan Change gess the the name name of the the se sele lect cted ed te temp mpla late te.. Yo You u must must be th the e ro root ot us user er or the template creator to rename a template.
View
Displays a summary of the selected 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 57.
Performing backups and restores of DB2 Performing a user-directed backup from the NetBackup for DB2 client
To use the DB2 template administration interface
Restore interface. interface. 1 Start the NetBackup Backup, Archive, and Restore Choose Choos e File File > Backup,Archive,andRestore in the NetBack NetBackup up Adminis Administrat tration ion Console. the Ba Back ckup up,, Ar Arch chiv ive, e, and and Rest Restor ore e inte interf rfac ace, e, ch choo oose se Acti Action onss > Administer 2 In the Datab Da tabas ase e Templ Template atess > DB2 DB2.
The DB2 Template Administration window appears. The Se Selec lectt Templa Template te lis listt show showss the nam names es and de descr script iption ionss of the DB DB2 2 backup backup templates that are stored on the current master server. backup p template you want want to run. 3 Select the name of the backu
4 Click Run. Userr Name Name and Password . 5 Type your Use
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 Status.
Using bpdbsbdb2 The bpdbsbdb2 co comma mmand nd runs runs a backu backup p templ template atetha thatt is cr creat eated ed by theNet the NetBa Back ckup up for DB2 Backup Wizard. At the command prompt, issue the in the bpdbsbdb2 following format: bpdbsb bpd bsbdb2 db2 -backu -backup p -r -t template_name
In the preceding command, -r runs a template and -t identifies the template. For example: bpdbsb bpd bsbdb2 db2 -backu -backup p -r -t DB2_Mo DB2_Mon_f n_full ull.tp .tpl l bpdbsbdb2 retrieves backup templates from a predetermined location on the
master server, so you only need to specify the template file name.
Using DB2 to perform a backup
69
To start a backup, run the DB2 BACKUP DATABA DATABASE SE command.
70
Performing backups and restores of DB2 Performing a user-directed backup from the NetBackup for DB2 client
You can run this command from the DB2 command window on the client. Depending on the release of DB2 that you use, issue the BACKU BACKUP P DATABA DATABASE SE command in one of the following formats to perform a backup.
Format 1 - supported in all DB2 releases Issue the command in the following format: db db2 2 ba back ckup up db sa samp mple le lo load ad install_path\NetBackup\bin\nbdb2.dll
For example: db2 backup db sample load C:\Program C:\Program Files\ Files\Verita Veritas\NetB s\NetBackup ackup\bin\n \bin\nbdb2.d bdb2.dll ll
The db2.conf spe specif cifies ies severa severall variab variables les that that the backup backup operat operation ion uses. uses. You ca can n 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: db db2 2 ba back ckup up db sa samp mple le lo load ad install_path\NetBackup\bin\lib OPTIONS "DB2_POLICY=policy3:DB2_SCHED=sched_name4"
Format 2 - supported in DB2 8.2 and later releases If you use a DB2 8.2 or later release and if VENDOR VENDOR is enabled, you can use the command in the following format: db db2 2 ba back ckup up db sa samp mple le on onli line ne lo load ad install_path\NetBackup\bin\nbdb2.dll include includ e logs
The db2.conf file file specif specifies ies severa severall variab variables les that that the backup backup op opera eratio tion n uses. uses. You canov can overr erride idethe thepo polic licy y name name andsc and sched hedule ulenam name e variab variables lesdir direct ectly ly on theco the comma mmand nd line by using the OPTIONS entry. The following example overrides the policy name and the schedule name: db db2 2 ba back ckup up db sa samp mple le on onli line ne lo load ad install_path\NetBackup\bin\lib include includ e logs OPTIONS OPTIONS "DB2_POLICY= "DB2_POLICY=polic policy3:DB2 y3:DB2_SCHED _SCHED=sched =sched_name _name4" 4"
For more information on the DB2 BACKUP BACKUP DATABA DATABASE SE command, see your DB2 documentation.
BACKUP BACK UP DATA DATABASE BASE command options You can back up a DB2 database to NetBackup with either the DB2 BACKUP DATABASE command or with its alternative syntax, BACK BACKUP UP DB.
Performing backups and restores of DB2 Performing a user-directed backup from the NetBackup for DB2 client
4-1 lists the command options when used in a NetBackup for DB2 Table 4-1 lists environment. Table 4-1
DB2 BACKUP command options
Option
Purpose
LOAD NBDB2_library_path
Instru Inst ruct ctss DB2 DB2 to us use e th the e NBDB NBDB2 2 ve vend ndor or libr librar ary y when 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 Thenumber of buffe buffers rs must must OPEN number SESSIONS. Thenumber be twice the number of sessions.
BUFFER size
Use this option to increase or decrease the buffer size, if necessary. Increased size can benefit b enefit performance, butdec but decrea reased sed size size might might be necess necessary ary if using using numero numerous us buff buffer ers. s. DB2 DB2 re reco comm mmen ends ds that that the the si size ze be a mult multip iple le of the extent size. The DB2 DFT_EXTENT_SZ setting defines the default extent size.
WITHOUT WITHOU T PROMPTING PROMPTING
This optionis This optionis requir required ed for unatte unattende nded d backup backups. s. It must must be specif specified ied in bac backup kup script scriptss that that Ne NetBa tBacku ckup p execut executes es..
INCREMENTAL
Use this option to perform a cumulative backup.
INCREMENTAL INCREM ENTAL DELTA
Use this option to perform a differential backup.
ONLINE
Us Use e this this opti option on to ba back ck up hot, hot, or acti active ve,, data databa base ses. s. Th The e DB2 USEREXIT setting must be enabled for online backups.
71
72
Performing backups and restores of DB2 Browsing backups
Table 4-1
Option
DB2 BACKUP command options (continued) Purpose
OPTION OPT IONS S "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.
Specifying this option with the DB2_POLICY, DB2_SCHED, BKUP_IMAGE_PERM, or DB2_RESTORE_PRIORITY environment variables overrides their settings in the db2.conf file. See Table 3-8 See Table 3-8 on on page 55.
Note: Specifying this option overrides the value that is spec specifie ified d by the VENDOROP VENDOROPT T database database configur configuratio ation n parameter. PARALLELISM n
Determines the number of tablespaces which can be read rea d in par parall allel el by th the e backu backup p uti utilit lity. y. DB2automat DB2automatica ically lly choose cho osess an optima optimall value value for this this parame parameter ter unless unless you explicitly enter a value.
Browsing backups This section describes how to browse backup images. You can also use the DB2 LIST HISTORY HISTORY command.
Using the Backup, Archive, and Restore interface to browse The Backup, Archive, and Restore interface displays the DB2 resource. You can browse the DB2 resource through four levels: instance, database, partition, and tablespace. You can view the containers in a tablespace, but you can only select for restore at the tablespace t ablespace level or the partition level. This interface does not let you browse previous backups. Instead, it browses the existing DB2 instances and databases. You can select these DB2 objects and use the NetBackup for DB2 recovery wizard to prepare recovery templates for the objects. See “ Using the NetBackup for DB2 recovery wizard” on page 76. Figure 4-1 shows 4-1 shows a sample restore window in the Backup, Archive, and Restore interface.
Performing backups and restores of DB2 Browsing backups
Figure 4-1
Restore window
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.
Using bplist to browse You can use the bplist command to search DB2 backup images. The examples in this section use bplist to search all DB2 backup images for a clientt named clien named camel, whic which h is al also so the the mast master er se serv rver er.. The The infor informa matio tion n co come mess fr from om the NetBackup catalog on the master server. More information on the t he bplist command is available. See the NetBackup online Help . The output from bplist differs depending on how you manage your archive log files. Examples 1 and 2 assume that the user exit program is used tto o back up the archiv arc hive e logs. logs. Exampl Example e 3 assume assumess that that VENDOR is se sett and and that that the the us user er ex exit it pr prog ogra ram m is not used to back up the archive logs.
Example 1 The -t 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. install_path\N \Net etBa Back ckup up\b \bin in\b \bpl plis ist t -C came camel l -S came camel l -t 18 -R /
73
DB2:\SAMPLE\node0000\1999120210515\SAMPLE.0.DB2.node00.0.1999120210515.1
74
Performing backups and restores of DB2 Browsing backups
DB2:\SAMPLE\node0000\1999120210473\SAMPLE.0.DB2.node00.0.1999120210473.1 DB2:\SAMPLE\node0000\1999120117120\SAMPLE.0.DB2.node00.0.1999120117120.1 DB2:\SAMPLE\node0000\1999112915411\SAMPLE.3.DB2.node00.4.1999112915411.1 DB2:\SAMPLE\node0000\1999112914204\SAMPLE.0.DB2.node00.0.1999112914204.1
Table 4-2 4-2 shows shows how to interpret one of the lines from the listing. Table 4-2
bplist output
Output component
Meaning
DB2
DB2 is the directory name for all DB2 backups.
SAMPLE
Name of the database.
node0000
Node name.
19991202105152
Time that the backup occurred.
(Filename) SAMPLE
Database name.
0
Type of back Type backup up taken. taken.Zer Zero o (0)ind (0) indicat icates es a ful fulll databasebacku databasebackup. p. Three (3) indicates a tablespace backup.
DB2
Database instance name. One to eight characters in length. ■
node0000
Node number Node number.. In non-pa non-parti rtitio tioned ned databa database se system systems, s, node node number numb er is always always zero (no (node00 de0000). 00). In parti partition tioned ed database 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 Timest amp.. Includ Includes es the date (year, (year, month, month, day) day) and time time (hour, minute, second). ■
1
Session Sessio n number number.. This This fil file e exten extensio sion n identi identifie fiess the sessi session on numb number er that that wa wass sp spec ecif ifie ied d on the the DB2 DB2 BACKUP command.
Performing backups and restores of DB2 Performing a restore
75
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 poli policy cy na name me or orig igina inate tess from from the the sett settin ings gs in the the db2.conf file file for for arch archiv ive e log log file files. s. The bplist output shows the list of DB2 archive log files that are stored in NetBackup. install_path\Ne \NetBa tBacku ckup\b p\bin\ in\bpl bplist ist -k DB2 DB2_Lo _Log_P g_Poli olicy cy -C cow -S cow -R /
C:\DB2\NODE0000\SQL00001\SQLOGDIR\S0000026.LOG C:\DB2\NODE0000\SQL00001\SQLOGDIR\S0000025.LOG C:\DB2\NODE0000\SQL00001\SQLOGDIR\S0000024.LOG
Example 3 Thiss exampl Thi example e uses uses bplist to se sear arch ch for for DB2 DB2 arch archiv ive e log log file files. s. The The -k log_po log_policy licy op opti tion on spec specif ifie iess file filess that that are are ba back cked ed up with with this this po poli licy cy.. Th The e ou outp tput ut form format at in the the following example differs from the previous examples because for this database, the VENDOR archive log method is enabled in DB2: install_path\N \Net etBa Back ckup up\b \bin in\b \bpl plis ist t -C co cow w -S co cow w -k log_ log_po poli licy cy -R /
C:\DB2\SAMPLE\LOGFILE\node0000\db2v864d\C0000000_S0000000.LOG
Table 4-3 4-3 explains explains the information in this command’s output. Table 4-3
Example output for bplist command
Output component
Meaning
DB2
DB2 is the directory name for all DB2 backups.
SAMPLE
Name of the database.
LOGFILE
Identifies this entry as a log file.
node0000
Name of the node.
db2v864d
Name of the DB2 instance.
C0000000_S0000000.LOG
Name of the log file. Provided by DB2.
Performing a restore The following sections describe restore methods.
76
Performing backups and restores of DB2 Performing a restore
Using the NetBackup for DB2 recovery wizard NetBac NetB acku kup p for for DB2 DB2 in incl clud udes es a reco recove very ry wiza wizard rd that that soli solici cits ts info inform rmat atio ion n fr from om the the user about the desired DB2 restore and recover operations. The wizard uses the information to create a template that can be used immediately or saved for later use. The NetBackup for DB2 recovery wizard saves a recovery template locally in a user-sp use r-specif ecified ied locatio location n on the NetBack NetBackup up cli client. ent. Recove Recovery ry templat templates es are not stored stored on the server because recovery is always user directed, not scheduled. Under typical circumstances, a recovery template is run immediately and then deleted. The recov recovery ery proces processs sometim sometimes es require requiress passwo passwords rds for DB2 DB2 databa database se access access and system user accounts. Templates store encrypted passwords that are decrypted at runtime. Because recovery can be a complex process, it might be necessary to perform manual steps as part of the operation. For more information, see your DB2 documentation.
Selecting files for restore The following procedure describes how to select files for a restore operation. To select files for restore
1 Open the Backup, Archive, and Restore interface. Specif cify y NetBa NetBacku ckup p Machi Machines nes and Policy Policy Typ Type e. 2 Click File > Spe Polic icy y type type for restor restores es list, select DB2. 3 In the Pol
4 Click OK. Sele lect ct Fi File less an and d Fold Folder erss to Rest Restor ore e > from from Norm Normal al Back Backup up. 5 Choose File > Se
resource in the left pane to view a DB2 instance hierarchy. hierarchy. 6 Expand the DB2 resource pane to v view iew details in the right right pane. 7 Select a node in the left pane If the the DB2 DB2 node node is not not vi visi sibl ble, e, it is poss possib ible le that that yo your ur Ne NetB tBac acku kup p for for DB2 DB2 clie client nt does not have the appropriate policy type specified.
Using the recovery wizard When you are ready to perform a recovery, complete the following procedure to create and run a template with the recovery wizard. When you run a template, all restore operations are performed before any and all roll-forward operations. Note the following:
Performing backups and restores of DB2 Performing a restore
■
When you perform a DB2 DB2 restore, false alarms are reported in the NetBackup NetBackup Ac Activ tivity ity Monito Monitor. r. DB2 access accesses es the NetBac NetBackup kup image image twice twice when when you perfor perform m a restore. The first access reads a partial image, which is reported as "The restor res tore e failed failed to recov recover er the reques requested ted files" files" (st (statu atuss 5) in the Activ Activity ity Mon Monito itor. r. The next access reads the entire image, which should result in a successful restore (status 0). The template execution status, not the activity monitor, is the best indication of overall success.
■
The DB2 warning warning SQL2539W indicates that the requested requested restore operation operation replac rep laces es the existi existing ng databa database. se. That That is, the existi existing ng dat databa abase se files files are delete deleted. d. When Wh en runn runnin ing g a te temp mpla late te to pe perf rfor orm m a re rest stor ore, e, this this wa warn rnin ing g is logg logged ed and and the the restore proceeds without interruption.
■
The DB2 DB2 warnin warning g SQL252 SQL2523W 3W indica indicates tes that that the backup backup image image origin originate atess fro from m a di diff ffer eren entt data databa base se of th the e sa same me na name me.. This This wa warn rnin ing g is ha hand ndle led d as an er erro rorr to prevent DB2 from deleting log files.
■
The DB2 error error SQL126 SQL1260N 0N indica indicates tes tha thatt the restore restored d partiti partition on is not config configured ured for roll-forward recovery. If the template is configured to perform a roll-forward, this step is skipped.
To use the recovery wizard
DB2 user. 1 Log onto NetBackup as the DB2 and Restore interface, choose choose File > Se Selec lectt Fil Files es and 2 In the Backup, Archive, and Folder Fol derss to Restor Restore e > from from Norma Normall Bac Backup kup.
Expand d a DB2 DB2 in inst stan ance ce and and sele select ct the the data databa base se obje object ct(s (s)) yo you u want want to re rest stor ore. e. 3 Expan
4 Click Actions > Restore. restore operation you want to perform in the 5 Enter information about the restore following screens: ■
Welcome
■
Database Login
■
Time Periods
■
Restore Options
■
Recovery Options
77
78
Performing backups and restores of DB2 Performing a restore
If yo you u ne need ed an expl explan anat atio ion n of an any y of the the fiel fields ds on the the wiza wizard rd scre screen enss or more more details, click Help on the wizard screen. template te immedi immediate ately ly after after the wizard wizard finish finishes, es, to save save the templa template te 6 Run the templa locally, or both. For explanations of your choices, click Help. Template execution does not support the use of local time when performing a ro roll ll-f -for orwa ward rd.. The The roll roll-f -for orwa ward rd time time that that is spec specifi ified ed in the thetem templ plate ateis is pa pass ssed ed 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: install_path\netba \netbackup\b ckup\bin\bpd in\bpdbsbdb bsbdb2 2 -resto -restore re -r -t templ_name
The -r runs a template, and the -t identifies the template. For example: bpdbsbdb2 bpdbsb db2 -restore -restore -r -t \db2\restor \db2\restore_temp e_templates\ lates\full_r full_restor estore.tpl e.tpl
Restore Restor e templa templates tes do not reside reside in a predet predeterm ermine ined d locati location on on the master master server server.. They Th ey are are cons consid ider ered ed to be te temp mpor orar ary y in na natu ture re an and d sh shou ould ld re resi side de on the the clie client nt.. If the full path is not specified as part of the restore template name, the file might not be found. You can create a script from a template with bpdbsbdb2. See “ Creating shell scripts using bpdbsbdb2” on page 59.
Using DB2 to perform a restore The exac Theex actt proc proces esss for for recov recoveri ering ng a DB2 DB2 da datab tabas ase e diffe differs rs from from site site to site site de depe pend nding ing on the following: the methods that are used for backing up the archive logs, the se setti tting ngss that that are are us used ed in the the NetB NetBac acku kup p for for DB2 DB2 co conf nfig igur urat atio ion n file file,, db2.conf, and the location of the archive logs. The proc The proced edur ures es in the the foll follow owin ing g to topi pics cs show show how how to re rest stor ore e an ex exam ampl ple e da data taba base se to the level of a recent database backup plus archive logs: ■
Recovering a DB2 database - Simplest case case
Use this procedure if the archive logs are in i n an accessible location and they were all created with the same parameters in db2.conf.
Performing backups and restores of DB2 Performing a restore
■
79
Recovering a DB2 database - Restoring archive archive logs Thiss ca Thi case se is more more co comp mplex lex.. Use Use this this pr proc oced edure ureif if you you have have to brows browse e for for ar arch chive ive logs and restore them from secondary storage.
For more information on how to recover a DB2 database, see your DB2 documentation.
Recovering a DB2 database - Simplest case The DB2 commands for recovering a database differ from release to release. Use this procedure to restore a database if the archive logs are in a location that is known and accessible to DB2 and NetBackup. For example, you can probably use the procedure in this section if the following are true: ■
If ARCFUN ARCFUNC C SAVE was in effect in the db2.conf file when all archive logs were backed up.
■
If ARCFUN ARCFUNC C COPY was in effect in the db2.conf file when all archive logs were ba back cked ed up an and d the the logs logs were were not not move moved d fr from om the ARCDIR and RETDIR directories.
■
If VENDOR VENDOR was in effect in DB2 at the time all the archive logs were created.
The co The comm mman ands ds in the the foll follow owin ing g proc proced edur ure e re rest stor ore e a DB2 DB2 da data taba base se and and its its arch archiv ive e logs. These commands assume that the archive log files reside in a location that is known and accessible to DB2 and NetBackup. To restore a DB2 database when the archive logs are accessible to DB2 and NetBackup ◆
Depe Depend ndin ing g on the the re rele leas ase e leve levell of DB DB2, 2, en ente terr on one e of the the foll follow owin ing g co comm mman ands ds:: ■
For DB2 8.2 8.2 and later releases, releases, enter the following following command: command: db db2 2 re reco cove ver r db db_name
■
For DB2 releases releases before 8.2, 8.2, enter the following following commands: db db2 2 re rest stor ore e db db_name load install_path\NetBackup\bin\nbdb2.dll db2 rollfo rollforwa rward rd db db_name to end end of logs logs and and stop stop
Where db_name is is the name of the DB2 database you want to restore.
Recovering a DB2 database - Restoring archive logs
You can use the procedure in this section if you need to restore the t he archive logs
before you perform the roll-forward.
80
Performing backups and restores of DB2 Performing a restore
Use the procedure in this section to restore the archive logs manually if the following situations exist: ■
If the archiv archive e logs logs are not not in the stand standard ard locati location ons. s. When When this this situa situatio tion n exists exists,, NetBackup cannot perform a seamless restore of DB2. You may have moved one or more of the needed archive logs to secondary storage such as tape, network storage, or some other location. For example, if ARCFU ARCFUNC NC COPY is in effect and the old archive logs were moved to tape, perform procedure in this section.
■
If ARCFUN wass in effe effect ct in the the db2.conf file file at the the time time the the ar arch chiv ive e logs logs ARCFUNC C COPY wa were backed up and the ARCDIR and RETDIR parameters specify two different locations.
■
If P PARTITI ARTITIONTYP ONTYPE E RAW was in effect in the db2.conf file for some (not all) of the archive log backups.
For more information about the DB2 commands, see your DB2 documentation. To restore a DB2 database when the archive logs are in a non-standard location
1 Restore the database. Issue the DB2 RESTOR Issue RESTORE E DATABASE DATABASE co comma mmand nd to restor restore e the databa database se itself itself.. For example: db db2 2 re rest stor ore e db db_name load install_path\NetBackup\bin\nbdb2.dll
where db_name is is the name of the DB2 database you are to restore. NetBackup ackup to browse browse the archive logs. 2 Use NetB If a restore requires log files that are backed up from a file system and log files that are backed up from a raw device, retrieve the logs from the file system manually. You can use the Backup, Archive, and Restore interface or the bplist co comm mman and d to br brow owse se the the arch archiv ive e logs logs and and find find thos those e mi miss ssin ing g fr from om the the re rest stor ore e directories. If PARTIT specif ifie ied d in the the db2.conf file file,, the the us user er ex exit it pr prog ogra ram m PARTITIONTYP IONTYPE E RAW is spec look lookss for for on only ly thos those e logs logs when when yo you u pe perf rfor orm m the the re rest stor ore. e. The The miss missin ing g logs logs are are those that were written when P PARTITI ARTITIONTYPE ONTYPE RAW was not in effect. See “ Browsing backups” on page 72.
Performing backups and restores of DB2 Performing a restore
81
commands to copy the missing archive archive logs to the 3 Use operating system commands correct locations in your operating system. For example, use your mouse to copy the files from one location to another. ARCFUNC NC COPY COPY is in effect and the ARCDIR and RETDIR parameters specify If ARCFU different locations, copy the logs in the ARCDIR directory to the RETDIR directory. If ARCDIR ARCDIR and RETDIR specify the same location, you do not have to take any action. If some of the log files have been moved to secondary storage, restore these files to the RETDIR directory.
4 Use NetBackup to restore the archive logs. Use either the NetBackup Backup, Archive, and Restore interface or the bprestore command. For example: bprestore C:\vedb2\db2\v8\db2V82d\NODE0000\SQL0001\SQLOGDIR\S00009.LOG
5 Bring the database online. When the roll-forward is initiated, DB2 sends a request to NetBackup to restor res tore e the log files files it needs needs.. DB2 DB2 then then reappl reapplies ies the transa transacti ction on inform informati ation on in the the arch archiv ive e logs logs si sinc nce e the the last last full full ba back ckup up was was pe perf rfor orme med. d. DB2 DB2 br brin ings gs ba back ck the database online. For example, you can use the following command options if PARTITIONTYPE PARTITIONTYPE RAW was not specified when any of the log files were backed up: db db2 2 ro roll llfo forw rwar ard d db sa samp mple le to end end of logs logs and and stop stop
The ROLLFO ROLLFORWARD RWARD DATABA DATABASE SE co comm mman and d issu issues es mess messag ages es if it ca cann nnot ot loca locate te all all the thear ive eglog lo files filive eseitlog ne eds. s.s,Ifand you yo rece ceiv th ese e mess meRWARD ssag ages es,DATABA , brows browse e and and re resto store re the the arch miss michiv ssin ing arch argchiv loneed g fi file les, an duissu isre sue e ive the theethes ROLLFORWARD ROLLFO DATABASE SE command again. After the database is successfully restored, the RO ROLLFORW LLFORWARD ARD DATABA DATABASE SE command restores and reapplies the transactions that are recorded in the archive log files since the last backup was performed. For example, if the backup image was created 10 days ago and restored today, the log files are used to restore transactions that occurred after the backup.
RESTORE REST ORE DATA DATABASE BASE command options You Yo u ca can n rest restor ore e a DB DB2 2 data databa base se with with eith either er the the DB2 DB2 RESTOR RESTORE E DATABA DATABASE SE command RESTOR TORE E DB.TheDB2 RESTOR RESTORE E DATABA DATABASE SE command or wit with h its altern alternati ative ve syntax syntax,, RES restores a database from NetBackup.
82
Performing backups and restores of DB2 Performing a restore
Table le 4-4 pro provid vides es refere reference nce inform informatio ation n for the comman command d op optio tions ns whe when n used used in Tab a NetBackup for DB2 environment. Table 4-4
DB2 RESTORE command options
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. Typically, you should specify the same number of sessio ses sions ns that that we were re used used during during the backup backup.. You can use fewer sessions, but it may degrade overall restore performance. No benefit exists if you specify more sessions.
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. If you use fewer buffers it can degrade performance or can cause the restore to fail when it reads multiplexed images.
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.
WITHOUT WITHOU T PROMPTING PROMPTING
This option is required for unattended restores, and it must be specified in backup scripts that are executed by NetBackup.
INCREMENTAL
When yo When you u us use e this this op opti tion on,, DB2 DB2 may may not not re read ad the the en enti tire re imagefrom image fromNetBa NetBackup ckupmedia media.. Consequent Consequently, ly, NetBackup NetBackup logs an error in the activity monitor, which can safely be ignored.
Performing backups and restores of DB2 Performing an alternate restore
Table 4-4
DB2 RESTORE command options (continued)
Option
Purpose
AUTOMATIC
Use thi thiss optionto optionto res restor tore e a seriesof seriesof ful fulll and inc increm rement ental al images. An automated restore coordinates the restoration of a full backup and all associated incremental backups. A single automated restore restores a full backup, an optional cumulative incremental backup, and one or more differential incremental backups.
HISTORY HISTOR Y FILE
When you When you us use e this this op opti tion on,, DB2 DB2 may may not not re read ad the the en enti tire re imagefrom image fromNetBa NetBackup ckupmedia media.. Consequent Consequently, ly, NetBackup NetBackup logs an error in the activity monitor, which can safely be ignored.
OPTION OPT IONS S "options-string " Specifies options to be used for the restore operation.The string passes to the vendor support library, for example TSM, exactly as it was entered, without the quotes.
Specifying this option overrides the value that is specified by the VENDOROPT database configuration parameter. PARALLELISM n
Specifies the number of buffer manipulators that are to be spawned during the restore operation. DB2 automatically chooses an optimal value for this parameter unless you explicitly enter a value.
Performing an alternate restore An alternate restore lets you restore a DB2 database to a different client or to a different instance. You can also change the name of the database during the restore.
When to use an alternate restore Alternate restores differ from regular restores, as follows: ■
Use the regular restore procedures procedures if you want want to restore a database into the sa same me in inst stan ance ce on the the sa same me NetB NetBac acku kup p clie client nt that that host hosted ed it pr prev evio ious usly ly.. In this this case, the database also retains its original name.
83
84
Performing backups and restores of DB2 Performing an alternate restore
■
Use Use al alter ternat nate e resto restore re proc proced edure uress if you you want want to re resto store re a da datab tabas ase e to a diff differe erent nt in inst stan ance ce or to a diff differ eren entt clie client nt or if yo you u must must re rena name me the the da data taba base se du duri ring ng the the restore. Dat Databa within hinan antinstan ins tance ce has must musat da have hav e unique uni names. es.If If you youres tore eate a databa dat abase se into int oabases anseswit instan instance ce that tha al alrea ready dy datab tabas ase equenam by tha that t name, na me, thealt therestor altern ernate resto res tore re process overwrites the existing database.
4-5 summarizes summarizes the types of restores you can perform and whether you Table 4-5 need to use regular or alternate restore procedures.
Table 4-5
Types of restores permitted
Object
Regular restore
Alternate Alternate Alternate Alternate Alternate Alternate Alternate restore restore restore restore restore restore restore
Database name
Same
Same
Same
Different
Same
Different
Different
Different
Instance
Same
Same
Different
Same
Different
Different
Same
Different
Client
Same
Different
Same
Same
Different
Same
Different
Different
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 4-2 illustrates illustrates this example. Figure 4-2
Alternate restore example
Client: grade7
Client: grade8
Instance: class1 Databases: math1,art1
Instance: class1 Databases: math1, art10
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
Performing backups and restores of DB2 Performing an alternate restore
math1 to math2 because class1 on grade8 alrea already dy hasa databa database se named 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 client grade7. Duri During ng the the re rest stor ore, e, yo you u need need to rena rename me art1 to art2 beca because use instance instance class1 alre alread ady y ha hass a data databa base se na name med d art1. Withou Withoutt renaming, the existing database art1 would be overwritten.
Preparing the master server for an alternate restore The exampl examples es in the followi following ng proced procedure ure assume assume that databas database e SAMPLE was backed backed up by client2, and you want to restore SAMPLE to client1. For more information on how to manage client restores, see the NetBackup Administrator s Guid Guide e . ’ ’
To prepare the NetBackup master server for alternate restores
1 Log onto the NetBackup master server that hosts the policy that backed up database SAMPLE. off the following following files on the NetBa NetBackup ckup master server: 2 Create one o ■
install_path\NetBackup\db\altnames\No.Restrictions
■
install_path\NetBackup\db\altnames\dest_client_name
dest_client_name is is the name of a client that is allowed to be a destination client for alternate restores. For example, client1.
Add d the name name of the NetBackup for DB2 source client client to the 3 (Conditional) Ad dest_client_name file. file.
Perf Perfor orm m this this st step ep if yo you u crea create ted d a dest_client_name file file.. Fo Forr ex exam ampl ple, e, add add the the following line to this file: client2
4 Start the Backup, Archive, and Restore interface. Specif cify y NetBac NetBackup kup Machin Machines es and Policy Policy Type Type. 5 Choose File > Spe Specif cify y NetBa NetBacku ckup p Machi Machines nes and Policy Policy Type Type dialog box, from the 6 In the Spe Se Serv rver er to use use for for back backup upss an and d re rest stor ores es list, select the name of the master server that contains the policy that backed up the database.
85
86
Performing backups and restores of DB2 Performing an alternate restore
Source rce client client for restor restores es list, select the client. 7 From the Sou
For example, client2. Destinat ination ion clients clients for restores restores list, select the client to which you 8 From the Dest
want to restore. For example, client1.
Performing the alternate restore on the clients The follow Thefol lowing ing proced procedure uress explai explain n howto how to restor restore e a DB2 DB2 databa database se and its transa transacti ction on logs. The procedure builds a request to DB2 to find the backup images that correspond to the database you try to restore. Type the commands in this procedure from the client that receives the restored database. To perform an alternate restore of a DB2 database
1 Modify the db2.conf file on the destination client. Add the following new object identifiers: ■
One to specify the alternate restore
■
One to define the new database database
■
One to define the old database database
■
One to define the new log files
■
One to define define the old old log files
The following example shows the keyword lines that are needed to specify the alternate restore: OBJECT OBJ ECTTYP TYPE E ALTERN ALTERNATE ATE # Specif Specifies ies an alt altern ernate ate res restor tore e SR SRCI CINS NST T db2v db2v83 832d 2d
# Na Name mes s the the so sour urce ce i ins nsta tanc nce e th that at w was as b bac acke ked d up
SRCA SRCALI LIAS AS S SAM AMP PLE
# Name Names s th the e s sou ourc rce e da data taba base se t tha hat t w was as b bac acke ked d up
DE DEST STIN INST ST db2 db2v8 v832 32t t
# Name Names s the the de dest stin inat atio ion n in inst stan ance ce n nam ame e
DE DEST STAL ALIA IAS S NE NEWS WSAM AMPL PL
# Na Name mes s the the dest destin inat atio ion n data databa base se ali alias as name
ENDOPER
# Ends the object identifier
The foll The follow owin ing g ex exam ampl ple e sh show owss the the ke keyw ywor ord d that that are are need needed ed to de defi fine ne th the e new new database: DATABASE DATABA SE NEWSAMPL NEWSAMPL OBJECTTYPE OBJECT TYPE DATABASE DATABASE POLICY db2-bkup db2-bkup SCHEDULE Default-Application-Backup
CLIENT_NAME CLIENT _NAME Client1 Client1 ENDOPER
Performing backups and restores of DB2 Performing an alternate restore
The following example shows the keyword that are needed to define the old database: DATABASE DATABA SE SAMPLE OBJECTTYPE DATABASE OBJECTTYPE DATABASE POLICY db2-bkup db2-bkup SCHEDULE Default-Application-Backup CLIENT_NAME CLIENT _NAME Client1 Client1 ENDOPER
The foll The follow owin ing g ex exam ampl ple e sh show owss the the ke keyw ywor ord d that that are are need needed ed to de defi fine ne th the e new new data archive log files: DATABASE DATABA SE NEWSAMPL NEWSAMPL OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY db_a_db2 db_a_db2 SCHEDULE Default-Application-Backup #SCHEDULE #SCHED ULE User CLIENT_NAME CLIENT _NAME Client1 Client1 ARCFUNC ARCFUN C SAVE #ARCFUNC #ARCFU NC COPY #ARCDIR C:\home\db2inst1\arcdir #RETDIR C:\home\db2inst1\arcdir ENDOPER
The following example shows the keyword that are needed to define the old data archive log files: DATABASE DATABA SE SAMPLE OBJECTTYPE OBJECT TYPE ARCHIVE ARCHIVE POLICY db_a_db2 db_a_db2 SCHEDULE Default-Application-Backup #SCHEDULE #SCHED ULE User CLIENT_NAME CLIENT _NAME Client1 Client1 ARCFUNC ARCFUN C SAVE #ARCFUNC #ARCFU NC COPY #ARCDIR C:\home\db2inst1\arcdir #RETDIR C:\home\db2inst1\arcdir
87
88
Performing backups and restores of DB2 Performing an alternate restore
ENDOPER
2 On the destination client, type the DB2 RESTORE command. Type this command in the following format:
db db2 2 re rest stor ore e db db_being_restored load lib_path into new_db_name redirect
where: db_being_restored
Specify the name of the database that was backed up.
lib_path
Specify the full path to the NetBackup library.
new_db_name
Specify the name for the new database. If the name of the new database matches the name of a database presentl pres ently y incl included uded in the new instance instance,, the new database database overwrites the existing database.
For example: db db2 2 re rest stor ore e db sa samp mple le lo load ad install_path\NetBackup\bin\nbdb2.dll into newsampl newsampl redirect redirect
of the data files for the tablespace. 3 Set the location of Type this command in the following format: db db2 2 se set t ta tabl bles espa pace ce co cont ntai aine ners rs for for 0 usin using g "(pa "(path th path)"
where path specifies the DB2 install path. For example, type one or more commands similar to the following: db db2 2 se set t ta tabl bles espa pace ce co cont ntai aine ners rs for for 0 usin using g "(pa "(path th DB2_install_path\db2v832t\NODE0000\SQL00001\SQLT0000.0)"
4 Restore the database. Type the RESTORE command in the following format: db db2 2 re rest stor ore e db db_bring_restored continue
For example:
db2 restor restore e db sample sample contin continue ue
Performing backups and restores of DB2 Performing an alternate restore
5 (Optional) Restore the transaction logs. See “ Restoring the transaction logs” on page 89.
6 Use the DB2 ROLLFORWARD command to restore the logs. Type this command in the following format: db2 rollfo rollforwa rward rd db new_db_name to end end of logs logs and and stop stop
For example: db db2 2 ro roll llfo forw rwar ard d db ne news wsam ampl pl to end end of logs logs and and stop stop
Restoring the transaction logs Perform this procedure if one of the following is true: ■ ■
The archive logs logs did not originally reside on a raw device. The user exit program was was used to back up the archive logs.
To restore the transaction logs
destination tination client, create create a directory directory for the restored transaction log 1 On the des files. For example: mkdir C:\db\db2_v5\home\db2inst1\NODE0000\SQL00001\SQLOGDIR
2 Use the bprestore command to restore the logs. For example: bprestore install_path\db\db2_v5\home\db2inst1\ NODE0000\SQL00001\SQLOGDIR\S00001.LOG
(Optio tional nal)) Move Move the logs logs to the co corre rrect ct direct director ory y for the des destin tinati ation on da datab tabase ase.. 3 (Op If the directory into which you restored the log files is not correct for the destination database, move the logs to the proper location. owner and group permissions permissions are enabled on the log 4 Verify that the correct owner directory.
89
90
Performing backups and restores of DB2 Performing an alternate restore
Chapter
5
Using Snapshot Client with NetBackup for DB2 This chapter includes the following topics: ■
About NetBackup NetBackup for DB2 with Snapshot Client
■
About supported platforms platforms for NetBackup NetBackup for DB2 with Snapshot Snapshot Client
■
About NetBackup for DB2 with with Snapshot Client operations
■
About configuring snapshot backups backups with NetBackup NetBackup for DB2 DB2
■
Restoring from from a snapshot backup
■
About Snapshot Client effects effects
■
Using NetBackup NetBackup for DB2 with Snapshot Client
About NetBackup for DB2 with Snapshot Client The following topics describe the NetBackup Snapshot Client features that are available for use with NetBackup for DB2. To use NetBackup for DB2 with Snapshot Client, you must have both NetBackup Snapshot Client and NetBackup for DB2 licensed and installed.
About the snapshot backup A snap snapsh shot ot is a di disk sk imag image e of the the clie client nt’s da data ta that that is ma made de almo almost st instan instantan taneo eous usly ly.. When it is used in conjunction with NetBackup Snapshot Client, NetBackup for 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.
92
Using Snapshot Client with NetBackup for DB2 About NetBackup for DB2 with Snapshot Client
Snapshot backup captures the data at a particular instant without causing significant client downtime. Client operations and user access continue without interr int errupt uption ion during during the backup backup.. The result resulting ing captur capture e or snapsh snapshot ot can be bac backed ked up without affecting the performance or availability of the database.
About instant recovery This feature makes backups available for instant recovery from disk. Instant recovery combines snapshot technology with the ability to do rapid disk-based restores. NetBackup creates the image without interrupting user access to data. Optionally, the image is retained on disk as well as backed up to storage. Instant recovery makes it possible to perform block-level restores.
About the off-host backup An off-h oft,f-hos backup bac kup shifts shinate ftstethe burde bur n sofreduc backup bac kup pr proce ocess ssing ing ont aient separ separate ate backu bac kup p agen agent, such suost cht as an al alter terna clie client. nt.den This Thi red uces es theef the effec fect t ononto theoclien cl t’s com comput puting ing resources ordinarily caused by a local backup. The backup agent reads the data from the client disk and writes it to storage.
Proxy copy A proxy copy is a special type of backup in which the NetBackup for DB2 agent manage man agess thecon the contro troll of thedat the data a transf transfer. er.Dur During ing thebac the backup kupand andres restor tore e operat operation ions, s, 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.
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 5-1 represents represents a file-based backup or restore.
Using Snapshot Client with NetBackup for DB2 About NetBackup for DB2 with Snapshot Client
Figure 5-1
NetBac NetBackup kupfor for DB2wit DB2 with h Snapsh Snapshot ot Cli Client entfil file-b e-base ased d backup backupor or restor restore e DB2 Server
Control commands
DB2 database disk
NetBackup for DB2
DB2 database disk
List of files
Data
Data NetBackup
Stream-based operations Stream-based operations are the standard NetBackup implementation of conven con ventio tional nal NetBac NetBackup kup for DB2 DB2 backup backup and restor restores. es. In a stream stream-ba -based sed backup backup,, NetBackup moves the data that is provided by the server process. NetBackup ca capt ptur ures es the the data data st stre ream am co cont nten entt that that is prov provid ided ed by DB2. DB2. If the the us user er has has sp spec ecif ifie ied d multiple mult iplestrea streams, ms, then NetBack NetBackup up for DB2 opens opens multiple multiple streams streams and NetBack NetBackup up catalogs them as separate images. 5-2 represents a stream-based backup or restore. Figure 5-2 represents
93
94
Using Snapshot Client with NetBackup for DB2 About supported platforms for NetBackup for DB2 with Snapshot Client
Figure 5-2
NetBackup for DB2 stream-based backup or restore
DB2 Server DB2 database disk
DB2 database disk Control commands Data
NetBackup
About supported platforms for NetBackup for DB2 with Snapshot Client Before you use NetBackup for DB2 with Snapshot Client, confirm that your platform is supported. See “ Verifying the operating system and platform compatibility for NetBackup for DB2” on page 22.
About NetBackup for DB2 with Snapshot Client operations NetBackup users or schedules start database backups or restores by specifying a te temp mpla late te or shel shelll scrip scriptt in the the ba back ckup up sele select ctio ions ns list list of the the DB DB2 2 po poli licy cy.. The The temp templa late te or shell script specifies the objects or commands that perform the backup or
restore on the client. You also can use the bpdb2proxy command to initiate a NetBackup for DB2 with Snapshot Client backup.
Using Snapshot Client with NetBackup for DB2 95 About NetBackup for DB2 with Snapshot Client operations
The agent checks that the policy it uses for the backup is configured with the approp app ropriat riate e Snapsh Snapshot ot Client Client attribu attributes. tes.The The agent agent then then initiate initiatess file-ba file-based sed backup backupss of the the DB2 DB2 file filess and and us uses es the the NetB NetBac acku kup p Snap Snapsh shot ot Clie Client nt inte interf rfac ace e to pe perf rfor orm m the the data movement. TheNe The NetB tBac acku kup p for for DB2 DB2 ag agen entt us uses es DB2 DB2 APIs APIs to pu putt the the da data ta file filess into into quies quiesce ce/w /writ rite e suspen sus pend d mode. mode. NetBack NetBackup up then then create createss a snapsh snapshot ot of the files. files. After After the snapsh snapshot ot is created, NetBackup for DB2 uses the DB2 APIs to take the data files out of quies qui esce ce/w /writ rite e suspe suspend nd mode. mode.The The da data ta files files that that arebac are backe ked d up arein are in quies quiesce ce/w /writ rite e su susp spen end d mode mode on only ly for for th the e peri period od of time time it take takess to cr crea eate te a sn snap apsh shot ot of the the data data..
About the sequence of a backup operation For a backup operation, the NetBackup for DB2 agent performs the following tasks: ■
Determines the list of files that make make up the D DB2 B2 database.
■
Suspends write write activity to the data files (quiesces (quiesces the database) database)..
■
Uses the Snapshot Client Client method to create a snaps snapshot hot image of the mapped files.
■
Enables DB2 write activity (unquiesces the database).
■
Backs up the snapshot image of the data data files.
About the sequence of a restore operation operation For a restore operation, the NetBackup for DB2 agent performs the following tasks: ■
Usi Using ng theDB the DB2 2 da datab tabas ase e and and a po point int in time, time, loca locates tes the theco corre rrect ct phys physica icall ba back ckup up images.
■
Disconnects all all users from the database (bring (bringss the database offline).
■
Restores the images to the original database.
■
Uses DB2 APIs APIs to takes the files out of the quiesced quiesced state, which puts the database in a roll-forward pending state.
■
Reruns Rerunsthe thetra transa nsacti ctionsfrom onsfrom thelog the logfil files es (perfo (performs rms therol the roll-f l-forw orward ardop opera eratio tion). n).
■
Enables user connections connections to the database (brings the database onl online). ine).
About database objects supported by advanced advanced backup methods methods
DB2 allows proxy method backups of databases at the node level, so NetBackup can use file-based Snapshot Client backup methods to back up databases.
96
Using Snapshot Client with NetBackup for DB2 About configuring snapshot backups with NetBackup for DB2
NetBackup for DB2 cannot use Snapshot Client methods to back up individual tablespaces or container files. DB2 DB 2 perfor performs ms only only conven conventio tional nal backup backupss for transa transacti ction on log files. files. You ca canno nnott use Snapsh Snap shot ot Cl Clie ient nt meth method odss for for tr tran ansa sact ctio ion n logs logs ba back cked ed up with with eith either er the the us user er ex exit it program or the VENDOR method. File-based and stream-bas File-based stream-based ed backups backups require require different different configurat configurations. ions. When you co conf nfig igur ure e NetB NetBac acku kup p for for DB2 DB2 with with Snap Snapsh shot ot Clie Client nt ba back ckup ups, s, be su sure re to co conf nfig igur ure e policies that allow both kinds of backups. See “ About Snapshot Client effects” on page 104.
About multistreaming and DB2 backups You can use either the -s option on the bpdb2proxy command or the sessions parameter in the Backup Options screen of the backup wizard to specify the numb nu mber er of prox proxy y co copy py ba back ckup up st stre ream amss to star start. t. NetB NetBac acku kup p for for DB2 DB2 sp spli lits ts the the file filess into a number of groups as specified by either of these parameters, based on file size. NetBackup for DB2 attempts to create streams of equal size.
Example: Exampl e: multiple channels for a DB2 command with proxy method The following NetBackup for DB2 sample command initiates a database backup (which includes the transaction logs) on a per node basis: bp bpdb db2p 2pro roxy xy -b -bac acku kup p -d sa samp mple le -s 3 -n 0
The agent splits the files into three streams and initiates a file-based backup for each eac h stream stream.. After After the proxy proxy backupis backupis done, done, DB2 DB2 starts starts a non-pr non-proxyconve oxyconventi ntiona onall backup of the transaction logs. Issue this command on each node of the database.
Aboutt con Abou confi figu gurin ring g sna snapsh pshot ot bac backup kupss wit with h Net NetBac Backup kup for DB2 You can Youca n co combi mbine ne the NetBa NetBack ckup up featur features es of snap snapsh shot ot bac backu kup p and and instan instantt re reco cove very ry to enable fast database backups and recoveries. These features are as follows: ■
A snaps snapshot hot backup backup occurs occurs when when NetBack NetBackup up create createss a po pointint-inin-tim time e disk disk ima image ge of the database and copies that image to disk. This process is nearly
instantaneous; so user access to the database is not interrupted during the backup.
Using Snapshot Client with NetBackup for DB2 About configuring snapshot backups with NetBackup for DB2
■
An instant recovery occurs occurs when NetBackup NetBackup restores the on-disk snapshot copy of the database.
Anothe Ano therr feature feature,, off-ho off-host st backup backup,, canred can reduce uce the I/O proces processin sing g load load on the client client that that host hostss the the da data taba base se.. To us use e offoff-ho host st ba back ckup up,, sp spec ecif ify y an alte altern rnat ate e clie client nt (U (UNI NIX X and Windows clients) or a data mover (UNIX clients only) to assume the I/O processing load.
Config Conf igur urat ation ion requ requir irem emen ents ts for snap snapsh shot ot back backup upss with with NetB NetBac acku kup p for for DB2 Each agent has its own hardware requirements, software requirements, compati com patibilit bility y with certain certain features features,, and the snapsho snapshott methods methods that are support supported. ed. Special requirements apply for specific types of backups. See the NetBackup Snapshot Snap shot Client Client Administr Administrator ator s Guid Guide e and and the Symantec Support Web site for more mor e informa information tion.. Familia Familiarize rizeyou yourse rself lf with withthis this informa information tionbefo before re youcon you configu figure re any snapshot backups. ’ ’
The following list highlights some of the requirements that pertain to database agents: ■
Allocate at least least two different volumes volumes or file ssystems ystems for databas database e activities, as follows: ■
Allocate one or more more volumes or file systems systems to the database data files.
Allocate a different different set of volumes or file ssystems ystems to the DB2 exec executables, utables, configuration files, and the transaction logs. One reason to have two different volumes is to t o separate the data files from the the ot othe herr fi file les. s. If the the logs logs are are co conf nfig igur ured ed on the the sa same me volu volume mess (or (or file file syst system ems) s) ■
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 thedat the databa abase se activi activity ty may freeze freezeunt until il the logs logs become becomeacc access essibl ible e aga again. in. Anothe Anotherr reaso rea son n for for writi writing ng the da data ta files files to their their own own repos reposito itory ry is becaus because e it is requir required ed for for an in inst stan antt re reco cove very ry poin pointt-in in-t -tim ime e ro roll llba back ck.. Only Only da data ta file filess ca can n ex exis istt on the the volume or file system that is being restored. ■
The hardware and software software that is required for the appropriate appropriate snapshot method must be installed and configured correctly.
■
NetBackup Snapshot Snapshot Client must be installed and configured correctly, correctly, and the license key for this option must be registered.
■
To perform off-host off-host backups, perform any special configuration configuration that is required.
97
98
Using Snapshot Client with NetBackup for DB2 About configuring snapshot backups with NetBackup for DB2
Configuring the DB2 policy with Snapshot Client backup methods This topic explains how to configure snapshot and instant recovery backups for the DB2 policy. For information on how a snapshot method is automatically se sele lect cted ed and and de deta tail ilss on the the ty type pess of ba back ckup up meth method ods, s, se see e the the NetBackup Snapshot Client Clie nt Administr Administrator ator s Guid Guide e . ’ ’
Snapshot Snaps hot backup backupss do not back back up all databa database se object objects. s. Your Your backup backup config configura uratio tion n must include policies to perform file-based and stream-based backups. This configuration ensures that the entire database can be restored successfully. For snapshot or instant recovery backups, configure the following policies and schedules as follows: ■
■
A DB2 policy with with the following following attributes: ■
Snapshot methods for the file systems in which which the database files reside.
■
A backup method on the policy attributes dialog dialog box.
■
An Automatic Full Backup Backup schedul schedule e to perform file-based snapshot snapshot and off-host backups of the database.
■
(Conditional) An Application Application Backup schedule to back up up the transaction logs. Configure this policy if you use the VENDOR method. DB2 does not support proxy backups of transaction logs.
(Conditional) An MS-Windows MS-Windows policy to perform stream-based backups backups of transaction logs. Configure this policy if you use the user exit program. DB2 does not support proxy backups of database transaction logs.
Configuring Config uring a snapshot snapshot policy for NetBackup for DB2 The follow following ing proced procedure ure shows shows how to config configure ure a snapsh snapshot ot pol policy icy with with op optio tional nal instant recovery, snapshot retention, and off-host backup. To configure a snapshot policy
configure. 1 Open the policy you want to configure.
2 Click on the Attributes tab.
Using Snapshot Client with NetBackup for DB2 About configuring snapshot backups with NetBackup for DB2
3 Select the DB2 policy type.
Select the policy type Select appropriate storage unit or storage unit group
Click Perform snapshot backups (Optional) Click Retain snapshots for instant recovery
(Optional) Click Perform off-host backup and specify a method
policy storage unit from the Poli Policy cy storage storage list. 4 Select a policy Select a policy storage unit in this step even if you plan to select Instant Recovery Reco very Snapshots Snapshots Only later in this procedure. NetBackup NetBac kup uses uses this this storag storage e unit unit for the stream stream-ba -based sed backup backupss of the co contr ntrol ol files and the transaction logs that are included in this policy. Perform rm snapshot snapshot backups backups. 5 Click Perfo
99
100
Using Snapshot Client with NetBackup for DB2 About configuring snapshot backups with NetBackup for DB2
6 (Optional) Click Options to choose a snapshot method. By default NetBackup chooses a snapshot method for you. To choose a snapshot snap shot method, method, click click auto (t (the he de defa faul ult) t) or clic click k on one e of the the meth method odss that that are are presented in the list. The snapshot method that you can use depends on your hardware enviro env ironme nment nt and softwa software re enviro environme nment. nt. Only Only certai certain n snapsh snapshot ot met method hodss are supported in certain environments. See the NetBa NetBackup ckup Snapshot Snapshot Client Client Administrator s Guid Guide e or or the supported platforms matrix on the Symantec Support Web site for more information. ’ ’
You can Youca n co confi nfigu gure re only only on one e snaps snapsho hott metho method d pe perr po polic licy. y. Fo Forr ex examp ample, le, assum assume e yo you u want want on one e sn snap apsh shot ot meth method od for for clie client ntss a, b, an and d c, an and d a diff differ eren entt meth method od for clients d, e, and f. Then you need to create two policies for each group of clients and select one method for each policy. Retain ain snapsh snapshots ots for instan instantt recove recovery ry. 7 (Optional) Select Ret
When this option is selected, NetBackup retains the snapshot backup image on disk for later use in recovery. Perform rm off-host off-host backup backup. 8 (Optional) Select Perfo
By default, the client that hosts the database performs the backup. If you want wa nt to redu reduce ce the the I/ I/O O proc proces essi sing ng load load on the the clie client nt that that host hostss the the data databa base se,, specify an alternate client to perform the backup.
9 (Conditional) Select an off-host backup method. The following off-host backup methods are available: Use Alte Alternat rnate e client (UNIX and Windows clients)
If you you se sele lect ct Alternate Alternateclient client, al also so sp spec ecif ify y th the e na name me of th the e cl clie ient nt to perform the backup. This option may require additional configuration. The alternate client must be a client that shares the disk array.
10 Click the Schedules tab. 11 Click New. Automatic schedule for the database files. 12 Configure an Automatic
Using Snapshot Client with NetBackup for DB2 Restoring from a snapshot backup
create only dis disk k images, in the Destination panel, under 13 (Conditional) To create Instant Insta nt Recovery Recovery, select Snap Snapshots shots only.
This setting suppresses NetBackup’s default behavior, which is to copy the Snapshots shots only, NetBackup snapshot to a storage unit. When you select Snap creates the on-disk snapshot copy of the database, but it does not copy the snapshot to a storage unit. The on-disk snapshot becomes the only backup copy. Note that the on-disk snapshot is not considered to be a replacement for a traditional backup.
Application Backup Backup for the control files and 14 (Conditional) Configure an Application transaction logs. NetBackup NetBac kup uses uses this this storag storage e unit unit for the stream stream-ba -based sed backup backupss of the co contr ntrol ol files files and the logs logs that that are includ included ed in this this po polic licy. y. Config Configure ure this this sch schedu edule le onl only y if you want to use the VENDOR method for backing up the transaction logs. NetBackup copies the database’s control files and transaction logs to the storage unit you selected. Fo Forr UNIX UNIX clien clients, ts, if you you selec selectt Third-PartyCopyDevice as an off-h off-hos ostt ba back ckup up method, select Ove Overri rride de policy policy storag storage e unit unit. Then select a non-SAN Media Mana Ma nage gerr or ot othe herr st stor orag age e unit unit type type that that is appr approp opri riat ate e to ba back ck up the the co cont ntro roll files and transaction logs.
15 On the Clients tab, specify the clients to be included in this policy. 16 On the Backup Selections tab, specify a template script or backup script. More information is available about how to use templates and scripts for a NetBackup for DB2 policy with Snapshot Client. See “ About Snapshot Client effects” on page 104. schedules and backup 17 Configure other attributes and add any additional schedules selections.
Restoring from a snapshot backup The following sections describe how to restore files, volumes, and file systems from a snapshot backup: ■
See “About restoring individual files from a snapshot backup” on page 102.
■
See “About restoring volumes and file systems using snapshot rollback” on page 102.
101
102
Using Snapshot Client with NetBackup for DB2 Restoring from a snapshot backup
About restoring restoring individual files from a snapshot snapshot backup Data th Data that at is ba back cked ed up wi with th Snap Snapsh shot ot Clie Client nt meth method odss is re rest stor ored ed in the the sa same me way way as data that is backed up without Snapshot Client methods. See “ Performing a restore” on page 75. Use this procedure for the files that were backed up with, or without, instant recovery enabled. In all cases, NetBackup determines the files that were backed up, and it initiates a corresponding restore request to the database agent. If in inst stan antt reco recove very ry is en enab able led, d, NetB NetBac acku kup p atte attemp mpts ts to re rest stor ore e the the file file by us usin ing g the the unique restore methods available with the instant recovery feature. The T he type of restore method that NetBackup uses depends on your environment and the type of backup performed. If NetBackup is unable to use any of the instant recovery meth me thod ods, s, it rest restor ores es the the fi file le in thetypica thetypicall mann manner er.. Data Data is co copi pied ed fr from om thesnapsh thesnapshot ot to the primary file system. Information on the instant recovery methods that NetBackup uses is available. See the Ne NetBac tBackup kup Snapshot Snapshot Client Client Administr Administrator ator s Guid Guide e . ’ ’
About restoring 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: ■ ■
vxvm snapshot FlashSnap snapshots
See the Ne NetBac tBackup kup Snapshot Snapshot Client Client Administr Administrator ator s Guid Guide e . ’ ’
The following considerations are relevant for NetBackup for DB2 restores: ■
Snapshot rollback rollback overwrites overwrites the entire volume.
■
With NetBac NetBackup kup for DB2, DB2, snaps snapshot hot rollba rollback ck always always perfor performs ms file file ver verifi ificat cation ion.. The agent checks for the following: ■
The requested files files (number and names) are identical identical to those in the snapshot
■
The The prim primar ary y vo volu lume me do does es not not co conta ntain in any any file filess that that were were cr crea eate ted d af afte terr the the
snapshot was made If verification fails, the rollback aborts with 249.
Using Snapshot Client with NetBackup for DB2 Restoring from a snapshot backup
■
Use snaps snapshot hot rollba rollback ck with with databa database se files files only. only. Databa Database se files files and archiv archive e logs logs should exist on different file systems or volumes.
Performing a snapshot Performing snapshot rollback restor restore e from the Java or Windows Windows interface This to This topi picc desc descri ribe bess how how to perf perfor orm m a sn snap apsh shot ot roll rollba back ck re rest stor ore e fr from om the the Java Java or Windows interface. To perform a snapshot rollback restore from the Java or Windows interface
1 If the file .SQLCRT.FLG exists, delete it. DB2 create createss the .SQLCR .SQLCRT.F T.FLG LG file file when when it create createss a direct directory ory (usual (usually ly during during tablespace creation). For volume level rollback restores this file cannot be present. The directory structure must be present at the time DB2 creates a ta tabl bles espa pace ce or yo you u must must dele delete te this this file file af afte terr DB2 DB2 cr crea eate tess the the dire direct ctor ory y du duri ring ng tablespace creation. Backup, Archive, and Restore interface. 2 Open the Backup,
3 Select one of the following: ■
In the Java interface, interface, click the Rest Restore ore Files Files tab.
■
In the Windows Windows interfac interface, e, select select File>SelectFilesandFolderstoRestore .
Acti tion onss > Se Sele lect ct Rest Restor ore e Type Type > Poin Pointt in Time Time Roll Rollba back ck. 4 Select Ac
5 Use the NetBackup for DB2 recovery wizard for the restore. See “ Performing a restore” on page 75.
Performing Perfor ming a snapshot snapshot rollback restor restore e from the command line This topic describes how to perform a snapshot rollback restore with the bpdb2proxy command. To specify a snapshot rollback restore from the command line
1 If the file .SQLCRT.FLG exists, delete it. DB2 create createss the .SQLCR .SQLCRT.F T.FLG LG file file when when it create createss a direct directory ory (usual (usually ly during during tablespace creation). For volume level rollback restores this file cannot be present. The directory structure must be present at the time DB2 creates a ta tabl bles espa pace ce or yo you u must must dele delete te this this file file af afte terr DB2 DB2 cr crea eate tess the the dire direct ctor ory y du duri ring ng tablespace creation.
103
2 Use the bpdb2proxy command in the following format:
104
Using Snapshot Client with NetBackup for DB2 About Snapshot Client effects
install_path\NetB \NetBackup\ ackup\bpdb2p bpdb2proxy roxy -rollb -rollbkresto krestore re -d dbali dbalias as -u user
-p password [-s session] [-n [-n node_number ] [-t [-t mm/dd /yyyy [HH :MM :SS ]] ]]
where: -rollbkrestore
Specifies that this restore is from a snapshot rollback.
-d dbalias
Database alias.
-u user
User name of the DB2 user.
-p password
Password for the DB2 user.
-s session
The number of sessions. Optional.
-n node_number
The node number. The default is 0. Optional.
-t mm /dd / yyyy [HH :MM :SS ] (Optional) The time of the backup. The values are as follows: ■
For mm, type the month.
■
For dd , type the day of the month.
■
For yyyy , type the year.
■
For HH , type the hour of the day. Optional.
■
For MM , type the minute of the hour. Optional.
■
For SS , type the second of the minute. Optional.
Troubleshooting rollback restores If the rollback restore fails, it may be because the database still has a file open. Shut down and restart the database to try to correct this problem.
About Snapshot Client effects The following topics describe how the Snapshot Client software affects backup types, schedule properties, and templates. Snapshot Client also affects scripts.
About the types of backups The ba The back ckup up type typess avai availa labl ble e on the the Sche Schedu dule less tab tab of the the po poli licy cy pl play ay a diff differ eren entt ro role le for NetBackup for DB2 with Snapshot Client backups.
See Table See Table 5-1. 5-1.
Using Snapshot Client with NetBackup for DB2 About Snapshot Client effects
Table 5-1
Backup types for DB2 policies
Backup type
Description
Application Backup
The Applic ApplicationBackup ationBackup schedule schedule enables enables stream-bas stream-based ed NetBackup NetBackup operations. The Default-Application-Backup schedule is automatically configured as an Application Backup schedule.
Automati Auto maticc Ful Fulll Backup Backup For file file-bas -based ed prox proxy y copy backups, backups,the the automati automaticc backup backup schedul schedule e types serve the following purposes: Automaticc Differ Automati Differential ential Incremental Backup, ■ Automatica Automatically lly start start the backups backups by running running the NetBacku NetBackup p for DB2 scripts or templates. Automatic Cumulative ■ Control file-based file-based snapshot backups backups of the database objects. Incremental Backup If you specify any of the automatic backup types, a full backup is performed.
About schedule properties for Snapshot Client backups Some schedu Some schedule le proper propertie tiess have have a differ different ent meanin meaning g for Snaps Snapshot hot Client Client databa database se backups than for a regular database backup. For a description of other schedule proper pro perties ties,, see the informa informatio tion n thatis that is specif specific ic to standa standard rd databa database se agent agent backup backups. s. See “ About NetBackup for DB2 schedule properties” on page 35. Table 5-2 5-2 explains explains the properties for Snapshot Client backups. Table 5-2
Schedule properties
Property
Description
Retention
Frequency based scheduling For proxy backups, NetBackup uses the retention period for the automatic type of backup to specify how long to keep proxy pr oxy file-based backup images. Calendar based scheduling For proxy proxy bac backup kups, s, NetBac NetBackup kup for DB2 with with Snapsh Snapshot ot Cli Client ent uses uses the retention period for the automatic type of backup to specify how long to keep proxy file-based backup images.
Multiple Mult iple copies copies
For proxy file-based backups, configure Mult Multiple iple copies on the automatic backup schedule.
105
106
Using Snapshot Client with NetBackup for DB2 Using NetBackup for DB2 with Snapshot Client
About templates and scripts You ca You can n us use e a te temp mpla late te that that was was crea createdby tedby the the ba back ckup up wiza wizard rd to pe perf rfor orm m ba back ckup upss with Snapshot Client. After they are created, templates reside on the NetBackup master server and are available for use by other NetBackup for DB2 clients. See “ Creating templates and shell scripts” on page 56. Whether you use a template or script, you must enable the advanced backup methodfor met hodfor your your client clients. s. Config Configure ure this this method method on the Att Attrib ribute utess tab of the pol policy icy.. At run run time, time, the the te temp mpla late te ch chec ecks ks the the poli policy cy attri attribu bute tess to dete determ rmin ine e if a Snap Snapsh shot ot Client Cli ent backup backup method method is config configure ured. d. Then Then it initiat initiates es the proxy proxy file-b file-base ased d backup backup.. If you use a script, the script must reside on each client that is included in the policy pol icy.. Includ Include e theDB the DB2 2 bpdb2proxy com comman mand d in thescr the script iptto to perfor perform m theadv the advanc anced ed backup method. Sample scripts are included with the installation.
Using NetBackup for DB2 with Snapshot Client After configuration is complete, performing NetBackup for DB2 with Snapshot Client backups and restores is similar to regular NetBackup for DB2 operations. The following sections describe some of the differences.
Performing backups NetBac Net Backup kup for DB2 perfor performs ms backup backupss with with Sna Snapsh pshot ot Client Client in the follow following ing ways: ways: ■
Server-directed, both both automatic and scheduled fro from m the master serv server er
■
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 co confi nfigur gurati ation on proced procedure uress in this this chapte chapterr descri describe be thepro the proces cesss for forcon config figuri uring ng policies for DB2 backups with Snapshot Client. See “Con Config figuri uring ng the DB DB2 2 po polic licy y wit with h Sna Snapsh pshot ot Cli Client ent bac backup kupmeth methods ods” on pa page ge 98 98.. These policies specify Snapshot Client backups for the DB2 database.
Using Snapshot Client with NetBackup for DB2 Using NetBackup for DB2 with Snapshot Client
107
User-directed backups using templates To perform a backup from the Backup, Archive, and Restore interface, run a template through DB2 Template Administration (click Actions > Administer Templa Tem plates tes > DB2). You can also create a new template using the DB2 Backup Wizard, and run the template t emplate from the Template Complete screen. The backup that results from the template t emplate is an Snapshot Client backup if the policy pol icy for the clien clientt is co confi nfigur gured ed for Snaps Snapshot hot Client Client method methods. s. Spe Specif cify y the policy policy by adding the client to that policy on the master server.
User-directed backups using bpdb2proxy Use the bpdb2proxy command to perform a Snapshot Client backup of your DB2 da data taba base se from from the the co comm mman and d li line ne.. You You must must be the the DB2 DB2 us user er to us use e the the bpdb2proxy command. For backups, specify the -backup option with bpdb2proxy. Use the Use the bpdb2proxy co comm mman and d in the the foll follow owin ing g form format at to ba back ck up a DB2 DB2 da data taba base se with a Snapshot Client method: install_path\NetB \NetBackup\ ackup\bpdb2p bpdb2proxy roxy -backu -backup p -d dbalias -u user -p password
Performing restores Perform NetBackup for DB2 Snapshot Client restores from the DB2 client. The following sections describe the restore methods.
User-directed restores using templates To perform a restore from the Backup, Archive, and Restore interface, use the NetBackup for DB2 Recovery Wizard to select the files you want to restore and the parameters for the restore. If the backup image was created with Snapshot Client methods, the restore uses Snapshot Client methods.
User-directed restores using bpdb2proxy To perf perfor orm m a re rest stor ore e from from the the co comm mman and d line line,, us use e the the bpdb2proxy comm command. and. You must be the DB2 user to use the bpdb2proxy command. For restores, 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.
108
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: install_path\NetBa \NetBackup\b ckup\bpdb2pr pdb2proxy oxy -resto -restore re -d dbalias -u user -p password
Restoring from a snapshot backup Further information is available on how to restore files from a snapshot backup. About ut res restori toring ng vol volume umess and andfile filesys systems temsusin using g sna snapsh pshot ot rol rollba lback ck” onpage102. See “Abo
Chapter
6
Troublesh Troubl eshoot ooting ing NetBac NetBackup kup for DB2 This chapter includes the following topics: logs and reports ■ NetBackup debug logs ■
Enabling the debug logs logs for a NetBackup Windows Windows client automatically automatically
■
Enabling the debug logs logs for NetBackup for DB2 for Windows manually manually
■
About the NetBackup for for DB2 log files
■
Setting the debug debug level on a Windows client client
■
About NetBackup NetBackup server reports
■
Minimizing timeout failures on large database database restores
■
Using NET_BUFFER_SZ NET_BUFFER_SZ to speed up a slow restore
■
About false restore restore failures reported reported in the activity monitor
■
About the error message message codes codes
NetBackup debug logs and reports The NetBac NetBackup kup ser server ver and client client softwa software re let you enable enable detail detailed ed debugg debugging ing logs. logs. The information in these log files can help you troubleshoot the problems that occur outside of either the database agent or the DB2 commands. Note the following with regard to these logs:
■
Thes These e logs logs do not not reve reveal al theerrors theerrors that that occu occurr wh when en DB2 DB2 co comm mman ands ds ar are e ru runn nnin ing g unless those errors also affect NetBackup. DB2 may (or may not) write errors
110
Troubleshooting NetBackup for DB2 Enabling the debug logs for a NetBackup Windows client automatically
in the application to the NetBackup logs. Your best sources for DB2 error information are the logs provided by DB2. ■
Gener Generall ally, y, ea each ch debug debug log co corre rresp spond ondss to a NetBa NetBack ckup up pr proce ocess ss and execut executabl able. e.
Information about the debugging log files is available. See the NetBack NetBackup up Troubles Troubleshooti hooting ng Guide . Also refer to the following file: install_path\NetBackup\logs\README.debug file
Enabling the debug logs for a NetBackup Windows client automatically You can enable debug logging by running a batch file that creates each log directory. To create all log file directories automatically, run the following: install_path\NetBackup\logs\mklogdir.bat
Or, you can manually create the directories for the log files you want created. See “ Enabling the debug logs for NetBackup for DB2 for Windows manually” on page 111.
Troubleshooting NetBackup for DB2 Enabling the debug logs for NetBackup for DB2 for Windows manually
Enabling the debug logs for NetBackup for DB2 for Windows manually Creating the NetBackup for DB2 for Windows database agent logs manually
following lowing directories directories on the client in a DOS window: 1 Create the fol install_path\NetBackup\logs\bpbackup install_path\NetBackup\logs\bpbkar32 install_path\NetBackup\logs\bpdbsbdb2 install_path\NetBackup\logs\bphdb install_path\NetBackup\logs\bprestore install_path\NetBackup\logs\bpubsdb2 install_path\NetBackup\logs\dbclient install_path\NetBackup\logs\tar32 install_path\NetBackup\logs\bpdb2
For example: cd install_path\NetBackup\logs mkdir bphdb
access to the log directories. 2 Make sure there is share access
3 Enable logging for the nbpem, nbjm, and nbrb scheduling processes, which use unified logging. NetBackup writes unified logs to install_path\NetBackup\logs. Yo You u do not not need need to crea create te log log dire direct ctor orie iess for for pr proc oces esse sess that that us use e unif unifiedlogg iedlogging ing.. For information on how to use logs and reports, see the NetBackup Troubles Trou bleshooti hooting ng Guide .
About the NetBackup for DB2 log files The follow following ing topics topics descri describe be the logs logs create created d when when you you create create the logdirec logdirector tories ies.. Use a text editor to view the contents of the logs. “
”
See About the bphdb directory on the Windows database client on page 112.
111
112
Troubleshooting NetBackup for DB2 Setting the debug level on a Windows client
About the bphdb directory directory on the Windows database client The install_path\NetBackup\logs\bphdb directory contains log files. The following types of logs exist: ■
db2_stdout.mmddyy.hhmmss.txt
Unless it is redirected elsewhere, NetBackup writes DB2 script output to this file. ■
db2_stderr.mmddyy.hhmmss.txt
Unless it is redirected elsewhere, NetBackup writes DB2 script errors to this file. ■
mmddyy .log .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.
bpdbsbdb2 directory on the client The install_path\NetBackup\logs\bpdbsbdb2 direc directory tory contains contains the foll following owing execution log: mmddyy .log .log
Thiss log co Thi conta ntains ins debugg debugging ing inform informati ation on and execut execution ion status status for the NetBac NetBackup kup forDB for DB2 2 backu bac p and recov rec overy eryugging wizard wizing ardssinforma and for fortion the bp bpdbs dbsbdb bdb2 2ion co comm mmand andinforma line linermation utilit utition lity. y. Thi This s logals log also okup contain con tains s the debugg deb info rmatio n and execut exe cution status status info that is generated when a DB2 template is run from an automatic schedule (when bphdb invokes bpdbsbdb2 to run the template).
Setting the debug level on a Windows client To control the amount of information that is written to the debug logs, change the “Database” deb debug ug le leve vel. l. Ty Typic pical ally, ly, the de defa fault ult va value lueof of 0 is suffi sufficie cient. nt. Howe However ver,, technical support may ask you to set the value higher to analyze a problem. The debug logs are located in install_path\NetBackup\logs.
Note: Inf Inform ormatio ation n from from both both the Verbos Verbose e and the Databa Database se debug debug setting settingss is log logged ged to the same file, mmddyy .log .log
Troubleshooting NetBackup for DB2 About NetBackup server reports
To set the debug level on a Windows client
Progra grams ms > Sym Symant antec ec NetBa NetBacku ckup p> 1 From the Windows Start menu, choose Pro Backup, Back up, Archive, Archive, and Restore Restore. File e > NetBac NetBackup kup Client Client Proper Propertie tiess. 2 Select Fil
3 Click the Troubleshooting tab. 4 Set the Verbose debug level. Set this this level level to adjust adjust theamo the amount unt of inform informatio ation n from from the use userr exit exit progra program. m.
5 Set the Database debug level. Set this level to adjust the amount of information from the NBDB2 vendor library.
6 Click OK to save your changes.
About NetBackup server reports NetBackup NetBac kup provid provides es other other report reportss that that are useful useful in isolat isolating ing proble problems. ms. One such such report rep ort is All Logs Logs Entrie Entriess on the server server.. Inform Informatio ation n on server serverrep report ortss is ava availa ilable ble.. See the NetBackup NetBackup Administr Administrator ator s Guid Guide e . ’ ’
Minimizing timeout failures on large database restores Large database restores sometimes fail when multiple restore sessions compete for for re reso sour urce ces. s. In this this si situa tuatio tion, n, a re rest stor ore e sess sessio ion n ca can n be de dela laye yed d whil while e wa wait itin ing g for for medi me dia a or devi device ce acce access ss.. If th the e dela delay y is too too long long,, the the re rest stor ore e se sess ssio ion n time timess ou out. t. Use Use the following procedure to minimize session timeouts and to allow the restores to complete successfully. successfully.
113
114
Troubleshooting NetBackup for DB2 Using NET_BUFFER_SZ to speed up a slow restore
To minimize timeout failures on large database restores
NetBackup kup Adminis Administra tratio tion n Conso Console, le, exp expand and NetBackup Management Management 1 In the NetBac > Hos Hostt Proper Propertie tiess > Client Clientss Client nt read timeout timeout property to a large value. 2 Set the Clie
The default for the Clie Client nt read timeout timeout setting is 300 seconds (5 minutes). For database agent clients, increase the value significantly from the recommended value. See the NetBackup Administrator s Guide uide,, Volu Volume me 1. ’ ’
For exampl example, e, change changethis this setting setting to 30-60 30-60 minutes minutes to minimize minimizetime timeout out errors. errors.
3 Click OK for each client.
Using NET_BUFFER_SZ to speed up a slow restore If file restores are slow and your NetBackup master server is a UNIX machine, you can increase file restore speeds. Create a file called NET_BUFFER_SZ on the NetBackup master server in the NetBackup install directory. To create the NET_BUFFER_SZ file
1 Log into a UNIX master server. 2 Use vi(1) or another editor to create file /usr/openv/netbackup/NET_BUFFER_SZ.
socket et size, in bytes. 3 Add a line that specifies the sock For example: 32 3276 768 8 by byte tes s = 32 32K K
4 Save and close the file.
About false restore failures reported in the activity monitor In some restore scenarios, DB2 reports a successful restore status, but the NetBackup activity monitor reports failures. This can occur during restores if DB2 reads a portion of a backup image but not the entire image.
Troubleshooting NetBackup for DB2 About the error message codes
About the error message codes This Th is to topi picc desc descri ribe bess the the DB2 DB2 and and NetB NetBac acku kup p re reas ason on co code des. s. Fo Forr more more info inform rmat atio ion n about an error message, see the log files. Errors can occur while accessing the NetBackup DLL during the processing of a DB2 database utility BACKUP or RESTORE.
300 Message:
ER ERR R - No ma matc tch h fo for r a da data taba base se imag image e file file was was foun found d base based d on the follow following ing criter criteria. ia.
Cause: The restore criteria of database name, instance, i nstance, 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. If logg loggin ing g is en enab able led, d, ch chec eck k the the cu curr rren entt log log file file in the the foll follow owin ing g dire direct ctor ory y for for mo more re information: install_path\NetBackup\logs\bpdb2\
305 Message: ER ERR R - fo foun und d mo more re th than an on one e ob obje ject ct. .
Cause: Multiple Multip le DB2 DB2 backup backup images images were were found found in the NetBac NetBackup kup databa database se that that mat matche ched d the restore criteria of database name, instance, type, and backup time. Action:
115
This erro This errorr sh shou ould ld not not oc occu curr unde underr typi typica call op oper erat atio ions ns.. If logg loggin ing g is en enab able led, d, ch chec eck k the current log file in the following directory for more information: install_path\NetBackup\logs\bpdb2\
116
Troubleshooting NetBackup for DB2 About the error message codes
310 Message: ER ERR R - bp bp.c .con onfi fig g fa fail iled ed wi with th status status.
Cause: Unable to read configuration file. Action: Make sure the file exists and is properly configured. If logg loggin ing g is en enab able led, d, ch chec eck k the the cu curr rren entt log log file file in the the foll follow owin ing g dire direct ctor ory y for for mo more re information: install_path\NetBackup\logs\bpdb2\
330 Message: ERR - Invali Invalid d option options s encoun encounter tered ed for act action ion action.
Cause: Invalid option(s) encountered for action. Action: Make sure the action parameters are used properly.
335 Message: ER ERR R - in ge get t DB DB2 2 UD UDB B le leve vel. l.
Cause: NetBackup server and the NetBackup for DB2 DLL are not at the same level. Action: Make sure that the NetBackup and the DB2 DLL are at the same level. Check the log file in the following directory: install path\NetBackup\logs\
Check the version number of the DLL and the version number for NetBackup. If they are not the same, install the same level.
Troubleshooting NetBackup for DB2 About the error message codes
380 Message: ER ERR R - db db2. 2.co conf nf re read ad st stat atus us erro error r error .
Cause: db2.conf read status error.
Action: Make su Make sure re the the di dire rect ctor ory y is acce access ssib ible le with with re read ad and and wr write ite pe perm rmis issi sion ons. s. Make Make su sure re the file exists and has read permission.
385 Message:
ERR - Found Found multip multiple le <DATAB <DATABASE ASE> > ent entrie ries s bef before ore an <ENDOPER> <ENDOP ER> entries entries was encountered. encountered.
Cause: Found multiple multiple DATABASE ent entrie riess before before an ENDOPER ent entry ry was enc encoun ounter tered ed in the following file: install_path\NetBackup\dbext\db2.conf
Action: Remove the extra DATABASE entry.
390 Message:
ERR - Found Found multip multiple le <OBJEC <OBJECTTY TTYPE> PE> ent entrie ries s bef before ore an ENDOPE END OPER R entrie entries s was encoun encounter tered. ed.
Cause: Found multiple OBJECTTYPE entries before an ENDOPER entry was encountered in
117
the following file: install_path\NetBackup\dbext\db2.conf
Action:
118
Troubleshooting NetBackup for DB2 About the error message codes
Remove the extra OBJECTTYPE entry.
395 Message:
ERR - Found Found multip multiple le <POLIC <POLICY> Y> entrie entries s bef before ore an <EN <ENDOP DOPER> ER> entries entrie s was encountered. encountered.
Cause: Found multiple POLICY entries before an ENDOPER entry was encountered in the following file: install_path\NetBackup\dbext\db2.conf
Action: Remove the extra POLICY entry.
400 Message:
ERR - Found Found multip multiple le <SCHED <SCHEDULE ULE> > ent entrie ries s bef before ore an <ENDOPER> <ENDOP ER> entries entries was encountered. encountered.
Cause: Found multiple multiple SCHEDULE ent entrie riess before before an ENDOPER ent entry ry was enc encoun ounter tered ed in the following file: install_path\NetBackup\dbext\db2.conf
Action: Remove the extra SCHEDULE entry.
405 Message:
ER ERR R - Fo Foun und d mu mult ltip iple le <A <ARC RCFU FUNC NC> > entr entrie ies s befo before re an <ENDOPER> <ENDOP ER> entries entries was encountered. encountered.
Troubleshooting NetBackup for DB2 About the error message codes
Cause: Found multiple ARCFUNC entries before an ENDOPER entry was encountered in the following file: install_path\NetBackup\dbext\db2.conf
Action: Remove the extra ARCFUNC entry.
410 Message:
ERR - Found Found multip multiple le <ARCDI <ARCDIR> R> ent entrie ries s bef before ore an <EN <ENDOP DOPER> ER> entries entrie s was encountered encountered. .
Cause: Found multiple ARCDIR entries before an ENDOPER entry was encountered in the following file: install_path\NetBackup\dbext\db2.conf
Action: Remove the extra ARCDIR entry.
415 Message:
ERR - Found Found multip multiple le <RETDI <RETDIR> R> ent entrie ries s bef before ore an <EN <ENDOP DOPER> ER> entries entrie s was encountered encountered. .
Cause: Found multiple RETDIR entries before an ENDOPER entry was encountered in the following file: install_path\NetBackup\dbext\db2.conf
119
Action: Remove the extra RETDIR entry.
120
Troubleshooting NetBackup for DB2 About the error message codes
420 Message:
ER ERR R - ne need ed to sp spec ecif ify y a va vali lid d POLI POLICY CY or SCHE SCHEDU DULE LE in db2.conf db2.co nf for <DATABASE <DATABASE database> and <OB <OBJEC JECTTY TTYPE PE objecttype>.
Cause: Policy name or schedule name is not specified in the POLICY or SCHEDULE entry in the following file: install_path\NetBackup\dbext\db2.conf
Action: Add an appropriate policy name or schedule name to the POLICY or SCHEDULE entry.
425 Message:
ER ERR R - ne need ed to sp spec ecif ify y a va vali lid d ARCD ARCDIR IR in db2. db2.co conf nf: : Errn Errno o = error_no : string .
Cause: Invalid ARCDIR is specified in db2.conf. Action: Add an appropriate directory name to the ARCDIR entry.
430 Message:
ER ERR R - AR ARCD CDIR IR fi fiel eld d ne need eds s to be spec specif ifie ied d in the the db2. db2.co conf nf file.
Cause:
No ARCDIR entry found in the t he following file: install_path\NetBackup\dbext\db2.conf
Troubleshooting NetBackup for DB2 About the error message codes
Action: Add an ARCDIR field with an appropriate directory name to the following file: install_path\NetBackup\dbext\db2.conf
435 Message:
ER ERR R - RE RETD TDIR IR fi fiel eld d ne need eds s to cont contai ain n a vali valid d file file when when OBJECT OBJ ECTTYP TYPE E is equal equal to ARCHIV ARCHIVE: E: string .
Cause: RETDIR field does not contain a valid file.
Action: RETDIR field must contain a valid file when OBJECTT OBJECTTYPE YPE ARCHIV ARCHIVE E is specified in
the following file: install_path\NetBackup\dbext\db2.conf
440 Message:
ER ERR R - CO COPY PY or SA SAVE VE ne need eds s to be spec specif ifie ied d for for ARCF ARCFUN UNC C when when OBJECT OBJ ECTTYP TYPE E is equal equal to ARCHIV ARCHIVE. E.
Cause: Found O OBJECTT BJECTTYPE YPE ARCHIVE ARCHIVE but no ARCFUNC in the db2.conf file. Action: Specify a copy or save parameter for ARCFUNC if OBJECTT OBJECTTYPE YPE ARCHIV ARCHIVE E is also specified.
445 Message:
121
ERR - Invali Invalid d <OBJEC <OBJECTTY TTYPE> PE> entrie entries: s: entry .
Cause:
122
Troubleshooting NetBackup for DB2 About the error message codes
Invalid OBJECTTYPE entry in the following file: install_path\NetBackup\dbext\db2.conf
Action: Add the appropriate object type to the following file: install_path\NetBackup\dbext\db2.conf
450 Message: ER ERR R - OB OBJE JECT CTTY TYPE PE en entr try y ne need eds s to be spec specif ifie ied. d.
Cause: OBJECTTYPE entry is not specified in the following file: install_path\NetBackup\dbext\db2.conf
Action: Add the appropriate object type to the following file: install_path\NetBackup\dbext\db2.conf
455 Message: ER ERR R - PO POLI LICY CY en entr try y ne need eds s to be spec specif ifie ied. d.
Cause: POLICY entry is not specified in the following file: install_path\NetBackup\dbext\db2.conf
Action: Add the appropriate policy name to the POLICY entry in the following file: install_path\NetBackup\dbext\db2.conf
502 Message:
Troubleshooting NetBackup for DB2 About the error message codes
NetBac Net Backup kup DB2 Handle Handle Invali Invalid d
Cause: Internal communication between DB2 and NetBackup failed.
505 Message: Th The e in inpu put t pa para rame mete ters rs su supp ppli lied ed by DB2 DB2 are are not not vali valid. d.
Cause: This error can occurr when you use an unsupported version of DB2.
507 Message: NetBackup NetBac kup Initialize Initialize Failed
Cause: NetBackup NetBac kup encoun encounter tered ed errors errors in prepar preparing ing for the reques requested ted operat operation ion.. This This can result from improper configuration.
510 Message: NetBac Net Backup kup Read Read Config Config Failed Failed
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:
123
NetBac Net Backup kup Write Write Config Config Failed Failed
Cause:
124
Troubleshooting NetBackup for DB2 About the error message codes
NetBackup encountered errors in preparing for the requested operation. This error can result from improper configuration.
513 Message: NetBac Net Backup kup Begin Begin Action Action Failed Failed
Cause: NetBackup NetBac kup encoun encounter tered ed errors errors when when attemp attemptin ting g to start start the reques requested ted operat operation ion.. This error can indicate a problem in obtaining necessary resources.
514 Message: NetBac Net Backup kup Create Create Image Image Failed Failed
Cause: NetBackup encountered errors when attempting to create a backup image.
515 Message: NetBac Net Backup kup Get Image Image Failed Failed
Cause: NetBackup encountered errors when attempting to access a backup image.
516 Message: NetBac Net Backup kup Find Find Image Image Failed Failed
Cause: NetBackup encountered errors when attempting to locate a backup image.
518 Message:
Troubleshooting NetBackup for DB2 About the error message codes
NetBackup NetBac kup Write Failed
Cause: NetBackup encountered errors when writing a backup image.
520 Message: NetBac Net Backup kup Read Read Failed Failed
Cause: NetBackup encountered errors when reading a backup image.
523 Message: NetBac Net Backup kup Commit Commit Data Data Failed Failed
Cause: NetBackup encountered errors when attempting to close the backup image.
524 Message: NetBac Net Backup kup Commit Commit Action Action Failed Failed
Cause: NetBackup encountered errors when attempting to complete the requested operation.
526 Message: NetBac Net Backup kup Abort Abort Action Action Failed Failed
Cause:
125
NetBackup NetBack up encount encountered ered errors errors when when attempt attempting ing to abort abort the prev previous iously ly requeste requested d operation.
126
Troubleshooting NetBackup for DB2 About the error message codes
528 Message: NetBac Net Backup kup Delete Delete Image Image Failed Failed
Cause: NetBackup NetBac kup encoun encounter tered ed errors errors when when attemp attemptin ting g to expire expire an incomp incomplet lete e bac backup kup 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: (DPF) environment ■ Overview of configuration for a DB2 EEE (DPF) ■
Installing NetBackup for DB2 DB2
■
Configuring NetBackup for DB2 DB2
■
Adding NetBackup NetBackup policies for DB2 EEE environment
■
Backing up archive logs in a DB2 EEE environment
■
Creating DB2 templates templates or scripts scripts for a DB2 DB2 EEE environment
Overview of configuration for a DB2 EEE (DPF) environment The IBM DB2 Enterprise Extended Edition (EEE) environment is a database that is distributed across multiple hosts or partitions. In a non-EEE environment, the database is typically centralized on a single host. The Database Partitioning Feature (DPF) is equivalent to the EEE. These topics contain instructions for installing and configuring NetBackup for DB2 in an Extended Enterprise Edition (EEE) or Database Partitioning Feature (DPF) environment. In this appendix, all instructions that refer to an EEE environment are also applicable for a DPF environment.
128
Configuration for a DB2 EEE (DPF) environment Installing NetBackup for DB2
Installing NetBackup for DB2 In a DB2 DB2 EEE (DPF) (DPF) enviro environme nment, nt, instal installl the NetBac NetBackupclien kupclientt on every every clien clientt used used by DB2.
Configuring NetBackup for DB2 The configuration process for NetBackup for DB2 in a DB2 EEE environment is the same as the configuration process for NetBackup for DB2 in a non-EEE environment with the exception of the procedure for adding a backup policy. ■
Set the Ma Maxim ximum um Jobs Jobs Pe Perr Client Client property. The instructions for setting this property for DB2 EEE EE E are the same as those for DB2. See “Configuring the Maximum jobs per client” on page 28.
■
Add NetBackup NetBackup policies for the DB2 EEE environment. The instructions for adding policies to NetBackup are different for DB2 EEE. See “Adding NetBackup policies for DB2 EEE environment” on page 128.
■
Create DB2 scripts for the DB2 EEE environment. The instructions for creating scripts for DB2 EEE are the same as those for DB2. See “Creating templates and shell scripts” on page 56.
■
See “Cre Creati ating ng DB DB2 2 tem templ plate atess or sc scrip ripts ts for fora a DB DB2 2 EEE EEEenv enviro ironme nment nt” on pa page ge 130. 130.
■
Create a $DB2_Instance_Home/db2.conf file. The instructions for configuring the db2.conf files for DB2 EEE are the same as those for DB2. See “Configuring the runtime environment” on page 46.
■
Test NetBackup for DB2 EEE configuration settings. The instructions for testing DB2 EEE configuration settings are the same as those for DB2. See “Configuring the Maximum jobs per client” on page 28.
Addi Ad ding ng Ne NetB tBac acku kup p po poli lici cies es fo forr DB DB2 2 EE EEE E en envi viro ronm nmen entt The following policies must be configured for a DB2 EEE environment:
■
A DB2 type policy policy with an Application Application Backup schedule schedule type. ■
Include only one one Application Backup Backup schedule type. type. Delete the schedule called Default-Application-Backup. Default-Application-Backup.
Configuration for a DB2 EEE (DPF) environment Backing up archive logs in a DB2 EEE environment
For complete instructions on how to create this type of schedule, see the following: See “ Configuring an Application Backup schedule” on page 31. ■
■
■
In the the clie client nt li list st,, in incl clud ude e all all clie client ntss you you wa want nt to ba back ck up up,, incl includ udin ing g the the DB DB2 2 catalog node.
A DB2 policy policy with an Automatic backup schedule. ■
Include one of the following schedule schedule types: Automatic Full Backup, Automatic Differential Incremental Backup, or Automatic Cumulative Increme Inc remental ntal Backup Backup.. This policy policy should should cont contain ain only one automatic automaticback backup up schedule type. For complete instructions on how to create this type of schedule, see the following: See “ Configuring automatic backup schedules” on page 32.
■
Do not specify specify the automatic backup sch schedule edule name in the $DB2_Instance_Home/db2.c /db2.conf onf file. However, for a proxy backup, do include the automatic backup schedule name.
■
Include only the clients that contain the DB2 catalog catalog node and that that run a DB2 script. The script uses the IBM db2_all command to archive the DB2 catalog nodes before any other node is backed up.
Cre Create atea a St Stand andard ard ty type pe po polic licy y with with a User User Back Backup up type type sche schedul dule e if thefo the follo llowin wing g apply: ■
The userexit program program for logg logging ing is turned o on n in DB2 UDB. UDB.
■
The client is a UNIX machine. machine.
About ut bac backin king g up arc archiv hive e lo log g fil files es wit with h the use userr exi exitt pro progr gram am” on pa page ge 41 41.. See “Abo ■
If you use the VENDOR method method,, see the follo following: wing: See “Creating a db2.conf file (vendor method)” on page 49.
Backing up archive logs in a DB2 EEE environment The poli The policy cy yo you u use use to ba back ck up th the e arch archiv ive e logs logs depe depend ndss on the the meth method od yo you u use use for for log archiving. If you use the user exit program, create a Standard policy. If you use the VENDOR method, you can use the DB2 Application Backup schedule.
129
130
Configuration for a DB2 EEE (DPF) environment Creating DB2 templates or scripts for a DB2 EEE environment
Creating DB2 templates or scripts for a DB2 EEE environment Templates and scripts operate on a single NetBackup client. If your EEE/DPF environment spans multiple machines, create at least one template or script for each machine. For exampl Forexa mple, e, assume assume your your databa database se spans spans two hos hosts, ts, and host host H1 contai contains ns partition partition P1, and host H2 contains partitions P2 and P3. You need at least two templates, t emplates, as follows: ■
One template for partition partition P1 on host H1
■
One template for partitions partitions P2 and P3 on host H2.
Note: Pro Proper per backup backup and restore restoreof of the catalo catalog g partiti partition on is the use user's r's respon responsibi sibility lity.. 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.
Information is available on how to create backup templates and how to create recovery templates. See “ Creating a backup template with the NetBackup for DB2 Backup Wizard” on page 58. See “ Using the NetBackup for DB2 recovery wizard” on page 76. Rollforwa Rollfo rward rd recove recovery ry to a pointpoint-inin-time time (PIT) (PIT) is not suppo supporte rted. d. DB2 DB2 requir requires es that that PIT recovery be run via the same operation for all partitions and tablespaces on all machines. Templates do not span machines.
Appendix
B
Using NetBackup for DB2 with SAP® This appendix includes the following topics: ■
NetBackup for DB2 with SAP About NetBackup
■
Installation of of the DB2 DB2 user exit exit program
■
Backup and restore of DB2 databases
■
Archive and restore of DB2 log files
■
Backup of SAP files
About NetBackup for DB2 with SAP When a DB2 database is used by SAP software, NetBackup for DB2 can be used within with in thatenv that enviro ironme nment nt forbac for backup kup and restore restoreof of SAP data. data. Thischa This chapte pterr provid provides es guidelines for using SAP, DB2, and NetBackup together.
Installation of the DB2 user exit program DB2 al DB2 allo lows ws for for the the pres presen ence ce of a sing single le us user er ex exit it pr prog ogra ram m to mana manage ge arch archiv ivin ing g of databa dat abase se logfiles. logfiles. Both Both SAP SAP and NetBac NetBackup kupdel delive iverr user user exit exit progra programs ms forexc for exclus lusive ive 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 and because it enables on-demand recovery of log files by DB2.
132
Using NetBackup for DB2 with SAP® Backup and restore of DB2 databases
Take precau Take precautio tions ns when when instal installin ling g SAP SAP to preven preventt overw overwriti riting ng the NetBac NetBackup kup user user exitt progra exi program. m. Always Always preser preserve ve the NetBac NetBackup kup db2uext2 file file bef before ore instal installin ling g SAP and restore afterwards.
Backup Backu p and restore of DB2 databases Follow the standard NetBackup instructions in this document for backup and rest restor ore e of the the DB2 DB2 da data taba base se(s (s)) us used ed by SAP. SAP. You You ca can n us use e eith either er DB DB2 2 or NetB NetBac acku kup p to initiate database backups and restores. Note: Donot use use SAP CCMS CCMS, sapdba, brbackup, or brrestore com comman mands ds to initia initiate te backups or restores. They do not invoke NetBackup.
Note: SAP must not be running when you attempt to restore the database.
Archive and restore of DB2 log files Follow the standa Follow standard rd NetBac NetBackup kup instru instructi ctions ons in this this doc docume ument nt for config configuri uring ng the userr exit use exit progra program. m. DB2 will will automa automatic ticall ally y invok invoke e the use userr exit exit progra program m to archiv archive e and recover the necessary log files. fi les. Note: Do not use S SAP AP CC CCMS MS, sapdba, brarchive commands, or the SAP Logfile Manage Man agemen mentt window window in the DB2 DB2 Contro Controll Center Center for log file file arc archiv hival. al. They They depend depend on the SAP user exit program for proper operation.
Backup of SAP files Be certain to include any and all SAP files when planning for SAP recovery, not just the DB2 database. For For instance, any regular files files used by SAP can can be backed up using standard NetBackup file backup procedures. For file backup instructions, consult the "Performing Backups" section in the NetBackup Backup, Archive, and Restore online help.
Index
A Application Backup schedule configuring 32 environment variables 56 overview 32 overview 32,, 34 retention 32 retention with Snapshot Client 98 ARCDIR keyword 52 ARCFUNC COPY keyword 48 48,, 52 ARCFUNC SAVE keyword 17 47 47,, 52 ARCHIVE LOG command archive logs backing up 24 24,, 66 configuring policies 43 keywords for backing up in db2.conf db2.conf 41 overview 18 overview restoring 79 restoring from a raw partition 53 automatic backup create scripts 61 overview 66 overview policy 66 automatic backup schedule configuring 32 Automatic Cumulative Automatic Cumulative Incre Increment mental al Backupsched Backup schedule ule overview 34 overview Snapshot Client effects 105 Automati Auto maticc Different Differential ial Increment Incremental al Backup Backup schedule schedule overview 34 overview Snapshot Client effects 105 Automatic Full Backup schedule 33–34 Snapshot Client effects 105 with Snapshot Client 98
B Backup
backup (continued) automatic configure scripts 61 using scripts 66 database 66 manual 67 partitions 67 tablespaces 67 user-directed 67 user-directed with Snapshot Client methods 95 95,, 106 wizard invoking 106 BACKUP command 17 BACKUP DATABASE command 15 15,, 66 66,, 69–70 backup media required 23 Backup Selections list adding scripts 39 adding selections 38–39 adding templates 38–39 overview 37 overview backups manual 40 wizard invoking 58 bp.conf variables 61 bpdb2proxy command 103 103,, 107 bpdbsbdb2 command syntax 69 running a backup template 69 running a recovery template 78 bpdbsbdb2 command 59 bphdb log 112 bplist command 72–73 browse for restore using Backup Archive. See and and Restore
using bplist 73
Archive and Restore interface. See invoking. invoking. See overview backup archive log 66
C client read timeout property 114
134
Index
clients list for backup policies 36 cluster storing templates and scripts 62 commands ARCHIVE LOG 17 BACKUP 17 BACKUP DATABASE 15 15,, 66 66,, 69–70 bpdb2proxy 103, bpdb2proxy 103, 107 bpdbsbdb2 59 bpdbsbdb2 59,, 69 69,, 78 bplist 72–73 DISCONNECT 17 QUIESCE 60 RECOVER DATABASE 15 RESTORE DATABASE 15 15,, 81 ROLLFORWARD 17 ROLLFORWARD DATABASE 15 15,, 42
debug logs (continued) troubleshooting with log files 109 DESTALIAS keyword 53 DESTINST keyword 53 DISCONNECT command 17
TERMINATE 17 compatibility information 22 configuration database user authentication 54 files policies for backing up 45 45,, 66
installation adding a license key 24 prerequisites in a cluster 23 requirements for NetBackup software 23 instance adding instances 26 browsing for an instance 57 instant recovery configuration requirements 97 overview 92 overview policy configuration 98 restore method 102 see Snapshot Client 92
D DATABASE keyword 53 DB2 DPF environment configuration procedure 128 DB2 EEE environment configuration procedure 128 db2.conf creating 46 46,, 49 keywords 46 46,, 50 50,, 52 object identifiers 46 46,, 50 overview 15 overview 15,, 18 variables 61 db2_backup_db_offline.cmd example script 60 db2_backup_db_online.cmd example script 60 db2_mpp_backup_offline.cmd example script 60 db2_mpp_restore_db.cmd example script 60 db2_restore_db.cmd example script 60 DB2NODE variable 60 db2uext2 see user exit program 15
E ENDOPER keyword 53 environment variables 55 55,, 61 execution log 112
F file-based operations 92 FlashSnap snapshots 102
I
J Java interface 28
K keywords ARCDIR 52 ARCFUNC COPY 48 48,, 52 ARCFUNC SAVE 47 47,, 52 DATABASE 53 db2.conf 52 db2.conf DESTALIAS 53 DESTINST 53
debug logs accessing 111 creating automatically with mklogdir.bat 110 enabling 109 in install_path\\NetBackup\\bslogs 111
ENDOPER NODE 53 53 OBJECTTYPE ALTERNATE 53 OBJECTTYPE ARCHIVE 53 OBJECTTYPE DATABASE 53
Index
keywords (continued) OBJECTTYPE TABLESPACE 53 PARTITIONTYE RAW 80 PARTITIONTYPE RAW 53 POLICY 54 RETDIR 54 SCHEDULE 54 SRCALIAS 54 SRCINST 54 summary 51
L license keys, adding 24 log files archiving 41 enabling 110
M manual backup of a policy 67 master server specifying 41 41,, 57 maximum jobs per client 28 multiple copies feature 36 36,, 105 multiplexing overview 13 overview multistreamed backups 96
N NBDB2 vendor I/O library overview 15–16 overview settings 66 NET_BUFFER_SZ file 114 NetBackup Client Service log on account, configuring 54 NODE keyword 53
O OBJECTTYPE ALTERNATE keyword 53 OBJECTTYPE ARCHIVE keyword 53 OBJECTTYPE DATABASE keyword 53 OBJECTTYPE TABLESPACE keyword 53 offhost backup. See Snapshot Snapshot Client configuration 96
P parameters for scripts 61 partitions backing up 67RAW keyword 53 PARTITIONTYPE 53,, 80 point in time rollback 102 policy configuration adding clients 37 attributes 31 attributes backup selections list 37 for archive logs 43 for configuration files 45 for databases 30 for Snapshot Client 98 overview 29 overview schedules 31 testing 40 POLICY keyword 54 processes log files for NetBackup processes 111 proxy copy 92
Q QUIESCE command 60
R raw partitions 80 reason codes 115 RECOVER DATABASE command 15 Recovery Wizard also see wizard 76 overview 76 overview use with Snapshot Client 106 remote folder button 40 reports 109 Se Seee al also so log files All Log Entries report 113 NetBackup server reports 113 RESTORE DATABASE command 15 15,, 81 restores snapshot rollback 102–103 using DB2 78 with Snapsho Snapshott Clientmetho Client methods ds 95 95,, 102, 102, 104, 104, 107 RETDIR keyword 54
135
configuring 100 overview 92 overview optimizing file restores 114
retention period for Snapshot Client 105 ROLLFORWARD command 17 ROLLFORWARD DATABASE command 15 15,, 42
136
Index
S
T
SAP
tablespaces backup 66–67
using NetBackup for DB2 with 131 SCHEDULE schedules keyword 54 adding 31 automatic backup 66 frequency 36 properties 35 properties properties for Snapshot Client 105 retention for Snapshot Client 105 types of schedules 31 scripts cautions for using 35 35,, 61 creating 57 57,, 59 creating from templates 59 creating manually 60
templates administration 68 administration interface 66 advantages over scripts 35 backups creating 59 creating scripts from templates 59 overview 14 overview 14,, 56 recovery 76 running from Backup Archive. See and and Restore running with bpdpsbdb2 69 storing 62 use with Snapshot Client 107
errors in executing 61 example backup scripts 60 example restore scripts 60 examples 18 18,, 60 modifying 61 parameters 61 scheduler 66 storing 62 type of operation 61 server-directed backups 106 snapshot backup 91 91,, 96 96,, 98 98,, 102 configuration 96 configuration requirements 97 database objects included 98 overview 91 overview policy configuration 98 restore method 102 Snapshot Client configuring policies 98 effect on backup schedules 35 effects on backups and restores 106 effects on policies and schedules 104 file-based operations 92 overview 91 overview proxy copy 92 stream-based operations 93 theory of operations 94
TERMINATE command 17 testing policy configuration 40 timeout failures minimizing 113 minimizing troubleshooting false restore failures reported 114 reason codes 115
U unified logging 111 user exit program archive log backup 24 24,, 41 41,, 66 overview 17–18 overview –
policies needed 26 26,, 43 44
V variables environment 55 environment for scripts 61 VENDOR method for archive logging db2.conf keywords needed 52 overview 18 overview 18,, 66 policies needed 25 specifying in DB2 24 used with BACKUP DATABASE command 70 vxvm snapshot 102
snapshot 102 SRCALIASrollback keyword 54 103 SRCINST keyword 54 stream-based operations 93
W Windows interface 28 wizard backup 18 18,, 56
Index
wizard (continued) overview 14 overview 14,, 18 recovery 18 18,, 76 use with Snapshot Client 106
137