using emc srdf to facilitate disaster recovery for db2 … · using emc srdf to facilitate disaster...

332
Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases Version 1.0 Disaster Recovery Solutions for DB2 Databases Setting up an SRDF Environment for a DB2 Database Performing Failover and Failback Operations Roger E. Sanders Aruna De Silva Aslam Nomani Dale McInnis

Upload: vokhuong

Post on 25-Apr-2018

236 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Using EMC SRDF to FacilitateDisaster Recovery for DB2 forLinux, UNIX, and WindowsDatabases

Version 1.0

• Disaster Recovery Solutions for DB2 Databases

• Setting up an SRDF Environment for a DB2 Database

• Performing Failover and Failback Operations

Roger E. SandersAruna De SilvaAslam NomaniDale McInnis

Page 2: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

2

Copyright © 2010 EMC Corporation. All rights reserved.

EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice.

THE INFORMATION IN THIS PUBLICATION IS PROVIDED “AS IS.” EMC CORPORATION MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Use, copying, and distribution of any EMC software described in this publication requires an applicable software license.

For the most up-to-date regulatory document for your product line, go to the Technical Documentation and Advisories section on EMC Powerlink.

For the most up-to-date listing of EMC product names, see EMC Corporation Trademarks on EMC.com.

This information was developed for DB2 products offered in the U.S.A.

IBM® may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product, program, or service.

IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to:

IBM Director of LicensingIBM CorporationNorth Castle DriveArmonk, NY 10504-1785U.S.A.

The following paragraph does not apply to the United Kingdom or any other country/region where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions; therefore, this statement may not apply to you.

This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice.

This document may provide links or references to non-IBM Web sites and resources. IBM makes no representations, warranties, or other commitments whatsoever about any non-IBM Web sites or third-party resources that may be referenced, accessible from, or linked from this document. A link to a non-IBM Web site does not mean that IBM endorses the content or use of such Web site or its owner. In addition, IBM is not a party to or responsible for any transactions you may enter into with third parties, even if you learn of such parties (or use a link to such parties) from an IBM site. Accordingly, you acknowledge and agree that IBM is not responsible for the availability of such external sites or resources, and is not responsible or liable for any content, services, products, or other materials on or available from those sites or resources. Any software

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 3: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

provided by third parties is subject to the terms and conditions of the license that accompanies that software.

IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.

Licensees of the DB2 programs referenced in this document who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information that has been exchanged, should contact:

IBM Canada LimitedOffice of the Lab Director8200 Warden AvenueMarkham, OntarioL6G 1C7 CANADA

Such information may be available, subject to appropriate terms and conditions, including in some cases payment of a fee.

The licensed program described in this document and all licensed material available for it are provided by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement, or any equivalent agreement between us.

Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments may vary significantly. Some measurements may have been made on development-level systems, and there is no guarantee that these measurements will be the same on generally available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.

Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements, or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility, or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products.

All statements regarding IBM's future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only.

This information may contain examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious, and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental.

The following terms are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both: IBM, the IBM logo, IBM Press, CICS, DB2, developerWorks, MVS, OS/2, RACF, Rational, Redbooks, Tivoli, WebSphere, z/OS and z/VM.

Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.

UNIX is a registered trademark of The Open Group in the United States and other countries.

All other trademarks used herein are the property of their respective owners.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3

Page 4: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

4

Part number H8089

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 5: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Contents

Preface

Chapter 1 Introduction to DB2 for Linux, UNIX, and WindowsThe DB2 Family................................................................................. 20DB2’s comprehensive tool set ......................................................... 27

The Control Center .....................................................................27The Command Editor ................................................................31The Configuration Assistant .....................................................33The Command Line Processor..................................................34

Server, instances, and databases ..................................................... 37The DB2 Administration Server (DAS) instance....................38

Objects that make up a DB2 database environment .................... 40Creating a DB2 LUW database ....................................................... 42

What happens when a DB2 LUW database is created ..........44A closer look at table spaces............................................................ 52

Creating additional table spaces...............................................56Modifying existing table spaces ...............................................57Adding new containers to existing automatic storagetable spaces ..................................................................................59

A closer look at transaction logging............................................... 61Logging strategies.......................................................................64Other logging considerations....................................................67

Configuring a DB2 LUW database environment ......................... 71Configuring servers....................................................................71Configuring instances ................................................................77Configuring databases ...............................................................80

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 5

Page 6: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Contents

Chapter 2 EMC Foundation ProductsIntroduction....................................................................................... 86Symmetrix hardware and EMC Enginuity features .................... 88

Symmetrix VMAX platform...................................................... 89EMC Enginuity operating environment ................................. 92

EMC Solutions Enabler base management ................................... 93EMC Change Tracker ....................................................................... 96EMC Symmetrix Remote Data Facility.......................................... 97

SRDF benefits .............................................................................. 98SRDF modes of operation.......................................................... 98SRDF device groups and composite groups .......................... 99SRDF consistency groups .......................................................... 99SRDF terminology .................................................................... 103SRDF control operations.......................................................... 105Failover and failback operations ............................................ 109EMC SRDF/Cluster Enabler solutions.................................. 112SRDF enhancements introduced with Enginuity 5875 ....... 113

EMC TimeFinder............................................................................. 115TimeFinder/Clone operations................................................ 117TimeFinder/Snap operations ................................................. 120TimeFinder/Mirror operations .............................................. 123TimeFinder consistent split..................................................... 127Enginuity Consistent Assist .................................................... 127TimeFinder/Mirror reverse split ........................................... 130

EMC Replication Manager ............................................................ 130EMC Storage Resource Management .......................................... 133EMC PowerPath.............................................................................. 137EMC Open Replicator .................................................................... 139EMC Virtual Provisioning ............................................................. 140

Thin device ................................................................................ 140Data device ................................................................................ 140New Symmetrix VMAX Virtual Provisioning features ...... 141New Symmetrix VMAX TimeFinder/Clone features......... 142

EMC Fully Automated Storage Tiering (FAST).......................... 144FAST VP..................................................................................... 145

Chapter 3 DB2 for Linux, UNIX, and Windows Disaster Recovery ConceptsDB2 LUW database back up and recovery concepts ................. 148

Crash recovery .......................................................................... 148Version recovery....................................................................... 149Roll-forward recovery.............................................................. 150

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases6

Page 7: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Contents

Recoverable and nonrecoverable databases .........................151Online versus offline back up and recovery .........................153Incremental and delta back up and recovery .......................153

Performing crash recovery operations......................................... 155A word about soft checkpoints ...............................................158

Performing back up and recovery operations ............................ 159The DB2 Backup utility ............................................................159The DB2 Restore utility ............................................................165The DB2 Roll-forward utility...................................................170A word about the recovery history file..................................176The DB2 Recover utility ...........................................................178Rebuilding invalid indexes......................................................180

Back up and recovery with split mirroring ................................. 181Initializing a split mirror with db2inidb................................183Changing the DB2-specific metadata associated with a database......................................................................................184

Providing continuous availability ................................................ 187Log shipping..............................................................................188Setting up a log shipping environment .................................190What to do when the primary server fails ............................191Reversing the roles of primary and standby servers(failing back) ..............................................................................192

High availability disaster recovery (HADR)............................... 194Requirements for HADR environments ................................195Setting up an HADR environment .........................................198Switching database roles in HADR........................................200

Chapter 4 EMC SRDF Family of ProductsIntroduction to SRDF...................................................................... 204

Modes of operation...................................................................204Base products.............................................................................206Options .......................................................................................207

Symmetrix Remote Data Facility/Synchronous (SRDF/S)....... 208Setting up SRDF/S using a single source Symmetrix .........209Running from the secondary Symmetrix in the event of a disaster ................................................................................210Setting up SRDF/S using multiple source Symmetrixarrays ..........................................................................................211

SRDF/S Consistency Group .......................................................... 213Rolling disaster..........................................................................214Protection against a rolling disaster .......................................216

Symmetrix Remote Data Facility/Asynchronous (SRDF/A)... 218

7Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 8: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Contents

Setting up SRDF/A using a single source Symmetrix........ 220Setting up SRDF/A using multiple source Symmetrixarrays.......................................................................................... 221How to restart in the event of a disaster ............................... 223

SRDF/Automated Replication ..................................................... 224SRDF/AR single-hop............................................................... 224SRDF/AR multi-hop................................................................ 227

SRDF/Star........................................................................................ 230

Chapter 5 Setting up a DB2 LUW Database - SRDF EnvironmentA basic two-site SRDF configuration........................................... 232Planning for remote replication.................................................... 234Setting up an SRDF environment for a DB2 LUW database .... 235Cloning a DB2 LUW database stored on R2 devices................. 257

Chapter 6 Performing SRDF Failover and Failback OperationsTwo-site SDRF recovery operations ............................................. 274Performing two-site SRDF failover operations .......................... 275

Performing a planned (orderly) failover to the secondary site............................................................................ 275Performing an unplanned failover to the secondary site............................................................................ 281

Performing two-site SRDF failback operations .......................... 286Performing a failback operation after a planned failover to the secondary site .................................................. 286Performing a failback operation after an unplanned failover to the secondary site .................................................. 294

Cloning a DB2 LUW database stored on SRDF devices ........... 302

Appendix A Test EnvironmentSteps used to create the test environment................................... 314

Glossary

Index

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases8

Page 9: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Title Page

Figures

1 DB2 family editions........................................................................................ 262 The Control Center (advanced view) .......................................................... 293 The Control Center toolbar ........................................................................... 304 The Command Editor .................................................................................... 325 The Configuration Assistant......................................................................... 346 The Command Line Processor (in interactive input mode)..................... 367 Hierarchical relationship between systems, instances, and databases... 388 Invoking the Create Database Wizard from the Control Center............. 439 The first page of the Create Database Wizard ........................................... 4410 Typical directory hierarchy tree for a nonpartitioned database ............. 4611 How data is written to table space containers ........................................... 5212 Invoking the Create Table Space Wizard from the Control Center........ 5613 The first page of the Create Table Space Wizard....................................... 5714 Invoking the Alter Table Space dialog box from the Control Center..... 5815 The first page of the Alter Table Space dialog box.................................... 5916 The transaction logging process................................................................... 6317 Circular logging.............................................................................................. 6518 Archival logging............................................................................................. 6719 Invoking the DB2 Registry management tool from the Configuration

Assistant .......................................................................................................... 7520 DB2 Registry management tool dialog box................................................ 7621 Invoking the DBM Configuration dialog box from the Control

Center............................................................................................................... 7922 DBM Configuration dialog box.................................................................... 8023 Invoking the Database Configuration dialog box from the Control

Center............................................................................................................... 8324 Database Configuration dialog box............................................................. 8425 EMC Symmetrix VMAX Series with Enginuity......................................... 9026 Basic synchronous SRDF configuration...................................................... 9827 SRDF consistency group ............................................................................. 101

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 9

Page 10: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Figures

28 SRDF establish and restore control operations........................................ 10729 SRDF failover and failback control operations ........................................ 10930 Geographically distributed four-node EMC SRDF/CE clusters........... 11231 EMC Symmetrix configured with standard volumes and BCVs.......... 11732 Creating a copy session using the symclone command......................... 11933 Copy of a standard device to a virtual device (VDEV) .......................... 12234 ECA consistent split across multiple database-associated hosts .......... 12835 ECA consistent split on a local Symmetrix system ................................. 12936 SRM commands............................................................................................ 13337 Virtual Provisioning components.............................................................. 14138 Crash recovery.............................................................................................. 14939 Version recovery .......................................................................................... 15040 Roll-forward recovery ................................................................................. 15141 Initiating a crash recovery operation from the Control Center............. 15742 Invoking the Backup Wizard from the Control Center.......................... 16243 The first page of the Backup Wizard......................................................... 16344 Invoking the Restore Data Wizard from the Control Center ................ 16945 The first page of the Restore Database Wizard........................................ 17046 Invoking the Roll-forward Wizard from the Control Center ................ 17447 The first page of the Roll-forward Wizard ............................................... 17548 Roll-forward page of the Restore Data Wizard ....................................... 17649 Concept of HADR in a DB2 LUW environment...................................... 19550 SRDF/S replication internals ..................................................................... 20851 SRDF/S with multiple source Symmetrix arrays.................................... 21152 Rolling disaster with multiple production Symmetrix .......................... 21453 Rolling disaster with SRDF consistency group protection .................... 21654 SRDF/A replication internals .................................................................... 21855 SRDF/AR single-hop replication internals .............................................. 22556 SRDF/AR multihop replication internals ................................................ 228

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases10

Page 11: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Title Page

Tables

1 Differences between SMS and DMS/AS table spaces ............................... 542 db2set command options ............................................................................... 733 SYMCLI base commands ............................................................................... 934 TimeFinder device type summary.............................................................. 1215 Data object SRM commands ........................................................................ 1346 Data object mapping commands ................................................................ 1357 File system SRM commands to examine file system mapping .............. 1358 File system SRM command to examine logical volume mapping ......... 1369 SRM statistics command .............................................................................. 13610 Differences between recoverable and nonrecoverable databases .......... 15211 DB2 back up image file name components ............................................... 16412 HADR-specific database configuration parameters................................. 198

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 11

Page 12: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Tables

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases12

Page 13: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

As part of an effort to improve and enhance the performance and capabilities of its product lines, EMC periodically releases revisions of its hardware and software. Therefore, some functions described in this document may not be supported by all versions of the software or hardware currently in use. For the most up-to-date information on product features, refer to the product release notes.

This TechBook provides a high-level overview of DB2 for Linux, UNIX, and Windows (LUW) and a general description of EMC products and utilities that can be used to provide disaster recovery (DR) for DB2 LUW databases. While much of the content presented focuses on single partition databases, considerations for multipartition databases are also addressed.

Audience This TechBook is written primarily for IT professionals who have some experience working with DB2 for Linux, UNIX, and Windows (LUW), are planning on deploying a DB2 LUW database on a Symmetrix storage system, and are looking for a way to incorporate a disaster recovery strategy into their environment. However, anyone who would like to learn how to use EMC SRDF in conjunction with DB2 LUW databases will benefit from the information found in this book.

Readers of this document are expected to be familiar with the following topics:

◆ Symmetrix operating environments◆ DB2 for Linux, UNIX, and Windows operations and concepts

Preface

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 13

Page 14: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

14

Preface

Relateddocumentation

Other related EMC publications include:

◆ Symmetrix VMAX Series Product Guide

◆ Symmetrix DMX-4 Product Guide

◆ Symmetrix Remote Data Facility (SRDF) Product Guide

◆ EMC Solutions Enabler Symmetrix SRDF CLI Product Guide

◆ EMC Solutions Enabler Symmetrix TimeFinder CLI Product Guide

◆ Enginuity - The EMC Symmetrix Storage Operating Environment - A Detailed Review, White Paper

◆ New Features in EMC Enginuity 5874 for Symmetrix Open Systems Environments, White Paper

◆ EMC Symmetrix Enginuity Release Notes (multiple release levels available)

◆ EMC Solutions Enabler Version 7.0 Release Notes

Other related IBM publications include:

◆ IBM DB2 Database Administration Concepts and Configuration Reference

◆ IBM DB2 Data Recovery and High Availability Guide and Reference

For more IBM DB2 reference material, refer to:

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsphttp://www.ibm.com/redbooks

Author’s publications include:

◆ DB2 9 Fundamentals: Certification Study Guide

◆ DB2 9 for Linux, UNIX, and Windows Database Administration: Certification Study Guide

◆ Deploying DB2 for Linux, UNIX, and Windows Databases on EMC Symmetrix Arrays

◆ Using EMC TimeFinder to Back Up and Restore DB2 for Linux, UNIX, and Windows Databases TechBook

◆ Using EMC TimeFinder to Clone DB2 for Linux, UNIX, and Windows Databases TechBook

Conventions used inthis document

EMC uses the following conventions for special notices.

Note: A note presents information that is important, but not hazard-related.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 15: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Preface

IMPORTANT

An important notice contains information essential to operation of the software or hardware.

Typographical conventionsEMC uses the following type style conventions in this document:

DB2 command/SQL statement syntax conventionsMany examples of DB2 LUW administrative commands and SQL statements can be found throughout this book. The following conventions are used whenever a DB2 command or SQL statement is presented:

Normal Used in running (nonprocedural) text for:• Names of interface elements (such as names of windows, dialog

boxes, buttons, fields, and menus)• Names of resources, attributes, pools, Boolean expressions,

buttons, DQL statements, keywords, clauses, environment variables, functions, utilities

• URLs, pathnames, filenames, directory names, computer names, filenames, links, groups, service keys, file systems, notifications

Bold Used in running (nonprocedural) text for:• Names of commands, daemons, options, programs, processes,

services, applications, utilities, kernels, notifications, system calls, man pages

Used in procedures for:• Names of interface elements (such as names of windows, dialog

boxes, buttons, fields, and menus)• What user specifically selects, clicks, presses, or types

Italic Used in all text (including procedures) for:• Full titles of publications referenced in text• Emphasis (for example a new term)• Variables

Courier Used for:• System output, such as an error message or script • URLs, complete paths, filenames, prompts, and syntax when

shown outside of running text

Courier bold Used for:• Specific user input (such as commands)

Courier italic Used in procedures for:• Variables on command line• User input variables

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 15

Page 16: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

16

Preface

◆ [ ] Parameters or items shown inside of brackets are required and must be provided.

◆ < > Parameters or items shown inside of angle brackets are optional and do not have to be provided.

◆ | Vertical bars are used to indicate that one (and only one) item in the list of items presented can be specified.

◆ ,… A comma followed by three periods (ellipsis) indicate that multiple instances of the preceding parameter or item can be included in the DB2 command or SQL statement.

The following examples illustrate each of these conventions:

Example 1 REFRESH TABLE [TableName ,...]<INCREMENTAL | NON INCREMENTAL>

In this example, at least one TableName value must be provided, as indicated by the brackets ([ ]), and more than one TableName value can be provided, as indicated by the comma-ellipsis (, . . . ) characters that follow the TableName parameter. INCREMENTAL and NON INCREMENTAL are optional, as indicated by the angle brackets (< >), and either one or the other can be specified, but not both, as indicated by the vertical bar (|).

Example 2 CREATE SEQUENCE [SequenceName]<AS [SMALLINT | INTEGER | BIGINT | DECIMAL]><START WITH [StartingNumber]><INCREMENT BY [1 | Increment]><NO MINVALUE | MINVALUE [MinValue]><NO MAXVALUE | MAXVALUE [MaxValue]><NO CYCLE | CYCLE><NO CACHE | CACHE 20 | CACHE [CacheValue]><NO ORDER | ORDER>

In this example, a SequenceName value must be provided, as indicated by the brackets ([ ]). However, everything else is optional, as indicated by the angle brackets (< >), and in many cases, a list of available option values is provided (for example, NO CYCLE and CYCLE); however, only one can be specified, as indicated by the vertical bar (|). In addition, when some options are provided (for example, START WITH, INCREMENT BY, MINVALUE, MAXVALUE, and CACHE), a corresponding value must be provided, as indicated by the brackets ([ ]) that follow the option.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 17: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Preface

Note: SQL is not a case-sensitive language, but for clarity, the examples provided are shown in mixed case; command syntax is presented in uppercase while user-supplied elements such as table names and column names are presented in lowercase. However, the examples shown can be entered in any case.

The team that wrote this TechBook

This TechBook was authored by a team of engineers from EMC and two DB2 experts at IBM’s Toronto lab.

◆ Roger E. Sanders is a Consultant Corporate Systems Engineer in the Integrated Customer Operations team at EMC. He has nine years of experience in the storage industry and he has been working with DB2 for Linux, UNIX, and Windows since it was first introduced on the IBM PC (as part of OS/2 1.3 Extended Edition). Roger has written articles for IDUG Solutions Journal and Certification Magazine, authored DB2 tutorials for IBM's developerWorks website, presented at several International DB2 User's Group (IDUG) and regional DB2 User's Group (RUG) conferences, taught numerous classes on DB2 Family Fundamentals and DB2 Database Administration (DB2 for Linux, UNIX, and Windows), and is the author of 20 books on DB2 for Linux, UNIX, and Windows and one book on ODBC. For the past eight years, Roger has authored the Distributed DBA column in IBM Data Management Magazine (formerly DB2 Magazine) and he has helped IBM develop 17 DB2 Certification Exams. In 2008 and 2010, Roger was recognized as an IBM Information Champion; in 2010, he was recognized as an IBM developerWorks Contributing Author.

◆ Aruna De Silva is a member of the QA team for the DB2 for Linux, UNIX, and Windows product at the IBM Toronto software lab where DB2 for Linux, UNIX, and Windows is developed. In addition to being an IBM Certified Advanced Database Administrator for DB2 9, he holds numerous IT certifications from IBM and other vendors in database, hardware, and systems administration. Aruna is actively involved in DB2 product integration, implementing and testing complex product stacks, and designing and testing HA and DR solutions. He is also the key contact person for EMC Storage within the DB2 QA team. He holds a Bachelor of Science degree in Computer Science from York University.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 17

Page 18: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

18

Preface

◆ Aslam Nomani has been with IBM for 14 years and has spent most of that time with the Quality Assurance team at the IBM Toronto Laboratory. His main area of focus has been on high availability and disaster recovery solutions. Over the past several years Aslam has been the Quality Assurance Architect for the DB2 pureScale Feature.

◆ Dale McInnis is a Senior Technical Staff Member (STSM) at the IBM Toronto lab where DB2 for Linux, UNIX, and Windows is developed. He has a B.Sc. (CS) from the University of New Brunswick and a Masters of Engineering from the University of Toronto. Dale joined IBM in 1988, and has been working on the DB2 development team since 1992. During this time, Dale has always focused on the DB2 Kernel development, where he led the team that designed the current back up and recovery architecture, and the integration of datalinks technology. Dale is currently the DB2 High Availability Architect and is known in the industry as the expert in this field. He is focused on the availability features and functions for DB2 LUW’s future releases and its integration with other software from IBM such as Tivoli System Automation and Tivoli Storage Manager.

Additional contributors to this book:

◆ Jim Wentworth, Integrated Customer Operations, EMC Corporation, Hopkinton, MA

◆ Mike Adams, Symmetrix Engineering, EMC Corporation, Hopkinton, MA

◆ Geraldine Ledoux, Integrated Customer Operations, EMC Corporation, Hopkinton, MA

◆ Paul Pendle, Integrated Customer Operations, EMC Corporation, Hopkinton, MA

We'd like to hear from you!

Your feedback on our TechBooks is important to us! We want our books to be as helpful and relevant as possible, so please feel free to send us your comments, opinions, and thoughts on this or any other TechBook:

[email protected]

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 19: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

1

DB2 version 9.7 for Linux, UNIX, and Windows (LUW) and DB2 pureScale (which technically, is version 9.8), are the latest releases of IBM’s open-systems hybrid database management system. In addition to the functionality introduced with DB2 version 9, version 9.7 delivers important new features and enhancements that address business needs, whether those needs are integrating business data from across your organization, reducing costs, creating business value, or providing a secure and resilient system for your company's valuable information assets. DB2 pureScale builds on version 9.7 by providing an active-active shared-disk database implementation that is based on the DB2 for z/OS data sharing architecture.

This chapter is designed to introduce you to the various products that make up the core of the DB2 Family and to the more common set of tools that are available to assist in the administration and management of DB2 servers, instances, databases, and database objects. This chapter is also designed to show you how to configure a server, an instance, or a database, to show you what happens when a new database is created, and to provide you with an overview of how data for a database is physically stored. Topics covered include:

◆ The DB2 Family.................................................................................. 20◆ DB2’s comprehensive tool set .......................................................... 27◆ Server, instances, and databases ...................................................... 37◆ Objects that make up a DB2 database environment ..................... 40◆ Creating a DB2 LUW database......................................................... 42◆ A closer look at table spaces ............................................................. 52◆ A closer look at transaction logging................................................ 61◆ Configuring a DB2 LUW database environment .......................... 71

Introduction to DB2 forLinux, UNIX, and

Windows

Introduction to DB2 for Linux, UNIX, and Windows 19

Page 20: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

20

Introduction to DB2 for Linux, UNIX, and Windows

The DB2 FamilyDB2, an acronym for DATABASE 2, was born on MVS in 1983. In 1987, DB2 arrived on the personal computer (PC) as the Database Manager in OS/2 1.3 Extended Edition and a year later, it emerged as SQL/400 for IBM’s new AS/400 server. By 1992, DB2 had become a stand-alone product on OS/2 (it now had the name DB2/2) and in 1993, DB2 appeared on AIX. (This prompted another name change and DB2/2 became DB2 for Common Servers.) New editions of DB2 were introduced on HP-UX and Solaris in 1994, on Windows in 1995, and on Linux in 1999. (Along the way, the name changed again and DB2 for Common Servers became DB2 Universal Database or DB2 UDB.)

DB2 version 9.7 for Linux, UNIX, and Windows and the DB2 pureScale Feature (which technically, is version 9.8), are the latest releases of IBM’s popular data management software for distributed open-systems. (Starting with version 9, the name changed again). Like previous versions, DB2 runs on a wide variety of platforms (AIX, HP-UX, Linux, Solaris, Windows, i5/OS, and z/OS), and several editions are available — each of which has been designed to meet a specific business need. These editions, along with an extensive suite of add-on products that provide additional storage capability and advanced connectivity, are collectively known as the DB2 Family. The editions that make up the heart of the DB2 Family are:

◆ DB2 Everyplace. DB2 Everyplace is a small footprint (approximately 350 KB) relational database and a high performance data synchronization solution that allows enterprise applications and data to be extended to mobile devices like personal digital assistants (PDAs), handheld personal computers (HPCs), and smart phones. DB2 Everyplace can be used as a local, stand-alone database that resides on a mobile device or to access information stored on remote servers whenever a connection is available. DB2 Everyplace can also be embedded directly into mobile devices to increase their functionality.

DB2 Everyplace is available in two editions: DB2 Everyplace Database Edition and DB2 Everyplace Enterprise Edition. DB2 Everyplace Database Edition is designed to be used by Independent Software Vendors (ISVs) and application developers who wish to create powerful mobile and embedded applications that work with DB2 Everyplace database data stored directly on a mobile device. DB2 Everyplace Enterprise Edition is designed to

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 21: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

be a complete datacentric mobile synchronization server. This secure server is responsible for managing the distribution and synchronization of data between mobile device users and back-end data sources, such as DB2, Informix, Oracle, Sybase, and Microsoft SQL Server. (Synchronization is performed whenever a connection to the back-end data source is detected.)

◆ DB2 Express. DB2 Express Edition (or DB2 Express) is an entry-level data server that is designed to be used on microcomputers that have up to two CPUs (a dual-core processor is treated as a single CPU), up to 4 GB of memory, and are running a supported version of Linux, Solaris, or Windows. DB2 Express contains a rich feature set that will meet the needs of most deployments; for workloads or environments that require additional functionality, add-on features are available for an additional licensing fee.

◆ DB2 Express-C. DB2 Express-C is a no-charge, entry-level, data server that is designed to be used on microcomputers that have up to two CPUs, up to 4 GB of memory, and are running a supported version of Linux or Windows. DB2 Express-C is intended to be used for evaluation purposes and for the development/deployment of C, C++, Java, .NET, PHP, and XQuery applications. Essentially, DB2 Express-C is a subset of DB2 Express Edition with one exception: where pureXML is available as an add-on feature for DB2 Express, it is included with DB2 Express-C.

◆ DB2 Personal Edition. DB2 Personal Edition (PE) is a single-user, full-function, relational database management system that is ideal for desktop or laptop-based deployments. Databases under its control can be managed remotely, making it the perfect edition for occasionally connected or remote office implementations that do not require multiuser capability. With DB2 Personal Edition, a user can create, manipulate, and administer any number of local databases; however, each database created must reside on a storage medium that is managed by the PC that the DB2 software has been installed on. Remote clients cannot access databases that are under DB2 Personal Edition’s control, but PCs running DB2 Personal Edition can act as remote clients and access data stored on other DB2 servers. DB2 Personal Edition can be deployed on any PC that is running Linux or Windows — however, you must acquire a separate license for each user that will access a database under its control.

The DB2 Family 21

Page 22: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

22

Introduction to DB2 for Linux, UNIX, and Windows

◆ DB2 Workgroup Server Edition. DB2 Workgroup Server Edition (WSE) is a multiuser, full-function, client/server database management system designed to be used on microcomputers that have up to four CPUs, up to 16 GB of memory, and are running any of the following operating systems: AIX, HP-UX, Solaris, Linux (32-bit and 64-bit), Novell Enterprise Server, and Windows (32-bit and 64-bit).

DB2 Workgroup Server Edition includes all of the features of DB2 Express, while providing scalability to larger servers. Thus, it is the ideal data server for small- to medium-size business environments and departments that are comprised of a small number of internal users.

◆ DB2 Enterprise Server Edition. DB2 Enterprise Server Edition (ESE) is a multiuser, full-function, Web-enabled client/server database management system that easily scales to handle high-volume transaction processing, multiterabyte data warehouses, and mission-critical applications from vendors like SAP. It is designed to be used on any size server (from one to hundreds of CPUs) that is running any of the following operating systems: AIX, HP-UX, Solaris, Linux (32-bit and 64-bit), Novell Enterprise Server, and Windows (32-bit and 64-bit).

DB2 Enterprise Server Edition includes all of the functionality found in DB2 Workgroup Edition, plus features that are needed to handle high user loads and provide 24x7x365 availability, including:

• High Availability Disaster Recovery (HADR)

• Data partitioning

• Table (range) partitioning

• Online table and index reorganization

• Materialized Query Tables

• Multidimensional data clustering

• Full intra-query parallelism

• Connection Concentrator

• The DB2 Governor

• Tivoli System Automation for Multiplatforms (TSA MP)

DB2 Enterprise Server Edition also comes packaged with a tightly integrated connectivity product (DB2 Connect) that allows it to participate in heterogeneous networks using the Distributed

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 23: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Relational Database Architecture (DRDA) protocol. This allows up to five users to interact with iSeries and zSeries-based DB2 databases, Informix Dynamic Server (IDS) databases, and nondatabase host resources like CICS, VSAM, and IMS. Designed for midsize to large businesses, DB2 Enterprise Server Edition is the ideal foundation for building multiterabyte data warehouses, high-availability, high-volume On-Line Transaction Processing (OLTP) systems, or Web-based Business Intelligence (BI) solutions.

◆ DB2 pureScale. DB2 pureScale is a feature for DB2 Enterprise Server Edition that builds on familiar and proven design features from the IBM DB2 for z/OS database software (DB2 for z/OS). It leverages proven technology from DB2 for z/OS to bring active-active shared-disk technology to open systems. The DB2 pureScale feature offers the following key benefits:

• Practically unlimited capacity - DB2 pureScale provides practically unlimited capacity by allowing for the addition and removal of members on demand. DB2 pureScale can scale to 128 members and has a highly efficient centralized management facility that allows for very efficient scale-out capabilities. DB2 pureScale also leverages a technology called Remote Direct Memory Access (RDMA) that provides a highly efficient inter-node communication mechanism that also facilitates its scaling capabilities.

• Application transparency - An application that runs in a DB2 pureScale environment does not need to have any knowledge of the different members in the cluster or to be concerned about partitioning data. DB2 pureScale will automatically route applications to the members deemed most appropriate. DB2 pureScale also provides native support for a great deal of syntax used by other database vendors, allowing those applications to run in a DB2 pureScale environment with minimal or no changes.

• Continuous availability - DB2 pureScale provides a fully active-active configuration such that if one member goes down, processing can continue at the remaining active members. During a failure, only data being modified on the failing member is temporarily unavailable until database recovery completes for that set of data, which is very quick. This is in direct contrast to other competing solutions where an entire system freeze may occur as part of the database recovery process.

The DB2 Family 23

Page 24: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

24

Introduction to DB2 for Linux, UNIX, and Windows

• Reduced TCO - DB2 pureScale can help reduce TCO through its integrated and simplified deployment and maintenance capabilities. The DB2 pureScale interfaces handle the deployment and maintenance of components integrated within the DB2 pureScale Feature. This helps reduce what might amount to steep learning curves that would be associated with some of the competing technologies.

◆ DB2 Data Warehouse Edition. DB2 Data Warehouse Edition (DWE) is the top-of-the-line DB2 Edition for dynamic data warehousing. It is designed for today's data center environments where On-Line Transaction Processing (OLTP) and decision support are merged into integrated information management systems. This integrated platform for developing warehouse-based analytics includes core components for warehouse construction and administration as well as Web-based applications with embedded data mining and multidimensional Online Analytical Processing (OLAP).

The core engine for DB2 Data Warehouse Edition is DB2 Enterprise Server Edition and the DB2 Data Partitioning Feature. (DB2 Enterprise Server Edition includes data warehouse enhancing features such as materialized query tables, the starburst optimizer, and multidimensional clusters; the DB2 Data Partitioning Feature provides increased parallelism to aid in performing administration tasks, as well as scalability to support very large databases and complex workloads.)

◆ DB2 for i5/OS. DB2 for i5/OS is an advanced, 64-bit relational database management system that leverages the On-Demand capabilities of System i, such as Dynamic Logical Partitioning, to quickly respond to changing workloads in order to ensure business continuity in a dynamic environment. Unlike other DB2 editions, DB2 for i5/OS is built directly into the operating system. As a result, Version/Release naming will differ because DB2 for i5/OS follows the i5/OS version/release numbering scheme, and not the DB2 for Linux, UNIX, and Windows version/release scheme. The current level of DB2 for i5/OS is Version 6 Release 1 (V6R1).

DB2 for i5/OS’s cost-based query optimizer, unique single level store architecture, and database parallelism feature allow it to scale near-linearally within an iSeries' SMP configuration. And if additional functionality is needed, there are several utilities available (including utilities for data replication, parallel

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 25: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

processing, and query management) that can either be added to the core database functionality or that are included in the System i Enterprise Edition bundle.

◆ DB2 for z/OS. DB2 for z/OS is a multiuser, full-function, database management system that has been designed specifically for z/OS, IBM’s flagship mainframe operating system. For over four decades the IBM mainframe has been a leader in data and transaction serving; DB2 9 for z/OS builds on the value delivered by the IBM mainframe. DB2 9 for z/OS is designed to significantly cut IT infrastructure costs, streamline efforts to meet compliance obligations, and simplify data serving on the System z9 operating system.

The DB2 Family 25

Page 26: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

26

Introduction to DB2 for Linux, UNIX, and Windows

All of the DB2 Family editions available, along with the type of computing environment each edition is primarily designed for, can be seen in Figure 1.

Figure 1 DB2 family editions

ICO-IMG-000051

DB2 for z/OS

DB2 for i5/OS

DB2 Data Warehouse Edition

DB2 Workgroup Server EditionDB2 Enterprise Server Edition

DB2 ExpressDB2 Express-CDB2 Personal Edition

DB2 Everyplace

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 27: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

DB2’s comprehensive tool set With the exception of DB2 Everyplace, DB2 for i5/OS, and DB2 for z/OS, each edition of DB2 comes with a comprehensive set of tools designed to assist in administering and managing DB2 instances, databases, and database objects. The majority of these tools have a graphical user interface (GUI); however, most of the tasks that can be performed with the GUI tools available can also be performed by issuing equivalent DB2 commands from the operating system prompt, the DB2 Command Editor, or the DB2 Command Line Processor. Of this set, the tools that are used most often include:

◆ The Control Center

◆ The Command Editor

◆ The Configuration Assistant

◆ The Command Line Processor

IMPORTANT

The GUI tools available with version 9.7 have been deprecated and will be replaced with the Optim family of products in a future release.

The Control Center

Of all the DB2 GUI tools available, the Control Center is the most important and versatile. The Control Center presents a clear, concise view of an entire system and serves as the central point for managing DB2 systems and performing common administration tasks. With the Control Center, users can:

◆ Create and delete instances.

◆ Create and delete (drop) DB2 databases.

◆ Catalog and uncatalog databases.

◆ Configure instances and databases.

◆ Create, alter, and drop buffer pools, table spaces, tables, views, indexes, aliases, triggers, schemas, and user-defined data types (UDTs).

◆ Grant and revoke authorities and privileges.

DB2’s comprehensive tool set 27

Page 28: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

28

Introduction to DB2 for Linux, UNIX, and Windows

◆ Export, import, or load data.

◆ Reorganize tables and collect table statistics.

◆ Back up and restore databases and table spaces.

◆ Replicate data between systems.

◆ Manage database connections.

◆ Monitor resources and track events as they take place.

◆ Analyze queries.

◆ Schedule jobs to run unattended.

The Control Center interface presents itself using one of three different views:

◆ Basic. The basic view displays essential objects such as databases, tables, views, and stored procedures and limits the actions you can perform to those objects. This is the view you should use if you only want to perform core DB2 database operations.

◆ Advanced. The advanced view displays all objects available in the Control Center and allows you to perform all actions available. This is the view you should use if you are working in an enterprise environment and/or if you want to connect to DB2 for i5/OS or DB2 for z/OS.

◆ Custom. The custom view gives you the ability to tailor the object tree and actions allowed to meet your specific needs.

Figure 2 on page 29 shows how the Control Center looks on a Windows XP server when the advanced view is used.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 29: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 2 The Control Center (advanced view)

If you look closely at Figure 2, you will notice that the Control Center is comprised of the following elements:

◆ A menu bar, which allows users to perform any of the Control Center functions available.

◆ A toolbar, which can be used to launch the other DB2 GUI tools available. Figure 3 on page 30 identifies the tools that can be invoked directly from the Control Center toolbar.

ICO-IMG-000057

DB2’s comprehensive tool set 29

Page 30: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

30

Introduction to DB2 for Linux, UNIX, and Windows

Figure 3 The Control Center toolbar

It is important to note that every tool that can be invoked from the Control Center toolbar can also be invoked from the Control Center’s menu bar.

◆ An objects pane (located on the left-hand side of the Control Center), which contains a hierarchical representation of every object type that can be managed from the Control Center.

◆ A contents pane (located on the upper right-hand side of the Control Center), which contains a listing of existing objects that correspond to the object type selected in the objects pane. (For example, if the Tables object type were selected in the objects pane, a list of all tables available would be listed in the contents pane.)

◆ An objects details pane (located on the lower right-hand side of the Control Center), which contains detailed information about the object selected in the object tree or contents pane.

Control Center

Replication Center

Satellite AdministrationCenter

Command Editor

Task Center

Health Center

Journal

License Center

Configuration Assistant

Tools Settings

Legend

Help

ICO-IMG-000055

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 31: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

The Command EditorThe Command Editor is an interactive GUI application that is used to generate, edit, execute, and manipulate SQL statements and DB2 commands; to work with the resulting output; and to view a graphical representation of the access plan chosen for explained SQL statements. From the Command Editor, users can:

◆ Execute SQL statements, DB2 commands, and operating system commands — operating system commands must be preceded by an exclamation mark (!).

◆ View the results of the execution of SQL statements and DB2 commands and see the result data set produced in response to a query.

◆ Save the results of the execution of SQL statements and DB2 commands to an external file.

◆ Create and save a sequence of SQL statements and DB2 commands to a script file that can be invoked by the Task Center. (Such a script file can then be scheduled to run at a specific time or frequency.)

◆ Use the SQL Assist tool to build complex queries.

◆ Examine the execution plan and statistics associated with a SQL statement before (or after) it is executed.

Figure 4 on page 32 shows how the Command Editor looks on a Windows XP server after a database connection has been established.

DB2’s comprehensive tool set 31

Page 32: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

32

Introduction to DB2 for Linux, UNIX, and Windows

Figure 4 The Command Editor

As Figure 4 shows, the Command Editor is comprised of three individual pages (which are accessed by tabs): the Commands page, the Query Results page, and the Access Plan page. Users can enter and execute an SQL statement or a DB2 command, create and save a script, run an existing script, or schedule a task from the Commands page. Once a query has been executed, users can see the results, if any, on the Query Results page. And on the Access Plan page, users can see the access plan for any explainable statement that was specified on the Commands page. (If more than one SQL statement is specified on the Commands page, an access plan will be created only for the first statement encountered.)

ICO-IMG-000058

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 33: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

The Configuration AssistantThe Configuration Assistant is an interactive GUI application that allows users to configure clients so they can access databases stored on remote DB2 servers. In order to access an instance or database on another server/system, that system must first be cataloged in the node directory of the client workstation, and information about the remote database must be cataloged in the database directory (also on the client workstation). The Configuration Assistant provides a way to quickly catalog nodes and databases without having to know the inherent complexities involved with performing these tasks. And because the Configuration Assistant maintains a list of databases to which users/applications can connect, it can act as a lightweight alternative to the Control Center in situations where the complete set of GUI tools available has not been installed.

From the Configuration Assistant, users can:

◆ Catalog new databases.

◆ Work with or uncatalog existing databases.

◆ Bind applications.

◆ Set DB2 environment/registry variables.

◆ Configure the DB2 Database Manager instance.

◆ Configure ODBC/CLI parameters.

◆ Import and export configuration information.

◆ Change passwords.

◆ Test connections.

Figure 5 on page 34 shows how the Configuration Assistant might look on a Windows XP server.

DB2’s comprehensive tool set 33

Page 34: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

34

Introduction to DB2 for Linux, UNIX, and Windows

Figure 5 The Configuration Assistant

The Command Line ProcessorThe Command Line Processor (CLP) is a text-oriented application that allows users to issue DB2 commands, system commands, and SQL statements, as well as view the results of the statements/commands executed. The Command Line Processor can be run in three modes:

ICO-IMG-000059

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 35: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

◆ Command mode. When the Command Line Processor is run in command mode, the user simply enters a DB2 command or SQL statement, preceded by the characters “db2”, at the system prompt. (For example, the command CONNECT TO sample would be entered as db2 CONNECT TO sample.) If the command contains characters that have a special meaning to the operating system being used, it must be enclosed in quotation marks to ensure that it will be properly executed (for example, db2 "SELECT COUNT(*) FROM employee"). If the command to be executed is too long to fit on a single line, a space followed by the line continuation character (\) can be placed at the end of the line that is to be continued, and the rest of the command can follow on a new line.

◆ Interactive Input mode. When the Command Line Processor is run in interactive input mode, the “db2” prefix is automatically provided (as characterized by the db2 => input prompt) for each command/SQL statement entered. To run the Command Line Processor in interactive input mode, you simply enter the command “db2” at the system prompt. To exit out of interactive, you enter the command “quit” at the Command Line Processor prompt. Aside from that, the rules that apply to using the command mode of the Command Line Processor also apply to using the interactive input mode.

◆ Batch mode. When the Command Line Processor is run in batch mode, it is assumed that all commands and/or SQL statements to be executed have been stored in an ASCII-format text file. (The characters “db2” should not precede the commands/statements stored in this file.) To run the Command Line Processor in batch mode, you simply enter the command db2 –f xxxxxxxx (where xxxxxxxx is the name of the file that contains the set of commands that are to be executed) at the system prompt.

Figure 6 on page 36 shows how the Command Line Processor looks on a Windows XP server when it is run in interactive input mode.

DB2’s comprehensive tool set 35

Page 36: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

36

Introduction to DB2 for Linux, UNIX, and Windows

Figure 6 The Command Line Processor (in interactive input mode)

There are various command-line options that can be specified when the Command Line Processor is invoked; a list of all options available can be obtained by executing the command LIST COMMAND OPTIONS, either from the system prompt or the Command Line Processor prompt (when the Command Line Processor is ran in interactive input mode).

ICO-IMG-000060

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 37: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Server, instances, and databasesDB2 for Linux, UNIX, and Windows sees the world as a hierarchy of objects. Workstations (or servers) on which DB2 has been installed occupy the highest level of this hierarchy. During the installation process, program files for a background process known as the DB2 Database Manager are physically copied to a specific location on the server and an instance of the DB2 Database Manager is created. (The default instance for a particular system is defined by the DB2INSTANCE environment variable and this is the instance used for most operations.)

Instances occupy the second level in the hierarchy and are responsible for managing system resources and databases that fall under their control. Although only one instance is created initially, several instances can exist. Each instance behaves like a separate installation of DB2, even though all instances within a system share the same DB2 Database Manager program files (unless each instance is running a different version of DB2). And although multiple instances share the same binary code, each runs independently of the others and has its own environment, which can be modified by altering the contents of its associated configuration file.

Every instance controls access to one or more databases; databases make up the third level in the hierarchy and are responsible for managing the storage, modification, and retrieval of data. Like instances, databases work independently of each other. Each database has its own environment (also controlled by a set of configuration parameters), as well as its own set of grantable authorities and privileges to govern how users interact with the data and database objects it controls. From a user’s perspective, a database is a collection of tables (preferably related in some way) that are used to store data. However, from a database administrator’s viewpoint, a DB2 LUW database is much more; a database is an entity that is comprised of many physical and logical components. Some of these components help determine how data is organized, while others determine how and where data is physically stored. Figure 7 on page 38 shows the hierarchical relationship between systems, instances, and databases.

Server, instances, and databases 37

Page 38: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

38

Introduction to DB2 for Linux, UNIX, and Windows

Figure 7 Hierarchical relationship between systems, instances, and databases

The DB2 Administration Server (DAS) instanceThe tools that come with DB2, such as the Control Center and the Command Center, require a separate instance that operates independently of, yet concurrently with, all other instances that have been defined for a particular workstation. For this reason, a special instance, known as the DB2 Administration Server (DAS) instance, is also created as part of the DB2 installation process. In contrast to other instances, only one DAS instance can exist on a single workstation. (The DB2 global-level profile registry variable DB2ADMINSERVER contains the name of the DAS instance that has been defined for a particular workstation.)

ICO-IMG-000052

System

Instance 1

Instance 2

Database 1

Database 2

Database 1

DatabaseConfiguration File

DatabaseConfiguration File

DatabaseConfiguration File

DB2 Database ManagerConfiguration File

DB2 Database ManagerConfiguration File

DB2 DatabaseManagerProgram Files

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 39: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Once created, the DAS instance runs continuously as a background process whenever the system it was created on is online; the DAS instance is usually started automatically each time the workstation it resides on is booted. The DAS instance must be running on every DB2 server that you wish to administer remotely. That’s because, among other things, the DAS instance provides remote clients with the information needed to establish communications with other instances.

Note: To administer a server from a remote client, a user must have System Administration (SYSADM) authority for the DAS instance used. Furthermore, once a remote instance and database have been registered on a client workstation, the user must hold the authorities and privileges needed to perform administrative tasks.

In addition to enabling remote administration of DB2 servers, the DAS instance assists the Control Center and the Configuration Assistant in:

◆ Providing job (task) management, including the ability to schedule and run user-defined shell scripts/batch files that contain both DB2 and operating system commands.

◆ Scheduling jobs, viewing the results of completed jobs, and performing administrative tasks against jobs executed either remotely or locally (by using the Task Center).

◆ Providing a means for discovering information about the configuration of other DAS instances, DB2 instances, and databases using DB2 Discovery. (The Configuration Assistant and the Control Center use such information to simplify and automate the configuration of client connections to DB2 servers; neither tool will be able to “discover” a server if the DAS instance for that server is not running.)

IMPORTANT

The DB2 Administration Server (DAS) has been deprecated in version 9.7 and may be removed in a future release.

Server, instances, and databases 39

Page 40: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

40

Introduction to DB2 for Linux, UNIX, and Windows

Objects that make up a DB2 database environmentDB2 LUW uses both a logical and a physical storage model that is comprised of several different, yet related, objects. Four types of objects exist. They are:

◆ System objects. System objects consist of registry variables, instance configuration files, and individual database configuration files. Registry variables are set at the system level and can affect every instance that resides on a particular server. Instance configuration files (also known as DB2 Database Manager configuration files) are created and assigned to individual instances during the instance creation process. Values in an instance’s configuration file control how resources are allocated for that particular instance, and changes to them affect every database that falls under that instance’s control. Similarly, database configuration files are created and assigned to individual databases during the database creation process. Values in a database’s configuration file control how resources are allocated for that particular database and changes to them can impact performance and control resource utilization.

◆ Recovery objects. Recovery objects consist of transaction log files and recovery history files. By default, one recovery history file and three transaction log files are automatically created when a database is created. Recovery log files are used, together with database back up images and transaction log files, to coordinate database recovery operations. The recovery history file contains information about every back up operation executed, while transaction log files contain records of recent database operations performed. In the event a database has to be recovered from an application, user, or system error, events stored in the transaction log files can be replayed to return the database to a consistent and stable state, or to return a database to the state it was in up to the point in time that the error occurred – provided roll-forward recovery is enabled. You cannot modify transaction log files or recovery history files directly; however, you can control where transaction log files are physically stored.

◆ Storage objects. Storage objects control where data is physically stored and how data is moved between storage and memory during normal operation. Three types of storage objects are used. They are:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 41: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

• Buffer pools. A buffer pool is a section of memory that has been reserved for the sole purpose of caching data pages as they are read from physical storage. Whenever data is needed to resolve a query, the page the data is stored on is located in physical storage and transferred to a buffer pool, where it is then read and/or modified. If the page is modified, eventually it is copied back to physical storage; however, all pages read stay in memory until the space they occupy is needed or until all connections to the database are terminated. Furthermore, whenever a page of data is retrieved, the DB2 Database Manager uses a set of heuristic algorithms to try to determine which pages will be needed next and those pages are retrieved as well (this is referred to as prefetching). Page retention and prefetching are done to improve overall performance; data can be accessed much faster when it is stored in memory than when it is stored on disk.

• Containers. A container is some form of physical storage that the DB2 Database manager has reserved access to. A container can be a directory that may or may not already exist, a fixed-size, preallocated file that may or may not already exist, or a physical (raw) device that is recognized by the operating system. (On Linux and UNIX operating systems, a physical device can be any logical volume that uses a character special interface; on Windows operating systems, a physical device is any unformatted partition or any physical disk.)

• Table spaces. Table spaces are used to control where data is physically stored and to provide a layer of indirection between database objects (such as tables, indexes, and views) and one or more containers (that is, directories, files, or raw devices) in which the object’s data actually resides. A single table space can span many containers, but each container can only belong to one table space.

◆ Data (or database) objects. Data objects — otherwise known as database objects — are used to logically store and manipulate data, as well as to control how all user data (and some system data) is organized. Data objects include tables, indexes, views, aliases, schemas, triggers, user-defined data types, user-defined functions, and sequences.

Objects that make up a DB2 database environment 41

Page 42: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

42

Introduction to DB2 for Linux, UNIX, and Windows

Creating a DB2 LUW databaseThere are several ways to create a DB2 LUW database; the most common way is by using the Create Database Wizard or by executing the CREATE DATABASE command. In its simplest form, the syntax for the CREATE DATABASE command is:

CREATE [DATABASE | DB] [DatabaseName]

where:

◆ DatabaseName — Identifies a unique name that is to be assigned to the database once it is created.

The only value you must provide when executing this command is a name to assign to the new database. This name:

◆ Can consist of only the characters a through z, A through Z, 0 through 9, @, #, $, and _ (underscore);

◆ Cannot begin with a number;

◆ Cannot begin with the letter sequences “SYS,” “DBM,” or “IBM”; and

◆ Cannot be the same as the name already assigned to another database within the same instance.

When this form of the CREATE DATABASE command is executed, the characteristics of the database created, such as the storage location and transaction logging method used, are determined by several predefined defaults. If you wish to change any of the default characteristics, you must use a more complex form of the CREATE DATABASE command.

If you prefer using graphical user interfaces to typing long commands, you can use the Create Database Wizard to construct a DB2 LUW database. (The Create Database Wizard is designed to collect information that defines the characteristics of a database — and then create a database that has those characteristics. These same characteristics can be specified through the various options that are available with the CREATE DATABASE command.) The Create Database Wizard is invoked by selecting the appropriate action from the Databases menu found in the Control Center. Figure 8 on page 43 shows the Control Center menu items that must be selected to activate the Create Database Wizard; Figure 9 on page 44 shows what the first page of the Create Database Wizard looks like when it is first initiated.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 43: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 8 Invoking the Create Database Wizard from the Control Center

ICO-IMG-000061

Creating a DB2 LUW database 43

Page 44: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

44

Introduction to DB2 for Linux, UNIX, and Windows

Figure 9 The first page of the Create Database Wizard

Once the Create Database Wizard is displayed, you simply follow the directions shown on each panel presented to define the characteristics of the database that is to be created. When you have provided enough information for the DB2 Database Manager to create a database, the Finish button displayed in the lower-right corner of the wizard (see Figure 9) will be enabled. Once this button is selected, a database will be created using the information provided.

What happens when a DB2 LUW database is created

Regardless of how the process is initiated, whenever a new DB2 database (other than a DB2 pureScale database) is created, the following tasks are performed, in the order shown:

ICO-IMG-000062

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 45: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

1. All directories and subdirectories needed are created in the appropriate location.

Information about every DB2 database created is stored in a special hierarchical directory tree. Where this directory tree is actually created is determined by information provided with the CREATE DATABASE command — if no location information is provided, this directory tree is created in the location specified by the dftdbpath DB2 Database Manager configuration parameter associated with the instance under which the database is being created. The root directory of this hierarchical tree is assigned the name of the instance with which the database is associated. This directory will contain a subdirectory that has been assigned a name corresponding to the partition’s node. If the database is a partitioned database, this directory will be named NODExxxx, where xxxx is the unique node number that has been assigned to the partition; if the database is a nonpartitioned database, this directory will be named NODE0000. The node-name directory, in turn, will contain one subdirectory for each database that has been created, along with one subdirectory that includes the containers that are used to hold the database’s data.

The name assigned to the subdirectory that holds the containers used to house the database’s data is the same as that specified for the database; the name assigned to the subdirectory that contains the base files for the database corresponds to the database token that is assigned to the database during the creation process (the subdirectory for the first database created will be named SQL00001, the subdirectory for the second database will be named SQL00002, and so on). Figure 10 on page 46 illustrates how this directory hierarchy typically looks in a nonpartitioned database environment.

Creating a DB2 LUW database 45

Page 46: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

46

Introduction to DB2 for Linux, UNIX, and Windows

Figure 10 Typical directory hierarchy tree for a nonpartitioned database

IMPORTANT

Never attempt to modify this directory structure or any of the files stored in it. Such actions could destroy one or more databases or make them unusable.

ICO-IMG-000053

DATABASE_PATH

DATABASE_NAME

INSTANCE_NAME

NODEXXXX

T0000000

T0000001

C0000000.TMP

T0000002

SQL0000X

DB2EVENT

SQLOGDIR

db2rhist.ascdb2rhist.bakSQLBP.1SQLBP.2SQLDBCONSQLDBCONFSQLINSLKSQLOGCTL.LFHSQLOGMIR.LFHSQLSGF.1SQLSGF.2SQLSPCS.1SQLSPCS.2SQLTMPLK

Files needed for database recoveryand bookeeping tasks.

Directory for transaction log files.

Directory for event monitor data.

Database directory (name matches thedatabase token assigned to the database).

Directories containing file or sub-directorycontainers for the SYSCATSPACE, TEMPSPACE1, and USERSPACE1table spaces.

Directory with the name that was assigned to thedatabase.

Directory with the name of the node number assigned to thispartition (always NODE0000 if the database is nonpartitioned).

Directory with the name of the instance that controlsthe database.

Location specified when the database was created OR thevalue of the dftdbpath DBM configuration parameter.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 47: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

2. Files needed for management, monitoring, and database recovery are created.

After the subdirectory that was assigned the name of the database’s token is created, the following files are created in it:

• db2rhist.asc — This file contains historical information about back up operations, restore operations, table load operations, table reorganization operations, table space alterations, and similar database changes (i.e., the recovery history file).

• db2rhist.bak — This file is a back up copy of db2rhist.asc.

• SQLBP.1 — This file contains buffer pool information.

• SQLBP.2 — This file is a back up copy of SQLBP.1.

• SQLDBCON — This file contains database configuration information.

• SQLDBCONF — This file is a back up copy of SQLDBCON.

• SQLINSLK — This file contains information that is used to ensure that the database is assigned to only one instance of the DB2 Database Manager.

• SQLOGCTL.LFH — This file contains information about active transaction log files. Recovery operations use information stored in this file to determine how far back in the logs to begin the recovery process.

• SQLOGMIR.LFH — This file is a mirrored copy of SQLOGCTL.LFH.

• SQLSGF.1 — This file contains storage path information associated with automatic storage.

• SQLSGF.2 — This file is a back up copy of SQLSGF.1.

• SQLSPCS.1 — This file contains table space information.

• SQLSPCS.2 — This file is a back up copy of SQLSPCS.1.

• SQLTMPLK — This file contains information about temporary table spaces.

Two subdirectories named DB2EVENT and SQLOGDIR are also created; a detailed deadlocks event monitor is created and stored in the DB2EVENT subdirectory, and three files named S0000000.LOG, S0000001.LOG, and S0000002.LOG are created and stored in the SQLLOGDIR subdirectory. These three files are used to store transaction log records as SQL operations are performed against the database.

Creating a DB2 LUW database 47

Page 48: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

48

Introduction to DB2 for Linux, UNIX, and Windows

3. A buffer pool is created for the database.

During the database creation process, a buffer pool is created and assigned the name IBMDEFAULTBP. By default, on Linux and UNIX platforms, this buffer pool is 1,000 4 KB (kilobyte) pages in size; on Windows platforms, this buffer pool is 250 4 KB pages in size. The actual memory used by this buffer pool (and for that matter, by any other buffer pools that may exist) is allocated when the first connection to the database is established and freed when all connections to the database have been terminated.

4. Two regular table spaces and one system temporary table space are created.

Immediately after the buffer pool IBMDEFAULTBP is created, three table spaces are created and associated with this buffer pool. These three table spaces are as follows:

• A regular table space named SYSCATSPACE, which is used to store the system catalog tables and views associated with the database

• A regular table space named USERSPACE1, which is used to store all user-defined objects (such as tables, indexes, and so on) along with user data, index data, and long value data

• A system temporary table space named TEMPSPACE1, which is used as a temporary storage area for operations such as sorting data, reorganizing tables, and creating indexes

Unless otherwise specified, SYSCATSPACE and USERSPACE1 will be DMS FILE table spaces, and TEMPSPACE1 will be an SMS table space; characteristics for each of these table spaces can be provided as input to the CREATE DATABASE command or the Create Database Wizard.

5. The system catalog tables and views are created.

After the table space SYSCATSPACE is created, a special set of tables, known as the system catalog tables, are constructed within that table space. The DB2 Database Manager uses the system catalog tables to keep track of information such as database object definitions, database object dependencies, database object privileges, column data types, table constraints, and object relationships. A set of system catalog views is created along with the system catalog tables, and these views are typically used when accessing data stored in the system catalog tables. The system catalog tables and views cannot be modified with SQL

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 49: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

statements (however, their contents can be viewed). Instead, they are modified by the DB2 Database Manager whenever one of the following events occurs:

• A database object (such as a table, view, or index) is created, altered, or dropped.

• Authorizations or privileges are granted or revoked.

• Statistical information is collected for a table.

• Packages are bound to the database.

In most cases, the complete characteristics of a database object are stored in one or more system catalog tables when the object is created. However, in some cases, such as when triggers and constraints are defined, the actual SQL used to create the object is stored instead.

6. The database is cataloged in the system and local database directory (a system or local database directory is created first if it does not already exist).

DB2 uses a set of special files to keep track of where databases are stored and to provide access to those databases. Because the information stored in these files is used like the information stored in an office-building directory is used, they are referred to as directory files. Whenever a database is created, these directories are updated with the database’s name and alias. If specified, a comment and code set values are also stored in these directories.

7. The database configuration file for the database is initialized.

Some of the parameters in the database configuration file (such as code set, territory, and collating sequence) will be set using values that were specified as input for the CREATE DATABASE command or the Create Database Wizard; others are assigned system default values.

8. Four schemas are created.

Schemas are objects that are used to logically classify and group other objects in the database. Once the system catalog tables and views are created, the following schemas are created: SYSIBM, SYSCAT, SYSSTAT, and SYSFUN. A special user named SYSIBM is made the owner of each.

Creating a DB2 LUW database 49

Page 50: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

50

Introduction to DB2 for Linux, UNIX, and Windows

9. A set of utility programs are bound to the database.

Before some of the DB2 utilities available can work with a database, the packages needed to run those utilities must be created. Such packages are created by binding a set of predefined DB2 Database Manager bind files to the database (the bind files used are stored in the utilities bind list file db2ubind.lst).

10. Authorities and privileges are granted to the appropriate users.

To connect to and work with a particular database, a user must have the authorities and privileges needed to use that database. Therefore, unless otherwise specified, whenever a new database is created the following authorities and privileges are granted:

• Database Administrator (DBADM) authority as well as CONNECT, CREATETAB, BINDADD, CREATE_NOT_FENCED, IMPLICIT_SCHEMA, and LOAD privileges are granted to the user who created the database.

• USE privilege on the table space USERSPACE1 is granted to the group PUBLIC.

• CONNECT, CREATETAB, BINDADD, and IMPLICIT_SCHEMA privileges are granted to the group PUBLIC.

• SELECT privilege on each system catalog table is granted to the group PUBLIC.

• EXECUTE privilege on all procedures found in the SYSIBM schema is granted to the group PUBLIC.

• EXECUTE WITH GRANT privilege on all functions found in the SYSFUN schema is granted to the group PUBLIC.

• BIND and EXECUTE privileges for each successfully bound utility are granted to the group PUBLIC.

11. Several autonomic features are enabled.

To help make management easy, whenever a new database is created, the following autonomic features are enabled:

• Automatic Maintenance (database back up operations, table and index reorganization, data access optimization, and statistics profiling)

• Self-Tuning Memory Manager (package cache, locking memory, sort memory, database shared memory, and buffer pool memory)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 51: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

• Utility throttling

• The Health Monitor

12. The Configuration Advisor is launched.

The Configuration Advisor is a tool designed to help you tune performance and balance memory requirements for a database by suggesting which configuration parameters to modify based on information you provide about the database. In DB2 9.7, the Configuration Advisor is automatically invoked whenever you create a database, unless the default behavior is changed by assigning the value NO to the DB2_ENABLE_AUTOCONFIG_DEFAULT registry variable.

Creating a DB2 LUW database 51

Page 52: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

52

Introduction to DB2 for Linux, UNIX, and Windows

A closer look at table spacesEarlier, we saw that table spaces are used to control where data is physically stored and to provide a layer of indirection between database objects (such as tables, indexes, and views) and one or more containers, such as directories, files, or raw devices, in which the object’s data actually resides. Data is transferred to and from containers in 4 KB, 8 KB, 16 KB, or 32 KB blocks called pages and when a table space spans multiple containers, data is written in groups of pages called extents, in a round-robin fashion, to each container assigned to that table space. This helps balance data across all containers used. Figure 11 shows the relationship between pages, extents, and table space containers.

Figure 11 How data is written to table space containers

Tablespace 0

Extent 4

Extent 2

Extent 0

Container 0 Container 1

Data written inround-robin manner

1 Extent = 32 pages(Default)

1 Page

Extent 3

Extent 1

ICO-IMG-000054

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 53: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Note: When multiple containers are used to store an SMS table space’s data, the maximum amount of data that each container can hold is determined by the smallest container used. For example, if a table space uses one container that is 10 MB (megabytes) in size and a second container that is 12 MB in size, 2 MB of the second container will not be useable; the maximum amount of storage available to the table space will be 20 MB. Therefore, container sizes should be equal whenever possible.

Two types of table spaces can exist: System Managed Space (SMS) table spaces and Database Managed Space (DMS) table spaces. With SMS table spaces, only directory containers can be used for storage, and the operating system’s file manager is responsible for controlling how that space is used. The SMS storage model consists of many files (each representing a table, index, or long data object) that reside within the file system space — the user decides on the location of the files, the DB2 Database Manager assigns the files their names, and the file system is responsible for managing their growth. With DMS table spaces, only file and/or device containers can be used for storage, and the DB2 Database Manager is responsible for controlling how the space is used. In DB2 9.7, the initial allocation of space for an object in a DMS table space is two extents; the initial allocation of space for an object in an SMS table space is one extent.

Both SMS and DMS table spaces are classified according to the type of data they are intended to store; three classifications exist: regular, large, and temporary. Regular data and index data reside in regular table spaces, whereas long field data and large object data can reside in large table spaces — but only if DMS table spaces are used. (The use of large table spaces is optional given that large data can reside in regular table spaces as well.) Temporary table spaces are further classified as being either system temporary or user temporary — system temporary table spaces are used to store internal temporary data generated when some types of operations are performed (for example, sorting data, reorganizing tables, creating indexes, and joining tables), whereas user temporary table spaces are used to store declared global temporary tables, which in turn are used to store application-specific data for a brief period of time.

If a database is enabled for automatic storage, one other type of table space — an Automatic Storage (AS) table space — can exist. Although at first glance, AS table spaces appear to be a third type of table space, they are really just an extension of SMS and DMS table spaces: regular and large table spaces are created as DMS table spaces with one or more file containers; system and user temporary table

A closer look at table spaces 53

Page 54: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

54

Introduction to DB2 for Linux, UNIX, and Windows

spaces are created as SMS table spaces with one or more directory containers. Unlike when SMS and DMS table spaces are defined, no container definitions are needed for automatic storage table spaces; the DB2 Database Manager assigns containers to automatic storage table spaces automatically.

Some of the more common differences between SMS and DMS/AS table spaces can be seen in Table 1.

In the early days of DB2 LUW, DMS table spaces using raw devices as storage containers could deliver better performance than SMS table spaces or DMS table spaces using file containers. As technology has improved the performance gap between DMS table spaces using raw devices as storage containers and DMS table spaces using files as containers has narrowed to the point that IBM now recommends using DMS table spaces that rely on file containers. And starting in version 8.2, these types of table spaces can be configured to grow automatically, as needed.

Table 1 Differences between SMS and DMS/AS table spaces

SMS table spaces DMS/AS table spaces

Storage space is allocated and managed by the operating system’s file manager.

Storage space is allocated, if so specified, and managed by the DB2 Database Manager.

Only directory containers can be used for storage; file and device containers cannot be used.

File or device containers can be used as storage; directory containers cannot be used.

No additional containers can be added to a table space (using the ALTER TABLESPACE SQL statement) once it has been created.

Additional containers can be added to a table space after it has been created. When new containers are added, existing data can automatically be rebalanced across the new set of containers to retain optimal I/O efficiency.

Storage space is allocated as it is needed. Storage space is preallocated.

A container’s size cannot be changed once a table space has been created.

A container’s size can be increased or decreased after a table space has been created.

Regular data and long data are stored in the same table space.

Regular data and long data can be split across multiple table spaces (regular data can reside in one table space while long data resides in another).

Table spaces are easier to create and manage. Table access is slightly faster, so overall performance is better.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 55: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

With DB2 version 8.2 and later, it is also possible to create a DB2 database that uses automatic storage; when automatic storage is used, you simply assign one or more storage locations to the database and the DB2 Database Manager will build its table spaces across the pool of available storage.

Note: Ideally, a DB2 LUWdatabase deployed in a SAN environment will use either automatic storage or auto-resizing DMS file table spaces to house user data. Automatic storage, SMS, or fixed size DMS file table spaces should be used to store temporary data.

A closer look at table spaces 55

Page 56: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

56

Introduction to DB2 for Linux, UNIX, and Windows

Creating additional table spacesIt was mentioned earlier that when a DB2 database is created, one buffer pool named IBMDEFAULTBP is created, and three table spaces are created and associated with this buffer pool as part of the database initialization process. These three table spaces are sufficient for small databases; however, large databases are usually composed of many different buffer pool and table space objects. Additional table spaces can be created by executing the CREATE TABLESPACE SQL statement or by using the Create Table Space Wizard, which can be activated by selecting the appropriate action from the Table Spaces menu found in the Control Center. Figure 12 shows the Control Center menu items that must be selected to activate the Create Table Space Wizard; Figure 13 on page 57 shows how the first page of the Create Table Space Wizard might look like when it is first activated.

Figure 12 Invoking the Create Table Space Wizard from the Control Center

ICO-IMG-000063

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 57: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 13 The first page of the Create Table Space Wizard

Modifying existing table spacesBecause SMS table spaces rely on the operating system for physical storage space management, they rarely need to be modified after they have been successfully created. DMS table spaces, on the other hand, have to be monitored closely to ensure that the fixed-size preallocated file(s) or physical raw device(s) that they use for storage always have enough free space available to meet the database’s needs. When the amount of free storage space available to a DMS table space becomes dangerously low (typically less than 10 percent), you can add more free space either by increasing the size of one or more of its containers or by adding one or more new containers to it. Existing table space containers can be resized, new containers can be made available to an existing table space, and an existing table space’s properties can be changed by executing the ALTER TABLESPACE SQL statement.

ICO-IMG-000064

A closer look at table spaces 57

Page 58: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

58

Introduction to DB2 for Linux, UNIX, and Windows

Table spaces can also be altered using the Alter Table Space dialog box, which can be activated by selecting the appropriate action from the Table Spaces menu found in the Control Center. Figure 14 shows the Control Center menu items that must be selected in order to activate the Alter Table Space dialog box; Figure 15 on page 59 shows how the first page of the Alter Table Space dialog box might look like when it is first activated.

Figure 14 Invoking the Alter Table Space dialog box from the Control Center

ICO-IMG-000065

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 59: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 15 The first page of the Alter Table Space dialog box

Adding new containers to existing automatic storage table spacesEarlier, we saw that if a database is enabled for automatic storage, the container- and space-management characteristics of its table spaces are determined by the DB2 Database Manager. And although the ALTER TABLESPACE command can be used to add new containers to existing DMS table spaces, it cannot be used to add new containers to automatic storage stable spaces. So how can you add new storage paths to the collection of paths that are used for automatic storage table spaces once a database has been created? To perform this type of operation, you must use the ALTER DATABASE statement. The basic syntax for this statement is:

ALTER DATABASE [DatabaseName]ADD STORAGE ON ‘[Container]’ ,...)

where:

◆ DatabaseName — Identifies the database, by name, that is to have new containers added to its pool of containers that are used for automatic storage.

ICO-IMG-000066

A closer look at table spaces 59

Page 60: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

60

Introduction to DB2 for Linux, UNIX, and Windows

◆ Container — Identifies one or more new storage locations (containers) that are to be added to the collection of storage locations that are used for automatic storage table spaces.

Thus, if you wanted to add the storage locations /data/path1 and /data/path2 to a database named SAMPLE that is configured for automatic storage and resides on a UNIX system, you could do so by executing an ALTER DATABASE SQL statement that looks like this:

ALTER DATABASE sampleADD STORAGE ‘/data/path1’, ‘/data/path2’

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 61: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

A closer look at transaction loggingA transaction (also known as a unit of work) is a sequence of one or more SQL operations grouped together as a single unit, usually within an application process. The initiation and termination of a single transaction define points of data consistency within a database; either the effects of all operations performed within a transaction are applied to the database and made permanent (committed), or the effects of all operations performed are backed out (rolled back), and the database is returned to the state it was in before the transaction was initiated.

In most cases, transactions are initiated the first time an executable SQL statement is executed after a connection to a database has been made or immediately after a pre-existing transaction has been terminated. Once initiated, transactions can be implicitly terminated using a feature known as “automatic commit” (in which case, each executable SQL statement is treated as a single transaction, and any changes made by that statement are applied to the database if the statement executes successfully or are discarded if the statement fails), or they can be explicitly terminated by executing the COMMIT or the ROLLBACK SQL statement.

Transaction logging is a process that is used to keep track of changes made to a database by transactions, as they occur. Each time an update or a delete operation is performed, the page containing the record to be updated/deleted is retrieved from storage and copied to the appropriate buffer pool, where it is then modified by the update/delete operation. (If a new record is created by an insert operation, that record is created directly in the appropriate buffer pool.) Once the record has been modified (or inserted), a record reflecting the modification/insertion is written to the log buffer, which is simply a designated storage area in memory. (The actual amount of memory reserved for the log buffer is controlled by the logbufsiz database configuration parameter.) If an insert operation is performed, a record containing the new row is written to the log buffer; if a delete operation is performed, a record containing the row’s original values is written to the log buffer; and if an update operation is performed, a record containing the row’s original values, combined with the row’s new values, is written to the log buffer. (If replication has not been enabled, an Exclusive OR operation is performed using the “before” and “after” rows and the results are written to the log buffer.) These kinds of records, along with records

A closer look at transaction logging 61

Page 62: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

62

Introduction to DB2 for Linux, UNIX, and Windows

that indicate whether the transactions that were responsible for making the changes were committed or rolled back, make up the majority of the records stored in the log buffer.

Whenever buffer pool I/O page cleaners are activated (I/O page cleaners are special agents that are responsible for writing pages to disk at predetermined intervals), the log buffer becomes full, or a transaction is terminated (by being committed or rolled back), all records stored in the log buffer are immediately written to one or more log files stored on disk. This is done to minimize the number of log records that might get lost in the event a system failure occurs. As soon as all log records associated with a particular transaction have been externalized to one or more log files, the effects of the transaction itself are recorded in the database, such as executed against the appropriate table space containers for permanent storage. The modified data pages remain in memory, where they can be quickly accessed if necessary — eventually, they will be overwritten as newer pages are retrieved from storage. The transaction logging process can be seen in Figure 16 on page 63.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 63: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 16 The transaction logging process

Because multiple transactions may be working with a database at any given point in time, a single log file may contain log records that belong to several different transactions. Therefore, to keep track of which log records belong to which transactions, every log record is assigned a special “transaction identifier” that ties it to the transaction that created it. By using transaction IDs, log records associated with a particular transaction can be written to one or more log files at any time, without impacting data consistency — eventually, the execution of the COMMIT or ROLLBACK statement that terminates the transaction will be logged as well.

Because log records are externalized frequently and because changes made by a particular transaction are only externalized to the database when the transaction itself is successfully terminated, the ability to return a database to a consistent state after a failure occurs is guaranteed — when the database is restarted, log records are

4096

1024

Chicago

New York

4096

1024 / 2048

Chicago

New York

ICO-IMG-000056

INSERT INTO table1 VALUES (4096, ‘CHICAGO’)

UPDATE table1 SET col1 = 2048 WHERE col2 = ‘NEW YORK’COMMIT

Buffer pool Log buffer

Page containingrecord to be

changed

Transaction committedAND

Log buffer flushed to disk

Database

I/O Page Cleaners activatedLog Buffer fullTransaction committed

Log files

A closer look at transaction logging 63

Page 64: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

64

Introduction to DB2 for Linux, UNIX, and Windows

analyzed, and each record that has a corresponding COMMIT record is reapplied to the database; every record that does not have a corresponding COMMIT record is either ignored or backed out (which is why “before” and “after” information is recorded for all update operations).

Logging strategiesWhen a database is first created, three log files, known as primary log files, are allocated as part of the creation process. On Linux and UNIX platforms, these log files are 1,000 4K (kilobyte) pages in size; on Windows platforms, these log files are 250 4K pages in size. However, the number of primary log files used, along with the amount of data each is capable of holding, is controlled by the logprimary and logfilsiz parameters in the database's configuration file. The way in which all primary log files created are used is determined by the logging strategy chosen for the database. Two very different strategies, known as circular logging and archival logging, are available.

Circular loggingWhen circular logging is used, records stored in the log buffer are written to primary log files in a circular sequence. Log records are written to the current “active” log file, and when that log file becomes full, it is marked as “unavailable.” At that point, DB2 makes the next log file in the sequence the active log file and begins writing log records to it; when that log file becomes full, the process is repeated. In the meantime, as transactions are terminated and their effects are externalized to the database, their corresponding log records are released because they are no longer needed. When all records stored in an individual log file are released, that file is marked as being “reusable,” and the next time it becomes the active log file, its contents are overwritten with new log records.

Although primary log files are not marked reusable in any particular order (they are marked reusable when they are no longer needed), they must be written to in sequence. So what happens when the logging process cycles back to a primary log file that was marked as being “unavailable”? When this occurs, DB2 will allocate what is known as a secondary log file and begin writing log records to it. As soon as the secondary log file becomes full, DB2 will poll the primary log file again, and if its status is still “unavailable,” another secondary log file is allocated and filled. This process will continue until either the desired primary log file becomes “reusable” or the number of

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 65: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

secondary log files created matches the number of secondary log files allowed (designated by the logsecond database configuration parameter). If the former occurs, DB2 will begin writing log records to the appropriate primary log file, and logging will pick up where it left off in the logging sequence. In the meantime, log records stored in the secondary log files are eventually released, and when all connections to the database have been terminated, any secondary log files that were created are destroyed. On the other hand, if the maximum number of secondary log files allowed has been allocated, and the desired primary log file is still unavailable, all database activity will stop, and the following message will be generated:

SQL0964C The transaction log for the database is full.

With the default configuration, up to two secondary log files will be created if necessary and their size will be the same as that of each primary log file used. Circular logging is illustrated in Figure 17.

Figure 17 Circular logging

By default, when a new database is created, circular logging is the logging strategy used.

Primary log files

When a primary log file becomes full, the next file in the sequence is used

(provided it is marked “reusable”)

As long as the next primary log file in the sequence remains “unusable,” secondary

log files are allocated and used

ICO-IMG-000086

A closer look at transaction logging 65

Page 66: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

66

Introduction to DB2 for Linux, UNIX, and Windows

Archival loggingLike circular logging, when archival logging (also known as log retention logging) is used, log records stored in the log buffer are written to the primary log files that have been preallocated. However, unlike with circular logging, these log files are never reused. Instead, when all records stored in an individual log file are released, that file is marked as being “archived” rather than as being “reusable,” and the only time it is used again is if it is needed for a roll-forward recovery operation. As soon as an active log file becomes full, DB2 allocates a new log file, in sequence, and that file can be used as a primary or a secondary log file, depending on what is needed when that sequence number is hit. This process continues as long as there is sufficient disk space available.

Because any number of primary log files can exist when archival logging is used, they are classified according to their current state and storage location. Log files containing records associated with transactions that have not yet been committed or rolled back are known as active log files and reside in the active log directory (or device). Log files containing records associated with completed transactions (i.e., transactions that have been externalized to the database) that reside in the active log directory are known as online archive log files. Log files containing records that are associated with completed transactions that have been moved to a storage location other than the active log directory are known as offline archive log files. Offline archive files can be moved to their storage location automatically by assigning the appropriate value (USEREXIT, DISK, TSM, or VENDOR) to the logarchmeth1 or logarchmeth2 database configuration parameter. (In this case, DB2 will attempt to move log files to the archive location specified as soon as they become full.) Archival logging is illustrated in Figure 18 on page 67.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 67: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 18 Archival logging

It is important to note that if both the logarcmeth1 and the logarcmeth2 database configuration parameters are assigned values, DB2 will store copies of offline archive log files in two locations; both copies will be kept in sync.

Other logging considerationsAlong with specifying the logging strategy to employ, several database configuration parameters can be used to control a database's logging behavior. The following items should be taken into consideration when configuring a database for transaction log management.

Infinite loggingYou would think that you could avoid running out of log space simply by configuring a database to use a large number of secondary log files, if needed. However, the maximum number of primary and secondary log files allowed (logprimary + logsecond) is 256, and if the size of your log files is relatively small, you can still run out of log space quickly when transaction workloads become heavy. Furthermore, you want to avoid allocating a large number of secondary log files if possible because performance is impacted each time a log file has to be allocated. Ideally, you want to allocate enough primary log files to handle most situations, and you want to use just enough secondary log files to handle peaks in transaction workloads.

Active log directory Archive log directory

Online archivelog files

Activelog files

Offline archivelog files

ICO-IMG-000087

When all preallocated log files are filed, more log files are allocated and used.

Filed log files may be moved to a different storage location.

A closer look at transaction logging 67

Page 68: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

68

Introduction to DB2 for Linux, UNIX, and Windows

If you are concerned about running out of log space, and you want to avoid allocating a large number of secondary log files, you can configure a database to use what is known as infinite logging. To enable infinite logging for a database, you simply set the logsecond database configuration parameter to -1.

In order to use infinite logging, a database must be configured to use archival logging. This means that if a problem occurs and a long running transaction needs to be rolled back, DB2 may have to access one or more log files that have already been archived, which, in turn, will negatively impact performance. And if the database needs to be restarted and some of the log files needed have been archived, the recovery process may take longer. To control the impact infinite logging can have on rollback and recovery operations, you can limit the number of logs, or total log space that an active transaction can use by assigning appropriate values to the max_log and num_log_span database configuration parameters.

Log mirroringWith DB2 version 8.1 and later, you have the ability to configure a database such that DB2 will simultaneously create and update active log files in two different locations. If you store active log files in one location and mirror them in another, separate location, database activity can continue if a disk failure or human error causes log files in one location to become inaccessible. (Mirroring log files may also aid in database recovery.) To enable log file mirroring, you simply assign the fully qualified name of the mirror log location (path) to the mirrorlogpath database configuration parameter. Ideally, the mirror log path used should refer to a physical location (disk) that does not see a large amount of disk I/O and that is separate from the physical location used to store primary log files.

If an error is encountered during attempts to write to either the active log path or the mirror log path, DB2 will mark the failing path as “bad,” write a message to the administration notification log, and write subsequent log records to the remaining “good” log path only. When DB2 allocates storage for its next primary log file, it will make a second attempt to write to both log paths. If successful, dual logging will continue. If not, DB2 will not attempt to use the “bad” path again until the next log file is accessed for the first time. There is no attempt to synchronize the log paths, but DB2 keeps track of each access error that occurs, so that the correct paths will be used when log files are archived. If a failure occurs while writing to the remaining “good” path, the database shuts down.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 69: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Archival logging failoverEarlier, we saw that a database can be configured to use archival logging and that archived log files can be automatically moved from the active log directory to another location when they become full — provided the value USEREXIT, DISK, TSM, or VENDOR is assigned to the logarcmeth1 or the logarcmeth2 database configuration parameter. If a database has been configured to take advantage of this functionality and for some reason (for example, because of a media problem), the archived log files cannot be moved to either the primary or the secondary (if set) archive destination, they will remain in the active log directory until the problem is resolved. This behavior, in turn, can cause a database to run out of log space if the active log directory is not large enough to accommodate the archived log files being generated.

To prevent such a problem from occurring, DB2 can be configured to store archived log files in an alternate location if, for some reason, the primary location becomes unavailable or the log archival method chosen fails. To take advantage of this functionality, you simply assign the fully qualified name of an alternate storage location (path) to the failarchpath database configuration parameter. The location specified will act as a temporary storage area for the log files until the primary location or log archival method that failed becomes available again; at that time, any log files stored in the storage area will automatically be moved to the primary location.

Controlling how “disk full” errors are handledWhen archival logging is used and archived log files are not moved from the active log directory to another location, the disk where the active log directory resides can quickly become full. By default, when this happens, transactions will receive a disk full error and be rolled back. But what if, instead of the current transaction being terminated, you were given the chance to manually move or delete files to make more room available? That's the purpose behind the blk_log_dsk_ful database configuration parameter; if this parameter is set to YES, applications will hang if the DB2 Database Manager receives a disk full error when it attempts to create a new log file in the active log directory. The DB2 Database Manager will then attempt to create the log file every five minutes until it succeeds-after each attempt, a message is written to the Administration Notification Log. (The only way that you can confirm that an application is hung because of a disk full condition is to monitor this log.) Until the log file is successfully created, applications attempting to insert or update data

A closer look at transaction logging 69

Page 70: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

70

Introduction to DB2 for Linux, UNIX, and Windows

will not be permitted to commit their transactions. Read-only queries may not be directly affected; however, if a query needs to access data that is locked by an update request or a data page that is fixed in the buffer pool by the updating application, read-only queries will also appear to hang.

To resolve a disk full situation, you simply move old log files to another location or enlarge the current file system. As soon as the needed space becomes available, new log files can be created, and all hung applications will be able to continue processing.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 71: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Configuring a DB2 LUW database environmentEarlier, we saw that a DB2 database environment contains a set of system objects that are used to control how resources are allocated for a server, an instance, or a database. Along with the comprehensive set of registry variables, DB2 uses an extensive array of configuration parameters to control how system resources are allocated and utilized on behalf of an instance and a database. However, the default values provided for many of the registry variables and configuration parameters that make up these system objects were produced with very simple systems in mind. (The goal was for DB2 to run out of the box, on virtually any platform, not for DB2 to run optimally on the platform on which it is installed.) Thus, while the default values provided are sufficient to meet most needs, you can often improve overall system and application performance simply by changing the values of one or more registry variables and/or configuration parameters.

Configuring servers

During normal operation, the behavior of the DB2 Database Manager is controlled, in part, by a collection of values that define the DB2 operating environment. Some of these values are operating system environment variables, and others are special DB2-specific system-level values known as environment or registry variables. Registry variables provide a way to centrally control the database environment. Three different registry profiles are available, and each controls the database environment at a different level. The registry profiles available are as follows:

◆ The DB2 Global — Level Profile Registry. All machine-wide environment variable settings are kept in this registry; one global-level profile registry exists on each DB2 workstation. If an environment variable is to be set for all instances, this profile registry is used.

◆ The DB2 Instance — Level Profile Registry. The environment variable settings for a particular instance are kept in this registry; this is where the majority of the DB2 environment variables are set. (Values defined in this profile registry override any corresponding settings in the global-level profile registry.)

Configuring a DB2 LUW database environment 71

Page 72: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

72

Introduction to DB2 for Linux, UNIX, and Windows

◆ The DB2 Instance Node — Level Profile Registry. This profile registry level contains variable settings that are specific to a partition (node) in a multipartitioned database environment. (Values defined in this profile registry override any corresponding settings in the global-level and instance-level profile registries.)

Note: DB2 looks for environment variable values in the DB2 global-level profile registry first, then in the DB2 instance-level profile registry, and finally, in the DB2 instance node–level profile registry. (Additional values may be set in individual sessions, in which case DB2 will see these values last.)

A wide variety of registry variables are available, and they vary depending on the operating system being used. A complete listing can be found in Appendix B of the IBM DB2 Troubleshooting and Tuning Database Performance product documentation.

So how do you determine which registry variables have been set, and what they have been set to? Or more importantly, how do you assign values to one or more registry variables? One way is by executing the db2set system command. The basic syntax for this command is:

db2set<[Variable] = [Value]><-g | -gl | -i [InstanceName]><-all><-null><-r [InstanceName]><-n [DASNode] <-u [UserID] <-p [Password]>>> <-l | -lr><-v><-ul | -ur><-h | -?>

where:

◆ Variable — Identifies the registry variable whose value is to be displayed, set, or removed.

◆ Value — Identifies the value that is to be assigned to the registry variable specified. If no value is provided, but a registry variable is specified, the registry variable specified is deleted.

◆ InstanceName — Identifies the instance profile with which the specified registry variable is associated.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 73: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

◆ DASNode — Identifies the name of the node where the DB2 Administration Server instance resides.

◆ UserID — Identifies the authentication ID that will be used to attach to the DB2 Administration Server instance.

◆ Password — Identifies the password (for the authentication ID) that will be used to attach to the DB2 Administration Server instance.

All other options shown with this command are described in Table 2.

Table 2 db2set command options (page 1 of 2)

Option Meaning

-g Indicates that a global profile variable is to be displayed, set, or removed.

-gl Indicates that a global profile variable stored in LDAP is to be displayed, set, or removed. This option is only effective if the registry variable DB2_ENABLE_LDAP has been set to YES.

-i Indicates that an instance profile variable is to be displayed, set, or removed.

-all Indicates that all occurrences of the registry variable, as defined in the following, are to be displayed: • The environment (denoted by [-e])• The node-level registry (denoted by [-n])• The instance-level registry (denoted by [-i])• The global-level registry (denoted by [-g])

-null Indicates that the value of the variable at the specified registry level is to be set to NULL.

-r Indicates that the profile registry for the given instance is to be reset.

-n Indicates that a remote DB2 Administration Server instance node name is specified.

-u Indicates that an authentication ID that will be used to attach to the DB2 Administration Server instance is specified.

-p Indicates that a password for the authentication ID specified is provided.

-l Indicates that all instance profiles will be listed.

-lr Indicates that all registry variables supported will be listed.

-v Indicates that the db2set command is to be executed in verbose mode.

Configuring a DB2 LUW database environment 73

Page 74: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

74

Introduction to DB2 for Linux, UNIX, and Windows

It is important to note that if the db2set command is executed without options, a list containing every registry variable that has been set for the current (default) instance, along with its value, will be returned.

Thus, if you wanted to find out which registry variables have been set for each profile available, you could do so by executing a db2set command that looks like this:

db2set -all

On the other hand, if you wanted to see the current value of the DB2_PARALLEL_IO registry variable for all DB2 instances, you could do so by executing a db2set command that looks something like this:

db2set –l DB2_PARALLEL_IO

And finally, if you wanted to assign the value 7 to the DB2_PARALLEL_IO registry variable for all DB2 instances on a server, you could do so by executing a db2set command that looks something like this:

db2set -g DB2_PARALLEL_IO=7

Another way to view and/or change registry variable settings is by using a tool known as the DB2 Registry management tool. The DB2 Registry management tool is activated by selecting the DB2 Registry action from the Configure menu found in the Configuration Assistant. Figure 19 on page 75 shows the Configuration Assistant menu items that must be selected in order to activate the DB2 Registry management tool. Figure 20 on page 76 shows how the main dialog box of the DB2 Registry management tool might look after it has been activated.

-ul Accesses the user profile variables. (This option is supported only on Windows operating systems.)

-ur Refreshes the user profile variables. (This option is supported only on Windows operating systems.)

-h | -? Displays help information. When this option is specified, all other options are ignored, and only the help information is displayed.

Table 2 db2set command options (page 2 of 2)

Option Meaning

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 75: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 19 Invoking the DB2 Registry management tool from the Configuration Assistant

ICO-IMG-000067

Configuring a DB2 LUW database environment 75

Page 76: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

76

Introduction to DB2 for Linux, UNIX, and Windows

Figure 20 DB2 Registry management tool dialog box

ICO-IMG-000068

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 77: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Configuring instancesWhenever an instance is created, a corresponding DB2 Database Manager configuration file is also created and initialized as part of the instance creation process. Each DB2 Database Manager configuration file is made up of approximately 85 different parameter values, and most control the amount of system resources that are allocated to a single DB2 Database Manager instance.

You can view the contents of the DB2 Database Manager configuration file for the current instance by executing the GET DATABASE MANAGER CONFIGURATION command. The syntax for this command is:

GET [DATABASE MANAGER | DB MANAGER | DBM] [CONFIGURATION | CONFIG | CFG]<SHOW DETAIL>

Thus, if you wanted to view the contents of the DB2 Database Manager configuration file for the current instance, you could do so by executing a GET DATABASE MANAGER CONFIGURATION command that looks like this:

GET DBM CFG

You can change the value assigned to a particular DB2 Database Manager configuration file parameter for the current instance by executing the UPDATE DATABASE MANAGER CONFIGURATION command. The syntax for this command is:

UPDATE [DATABASE MANAGER | DB MANAGER | DBM] [CONFIGURATION | CONFIG | CFG]USING [[Parameter] [Value] | [Parameter] [Value] AUTOMATIC | [Parameter] AUTOMATIC | [Parameter] MANUAL ,...]<IMMEDIATE | DEFERRED>

where:

◆ Parameter — Identifies one or more DB2 Database Manager configuration parameters (by keyword) whose values are to be modified. (In many cases, the keyword for a parameter is the same as the parameter name itself.)

◆ Value — Identifies the new value or values that are to be assigned to the DB2 Database Manager configuration parameter(s) specified.

Configuring a DB2 LUW database environment 77

Page 78: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

78

Introduction to DB2 for Linux, UNIX, and Windows

If the AUTOMATIC keyword is specified as the value for a particular parameter, DB2 will automatically adjust the parameter value to reflect the current resource requirements. If a value is specified along with the AUTOMATIC keyword, the value provided may influence the automatic calculations performed.

If the DEFERRED clause is specified with the UPDATE DATABASE MANAGER CONFIGURATION command, changes made to the DB2 Database Manager configuration file will not take effect until the instance is stopped and restarted. If the IMMEDIATE clause is specified instead, or if neither clause is specified, all changes made to the DB2 Database Manager configuration file will take effect immediately — provided that the necessary resources required are available.

So if you wanted to configure the current instance such that the maximum number of applications that can be executing concurrently at any given point in time is 100, you could do so by executing an UPDATE DATABASE MANAGER CONFIGURATION command that looks like this:

UPDATE DBM CFG USING MAXCAGENTS 100

The contents of a DB2 Database Manager configuration file can also be viewed or altered using the DBM Configuration dialog box, which can be activated by selecting the Configure Parameters action from the Instances menu found in the Control Center. Figure 21 on page 79 shows the Control Center menu items that must be selected to activate the DBM Configuration dialog box. Figure 22 on page 80 shows how this dialog box might look after it has been activated.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 79: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 21 Invoking the DBM Configuration dialog box from the Control Center

ICO-IMG-000069

Configuring a DB2 LUW database environment 79

Page 80: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

80

Introduction to DB2 for Linux, UNIX, and Windows

Figure 22 DBM Configuration dialog box

Configuring databases

Just as a DB2 Database Manager configuration file is created and initialized whenever a new instance is created, a database configuration file is created and initialized each time a new database is created. Each database configuration file is made up of several different parameters, and just as most DB2 Database Manager instance configuration parameters control the amount of system resources that will be allocated to a single DB2 Database Manager

ICO-IMG-000070

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 81: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

instance, many of the database configuration file parameters control the amount of system resources that will be allocated to a database during normal operation.

The contents of the database configuration file for a particular database can be displayed by executing the GET DATABASE CONFIGURATION command. The syntax for this command is:

GET [DATABASE | DB] [CONFIGURATION | CONFIG | CFG]FOR [DatabaseAlias]<SHOW DETAIL>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database that configuration information is to be displayed for.

Thus, if you wanted to view the contents of the database configuration file for a database named SAMPLE, you could do so by executing a GET DATABASE CONFIGURATION command that looks like this:

GET DB CFG FOR sample

The value assigned to a particular database configuration file parameter can be changed by executing the UPDATE DATABASE CONFIGURATION command. The syntax for this command is:

UPDATE [DATABASE | DB] [CONFIGURATION | CONFIG | CFG]FOR [DatabaseAlias]USING [[Parameter] [Value] | [Parameter] [Value] AUTOMATIC | [Parameter] AUTOMATIC | [Parameter] MANUAL ,...]<IMMEDIATE | DEFERRED>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database for which configuration information is to be modified.

◆ Parameter — Identifies one or more database configuration parameters (by keyword) whose values are to be modified. (In many cases, the keyword for a parameter is the same as the parameter name itself.)

◆ Value — Identifies the new value(s) that are to be assigned to the database configuration parameter(s) specified.

Configuring a DB2 LUW database environment 81

Page 82: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

82

Introduction to DB2 for Linux, UNIX, and Windows

Once again, if the AUTOMATIC keyword is specified as the value for a particular parameter, DB2 will automatically adjust the parameter value to reflect the current resource requirements. If a value is specified along with the AUTOMATIC keyword, the value provided may influence the automatic calculations performed.

If the DEFERRED clause is specified with the UPDATE DATABASE CONFIGURATION command, changes made to the database configuration file will not take effect until all connections to the corresponding database have been terminated and a new connection is established. If the IMMEDIATE clause is specified instead, or if neither clause is specified, all changes made to the database configuration file will take effect immediately — provided the necessary resources are available. (Applications running against a database at the time database configuration changes are made will see the change the next time an SQL statement is executed.)

So if you wanted to configure a database named SAMPLE such that any application connected to the database will wait up to 100 seconds to acquire a lock before rolling back the current transaction, you could do so by executing an UPDATE DATABASE CONFIGURATION command that looks like this:

UPDATE DB CFG FOR sample USING LOCKTIMEOUT 100

You can view or alter the contents of a database configuration file by using the Database Configuration dialog box, which can be activated by selecting the Configure Parameters action from the Databases menu found in the Control Center. Figure 23 on page 83 shows the Control Center menu items that must be selected to activate the Database Configuration dialog box. Figure 24 on page 84 shows how this dialog box might look after it has been activated.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 83: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Introduction to DB2 for Linux, UNIX, and Windows

Figure 23 Invoking the Database Configuration dialog box from the Control Center

ICO-IMG-000071

Configuring a DB2 LUW database environment 83

Page 84: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

84

Introduction to DB2 for Linux, UNIX, and Windows

Figure 24 Database Configuration dialog box

ICO-IMG-000072

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 85: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

2

This chapter introduces the EMC foundation products, some of which are discussed in this TechBook, that work in combined Symmetrix and open systems environments:

◆ Introduction ........................................................................................ 86◆ Symmetrix hardware and EMC Enginuity features...................... 88◆ EMC Solutions Enabler base management .................................... 93◆ EMC Change Tracker......................................................................... 96◆ EMC Symmetrix Remote Data Facility ........................................... 97◆ EMC TimeFinder .............................................................................. 115◆ EMC Replication Manager.............................................................. 130◆ EMC Storage Resource Management............................................ 133◆ EMC PowerPath ............................................................................... 137◆ EMC Open Replicator ..................................................................... 139◆ EMC Virtual Provisioning............................................................... 140◆ EMC Fully Automated Storage Tiering (FAST)........................... 144

EMC FoundationProducts

EMC Foundation Products 85

Page 86: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

86

EMC Foundation Products

IntroductionEMC provides many hardware and software products that support application environments on Symmetrix® storage systems. The following products, which are highlighted and discussed, have been used and/or tested with DB2 for Linux, UNIX, and Windows databases.

EMC® Symmetrix — EMC offers an extensive product line of high-end storage solutions targeted to meet the requirements of mission-critical databases and applications. The Symmetrix product line includes the EMC Symmetrix VMAX™ Series with Enginuity™, the Symmetrix DMX™ Direct Matrix Architecture® systems and earlier Symmetrix system array models. The EMC Symmetrix array is a fully redundant, high-availability storage processor, providing nondisruptive component replacements and code upgrades. Symmetrix arrays features high levels of performance, data integrity, reliability, and availability.

EMC Enginuity Operating Environment — Enginuity enables interoperation between the latest Symmetrix platforms and previous generations of Symmetrix systems and enables them to connect to a large number of server types, operating systems and storage software products, and a broad selection of network connectivity elements and other devices, ranging from HBAs and drivers to switches and tape systems.

EMC Solutions Enabler — Solutions Enabler is a package that contains the SYMAPI runtime libraries and the SYMCLI command line interface. SYMAPI provides the interface to the EMC Enginuity operating environment; SYMCLI is a set of commands that can be invoked from the command line or within scripts. These commands can be used to monitor device configuration and status and to perform control operations on devices and data objects within a storage complex.

EMC Change Tracker — EMC Symmetrix Change Tracker software measures changes to data on a Symmetrix volume or group of volumes. Change Tracker software is often used as a planning tool in the analysis and design of configurations that use the EMC TimeFinder or SRDF components to store data at remote sites.

EMC Symmetrix Remote Data Facility (SRDF®) — SRDF is a business continuity software solution that replicates and maintains a mirror image of data at the storage block level in a remote Symmetrix

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 87: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

system. The SRDF component extends the basic SYMCLI command set of Solutions Enabler to include commands that specifically manage SRDF.

EMC SRDF consistency groups — An SRDF consistency group is a collection of related Symmetrix devices that are configured to act in unison to maintain data integrity. The devices in consistency groups can be spread across multiple Symmetrix systems.

EMC TimeFinder® — TimeFinder is a family of products that enable LUN-based replication within a single Symmetrix system. Data is copied from Symmetrix devices using array-based resources without using host CPU or I/O. The source Symmetrix devices remain online for regular I/O operations while the copies are created.

Solutions Enabler Storage Resource Management (SRM) component — The SRM component extends the basic SYMCLI command set of Solutions Enabler to include commands that allow users to systematically find and examine attributes of various objects on the host, within a specified relational database, or in the EMC enterprise storage. The SRM commands provide mapping support for relational databases, file systems, logical volumes and volume groups, as well as performance statistics.

EMC PowerPath® — PowerPath is host-based software that provides I/O path management. PowerPath operates with several storage systems, on several enterprise operating systems and provides failover and load balancing transparent to the host application and database.

Symmetrix management software — Enginuity and array-based applications like SRDF and TimeFinder reside in the Symmetrix array and can be managed by host applications. EMC Solutions Enabler includes a CLI interface for SRDF, TimeFinder, device configuration, device mapping, and device masking. Symmetrix Management Console (SMC) provides a browser-based GUI interface on top of Solutions Enabler. EMC Ionix™ ControlCenter® Symmetrix Manager is a central feature of the EMC ControlCenter family of products, which provides a unified view for multiple arrays using a single-pane-of-glass interface. Symmetrix Manager is used to discover, monitor, and configure Symmetrix storage from a single console including the ability to automate key system management, and replication tasks.

Introduction 87

Page 88: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

88

EMC Foundation Products

Symmetrix hardware and EMC Enginuity featuresSymmetrix hardware architecture and the EMC Enginuity operating environment are the foundation for the Symmetrix storage platform. This environment consists of the following components:

◆ Symmetrix hardware

◆ Enginuity-based operating functions

◆ Solutions Enabler

◆ Symmetrix application program interface (API) for mainframe

◆ Symmetrix-based applications

◆ Host-based Symmetrix applications

◆ Independent software vendor (ISV) applications

All Symmetrix systems provide advanced data replication capabilities, full mainframe and open systems support, and flexible connectivity options, including Fibre Channel, FICON, ESCON, Gigabit Ethernet, and iSCSI.

Interoperability between Symmetrix storage systems enables customers to migrate storage solutions from one generation to the next, protecting their investment even as their storage demands expand.

Symmetrix enhanced cache director technology allows configurations of up to 512 GB of cache. The cache can be logically divided into 32 independent regions providing up to 32 concurrent 500 MB/s transaction throughput.

The Symmetrix on-board data integrity features include:

◆ Continuous cache and on-disk data integrity checking and error detection/correction

◆ Fault isolation

◆ Nondisruptive hardware and software upgrades

◆ Automatic diagnostics and phone-home capabilities

At the software level, advanced integrity features ensure information is always protected and available. By choosing a mix of RAID 1 (mirroring), RAID 1/0, high performance RAID 5 (3+1 and 7+1)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 89: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

protection and RAID 6, users have the flexibility to choose the protection level most appropriate to the value and performance requirements of their information.

From the perspective of the host operating system, a Symmetrix system appears to be multiple physical devices connected through one or more I/O controllers. The host operating system addresses each of these devices using a physical device name. Each physical device includes attributes, vendor ID, product ID, revision level, and serial ID. The host physical device maps to a Symmetrix device. In turn, the Symmetrix device is a virtual representation of a portion of the physical disk called a hypervolume.

Symmetrix VMAX platform

The EMC Symmetrix VMAX Series with Enginuity is the newest addition to the Symmetrix family, and the first high-end system purpose-built for the virtual data center. Based on the Virtual Matrix Architecture™, the Symmetrix VMAX system scales performance and capacity to unprecedented levels, delivers nondisruptive operations, and greatly simplifies and automates the management and protection of information. Advanced tiering via Enterprise Flash, Fibre Channel, and SATA drives allows users to ensure that the right data is on the right storage tier at the right cost.

At the heart of the Symmetrix VMAX system is the Virtual Matrix Architecture, designed to break through the physical boundaries of fixed backplane storage architectures — in a system that can scale to dozens of PBs, support thousands of virtual servers, deliver millions of IOPs, and provide 24x7xforever availability.

The advantages of this unique scale-out architecture, along with new Enginuity operating environment capabilities, are critical for customers transitioning to more of a virtual data center infrastructure. The ability to dynamically scale, while dramatically simplifying and automating operational tasks, is critical to addressing the infrastructure requirements and driving down cost in both virtual and physical deployments.

Design overviewThe Symmetrix VMAX system design is based on a highly available VMAX system engine with redundant CPU, memory, and connectivity on two directors for fault tolerance. Symmetrix VMAX system engines connect to and scale-out linearly through the Virtual

Symmetrix hardware and EMC Enginuity features 89

Page 90: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

90

EMC Foundation Products

Matrix Architecture, which allows resources to be shared within and across Symmetrix VMAX system engines. To meet growth requirements, additional engines can be added nondisruptively for efficient and dynamic scaling of capacity and performance that is available to any application on demand. Figure 25 illustrates the architecture and interconnection of the major components in the Symmetrix VMAX storage system.

The Symmetrix VMAX system is the only high-end platform with multi-core processors providing maximum performance and energy-efficient capabilities in each Symmetrix VMAX system engine. This unique feature allows the single engine Symmetrix VMAX system configurations to deliver significantly more performance in a smaller footprint than any other storage array.

Figure 25 EMC Symmetrix VMAX Series with Enginuity

Each Symmetrix VMAX system engine (Figure 25, right example) contains two directors with extensive CPU processing power, global cache memory, and a Virtual Matrix Interface for inter-director communications.

Virtual matrix interconnect Symmetrix VMAX enginesICO-IMG-000752

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 91: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

The Symmetrix VMAX system engines are configurable to provide maximal and flexible host connectivity and back-end physical drive loops. Front-end port configurations are Fibre Channel, iSCSI and FICON for host connections and Fibre Channel and Gigabit Ethernet for remote replication. Speeds auto-negotiate between 1 and 4 Gigabit per second based on the connection types.

The processing power is provided by dual quad-core 2.33 GHZ Xeon processors from Intel. Each director includes up to 64 GB of memory using eight Cache Memory Modules. Current memory module sizes are 2 GB, 4 GB, and 8 GB, which provide a total capacity of 16, 32, and 64 GB per director or a maximum of 128 GB of physical memory per Symmetrix VMAX system.

To enable multiple director boards and instances to work together as a single system, a high-bandwidth, low latency, nonblocking communication matrix is used. The Symmetrix VMAX Virtual Matrix Interconnect is implemented using the industry-standard Rapid IO (RIO) protocol through two redundant switching elements. On the physical director board, two separate sets of eight lanes of PCI-Express are converted to RIO by the Virtual Matrix Interface. The Matrix Interface Board Enclosure (MIBE) contains two independent matrix switches that provide point-to point communications between directors. This redundant matrix is used for mirrored writes across directors and for other inter-director signaling and communications.

The Symmetrix VMAX Series provides a distributed architecture that provides near infinite scalability while maintaining a single system to manage. Through the use of the high-speed interconnect, the Symmetrix VMAX system provides the building blocks for EMC high-performance storage systems. This has transformed enterprise storage and is the baseline for how current and future storage systems will be measured.

While the benefits of moving to a distributed architecture are numerous and well understood, it is also a fact that distributed system are typically very difficult to manage. The glue that keeps the distributed architecture of the Symmetrix VMAX system operating as a single system is the Enginuity operating environment.

Many of the new features provided by the new EMC Symmetrix VMAX platform can reduce operational costs for customers deploying DB2 for Linux, UNIX, and Windows environments, as well as enhance functionality to enable greater benefits.

Symmetrix hardware and EMC Enginuity features 91

Page 92: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

92

EMC Foundation Products

EMC Enginuity operating environmentEMC Enginuity is the operating environment for all Symmetrix storage systems. Enginuity manages and ensures the optimal flow and integrity of data through the different hardware components. It also manages Symmetrix operations associated with monitoring and optimizing internal data flow. This ensures the fastest response to the user's requests for information, along with protecting and replicating data. Enginuity provides the following services:

◆ Manages system resources to intelligently optimize performance across a wide range of I/O requirements.

◆ Ensures system availability through advanced fault monitoring, detection, and correction capabilities and provides concurrent maintenance and serviceability features.

◆ Offers the foundation for specific software features available through EMC disaster recovery, business continuity, and storage management software.

◆ Provides functional services for both Symmetrix-based functionality and for a large suite of EMC storage application software.

◆ Defines priority of each task, including basic system maintenance, I/O processing, and application processing.

◆ Provides uniform access through APIs for internal calls, and provides an external interface to allow integration with other software providers and ISVs.

The Enginuity operating environment for Symmetrix version 5874 is a feature-rich Enginuity release supporting Symmetrix VMAX storage arrays. With the release of Enginuity 5874, Symmetrix VMAX systems deliver new software capabilities that improve capacity utilization, ease of use, business continuity and security.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 93: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC Solutions Enabler base managementThe EMC Solutions Enabler kit contains all the base management software necessary to provide a host with SYMAPI-shared libraries and the basic Symmetrix command line interface (SYMCLI). Other optional subcomponents in the Solutions Enabler (SYMCLI) series enable users to extend functionality of their Symmetrix systems. Three principle sub-components are:

◆ Solutions Enabler SYMCLI SRDF, SRDF/CG, and SRDF/A

◆ Solutions Enabler SYMCLI TimeFinder/Mirror, TimeFinder/CG, TimeFinder/Snap, TimeFinder/Clone

◆ Solutions Enabler SYMCLI Storage Resource Management (SRM)

These components are discussed later in this chapter.

SYMCLI resides on a host system and is used to perform control operations on devices and data objects on Symmetrix storage arrays. SYMCLI commands are invoked from the host operating system command line or via scripts; when executed, SYMCLI commands invoke low-level channel commands to specialized devices on the Symmetrix called gatekeepers. Gatekeepers are very small devices carved from disks in the Symmetrix that act as SCSI targets for the SYMCLI commands.

SYMCLI commands are also used to monitor device configuration and the status of devices that make up the storage environment. To reduce the number of inquiries from the host to a Symmetrix system, configuration and status information is maintained in a host database file.

Table 3 lists some of the more common SYMCLI base commands.

Table 3 SYMCLI base commands (page 1 of 3)

Command Argument Description

symdg Performs operations on a device group (dg)

create Creates an empty device group

delete Deletes a device group

rename Renames a device group

release Releases a device external lock associated with all devices in a device group

EMC Solutions Enabler base management 93

Page 94: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

94

EMC Foundation Products

list Displays a list of all device groups known to this host

show Shows detailed information about a device group and any gatekeeper or BCV devices associated with the device group

symcg Performs operations on a composite group (cg)

create Creates an empty composite group

add Adds a device to a composite group

remove Removes a device from a composite group

delete Deletes a composite group

rename Renames a composite group

release Releases a device external lock associated with all devices in a composite group

hold Hold devices in a composite group

unhold Unhold devices in a composite group

list Displays a list of all composite groups known to this host

show Shows detailed information about a composite group, and any gatekeeper or BCV devices associated with the group

symld Performs operations on a device in a device group

add Adds devices to a device group and assigns the device a logical name

list Lists all devices in a device group and any associated BCV devices

remove Removes a device from a device group

rename Renames a device in the device group

show Shows detailed information about a device in a the device group

symbcv Performs support operations on BCV pairs

list Lists BCV devices

Table 3 SYMCLI base commands (page 2 of 3)

Command Argument Description

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 95: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

associate Associates BCV devices to a device group – required to perform operations on the BCV device

disassociate Disassociates BCV devices from a device group

associate –rdf Associates remotely attached BCV devices to a SRDF device group

disassociate –rdf

Disassociates remotely attached BCV devices from an SRDF device group

Table 3 SYMCLI base commands (page 3 of 3)

Command Argument Description

EMC Solutions Enabler base management 95

Page 96: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

96

EMC Foundation Products

EMC Change TrackerThe EMC Symmetrix Change Tracker software is also part of the base Solutions Enabler SYMCLI management offering. Change Tracker commands are used to measure changes to data on a Symmetrix volume or group of volumes. Change Tracker functionality is often used as a planning tool in the analysis and design of configurations that use the EMC SRDF and TimeFinder components to create copies of production data.

The Change Tracker command (symchg) is used to monitor the amount of changes being made to a group of hypervolumes. This command timestamps and marks specific volumes for tracking and maintains a bitmap to record which tracks have changed on those volumes. The bitmap can be interrogated to gain an understanding of how the data on the volume changes over time and to assess the locality of reference of applications.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 97: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC Symmetrix Remote Data FacilityThe Symmetrix Remote Data Facility (SRDF) component of EMC Solutions Enabler extends the basic SYMCLI command set to enable users to manage SRDF. SRDF is a business continuity solution that provides a host-independent, mirrored data storage solution for duplicating production site data to one or more physically separated target Symmetrix systems. In basic terms, SRDF is a configuration of multiple Symmetrix systems whose purpose is to maintain multiple copies of logical volume data in more than one location.

SRDF replicates production or primary (source) site data to a secondary (target) site transparently to users, applications, databases, and host processors. The local SRDF device, known as the source (R1) device, is configured in a partner relationship with a remote target (R2) device, forming an SRDF pair. While the R2 device is mirrored with the R1 device, the R2 device is write-disabled to the remote host. After the R2 device synchronizes with its R1 device, the R2 device can be split from the R1 device at any time, making the R2 device fully accessible again to its host. After the split, the target (R2) device contains valid data and is available for performing business continuity tasks through its original device address.

SRDF requires configuration of specific source Symmetrix volumes (R1) to be mirrored to target Symmetrix volumes (R2). If the primary site is no longer able to continue processing when SRDF is operating in synchronous mode, data at the secondary site is current up to the last committed transaction. When primary systems are down, SRDF enables fast failover to the secondary copy of the data so that critical information becomes available in minutes. Business operations and related applications may resume full functionality with minimal interruption.

Figure 26 on page 98 illustrates a basic SRDF configuration where connectivity between the two Symmetrix is provided using ESCON, Fibre Channel, or Gigabit Ethernet. The connection between the R1 and R2 devices is through a logical grouping of devices called a remote adapter (RA) group. The RA group is independent of the device and composite groups defined; device and composite groups are discussed in “SRDF device groups and composite groups” on page 99.

EMC Symmetrix Remote Data Facility 97

Page 98: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

98

EMC Foundation Products

Figure 26 Basic synchronous SRDF configuration

SRDF benefits

SRDF offers the following features and benefits:

◆ High data availability

◆ High performance

◆ Flexible configurations

◆ Host and application software transparency

◆ Automatic recovery from a component or link failure

◆ Significantly reduced recovery time after a disaster

◆ Increased integrity of recovery procedures

◆ Reduced backup and recovery costs

◆ Reduced disaster recovery complexity, planning, testing, etc.

◆ Supports Business Continuity across and between multiple databases on multiple servers and Symmetrix systems.

SRDF modes of operation

SRDF currently supports the following modes of operation:

◆ Synchronous mode (SRDF/S) provides real-time mirroring of data between the source Symmetrix system(s) and the target Symmetrix system(s). Data is written simultaneously to the cache of both systems in real time before the application I/O is completed, thus ensuring the highest possible data availability.

Source Target

Escon

FCGigE

<200Km

ICO-IMG-000001

Server

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 99: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Data must be successfully stored in both the local and remote Symmetrix systems before an acknowledgment is sent to the local host. This mode is used mainly for metropolitan area network distances less than 200 km.

◆ Asynchronous mode (SRDF/A) maintains a dependent-write consistent copy of data at all times across any distance with no host application impact. Applications needing to replicate data across long distances historically have had limited options. SRDF/A delivers high-performance, extended-distance replication and reduced telecommunication costs while leveraging existing management capabilities with no host performance impact.

◆ Adaptive copy mode transfers data from source devices to target devices regardless of order or consistency, and without host performance impact. This is especially useful when transferring large amounts of data during data center migrations, consolidations, and in data mobility environments. Adaptive copy mode is the data movement mechanism of the Symmetrix Automated Replication (SRDF/AR) solution.

SRDF device groups and composite groupsApplications running on Symmetrix systems normally utilize a number of Symmetrix devices. Therefore, any Symmetrix operation must ensure all related devices are operated upon as a logical group. Defining device or composite groups achieves this.

A device group or a composite group is a user-defined group of devices that SYMCLI commands can be executed upon. Device groups are limited to a single Symmetrix system and RA group (a.k.a. SRDF group). A composite group, on the other hand, can span multiple Symmetrix systems and RA groups. The device or composite group type may contain R1 or R2 devices and may contain various device lists for standard, BCV, virtual, and remote BCV devices. The symdg/symld and symcg commands are used to create and manage device and composite groups.

SRDF consistency groupsAn SRDF consistency group is a collection of devices defined by a composite group that has been enabled for consistency protection. Its purpose is to protect data integrity for applications that span multiple

EMC Symmetrix Remote Data Facility 99

Page 100: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

100

EMC Foundation Products

RA groups and/or multiple Symmetrix systems. The protected applications may comprise multiple heterogeneous data resource managers across multiple host operating systems.

An SRDF consistency group uses PowerPath or Enginuity Consistency Assist (SRDF-ECA) to provide synchronous disaster restart with zero data loss. Disaster restart solutions that use consistency groups provide remote restart with short recovery time objectives. Zero data loss implies that all completed transactions at the beginning of a disaster will be available at the target.

When the amount of data for an application becomes very large, the time and resources required for host-based software to protect, back up, or run decision-support queries on this data become critical factors. The time required to quiesce or shut down the application for offline backup is no longer acceptable. SRDF consistency groups allow users to remotely mirror the largest data environments and automatically split off dependent-write consistent, restartable copies of applications in seconds without interruption to online service.

A consistency group is a composite group of SRDF devices (R1 or R2) that act in unison to maintain the integrity of applications distributed across multiple Symmetrix systems or multiple RA groups within a single Symmetrix. If a source (R1) device in the consistency group cannot propagate data to its corresponding target (R2) device, EMC software suspends data propagation from all R1 devices in the consistency group, halting all data flow to the R2 targets. This suspension, referred to as a “consistency group trip,” ensures that a dependent-write consistent R2 copy of the data up to the point in time that the consistency group tripped, exists.

Tripping a consistency group can occur either automatically or manually. Scenarios in which an automatic trip would occur include:

◆ One or more R1 devices cannot propagate changes to their corresponding R2 devices

◆ The R2 device fails

◆ The SRDF directors on the R1 side or R2 side fail

In an automatic trip, the Symmetrix system completes the write to the R1 device, but indicates that the write did not propagate to the R2 device. EMC software intercepts the I/O and instructs the Symmetrix to suspend all R1 source devices in the consistency group from propagating any further writes to the R2 side. Once the suspension is

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 101: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

complete, writes to all of the R1 devices in the consistency group continue normally, but they are not propagated to the target side until normal SRDF mirroring resumes.

An explicit trip occurs when the command symrdf –cg suspend or split is invoked. Suspending or splitting the consistency group creates an on-demand, restartable copy of the data at the R2 target site. BCV devices that are synchronized with the R2 devices are then split after the consistency group is tripped, creating a second dependent-write consistent copy of the data. During the explicit trip, SYMCLI issues the command to create the dependent-write consistent copy, but may require assistance from PowerPath or SRDF-ECA if I/O is received on one or more R1 devices, or if the SYMCLI commands issued are abnormally terminated before the explicit trip.

An EMC consistency group maintains consistency within applications spread across multiple Symmetrix systems in an SRDF configuration, by monitoring data propagation from the source (R1) devices in a consistency group to their corresponding target (R2) devices as depicted in Figure 27. Consistency groups provide data integrity protection during a rolling disaster.

Figure 27 SRDF consistency group

Host 1

DBMS

Host 2

DBMS

RDF-ECA

RDF-ECA

Consistency groupHost component

Symmetrix control Facility

Consistency groupHost component

Symmetrix control Facility

2

R1(Z)

R1(Y)

R1(X)

R2(Y)

R2(Z)

R2(X)

R1(C)

R1(B)

R1(A)

R2(B)

R2(C)

R2(A)

ICO-IMG-000106

Suspend R1/R2relationship

DBMSrestartablecopy

E-ConGroupdefinition(X,Y,Z)

X = DBMS dataY = Application dataZ = Logs

1

3

4 5

6

7

EMC Symmetrix Remote Data Facility 101

Page 102: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

102

EMC Foundation Products

In the example depicted in Figure 27 on page 101, a consistency group containing volumes X, Y, and Z on the source Symmetrix is defined. This consistency group definition must contain all of the devices that need to maintain dependent-write consistency and that reside on all participating hosts involved in issuing I/O to these devices. A mix of CKD (mainframe) and FBA (UNIX/Windows) devices can be logically grouped together. In some cases, the entire processing environment may be defined in a consistency group to ensure dependent-write consistency.

Next, the rolling disaster described previously begins, preventing the replication of changes from volume Z to the remote site. Since the predecessor log write to volume Z cannot be propagated to the remote Symmetrix system, a consistency group trip occurs.

The consistency group trip holds the write that could not be replicated along with all of the writes to the logically grouped devices. The writes are held by PowerPath on UNIX/Windows hosts and by IOS on mainframe hosts (or by ECA-RDA for both UNIX/Windows and mainframe hosts) long enough to issue two I/Os to all of the Symmetrix systems involved in the consistency group. The first I/O changes the state of the devices to a suspend-pending state.

The second I/O performs the suspend actions on the R1/R2 relationships for the logically grouped devices which immediately disables all replication to the remote site. This allows other devices outside of the group to continue replicating, provided the communication links are available. After the relationship is suspended, the completion of the predecessor write is acknowledged back to the issuing host. Furthermore, all writes that were held during the consistency group trip operation are released.

After the second I/O per Symmetrix completes, the I/O is released, allowing the predecessor log write to complete to the host. The dependent data write is issued by the DBMS and arrives at X but is not replicated to the R2(X).

When a complete failure occurs from this rolling disaster, the dependent-write consistency at the remote site is preserved. If a complete disaster does not occur and the failed links are activated again, the consistency group replication can be resumed. EMC recommends creating a copy of the dependent-write consistent image while the resume takes place. Once the SRDF process reaches synchronization the dependent-write consistent copy is achieved at the remote site.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 103: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

SRDF terminologyThis section describes various terms related to SRDF operations.

Suspend and resume operationsPractical uses of suspend and resume operations usually involve unplanned situations in which an immediate suspension of I/O between the R1 and R2 devices over the SRDF links is desired. In this way, data propagation problems can be stopped. When suspend is used with consistency groups, immediate backups can be performed off the R2 devices without affecting I/O from the local host application. I/O can then be resumed between the R1 and R2 and return to normal operation.

Establish and split operationsNormally, establish and split operations are used in planned situations in which use of the R2 copy of the data is desired without interfering with normal write operations to the R1 device. Splitting a point-in-time copy of data allows access to the data on the R2 device for various business continuity tasks. The ease of splitting SRDF pairs to provide exact database copies makes it convenient to perform scheduled backup operations, reporting operations, or new application testing from the target Symmetrix data while normal processing continues on the source Symmetrix system.

The R2 copy can also be used to test disaster recovery plans without manually intensive recovery drills, complex procedures, and application service interruptions. Upgrades to new versions can be tested or changes to actual code can be made without affecting the online production server. For example, modified server code can be run on the R2 copy of the data until the upgraded code runs with no errors before upgrading the production server.

In cases where an absolute real-time copy of the production data is not essential, users may choose to split the SRDF pair periodically and use the R2 copy for queries and report generation. The SRDF pair can be re-established periodically to provide incremental updating of data on the R2 device. The ability to refresh the R2 device periodically provides the latest information for data processing and reporting.

EMC Symmetrix Remote Data Facility 103

Page 104: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

104

EMC Foundation Products

Failover and failback operationsPractical uses of failover and failback operations usually involve the need to switch business operations from the production site to a remote site (failover) or the opposite (failback). Once failover occurs, normal operations continue using the remote (R2) copy of synchronized application data. Scheduled maintenance at the production site is one example of where failover to the R2 site might be needed.

Testing of disaster recovery plans is the primary reason to temporarily fail over to a remote site. Traditional disaster recovery routines involve customized software and complex procedures. Offsite media must be either electronically transmitted or physically shipped to the recovery site. Time-consuming restores and the application of logs usually follow. SRDF failover/failback operations significantly reduce the recovery time by incrementally updating only the specific tracks that have changed; this accomplishes in minutes what might take hours for a complete load from dumped data volumes.

Update operationThe update operation allows users to resynchronize the R1 devices after a failover while continuing to run application and database services on the R2 devices. This function helps reduce the amount of time that a failback to the R1 side takes. The update operation is a subset of failover/failback functionality. Practical uses of the R1 update operation usually involve situations in which the R1 becomes almost synchronized with the R2 data before a failback, while the R2 side is still online to its host. The -until option, when used with update, specifies the target number of invalid tracks that are allowed to be out of sync before resynchronization to the R1 completes.

Concurrent SRDFConcurrent SRDF means having two target R2 devices configured as concurrent mirrors of one source R1 device. Using a Concurrent SRDF pair allows the creation of two copies of the same data at two remote locations. When the two R2 devices are split from their source R1 device, each target site copy of the application can be accessed independently.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 105: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

R1/R2 swapSwapping R1/R2 devices of an SRDF pair causes the source R1 device to become a target R2 device and vice versa. Swapping SRDF devices allows the R2 site to take over operations while retaining a remote mirror on the original source site. Swapping is especially useful after failing over an application from the R1 site to the R2 site. SRDF swapping is available with Enginuity version 5567 or later.

Data mobility Data mobility is an SRDF configuration that restricts SRDF devices to operating only in adaptive copy mode. This is a lower-cost licensing option that is typically used for data migrations. It allows data to be transferred in adaptive copy mode from source to target, and is not designed as a solution for DR requirements unless used in combination with TimeFinder.

Dynamic SRDFDynamic SRDF allows the creation of SRDF pairs from non-SRDF devices while the Symmetrix system is in operation. Historically, source and target SRDF device pairing has been static and changes required assistance from EMC personnel. This feature provides greater flexibility in deciding where to copy protected data.

Dynamic RA groups can be created in a SRDF switched fabric environment. An RA group represents a logical connection between two Symmetrix systems. Historically, RA groups were limited to those static RA groups defined at configuration time. However, RA groups can now be created, modified, and deleted while the Symmetrix system is in operation. This provides greater flexibility in forming SRDF-pair-associated links.

SRDF control operations

This section describes typical control operations that can be performed by the Solutions Enabler symrdf command.

Solutions Enabler SYMCLI SRDF commands perform the following basic control operations on SRDF devices:

◆ establish synchronizes an SRDF pair by initiating a data copy from the source (R1) side to the target (R2) side. This operation can be a full or incremental establish. Changes on the R2 devices are discarded by this process.

EMC Symmetrix Remote Data Facility 105

Page 106: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

106

EMC Foundation Products

◆ restore resynchronizes a data copy from the target (R2) side to the source (R1) side. This operation can be a full or incremental restore. Changes on the R1 devices are discarded by this process.

◆ split stops mirroring for the SRDF pair(s) in a device group and write-enables the R2 devices.

◆ swap exchanges the source (R1) and target (R2) designations on the source and target volumes.

◆ failover switches data processing from the source (R1) side to the target (R2) side. The source side volumes (R1), if still available, are write-disabled.

◆ failback switches data processing from the target (R2) side to the source (R1) side. The target side volumes (R2), if still available, are write-disabled.

Establishing an SRDF pairThe establishment of an SRDF pair initiates remote mirroring—the copying of data from the source (R1) device to the target (R2) device. SRDF pairs come into existence in two different ways:

◆ At configuration time through the pairing of SRDF devices. This is a static pairing configuration discussed earlier.

◆ Anytime during a dynamic pairing configuration in which SRDF pairs are created on demand.

A full establish (symrdf establish –full) is typically performed after an SRDF pair is initially configured and connected via the SRDF links. After the first full establish, users can perform an incremental establish, where the R1 device copies to the R2 device only the new data that was updated while the relationship was split or suspended.

To initiate an establish operation on all SRDF pairs in a device or composite group, all pairs must be in the split or suspended state. The symrdf query command can be used to check the state of SRDF pairs in a device or composite group.

When an establish operation is initiated, the system write-disables the R2 device to its host and merges the track tables. The merge creates a bitmap of the tracks that need to be copied to the target volumes, discarding the changes on the target volumes. When the establish operation is complete and the SRDF pairs are in the synchronized state. The R1 device and R2 device contain identical

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 107: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

data, and continue to do so until interrupted by administrative command or unplanned disruption. Figure 28 depicts SRDF establish and restore operations:

Figure 28 SRDF establish and restore control operations

The establish operation may be initiated by any host connected to either Symmetrix system, provided that an appropriate device group has been built on that host. The following command initiates an incremental establish operation for all SRDF pairs in the device group named MyDevGrp:

symrdf –g MyDevGrp establish –noprompt

Splitting an SRDF pairWhen read/write access to a target (R2) device is necessary, the SRDF pair can be split. When the split completes, the target host can access the R2 device for write operations. The R2 device contains valid data and is available for business continuity tasks or restoring data to the R1 device if there is a loss of data on that device.

While an SRDF pair is in the split state, local I/O to the R1 device can still occur. These updates are not propagated to the R2 device immediately. Changes on each Symmetrix system are tracked through bitmaps and are reconciled when normal SRDF mirroring operations are resumed. To initiate a split, an SRDF pair must already be in one of the following states:

◆ Synchronized◆ Suspended◆ R1 updated

R1 R2

Establish

Restore

ICO-IMG-000003

Productionserver

DRserver

ProductionDBMS

Disaster recoveryDBMS

Data

Logs

Data

Logs

EMC Symmetrix Remote Data Facility 107

Page 108: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

108

EMC Foundation Products

◆ SyncInProg (if the –symforce option is specified for the split — resulting in a set of R2 devices that are not dependent-write consistent and are not usable)

The split operation may be initiated from either host. The following command initiates a split operation on all SRDF pairs in the device group named MyDevGrp:

symrdf –g MyDevGrp split –noprompt

The symrdf split command provides exactly the same functionality as the symrdf suspend and symrdf rw_enable R2 commands together. Furthermore, the split and suspend operations have exactly the same consistency characteristics as SRDF consistency groups. Therefore, when SRDF pairs are in a single device group, users can split the SRDF pairs in the device group as shown previously and have restartable copies on the R2 devices. If the application data spans multiple Symmetrix systems or multiple RA groups, include SRDF pairs in a consistency group to achieve the same results.

Restoring an SRDF pairWhen the target (R2) data must be copied back to the source (R1) device, the SRDF restore command is used (see Figure 28 on page 107). After an SRDF pair is split, the R2 device contains valid data and is available for business continuance tasks (such as running a new application) or for restoring data to the R1 device. Moreover, if the results of running a new application on the R2 device need to be preserved, moving the changed data and new application to the R1 device is another option.

Users can perform a full or incremental restore. A full restore operation copies the entire contents of the R2 device to the R1 device. An incremental restore operation is much faster because it copies only new data that was updated on the R2 device while the SRDF pair was split. Any tracks on the R1 device that changed while the SRDF pair was split are replaced with corresponding tracks on the R2 device. To initiate a restore, an SRDF pair must already be in the split state. The restore operation can be initiated from either host. The following command initiates an incremental restore operation on all SRDF pairs in the device group named MyDevGrp (add the –full option for a full restore).

symrdf –g MyDevGrp restore –noprompt symrdf –g MyDevGrp restore –noprompt -full

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 109: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

The restore operation is complete when the R1 and R2 devices contain identical data. The SRDF pair is then in a synchronized state and may be re-established by initiating the following command:

symrdf -g MyDevGrp establish

Failover and failback operationsHaving a synchronized SRDF pair allows users to switch data processing operations from the source site to the target site if operations at the source site are disrupted or if downtime must be scheduled for maintenance. This switchover from source to target is enabled through the use of the failover command. When the situation at the source site is back to normal, a failback operation is used to reestablish I/O communications links between source and target, resynchronize the data between the sites, and resume normal operations on the R1 devices as shown in Figure 29, which illustrates the failover and failback operations.

Figure 29 SRDF failover and failback control operations

The failover and failback operations relocate the processing from the source site to the target site or vice versa. This may or may not imply movement of data.

FailoverScheduled maintenance or storage system problems can disrupt access to production data at the source site. In this case, a failover operation can be initiated from either host to make the R2 device read/write-enabled to its host. Before issuing the failover, all applications services on the R1 devices must be stopped. This is

R1 R2

Failover

Failback

ICO-IMG-000004

Productionserver

DRserver

ProductionDBMS

Disaster recoveryDBMS

Data

Logs

Data

Logs

EMC Symmetrix Remote Data Facility 109

Page 110: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

110

EMC Foundation Products

because the failover operation makes the R1 devices read-only. The following command initiates a failover on all SRDF pairs in the device group named MyDevGrp:

symrdf –g MyDevGrp failover –noprompt

In order to initiate a failover operation, the SRDF pair must already be in one of the following states:

◆ Synchronized◆ Suspended◆ R1 updated◆ Partitioned (when invoking this operation at the target site)

Once initiated, a failover operation:

◆ Suspends data traffic on the SRDF links◆ Write-disables the R1 devices◆ Write-enables the R2 devices

FailbackTo resume normal operations on the R1 side, a failback (R1 device takeover) operation is initiated. This means read/write operations on the R2 device must be stopped, and read/write operations on the R1 device must be started. When the failback command is initiated, the R2 becomes read-only to its host, while the R1 becomes read/write-enabled to its host. The following command performs a failback operation on all SRDF pairs in the device group named MyDevGrp:

symrdf –g MyDevGrp failback -noprompt

The SRDF pair must already be in one of the following states in order for a failback operation to succeed:

◆ Failed over◆ Suspended and write-disabled at the source◆ Suspended and not ready at the source◆ R1 Updated◆ R1 UpdInProg

Once initiated, a failback operation:

◆ Write-enables the R1 devices.◆ Performs a track table merge to discard changes on the R1

devices.◆ Transfers the changes on the R2 devices.◆ Resumes traffic on the SRDF links.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 111: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

◆ Write-disables the R2 devices.

EMC Symmetrix Remote Data Facility 111

Page 112: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

112

EMC Foundation Products

EMC SRDF/Cluster Enabler solutionsEMC SRDF/Cluster Enabler (SRDF/CE) for MSCS is an integrated solution that combines SRDF and clustering protection over distance. EMC SRDF/CE provides disaster-tolerant capabilities that enable a cluster to span geographically separated Symmetrix systems. It operates as a software extension (MMC snap-in) to the Microsoft Cluster Service (MSCS).

SRDF/CE achieves this capability by exploiting SRDF disaster restart capabilities. SRDF allows the MSCS cluster to have two identical sets of application data in two different locations. When cluster services are failed over or failed back, SRDF/CE is invoked automatically to perform the SRDF functions necessary to enable the requested operation.

Figure 30 illustrates the hardware configuration of two, four-node, geographically distributed EMC SRDF/CE clusters using bidirectional SRDF.

Figure 30 Geographically distributed four-node EMC SRDF/CE clusters

R1

R2

R1

R2

Clients

Enterprise LAN/WAN

Primarysite nodes

Secondarysite nodes

Fibre Channelor SCSI

Fibre Channelor SCSI

SRDF

ICO-IMG-000005

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 113: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

SRDF enhancements introduced with Enginuity 5875EMC Enginuity 5875 is the latest intelligent, multitasking, preemptive storage operating environment (SOE) for the Symmetrix VMAX. As with previous Enginuity versions this release is devoted to storage operations and optimized for service levels required in high-end environments. And as expected, this Enginuity version on Symmetrix VMAX further advances the ability of EMC self-optimizing intelligence to deliver performance, array tiering, availability, and data integrity that now define advanced storage functionality.

Some of the more general SRDF enhancements made available with the Enginuity 5875 operating environment on VMAX storage arrays include:

◆ The ability to configure simultaneously multiple static SRDF groups

◆ The ability to throttle host write I/O response time up to a user-defined limit

◆ The ability to create a TimeFinder/Snap off an SRDF/A R2 device

In addition, the following new features were introduced with Enginuity 5875:

◆ Concurrent SRDF/A — Concurrent SRDF/A expands the SRDF multisite topology offering by allowing two separate asynchronous links from a Symmetrix VMAX to Symmetrix systems located at remote data centers. This configuration exploits the core benefits of SRDF/A for improved application response times while replicating at extended distances. Enginuity 5875 offers the flexibility to change Concurrent SRDF/S and SRDF/A disaster restart topologies to Concurrent SRDF/A and SRDF/A. This flexibility:

• Allows you to meet performance goals during planned and known workload spike periods

• Offers a new migration option for data center relocation

• Provides additional disaster restart protection

◆ Thick-to-thin migration with SRDF — Thick-to-thin migration supports the migration of data between thick (standard) provisioned volumes on earlier generation Symmetrix systems to thin (virtually provisioned) volumes on new VMAX systems via SRDF replication. During replication, SRDF will detect tracks or blocks containing all zeros and remove them from the replication

EMC Symmetrix Remote Data Facility 113

Page 114: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

114

EMC Foundation Products

stream, thereby allowing the reclamation of space during migration and the desired result of a thin migration target. Supported Enginuity combinations include:

• 5671 thick to 5875 thin

• 5773 thick to 5875 thin

• 5875 thick to 5875 thin

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 115: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC TimeFinderThe SYMCLI TimeFinder component extends the basic SYMCLI command set to include TimeFinder or business continuance commands that perform control operations on device pairs within the TimeFinder environment.

Currently, the TimeFinder family consists of two separate and distinct software products along with several additional component options. The TimeFinder base replication products are:

• TimeFinder/Clone enables users to make copies of data simultaneously on multiple target devices from a single source device. The data is available to a target’s host immediately upon activation, even if the copy process has not completed. Data may be copied from a single source device to as many as 16 target devices. A source device can be either a Symmetrix standard device or a TimeFinder BCV device.

• TimeFinder/Snap enables users to configure special devices in the Symmetrix array called virtual devices (VDEVs) and save devices (SAVEDEVs). These devices can be used to make pointer-based, space-saving copies of data simultaneously on multiple target devices from a single source device. The data is available to a target’s host immediately upon activation. Data may be copied from a single source device to as many as 128 VDEVs. A source device can be either a Symmetrix standard device or a TimeFinder BCV device. A target device is a VDEV. A SAVDEV is a special device without a host address that is used to hold the changing contents of the source or target device.

TimeFinder component options include:

• TimeFinder/Mirror enables users to configure special devices, called business continuance volumes (BCVs), to create a mirror image of Symmetrix standard devices. Using BCVs, TimeFinder creates a point-in-time copy of data that can be repurposed. TimeFinder/Mirror is a family component that works in Symmetrix environments running Enginuity 5773 and earlier. In environments running Enginuity 5874 and higher, all TimeFinder/Mirror scripts are executed in Clone Emulation mode.

EMC TimeFinder 115

Page 116: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

116

EMC Foundation Products

IMPORTANT

Starting with Enginuity 5874, TimeFinder/Mirror functions are performed through TimeFinder/Clone software using a process called Clone Emulation. When running in Emulation Mode, TimeFinder/Clone transparently performs TimeFinder/Mirror commands and executes scripts that were written for Solutions Enabler up through version 6.5.2 running on Symmetrix arrays using Enginuity 5773 and earlier.

• TimeFinder/Consistency Groups (TimeFinder/CG) enables other TimeFinder family products to coordinate cross-volume and cross-system consistency to ensure application restartability. This option for Symmetrix arrays creates multivolume sets of point-in-time copies at the same instant, ensuring that as a set the copies are consistent and restartable, even when spread across multiple Symmetrix volumes and data is spread across multiple arrays, without quiescing or shutting down to ensure that all devices are copied at the same point in time.

• TimeFinder/Exchange Integration Module (TimeFinder/EIM) automates and simplifies the process of creating and managing TimeFinder replications of a Microsoft Windows Exchange Server environment.

• TimeFinder/SQL Integration Module (TimeFinder/SIM) automates (TimeFinder/SIM) simplifies the process of creating and managing TimeFinder replications of a Microsoft Windows SQL Server environment.

• Duplicate TimeFinder/Snap offers the capability to capture TimeFinder/Snap replicas from another TimeFinder/Snap point-in-time copy. This functionality is targeted mainly at SAP and database environments where copies of production environments are repurposed for testing, QA, or development. Work can proceed against an existing TimeFinder/Snap while duplicate copies can be created for additional downstream processes or checkpoint backups. With Enginuity 5875, snap copies can be taken from another snap source, adding even more disk space savings and flexibility through this track sharing technology.

The commands that comprise the TimeFinder component technologies of the EMC Solutions Enabler are: symclone, symsnap, symmir, symbcv, and symioctl. The TimeFinder/Clone command,

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 117: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

symclone, is used to create a point-in-time copy of a source device on nonstandard device pairs (such as standard/standard and BCV/BCV). The TimeFinder/Snap command, symsnap, is used to create virtual device copy sessions between a source device and multiple virtual target devices. These virtual devices only store pointers to changed data blocks from the source device, rather than a full copy of the data.

Base component commands such as symmir and symbcv are used to perform a wide spectrum of monitor and control operations on Symmetrix standard/BCV device pairs within a TimeFinder environment. The symioctl command is used to send I/O control commands to a specified database server.

Configuring and controlling remote BCV pairs requires the EMC SRDF business continuity software that was discussed earlier. The combination of TimeFinder with SRDF provides for multiple local and remote copies of production data.

Figure 31 illustrates application usage for a TimeFinder/Mirror configuration in a Symmetrix system.

Figure 31 EMC Symmetrix configured with standard volumes and BCVs

TimeFinder/Clone operationsSymmetrix TimeFinder/Clone operations are performed using the SYMCLI TimeFinder symclone command, which creates clone copies of a source device on multiple target devices. The source and target devices can be either standard devices or BCV devices as long as they are all of the same size and emulation type (FBA or CKD). Clone copies of striped or concatenated metadevices can also be created, but the source and target metadevices must be completely identical in

STD

STD

STD

BCV

BCV

BCV

Target data uses:BackupData warehouseRegression testingData protection

ICO-IMG-000006

ServerrunningSYMCLI

EMC TimeFinder 117

Page 118: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

118

EMC Foundation Products

stripe count, stripe size, and capacity. Once activated, the copy can be instantly accessed by a target’s host, even before the data is fully copied to the target device.

There are several key advantages of using TimeFinder/Clone, such as the ability to perform precopy operations and its cache partitioning. TimeFinder/Clone copies are appropriate in situations where multiple copies of production data are needed for testing, backups, or report generation. Clone copies can also be used to reduce disk contention and improve data access speed by assigning users to copies of data rather than accessing the one production copy.

Depending on whether a device has associated BCVs, a single source device can have up to 16 clone copy sessions (15 copy sessions and one reserve copy session for restore operations). When using the -copy option, you can copy up to eight full data copies simultaneously, without disruption to database production activity.

Clone copy sessionsTimeFinder/Clone functionality is controlled via copy sessions, which pair source and target devices. Sessions are maintained on the Symmetrix system and can be queried to verify the current state of the device pairs. A copy session must first be created to define and set up the TimeFinder/Clone devices. The session is then activated, enabling the target device to be accessed by its host. When the information is no longer needed, the session can be terminated. TimeFinder/Clone operations are controlled from the host by using the symclone command to create, activate, restore, recreate, set mode, split, establish, and terminate copy sessions.

Figure 32 on page 119 illustrates a copy session where the controlling host creates a TimeFinder/Clone copy of standard device DEV001 on target device DEV005, using the symclone command.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 119: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Figure 32 Creating a copy session using the symclone command

The symclone command is used to enable cloning operations. The cloning operation happens in two phases: creation and activation. The creation phase builds bitmaps of the source and target that are later used during the activation or copy phase. The creation of a symclone pairing does not start copying of the source volume to the target volume, unless the -precopy option is used.

For example, to create clone sessions on all the standards and BCVs in the device group MyDevGrp, use the following command:

symclone -g MyDevGrp create -noprompt

The activation of a clone enables the copying of the data. The data may start copying immediately if the –copy keyword is used. If the –copy keyword is not used, tracks are only copied when they are accessed from the target volume or when they are changed on the source volume.

Activation of the clone session established in the previous create command can be accomplished using the following command.

symclone –g MyDevGrp activate -noprompt

SourceDEV001

TargetDEV005

ControllingHost

symclone create

followedby

symclone activate

TargetHost

SYM-001791

EMC TimeFinder 119

Page 120: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

120

EMC Foundation Products

TimeFinder/Snap operationsSymmetrix arrays provide another technique for creating copies of application data. The functionality, called TimeFinder/Snap, allows users to make pointer-based, space-saving copies of data simultaneously on multiple virtual (VDEV) target devices from a single source device. (The data is available for access instantly.)

TimeFinder/Snap allows data to be copied from a single source device to as many as 128 target devices (Enginuity 5772 and later). A source device can be either a Symmetrix standard device or a BCV device controlled by TimeFinder/Mirror, with the exception being a BCV working in clone emulation mode. The target device is a Symmetrix virtual device (VDEV), which consumes negligible physical storage through the use of pointers to track changed data.

A VDEV is a host-addressable Symmetrix device with special attributes that is created when a Symmetrix system is configured. However, unlike a BCV which contains a full volume of data, a VDEV is a logical-image device that offers a space-saving way to create instant, point-in-time copies of volumes. Any updates to a source device after its activation with a virtual device, causes the pre-update image of the changed tracks to be copied to a save device. The virtual device’s indirect pointer is then updated to point to the original track data on the save device, preserving a point-in-time image of the volume. TimeFinder/Snap uses this copy-on-first-write technique to conserve disk space, since only changes to tracks on the source cause any incremental storage to be consumed.

The symsnap create and symsnap activate commands are used to create a source/target snap pair.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 121: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Table 4 summarizes some of the differences between devices used in TimeFinder/Snap operations.

Snap copy sessionsMuch like TimeFinder/Clone, TimeFinder/Snap functionality is managed via copy sessions, which pair source and target virtual devices. Sessions are maintained on the Symmetrix system and can be queried to verify the current state of the devices. A copy session must be created first—this defines the devices that will be used in the copy operation. On subsequent activation, the target virtual devices become accessible to a host. (Once a copy session has been activated, the copy can be accessed via the VDEV target device immediately.) Unless the data is changed by the host accessing the VDEV, the VDEV always presents a frozen point-in-time copy of the source device at the point of activation. Data can also be restored from the virtual devices back to the source devices. When the information is no longer needed, the session can be terminated.

TimeFinder/Snap operations are controlled from the host by using the symsnap command to create, activate, restore, and terminate TimeFinder/Snap copy sessions.

Table 4 TimeFinder device type summary

Device Description

Virtual device A logical-image device that saves disk space through the use of pointers to track data that is immediately accessible after activation. Snapping data to a virtual device uses a copy-on-first-write technique.

Save device A device that is not host-accessible but accessed only through the virtual devices that point to it. Save devices provide a pool of physical space to store snap copy data to which virtual devices point.

BCV A full volume mirror that has valid data after fully synchronizing with its source device. It is accessible only when split from the source device that it is mirroring.

EMC TimeFinder 121

Page 122: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

122

EMC Foundation Products

Figure 33 illustrates a virtual copy session where the controlling host creates a copy of standard device DEV001 on target device VDEV005.

Figure 33 Copy of a standard device to a virtual device (VDEV)

As illustrated in Figure 33, a virtual device is a host-accessible device that contains a collection of pointers to unchanged data and to save data. When you activate a snap pair, disk space is consumed (on SAVE devices) only when data is written to the source device or VDEV, and then only the space required to accommodate pre-update data from the source tracks that changed.

Pointers on the virtual device are initialized to point to tracks on the source device. The first time new data is written to a track on the source device, the original track data is copied to a SAVE device, and the pointer on the virtual device is changed to point to that original data. When a track is written to a VDEV, it also gets copied to the SAVE device and the pointer on the VDEV is changed to point to the SAVE device.

StandardDEV001

Create Session

Source

Target

VirtualVDEV005

SaveDevices

ControllingHost

I/O

symsnap createsymsnap activate

TargetHost

Device pointers toSave Devices

I/O

Device pointersfrom virtual device

to original data

Original data copiedto save devices on

first write(CopyOnWrite)

SYM-001803

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 123: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

The symsnap command is used to enable TimeFinder/Snap operations. The snap operation happens in two phases: creation and activation. The creation phase builds bitmaps of the source and target that are later used to manage the changes on the source and target. The creation of a snap pairing does not copy the data from the source volume to the target volume. To create snap sessions on all the standards and BCVs in the device group MyDevGrp, use the following command.

symsnap -g <MyDevGrp> create -noprompt

The activation of a snap session enables the protection of the source data tracks. When protected tracks are changed on the source volume, they are first copied into the save pool and the VDEV pointers are updated to point to the changed tracks in the save pool. When tracks are changed on the VDEV, the data is written directly to the save pool and the VDEV pointers are updated in the same way.

Activation of the snap session created in the previous create command can be accomplished by executing the following command.

symsnap –g MyDevGrp activate -noprompt

Note: Starting with Solutions Enabler version 5.4, TimeFinder operations using the SYMCLI symmir, symclone, and symsnap commands support composite groups (-cg) or devices in a composite group, as well as device groups (-g) and devices within a device group.

TimeFinder/Mirror operationsSymmetrix TimeFinder/Mirror is essentially a business continuance solution that allows the use of special business continuance volume (BCV) Symmetrix devices. Copies of data from a standard Symmetrix device (which are online for regular I/O operations from the host) are sent and stored on BCV devices to mirror the primary data. Uses for the BCV copies can include backup, restore, decision support, and applications testing. Each BCV device has its own host address, and is configured as a stand-alone Symmetrix device.

A Business Continuance sequence first involves associating and establishing the BCV device as a mirror of a specific standard Symmetrix device. As a result, the BCV device becomes inaccessible (Not Ready) using its original device address while it is in an established pair. Once the BCV device is synchronized, you can

EMC TimeFinder 123

Page 124: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

124

EMC Foundation Products

separate (split) it from the standard device with which it is paired, thereby making it available again to its host for backup or other host processes through its original device address.

After host processing on the BCV device is complete, the BCV may again be mirrored to a standard Symmetrix device — either the same device with which it was previously paired, or with a different device.

Note: For Symmetrix configurations running Enginuity release level 5874 and Solutions Enabler 7.0, the TimeFinder/Mirror functions described herein will be performed through TimeFinder/Clone software using a process called Clone Emulation. Clone Emulation mode makes the use of RAID-protected BCVs transparent to the TimeFinder/Mirror user.

For backward compatibility, TimeFinder/Clone Emulation mode transparently performs TimeFinder/Mirror commands and executes scripts written for Solutions Enabler up through version 6.5.2 running on Symmetrix arrays using Enginuity release levels 5773 and earlier.

TimeFinder/Mirror establish operationsA BCV device can be fully or incrementally established. After configuration and initialization of a Symmetrix system, BCV devices contain no data. Like standard devices, BCV devices can have unique host addresses and can be online and ready to the host(s) to which they are connected. A full establish operation must be used the first time the standard devices are paired with the BCV devices. An incremental establish of a BCV device can be performed to resynchronize any data that has changed on the standard since the last establish operation.

Note: When BCVs are established, they are inaccessible to any host.

Symmetrix systems allow up to four mirrors for each hypervolume. The mirror positions are commonly designated M1, M2, M3, and M4. An unprotected BCV can be the second, third, or fourth mirror position of the standard device. A host, however, logically views the Symmetrix M1/M2 mirrored devices as a single device.

To assign a BCV as a mirror of a standard Symmetrix device, the symmir establish command is used. One method of establishing a BCV pair is to allow the standard/BCV device-pairing algorithm to arbitrarily create BCV pairs from multiple devices within a device group:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 125: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

symmir -g MyDevGrp establish –full -noprompt

With this method, TimeFinder/Mirror first checks for any attach assignments (specifying a preferred BCV match from among multiple BCVs in a device group). TimeFinder/Mirror then checks if there are any pairing relationships among the devices. If either of these previous conditions exists, TimeFinder/Mirror uses these assignments.

TimeFinder/Mirror split operationsSplitting a BCV pair is a TimeFinder/Mirror action that detaches the BCV from its standard device and makes the BCV ready for host access. When splitting a BCV, the system must perform housekeeping tasks that may require a few milliseconds on a busy Symmetrix system. These tasks involve a series of steps that result in separation of the BCV from its paired standard:

◆ I/O is suspended briefly to the standard device.

◆ Write pending tracks for the standard device that have not yet been written out to the BCV are duplicated in cache to be written to the BCV.

◆ The BCV is split from the standard device.

◆ The BCV device status is changed to ready.

Regular splitA regular split is the type of split that has existed for TimeFinder/Mirror since its inception. With a regular split (before Enginuity version 5568), I/O activity from the production hosts to a standard volume was not accepted until it was split from its BCV pair. Therefore, applications attempting to access the standard or the BCV would experience a short wait during a regular split. Once the split was complete, no further overhead was incurred.

Beginning with Enginuity version 5568, any split operation is an instant split. A regular split is still valid for earlier versions and for current applications that perform regular split operations. However, current applications that perform regular splits with Enginuity version 5568 actually perform an instant split.

By specifying the –instant option on the command line, an instant split with Enginuity versions 5x66 and 5x67 can be performed. Since version 5568, this option is no longer required because instant split mode has become the default behavior. It is beneficial to

EMC TimeFinder 125

Page 126: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

126

EMC Foundation Products

continue to supply the –instant option with later Enginuity versions, otherwise the default is to wait for the background split to complete.

Instant splitAn instant split shortens the wait period during a split by dividing the process into a foreground split and a background split. During an instant split, the system executes the foreground split almost instantaneously and returns a successful status to the host. This instantaneous execution allows minimal I/O disruptions to the production volumes. Furthermore, the BCVs are accessible to the hosts as soon as the foreground process is complete. The background split continues to split the BCV pair until it is complete. When the -instant option is included or defaulted, SYMCLI returns immediately after the foreground split, allowing other operations while the BCV pair is splitting in the background.

For example, to perform an instant split on all BCV pairs in a device group named MyDevGrp, and allow SYMCLI to return to the server process while the split is performed in the background, you would execute a command that looks like this:

symmir -g MyDevGrp split –instant –noprompt

And once the split operation is started, the progress of the split can be obtained by executing a symmir query command that looks like this:

symmir –cg MyConGrp query –bg

In this example, the –bg option is provided to query the status of the background split.

TimeFinder/Mirror restore operationsOnce established, a BCV device can be used to fully or incrementally restore data on its associated standard devices. Like the full establish operation, a full restore operation copies the entire contents of the BCV devices to the standard devices. The devices upon which the restore operates may be defined in a device group, composite group, or device file. For example:

symmir -g MyDevGrp -full restore –nopromptsymmir -cg MyConGrp -full restore –nopromptsymmir -f MyFile -full –sid 109 restore -noprompt

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 127: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

The incremental restore process accomplishes the same thing as the full restore process with a major time-saving exception. The BCV copies to the standard device only new data that was updated on the BCV device while the BCV pair was split. The data on the corresponding tracks of the BCV device also overwrites any changed tracks on the standard device. This maximizes the efficiency of the resynchronization process. This process is useful, for example, if, after testing or validating an updated version of a database or a new application on the BCV device is completed, a user wants to migrate and utilize a copy of the tested data or application on the production standard device.

Note: An incremental restore of a BCV volume to a standard volume is only possible when the two volumes have an existing TimeFinder relationship.

TimeFinder consistent splitTimeFinder consistent split allows you to split off a dependent-write consistent, restartable image of an application without interrupting online services. Consistent split helps to avoid inconsistencies and restart problems that can occur when splitting an application-related BCV without first quiescing or halting the application. Consistent split is implemented using Enginuity Consistency Assist (ECA) feature.

Enginuity Consistent AssistThe Enginuity Consistency Assist (ECA) feature of the Symmetrix operating environment can be used to perform consistent split operations across multiple heterogeneous environments. This functionality requires a TimeFinder/CG license and uses the –consistent option of the symmir command.

Using ECA to consistently split BCV devices from the standards, a control host with no database or a database host with a dedicated channel to gatekeeper devices must be available. The dedicated channel cannot be used for servicing other devices or to freeze I/O. For example, to split a device group, execute:

symmir –g MyDevGrp split –consistent -noprompt

EMC TimeFinder 127

Page 128: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

128

EMC Foundation Products

Figure 34 illustrates an ECA split across three database hosts that access devices on a Symmetrix system.

Figure 34 ECA consistent split across multiple database-associated hosts

Device groups or composite groups must be created on the controlling host for the target application to be consistently split. Device groups can be created to include all of the required devices for maintaining business continuity. For example, if a device group is defined that includes all of the devices being accessed by Hosts A, B, and C (see Figure 34), then all of the BCV pairs related to those hosts can be consistently split with a single command.

However, if a device group is defined that includes only the devices accessed by Host A, then the BCV pairs related to Host A can be split without affecting the other hosts. The solid vertical line in Figure 34 represents the ECA holding of I/Os during an instant split process, creating a dependent-write consistent image in the BCVs.

Figure 35 on page 129 illustrates the use of local consistent split with a database management system (DBMS).

STD

STD

STD

BCV

BCV

BCV

ICO-IMG-000007

prodgrp

Controlling host

SYMAPIECA

Databaseservers

Host B

Consistent split

Host A

Host C

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 129: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Figure 35 ECA consistent split on a local Symmetrix system

When a split command is issued with ECA from the production host, a consistent database image is created using the following sequence of events shown in Figure 35:

1. The device group, device file, or composite group identifies the standard devices that hold the database.

2. SYMAPI communicates to Symmetrix Enginuity to validate that all identified BCV pairs can be split.

3. SYMAPI communicates to Symmetrix Enginuity to open the ECA window (the time within Symmetrix Enginuity where the writes are deferred), the instant split is issued, and the writes are released by closing the window.

4. ECA suspends writes to the standard devices that hold the database. The DBMS cannot write to the devices and subsequently waits for these devices to become available before resuming any further write activity. Read activity to the device is not affected unless attempting to read from a device with a write queued against it.

5. SYMAPI sends an instant split request to all BCV pairs in the specified device group and waits for the Symmetrix to acknowledge that the foreground split has occurred. SYMAPI then communicates with Symmetrix Enginuity to resume the write or close the ECA window.

6. The application resumes writing to the production devices.

The BCV devices now contain a restartable copy of the production data that is consistent up until the time of the instant split. The production application is unaware that the split or

ICO-IMG-000008

Host

DBMS

PowerPath orECA

SYMAPISYMCLI 1

2

3

4

5

6

Symmetrix

Applicationdata

LOGS

Applicationdata

Otherdata

BCV

BCV

BCV

BCV

EMC TimeFinder 129

Page 130: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

130

EMC Foundation Products

suspend/resume operation occurred. When the application on the secondary host is started using the BCVs, there is no record of a successful shutdown. Therefore, the secondary application instance views the BCV copy as a crashed instance and proceeds to perform the normal crash recovery sequence to restart.

When performing a consistent split, it is a good practice to issue host-based commands that commit any data that has not been written to disk before the split to reduce the amount of time on restart. For example on UNIX systems, the sync command can be run; from a database perspective, a checkpoint or equivalent should be executed.

TimeFinder/Mirror reverse splitBCVs can be mirrored to guard against data loss through physical drive failures. A reverse split is applicable for a BCV that is configured to have two local mirrors. It is generally used to recover from an unsuccessful restore operation. When data is restored from the BCV to the standard device, any writes that occur while the standard is being restored alter the original copy of data on the BCVs primary mirror. If the original copy of BCV data is needed again at a later time, it can be restored to the BCVs primary mirror from the BCVs secondary mirror using a reverse split. For example, whenever logical corruption is reintroduced to a database during a recovery process (following a BCV restore), both the standard device and the primary BCV mirror are left with corrupted data. In this case, a reverse split can restore the original BCV data from a BCVs secondary mirror to its primary mirror.

This is particularly useful when performing a restore and immediately restarting processing on the standard devices when the process may have to be restarted many times.

Note: Reverse split is not available when protected restore is used to return the data from the BCVs to the standards.

EMC Replication ManagerEMC Replication Manager is an EMC software application that dramatically simplifies the management and use of disk-based replications to improve the availability of users’ mission-critical data and rapid recovery of that data in case of corruption.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 131: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Replication Manager makes it easy to create point-in-time, disk-based replicas of applications, file systems, or logical volumes residing on existing storage arrays. Specifically, Replication Manager can:

◆ Create point-in-time replicas of production data in seconds.

◆ Facilitate quick, frequent, and non-destructive backups from replicas.

◆ Mount replicas to alternate hosts to facilitate offline processing (for example, decision-support services, integrity checking, and offline reporting).

◆ Restore deleted or damaged information quickly and easily from a disk replica.

◆ Set the retention period for replicas so that storage is made available automatically.

Replication Manager helps users manage replicas as if they were tape cartridges in a tape library unit. The creation of replicas may be scheduled or replicas may be created on demand, with predefined expiration periods and automatic mounting to alternate hosts for backups or scripted processing. Different levels of access (assigned to individual users) ensure system and replica integrity.

Replicas created by Replication Manager can be stored on Symmetrix TimeFinder/Mirrors, Clones, or Snapshots (VDEVs); CLARiiON clones or snapshots; Invista® clones, Celerra® SnapSure™ local snapshots, or Celerra Replicator™ remote snapshots. Replication Manager also allows you to perform local and remote replications using TimeFinder, Symmetrix Remote Data Facility (SRDF), SAN Copy™, Navisphere®, Celerra iSCSI, and/or replicas of MirrorView™/S secondaries using SnapView™/Snap and SnapView/Clone replication technologies where they are appropriate. Additionally, Replication Manager automatically controls the complexities associated with creating, mounting, restoring, and expiring replicas of data.

There are several phases to the recovery process and Replication Manager helps to shorten each of these phases. The following list describes how Replication Manager shortens each of the phases in the data recovery process:

◆ Latent Error phase

An error occurs in the data, but is not immediately detected. Replication Manager can provide separate replicas to verify the integrity of the data and actively search for errors. Proactive data

EMC Replication Manager 131

Page 132: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

132

EMC Foundation Products

scrubbing, a process by which Replication Manager creates a point-in-time replica and automated scripts scrub the data to find errors, can reduce or eliminate the latent error phase.

◆ Evaluation phase

After an error is detected, you must evaluate the data and determine the best way to fix the error. You might choose to perform a surgical repair, making manual changes to the database to fix the error. Or, you might decide to restore the database from a replica and recover that database by applying the logs. You can shorten the evaluation process by creating a replica of the damaged database and using the replica to perform the evaluation, rather than using the production data.

◆ Surgery phase

If you decide to perform a surgical repair, you can create a replica of the current data before the surgery. If something goes wrong during the manual database edit, you can restore the replica and attempt the surgery again. Restoring a replica is much faster than restoring from tape after a failed attempt to surgically repair the database. When the system is down, it is important to save as much time as possible.

◆ Restore and Roll Forward phase

If you decide to restore the data from a replica, you can check each replica and choose the most recent replica that does not have the latent error. After that replica has been restored, use logs to roll the database forward, and then manually restart the database. You cannot perform the same validity check before restoring a tape.

Replication Manager can shorten the overall recovery process. Most other products focus on shortening only the Restore phase, while Replication Manager offers a complete solution that can save time throughout all phases of the recovery process.

Replication Manager uses Symmetrix API (SYMAPI) Solutions Enabler software and interfaces to the storage array’s native software to manipulate the supported disk arrays. (The Replication Manager software utilizes Java-based client-server architecture.) Replication Manager also offers a logical view of the production data and corresponding replicas; replicas are managed and controlled with the easy-to-use Replication Manager console.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 133: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC Storage Resource ManagementThe Storage Resource Management (SRM) component of EMC Solutions Enabler extends the basic SYMCLI command set to include SRM commands that allow users to discover and examine attributes of various objects on a host or in the EMC storage enterprise. SYMCLI commands support SRM in the following areas:

◆ Data objects and files

◆ Relational databases

◆ File systems

◆ Logical volumes and volume groups

◆ Performance statistics

SRM allows users to examine the mapping of storage devices and the characteristics of data files and objects. These commands allow the examination of relationships between extents and data files or data objects, and how they are mapped on storage devices. Frequently, SRM commands are used with TimeFinder and SRDF to create point-in-time copies for backup and restart.

Figure 36 outlines the process of how SRM commands are used with TimeFinder in a database environment.

Figure 36 SRM commands

Host

DBMS

PowerPath orECA

SYMAPISYMCLI

2

1

3

4

SYMCLI Mapping Command

Invoke Database APIsIdentify devices

Map database objects between database metadata and the SYMCLI database

TimeFinder SPLIT

SRM

ICO-IMG-000011

DEV001

BCV

DEV002

BCV

DEV003

BCV

DEV004

BCV

DEV001

Data

DEV002

Data

DEV003

Log

DEV004

Log

EMC Storage Resource Management 133

Page 134: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

134

EMC Foundation Products

EMC Solutions Enabler with a valid license for TimeFinder and SRM is installed on the host. In addition, the host must also have PowerPath or use ECA, and must be utilized with a supported DBMS system. When splitting a BCV, the system must perform housekeeping tasks that may require a few seconds on a busy Symmetrix system. These tasks involve a series of steps (shown in Figure 36 on page 133) that result in the separation of the BCV from its paired standard:

1. Using the SRM base mapping commands, first query the Symmetrix system to display the logical-to-physical mapping information about any physical device, logical volume, file, directory, and/or file system.

2. Using the database mapping command, query the Symmetrix to display physical and logical database information.

3. Next, use the database mapping command to translate:

• The devices of a specified database into a device group or a consistency group, or

• The devices of a specified table space into a device group or a consistency group.

4. The BCV is split from the standard device.

Table 5 lists the SYMCLI commands used to examine the mapping of data objects.

SRM commands allow users to examine the host database mapping and the characteristics of a database. The commands provide listings and attributes that describe various databases, their structures, files, table spaces, and user schemas. Typically, the database commands work with Oracle, Informix, SQL Server, Sybase, Microsoft Exchange, SharePoint Portal Server, and DB2 LUW database applications.

Table 5 Data object SRM commands

Command Argument Action

symrslv pd Displays logical to physical mapping information about any physical device.

lv Displays logical to physical mapping information about a logical volume.

file Displays logical to physical mapping information about a file.

dir Displays logical to physical mapping information about a directory.

fs Displays logical to physical mapping information about a file system.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 135: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Table 6 lists the SYMCLI commands used to examine the mapping of database objects.

The SYMCLI file system SRM command allows users to investigate the file systems that are in use on the operating system. This command provides listings and attributes that describe file systems, directories, and files, and their mapping to physical devices and extents.

Table 7 lists the SYMCLI command that can be used to examine a file system mapping.

Table 6 Data object mapping commands

Command Argument Action

symrdb list Lists various physical and logical database objects:• Current relational database instances available• Table spaces, tables, files, or schemas of a database• Files, segments, or tables of a database table space or schema

show Shows information about a database object: table space, tables, file, or schema of a database, File, segment, or a table of a specified table space or schema

rdb2dg Translates the devices of a specified database into a device group.

rdb2cg Translates the devices of a specified table space into a composite group or a consistency group.

tbs2cg Translates the devices of a specified table space into a composite group. Only data database files are translated.

tbs2dg Translates the devices of a specified table space into a device group. Only data database files are translated.

Table 7 File system SRM commands to examine file system mapping

Command Argument Action

symhostfs list Displays a list of file systems, files, or directories.

show Displays more detail information about a file system or file system object.

EMC Storage Resource Management 135

Page 136: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

136

EMC Foundation Products

SYMCLI logical volume SRM commands allow users to map logical volumes to display a detailed view of the underlying storage devices. Logical volume architecture defined by a Logical Volume Manager (LVM) is a means for advanced applications to improve performance by the strategic placement of data.

Table 8 lists the SYMCLI commands that can be used to examine a logical volume mapping.

SRM performance statistics commands allow users to retrieve statistics about a host’s CPU, disk, and memory.

Table 9 lists the statistics commands.

Table 8 File system SRM command to examine logical volume mapping

Command Argument Action

symvg deport Deports a specified volume group so it can be imported later.

import Imports a specified volume group.

list Displays a list of volume groups defined on the host system by the logical volume manager.

rescan Rescans all the volume groups.

show Displays more detail information about a volume group.

vg2cg Translates volume groups to composite groups.

vg2dg Translates volume groups to device groups.

symlv list Displays a list of logical volumes on a specified volume group.

show Displays detail information (including extent data) about a logical volume.

Table 9 SRM statistics command

Command Argument Action

symhost show Displays host configuration information.

stats Displays performance statistics.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 137: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC PowerPathEMC PowerPath is host-based software that works with networked storage systems to intelligently manage I/O paths. PowerPath manages multiple paths to a storage array. Supporting multiple paths enables recovery from path failure because PowerPath automatically detects path failures and redirects I/O to other available paths. PowerPath also uses sophisticated algorithms to provide dynamic load balancing for several kinds of path management policies that the user can set. With the help of PowerPath, systems administrators are able to ensure that applications on the host have highly available access to storage and perform optimally at all times.

A key feature of path management in PowerPath is dynamic, multipath load balancing. Without PowerPath, an administrator must statically load balance paths to logical devices to improve performance. For example, based on current usage, the administrator might configure three heavily used logical devices on one path, seven moderately used logical devices on a second path, and 20 lightly used logical devices on a third path. As I/O patterns change, these statically configured paths may become unbalanced, causing performance to suffer. The administrator must then reconfigure the paths, and continue to reconfigure them as I/O traffic between the host and the storage system shifts in response to usage changes.

Designed to use all paths concurrently, PowerPath distributes I/O requests to a logical device across all available paths, rather than requiring a single path to bear the entire I/O burden. PowerPath can distribute the I/O for all logical devices over all paths shared by those logical devices, so that all paths are equally burdened. PowerPath load balances I/O on a host-by-host basis, and maintains statistics on all I/O for all paths. For each I/O request, PowerPath intelligently chooses the least-burdened available path, depending on the load-balancing and failover policy in effect. In addition to improving I/O performance, dynamic load balancing reduces management time and downtime because administrators no longer need to manage paths across logical devices. With PowerPath, configurations of paths and policies for an individual device can be changed dynamically, taking effect immediately, without any disruption to the applications.

PowerPath provides the following features and benefits:

EMC PowerPath 137

Page 138: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

138

EMC Foundation Products

◆ Multiple paths, for higher availability and performance — PowerPath supports multiple paths between a logical device and a host bus adapter (HBA, a device through which a host can issue I/O requests). Having multiple paths enables the host to access a logical device even if a specific path is unavailable. Also, multiple paths can share the I/O workload to a given logical device.

◆ Dynamic multipath load balancing — Through continuous I/O balancing, PowerPath improves a host’s ability to manage heavy I/O loads. PowerPath dynamically tunes paths for performance as workloads change, eliminating the need for repeated static reconfigurations.

◆ Proactive I/O path testing and automatic path recovery — PowerPath periodically tests failed paths to determine if they are available. A path is restored automatically when available, and PowerPath resumes sending I/O to it. PowerPath also periodically tests available but unused paths, to ensure they are operational.

◆ Automatic path failover — PowerPath automatically redirects data from a failed I/O path to an alternate path. This eliminates application downtime; failovers are transparent and non-disruptive to applications.

◆ Enhanced high availability cluster support — PowerPath is particularly beneficial in cluster environments, as it can prevent interruptions to operations and costly downtime. PowerPath’s path failover capability avoids node failover, maintaining uninterrupted application support on the active node in the event of a path disconnect (as long as another path is available).

◆ Consistent split — PowerPath allows users to perform TimeFinder consistent splits by suspending device writes at the host level for a fraction of a second while the foreground split occurs. PowerPath software provides suspend-and-resume capability that avoids inconsistencies and restart problems that can occur if a database-related BCV is split without first quiescing the database.

◆ Consistency Groups — Consistency groups are a composite group of Symmetrix devices specially configured to act in unison to maintain the integrity of a database distributed across multiple SRDF arrays controlled by an open systems host computer.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 139: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

EMC Open ReplicatorEMC Open Replicator enables distribution and/or consolidation of remote point-in-time copies between EMC Symmetrix and qualified storage systems such as the EMC CLARiiON storage arrays. By leveraging the high-end Symmetrix storage architecture, Open Replicator offers unmatched deployment flexibility and massive scalability.

Open Replicator can be used to provide solutions to business processes that require high-speed data mobility, remote vaulting and data migration. Specifically, Open Replicator enables customers to:

◆ Rapidly copy data between Symmetrix, CLARiiON and third-party storage arrays.

◆ Perform online migrations from qualified storage to Symmetrix arrays with minimal disruption to host applications.

◆ Push a point-in-time copy of applications from Symmetrix arrays to a target volume on qualified storage arrays with incremental updates.

◆ Copy from source volumes on qualified remote arrays to Symmetrix volumes.

Open Replicator is tightly integrated with the EMC TimeFinder and SRDF family of products, providing enterprises with highly flexible and lower-cost options for remote protection and migration. Open Replicator is ideal for applications and environments where economics and infrastructure flexibility outweigh RPO and RTO requirements. Open Replicator enables businesses to:

◆ Provide a cost-effective and flexible solution to protect lower-tier applications.

◆ Reduce TCO by pushing or pulling data from Symmetrix systems to other qualified storage arrays in conventional SAN/WAN environments.

◆ Create remote point-in-time copies of production applications for many ancillary business operations such as data vaulting.

◆ Obtain cost-effective application restore capabilities with minimal RPO/RTO impact.

◆ Comply with industry policies and government regulations.

EMC Open Replicator 139

Page 140: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

140

EMC Foundation Products

EMC Virtual ProvisioningVirtual Provisioning™ (commonly known as thin provisioning) was released with the 5773 Enginuity operating environment. Virtual Provisioning allows for storage to be allocated/accessed on-demand from a pool of storage servicing one or many applications. This type of approach has multiple benefits:

◆ Enables LUNs to be “grown” into over time with no impact to the host or application as space is added to the thin pool

◆ Only delivers space from the thin pool when it is written to, that is, on-demand. Overallocated application components only use space that is written to — not requested.

◆ Provides for thin-pool wide striping and for the most part relieves the storage administrator of the burden of physical device/LUN configuration

Virtual Provisioning introduces two new devices to the Symmetrix: a thin device and a data device.

Thin device

A thin device is a “host accessible device” that has no storage directly associated with it. Thin devices have pre-configured sizes and appear to the host to have that exact capacity. Storage is allocated in chunks when a block is written to for the first time. Zeros are provided to the host for data that is read from chunks that have not yet been allocated.

Data device

Data devices are specifically configured devices within the Symmetrix that are containers for the written-to blocks of thin devices. Any number of data devices may comprise a data device pool. Blocks are allocated to the thin devices from the pool on a round robin basis. The allocation block size is 768K.

Figure 37 on page 141 depicts the components of a Virtual Provisioning configuration:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 141: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

Figure 37 Virtual Provisioning components

New Symmetrix VMAX Virtual Provisioning features

Solutions Enabler 7.1 and Enginuity 5874 SR1 introduce two new features to Symmetrix Virtual Provisioning — thin pool write rebalancing and zero space reclamation. Thin pool write rebalancing provides the ability to automatically rebalance allocated extents on data devices over the entire pool when new data devices are added. Zero space reclamation allows users to reclaim space from tracks of data devices that are all zeros.

Thin pool write rebalanceThin pool write rebalancing for Virtual Provisioning pools extends the functionality of the Virtual Provisioning feature by implementing a method to normalize the used capacity levels of data devices within a Virtual data pool after new data drives are added or existing data drives are drained. This feature introduces a background optimization task to scan the used capacity levels of the data devices within a virtual pool and perform movements of multiple track groups from the most utilized pool data devices to the least used pool

Pool A

Pool B

Datadevices

Datadevices

ThinDevices

ICO-IMG-000493

EMC Virtual Provisioning 141

Page 142: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

142

EMC Foundation Products

data devices. The process can be scheduled to run only when changes to virtual pool composition make it necessary and user controls exist to specify what utilization delta will trigger track group movement.

Zero space reclamationZero space reclamation or Virtual Provisioning space reclamation provides the ability to free, also referred to as "de-allocate," storage extents found to contain all zeros. This feature is an extension of the existing Virtual Provisioning space de-allocation mechanism. Previous versions of Enginuity and Solutions Enabler allowed for reclaiming allocated (reserved but unused) thin device space from a thin pool. Administrators now have the ability to reclaim both allocated/unwritten extents as well as extents filled with host-written zeros within a thin pool. The space reclamation process is nondisruptive and can be executed with the targeted thin device ready and read/write to operating systems and applications.

When the space reclamation process is initiated, a back-end disk director (DA) task that will examine the allocated thin device extents on specified thin devices is started. A thin device extent is 768 KB (or 12 tracks) in size and is the default unit of storage at which allocations occur. For each allocated extent, all 12 tracks will be brought into Symmetrix cache and examined to see if they contain all zero data. If the entire extent contains all zero data, the extent will be de-allocated and added back into the pool, making it available for a new extent allocation operation. An extent that contains any non-zero data is not reclaimed.

New Symmetrix VMAX TimeFinder/Clone featuresSolutions Enabler 7.1 and Enginuity 5874 SR1 introduce the ability to clone from thick to thin devices using TimeFinder/Clone. Thick-to-thin TimeFinder/Clone allows application data to be moved from standard Symmetrix volumes to virtually provisioned storage within the same array. For some workloads virtually provisioned volumes offer advantages with allocation utilization, ease of use and performance through automatic wide striping. Thick-to-thin TimeFinder/Clone provides an easy way to move workloads that benefit from Virtual Provisioning into that storage paradigm. Migration from thin devices back to fully provisioned devices is also possible. The source and target of the migration may be of different protection types and disk technologies, offering versatility with

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 143: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

protections schemes and disk tier options. Thick-to-thin TimeFinder Clone will not disrupt hosts or internal array replication sessions during the copy process.

EMC Virtual Provisioning 143

Page 144: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

144

EMC Foundation Products

EMC Fully Automated Storage Tiering (FAST)With the release of Enginuity 5874, EMC now offers the first generation of Fully Automated Storage Tiering technology. EMC Symmetrix VMAX Fully Automated Storage Tiering (FAST) for standard provisioned environments automates the identification of data volumes for the purposes of allocating or re-allocating application data across different performance tiers within an array. FAST proactively monitors workloads at the volume (LUN) level in order to identify "busy" volumes that would benefit from being moved to higher-performing drives. FAST will also identify less "busy" volumes that could be relocated to higher-capacity drives, without existing performance being affected. This promotion/demotion activity is based on policies that associate a storage group to multiple drive technologies, or RAID protection schemes, based on the performance requirements of the application contained within the storage group. Data movement executed during this activity is performed nondisruptively, without affecting business continuity and data availability.

The primary benefits of FAST include:

◆ Automating the process of identifying volumes that can benefit from Enterprise Flash Drives and/or that can be kept on higher-capacity, less-expensive drives without impacting performance

◆ Improving application performance at the same cost, or providing the same application performance at lower cost. Cost is defined as space, energy, acquisition, management and operational expense.

◆ Optimizing and prioritizing business applications, which allows customers to dynamically allocate resources within a single array

◆ Delivering greater flexibility in meeting different price/performance ratios throughout the lifecycle of the information stored

Management and operation of FAST are provided by SMC, as well as the Solutions Enabler Command Line Interface (SYMCLI). In addition, detailed performance trending, forecasting, alerts, and resource utilization are provided through Symmetrix Performance Analyzer (SPA). Ionix ControlCenter provides the capability for advanced reporting and analysis to be used for chargeback and capacity planning.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 145: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC Foundation Products

FAST VPFAST VP with Enginuity 5875 extends current FAST capabilities to include both thick (standard) devices and thin (virtually provisioned) devices. Building on the original version of FAST, EMC now offers sub-LUN data movement for thin devices providing increased capacity utilization.

Typically, only a small portion of any LUN is actively supporting workload I/O activity. Providing sub-LUN data movement at a much more granular level (smaller pieces) means production workloads can enjoy the benefits of improved performance and improved capacity utilization. For example, sub-LUN FAST can experience the benefits of improved performance from placing data on Enterprise Flash Drives (EFDs) while using fewer EFDs. Since a majority of the data is low activity data (due to workload skew), it can be placed on the FC and SATA drives, preserving performance while saving cost. Providing sub-LUN data movement at a much more granular level, called extents, allows FAST to be more responsive to changes in the production workload activity, thereby:

◆ Improving performance

◆ Efficiently utilizing capacity

◆ Requiring fewer EFDs in the system

◆ Allowing more data to be placed on SATA drives

EMC Fully Automated Storage Tiering (FAST) 145

Page 146: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

146

EMC Foundation Products

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 147: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

3

Every database environment has the potential of becoming a victim of an outage. Planned outages typically occur when a maintenance activity that will affect the availability of a system needs to be performed; unplanned outages occur when an unexpected event such as a power interruption or a natural disaster like fire or flooding affects the availability of a system. And today’s highly competitive market demands high availability, continuous operation, or rapid recovery when an outage occurs. Today, an event that makes data unavailable, even for a relatively short period of time, has the potential to have a significant impact on a company and its bottom line.

When a outage that affects a database environment does occur, a primary goal is usually to get the database back up and running as quickly as possible. Depending on the nature of the outage, different recovery techniques may need to be employed to satisfy this goal. This chapter is designed to introduce you to some of the tools that are available with DB2 version for Linux, UNIX, and Windows (LUW) that can be used to assist in returning a database environment back to “normal” when an outage occurs. Topics covered include:

◆ DB2 LUW database back up and recovery concepts .................. 148◆ Performing crash recovery operations.......................................... 155◆ Performing back up and recovery operations ............................. 159◆ Back up and recovery with split mirroring .................................. 181◆ Providing continuous availability ................................................. 187◆ High availability disaster recovery (HADR)................................ 194

DB2 for Linux, UNIX, andWindows Disaster

Recovery Concepts

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts 147

Page 148: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

148

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

DB2 LUW database back up and recovery conceptsThe concept of backing up a database is the same as that of backing up any other set of data files: you make a copy of the data and store it on a different medium where it can be accessed in the event the original becomes damaged or destroyed. The simplest way to back up a DB2 database is to shut it down to ensure that no further transactions are processed and then back it up using the Backup utility provided with DB2. Once a back up image has been created, you can use it to rebuild the database if for some reason it becomes damaged or corrupted.

The process of rebuilding a database is known as recovery, and three types of recovery are available with DB2:

◆ Crash recovery

◆ Version recovery

◆ Roll-forward recovery

Crash recoveryTo increase performance, much of the transactional operations that are performed against a DB2 database take place completely in memory. So when an event or condition that causes a database or the DB2 Database Manager to end abnormally occurs, one or more transaction failures may result. And when a transaction failure takes place, all work done by partially completed transactions that has not yet been externalized to the database is lost. As a result, the database may be left in an inconsistent state (and therefore will be unusable). Crash recovery is the process used to return such a database to a consistent and usable state. Crash recovery is performed by using information stored in the transaction log files to complete any committed transactions that were in memory (but had not yet been externalized to storage) when the failure occurred, roll back any incomplete transactions found, and purge any uncommitted transactions from memory. Once a database is returned to a consistent and usable state, it has attained what is known as a “point of consistency.” Crash recovery is illustrated in Figure 38 on page 149.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 149: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 38 Crash recovery

A crash recovery operation is initiated by executing the RESTART DATABASE command.

Note: By default, a DB2 database is configured such that crash recovery will automatically be performed if an application or user attempts to establish a connection to it while it is in an inconsistent state. (This behavior can be changed by assigning the value OFF to a database’s autorestart configuration parameter.)

Version recovery

Version recovery is a process that is used to return a database to the state it was in at the time a particular back up image was made. Version recovery is performed by replacing the current version of a database with a previous version, using a copy that was made with a back up operation—the entire database is rebuilt using a back up image that was created earlier. Unfortunately, when version recovery

Transaction 1

Transaction 2

Transaction 3

Transaction 4

Transaction 1 - COMMIT

Transaction 2 - ROLLBACK

Transaction 3 - ROLLBACK

Transaction 4 - ROLLBACK

RESTART

DatabaseLog Files

Time

RASHC

!

ICO-IMG-000088

DB2 LUW database back up and recovery concepts 149

Page 150: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

150

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

is performed, all changes made to the database since the back up image used was created are lost. Version recovery is illustrated in Figure 39.

Figure 39 Version recovery

A version recovery operation is initiated by executing the RESTORE DATABASE command; database back up images needed for version recovery operations are generated by executing the BACKUP DATABASE command.

Roll-forward recovery

Roll-forward recovery takes version recovery one step further by rebuilding a database or one or more individual table spaces using an existing back up image, and then replaying information stored in transaction log files to return the database/table spaces to the state they were in at a specific point in time. In order to perform a roll-forward recovery operation, you must have archival logging enabled, you must have either a full back up image of the database or a complete set of table space back up images available, and you must

Execute transactions RESTORE

ExistingDatabase

ModifiedDatabase

RestoredDatabase

Time

RASHC

!

ICO-IMG-000090

BackupImage

BACKUP

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 151: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

have access to all archived log files that have been created since the back up image(s) used were made. Roll-forward recovery is illustrated in Figure 40.

Figure 40 Roll-forward recovery

A roll-forward recovery operation is initiated by executing the ROLLFORWARD DATABASE command.

Recoverable and nonrecoverable databasesAlthough any DB2 database can be recovered from a back up image, whether a database is considered recoverable or nonrecoverable is determined by the values of the database's logarchmeth1 and logarchmeth2 configuration parameters; when both of these configuration parameters are set to OFF—which is the default—circular logging is used, and the database is considered nonrecoverable. When either of the configuration parameters are assigned a value other than, OFF the database is considered recoverable. Crash recovery and version recovery operations can be

Execute transactions RESTOREROLLFORWARD

ExistingDatabase

ModifiedDatabase

RestoredDatabase

RestoredModifiedDatabase

Log Files

Time

RASHC

!

ICO-IMG-000089

BackupImage

BACKUP

DB2 LUW database back up and recovery concepts 151

Page 152: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

152

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

performed on nonrecoverable databases; crash recovery, version recovery, and roll-forward recovery are possible when a database is recoverable. Other differences between recoverable and nonrecoverable databases can be seen in Table 10.

Note: Some relational database management systems refer to nonrecoverable databases as restartable databases. Typically, the recovery options available for a restartable database are the same as for a nonrecoverable database.

The decision of whether a database should be recoverable or nonrecoverable is based on several factors:

◆ If a database is used to support read-only operations, it can be nonrecoverable; because no transactions will be logged, roll-forward recovery is not necessary.

◆ If relatively few changes will be made to a database, and if all changes made can be easily re-created, it may be desirable to leave the database nonrecoverable.

◆ If a large amount of changes will be made to a database, or if it would be difficult and time-consuming to re-create all changes made, the database should be recoverable.

Table 10 Differences between recoverable and nonrecoverable databases

Recoverable database Nonrecoverable database

Archive logging is used. Circular logging is used.

The database can be backed up at any time, regardless of whether applications are connected to it and transactions are in progress.

The database can be backed up only when all connections to it have been terminated.

The entire database can be backed up, or individual table spaces can be backed up. Table spaces can also be restored independently.

The entire database must be backed up; table space-level back up operations are not supported.

A damaged database can be returned to the state it was in at any point in time; crash recovery, version recovery, and roll-forward recovery are supported.

A damaged database can be returned only to the state it was in at the time the last back up image was taken; only crash recovery and version recovery are supported.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 153: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Online versus offline back up and recoveryFrom a back up and recovery perspective, a database is considered to be either online or offline: when a database is offline, other applications and users cannot gain access to it; when a database is online, just the opposite is true. Back up operations can only be performed against a nonrecoverable database (that is, a database that has been configured to use circular logging) while it is offline; recoverable databases (i.e., databases that use archival logging) can be backed up at any time, regardless of whether the database is offline or online. However, before a database (recoverable or nonrecoverable) can be restored, it must first be taken offline. (Individual table spaces can be both backed up and restored while a database remains online.)

When an online back up operation is performed, archival logging ensures that all changes made while the back up image is being made are captured and can be re-created with a roll-forward recovery operation. Additionally, online back up operations can be performed against individual table spaces as well as entire databases. And, unlike when full database version recovery operations are performed, table space version recovery operations and table space roll-forward recovery operations can be performed while a database remains online—provided the table space that contains the system catalog is not the table space being recovered. While an online table space back up operation is performed, the table space being backed up remains available for use, and all modifications to the data stored in that table space are recorded in the transaction log files. However, when an online restore or online roll-forward recovery operation is performed against a table space, the table space itself is taken offline and is not available for use until the restore/roll-forward recovery operation is complete.

Incremental and delta back up and recoveryAs the size of a database grows, the time and hardware needed to back up and recover the databases also grow substantially. Thus, creating full database and table space back up images is not always the best approach when dealing with large databases because the storage requirements for multiple copies of such back up images can be enormous. A better alternative is to create a full back up image periodically and one or more incremental back up images on a more frequent basis. An incremental back up is a back up image that

DB2 LUW database back up and recovery concepts 153

Page 154: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

154

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

contains only pages that have been updated since the previous back up image was made. Along with updated data and index pages, each incremental back up image also contains all of the initial database metadata (such as database configuration, table space definitions, recovery history file, etc.) that is normally found in a full database back up image.

Two types of incremental back up images can be produced: incremental and delta. An incremental back up image is a copy of all database data that has changed since the most recent, successful, full back up image was created. An incremental back up image is also known as a cumulative back up image because the last incremental back up image in a series of incremental back up images made over a period of time will contain the contents of all of the previous incremental back up images. The predecessor of an incremental back up image is always the most recent successful full back up image of the same object.

A delta back up image, on the other hand, is a copy of all database data that has changed since the last successful back up (full, incremental, or delta) of the database or table space in question. For this reason, a delta back up image is also known as a differential, or noncumulative, back up image. The predecessor of a delta back up image is the most recent successful back up image that contains a copy of each of the objects found in the delta back up image.

The one thing that incremental and delta back up images have in common is that before either type of back up image can be created; a full back up image must already exist. Where they differ can be seen both in their creation (usually, delta back up images are smaller and can be created faster than incremental back up images) and in how they are used for recovery. When incremental back up images are taken, database recovery involves restoring the database using the most recent full back up image available and applying the most recent incremental back up image produced. On the other hand, when delta back up images are taken, database recovery involves restoring the database using the most recent full back up image available and applying each delta back up image produced since the full back up image used was made, in the order in which they were created.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 155: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Performing crash recovery operationsEarlier, we saw that whenever transaction processing is interrupted by an unexpected event (such as a power failure), the database with which the transaction was interacting at the time is placed in an inconsistent state. Such a database will remain in an inconsistent state and will be unusable until a crash recovery operation returns it to some point of consistency. (An inconsistent database will notify users and applications that it is unusable via a return code and error message that is generated each time an attempt to activate it or establish a connection to it is made.)

So just how is a crash recovery operation initiated? One way is by executing the RESTART DATABASE command from the DB2 Command Line Processor (CLP). The basic syntax for this command is:

RESTART [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>><DROP PENDING TABLESPACES ([TS_Name], ... )><WRITE RESUME>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database that is to be returned to a consistent and usable state.

◆ UserName — Identifies the name assigned to a specific user under whose authority the crash recovery operation is to be performed.

◆ Password — Identifies the password that corresponds to the name of the user under whom the crash recovery operation is to be performed.

◆ TS_Name — Identifies the name assigned to one or more table spaces that are to be disabled and placed in “Drop Pending” state during the crash recovery process.

If a problem occurs with a table space container during the restart process, the DROP PENDING TABLESPACES ([TS_Name]) option can be used to place one or more table spaces in “Drop Pending” state. This allows the database to be successfully restarted, after which the offending table space(s) can be dropped and, if necessary, re-created. A list of troubled table space names can be found in the administration notification log if a database restart operation fails because of table space container problems.

Performing crash recovery operations 155

Page 156: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

156

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Note: If there is only one system temporary table space in the database, and it is placed in “Drop Pending” state, a new system temporary table space must be created immediately following a successful database restart operation.

If all database I/O happened to be suspended at the time a crash occurred, the WRITE RESUME option of the RESTART command can be used to resume database I/O as part of the crash recovery process.

Thus, if you wanted to perform a crash recovery operation on an unusable database named SAMPLE, you could do so by executing a RESTART command that looks something like this:

RESTART DATABASE sample

On the other hand, if you wanted to perform a crash recovery operation on a database named SAMPLE and place a table space named TEMPSPACE1 in “Drop Pending” state, you could do so by executing a RESTART command that looks something like this:

RESTART DATABASE sample DROP PENDING TABLESPACES (TEMPSPACE1)

You can also initiate a crash recovery operation for a particular database by selecting the Restart action from the Databases menu found in the Control Center. Figure 41 on page 157 shows the Control Center menu items that must be selected in order to perform a crash recovery operation on a DB2 database.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 157: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 41 Initiating a crash recovery operation from the Control Center

It is possible to configure a database in such a way that crash recovery will automatically be performed, if necessary, when an application or user attempts to establish a connection to it. This is done by assigning the value ON to the autorestart database configuration parameter. (DB2 checks the state of a database the first time an attempt to establish a connection to the database is made, and if it determines that the database is in an inconsistent state, it executes the RESTART command automatically if the autorestart database configuration parameter is set to ON — by default, when a database is created, the autorestart configuration parameter is set to ON.)

ICO-IMG-000091

Performing crash recovery operations 157

Page 158: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

158

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

It is important to note that if a crash recovery operation is performed on a recoverable database (i.e., a database that has been configured to support forward recovery operations), and an error occurs during the recovery process that is attributable to an individual table space, that table space will be taken offline and will no longer be accessible until it is repaired. This has no effect on crash recovery itself, and upon completion of the crash recovery operation, all other table spaces in the database will be accessible and connections to the database can be established provided the table space that is taken offline is not the table space that contains the system catalogs. If the table space containing the system catalogs is taken offline, it must be repaired before any connections to the database will be permitted.

A word about soft checkpointsIt was mentioned earlier that crash recovery is performed by using information stored in the transaction log files to roll back all incomplete transactions found and complete any committed transactions that were still in memory (but had not yet been externalized to storage) when the transaction failure occurred. As you might imagine, if the transaction log files for a database are large, it could take quite a while to scan the entire log and check for corresponding rows in the database. However, it is usually not necessary to scan the entire log because records recorded at the beginning of a log file are usually associated with transactions that have been completed and have already been externalized to the database. Furthermore, if these records can be skipped, the amount of time required to recover a crashed database can be greatly reduced.

That's where a mechanism known as the soft checkpoint comes in. DB2 uses a log control file to determine which records from a specific log file need to be applied to the database. This log control file is written to disk periodically, and the frequency at which this file is updated is determined by the value of the softmax database configuration parameter. Once the log control file is updated, the soft checkpoint information stored in it establishes where in a transaction log file crash recovery should begin; all records in a log file that precede the soft checkpoint are assumed to be associated with transactions that have already been written to the database and are ignored.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 159: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Performing back up and recovery operationsAlthough crash recovery can be used to resolve inconsistency problems that result from power interruptions or application failures, it cannot be used to handle problems that arise when the storage media being used to hold a database's files becomes corrupted or fails. In order to handle these types of problems, some kind of back up (and recovery) program must be put in place.

A database recovery strategy should include a regular schedule for making database back up images and, in the case of partitioned database systems, include making back up images whenever the system is scaled (i.e., whenever database partition servers are added or dropped). Additionally, the strategy used should ensure that all information needed is available when database recovery is necessary, and it should include procedures for restoring command scripts, applications, user-defined functions (UDFs), stored procedure code in operating system libraries, and load copies as well as database data. To help with such a strategy, DB2 provides four utilities that are used to facilitate backing up and restoring a database:

◆ The Backup utility

◆ The Restore utility

◆ The Roll-forward utility

◆ The Recover utility

The DB2 Backup utility

The single most important item you can possess that will prevent catastrophic data losses in the event storage media becomes corrupted or fails is a database back up image. A database back up image is essentially a copy of an entire database that includes its metadata, its objects, its data, and optionally, its transaction logs. Once created, a back up image can be used at any time to return a database to the exact state it was in at the time the back up image was made (version recovery). A good database recovery strategy should ensure that back up images are created on a regular basis and that back up copies of critical data are retained in a secure location and on different storage media from that used to house the database. Depending on the logging method used (circular or archival), database back up images can be made when a database is offline or

Performing back up and recovery operations 159

Page 160: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

160

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

while other users and applications are connected to it. (In order to back up a database while it is online, archival logging must be enabled.)

A back up image of a DB2 database, or a table space within a DB2 database, can be created by executing the BACKUP DATABASE command. The basic syntax for this command is:

BACKUP [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>><TABLESPACE ([TS_Name],...)<ONLINE><INCREMENTAL <DELTA>><TO [Location] | USE TSM <OPTIONS [TSMOptions]>><WITH [NumBuffers] BUFFERS><BUFFER [BufferSize]><PARALLELISM [ParallelNum]><UTIL_IMPACT_PRIORITY [Priority]><EXCLUDE LOGS | INCLUDE LOGS><WITHOUT PROMPTING>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database for which a back up image is to be created.

◆ UserName — Identifies the name assigned to a specific user under whose authority the back up operation is to be performed.

◆ Password — Identifies the password that corresponds to the name of the user under whom the back up operation is to be performed.

◆ TS_Name — Identifies the name assigned to one or more specific table spaces for which back up images are to be created.

◆ Location — Identifies the directory or device where the back up image created is to be stored.

◆ TSMOptions — Identifies options that are to be used by Tivoli Storage Manager (TSM) during the back up operation.

◆ NumBuffers — Identifies the number of buffers that are to be used to perform the back up operation. (By default, two buffers are used if this option is not specified.)

◆ BufferSize — Identifies the size, in pages, that each buffer used to perform the back up operation will be. (By default, the size of each buffer used by the Backup utility is determined by the value of the backbufsz DB2 Database Manager configuration parameter.)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 161: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ ParallelNum — Identifies the number of table spaces that can be read in parallel during the back up operation.

◆ Priority — Indicates that the Backup utility is to be throttled such that it executes at a specific rate so that its effect on concurrent database activity can be controlled. This parameter can be assigned a numerical value within the range of 1 to 100, with 100 representing the highest priority and 1 representing the lowest.

If the INCREMENTAL option is specified, an incremental back up image will be produced—an incremental back up image is a copy of all data that has changed since the last successful, full back up image was produced. If the INCREMENTAL DELTA option is specified, a delta back up image will be produced—a delta back up image is a copy of all data that has changed since the last successful back up image of any type (full, incremental, or delta) was produced.

Thus, if you wanted to create a full back up image of a database named SAMPLE that is currently offline and store the image created in a directory named BACKUPS on logical disk drive E:, you could do so by executing a BACKUP DATABASE command that looks something like this:

BACKUP DATABASE sampleUSER db2admin USING ibmdb2TO E:\backups

On the other hand, if you wanted to create an incremental back up image of a table space named TBSP1 and store the image created in a directory named BACKUPS on logical disk drive E: while the database it is associated with (named SAMPLE) remains online, you could do so by executing a BACKUP DATABASE command that looks something like this:

BACKUP DATABASE sampleUSER db2admin USING ibmdb2TABLESPACE (tbsp1) ONLINE INCREMENTAL TO E:\backups

Keep in mind that table space back up images can be created only if archival logging is being used; if circular logging is used instead, table space back up operations are not supported.

You can also create a back up image of a database or one or more table spaces using the Backup Wizard, which can be activated by selecting the Backup action from the Databases menu found in the Control Center. Figure 42 on page 162 shows the Control Center

Performing back up and recovery operations 161

Page 162: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

162

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

menu items that must be selected to activate the Backup Wizard; Figure 43 on page 163 shows how the first page of the Backup Wizard might look immediately after it is activated.

Figure 42 Invoking the Backup Wizard from the Control Center

ICO-IMG-000092

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 163: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 43 The first page of the Backup Wizard

Note: Only users with System Administrator (SYSADM) authority, System Control (SYSCTRL) authority, or System Maintenance (SYSMAINT) authority are allowed to back up a database or its table spaces.

A word about back up image naming conventionsWhen a backup image is saved to disk, it is stored in a single flat file that has been assigned a unique name using the following naming convention:

DB_ALIAS.TYPE.INSTANCE.NODE####.CATN####.TIMESTAMP.SEQ_NUM

ICO-IMG-000093

Performing back up and recovery operations 163

Page 164: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

164

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

The elements used in this naming convention are described in Table 11.

Thus, a full database-level back up image for a single-partition database named SAMPLE that was created at 7:45 AM on March 26, 2008 would be assigned a name that looks something like this:

SAMPLE.0.DB2.NODE0000.CATN0000.20080326074544.001

When a back up image is written to tape, file names are not created but the information shown in Table 11 is stored in the back up header for verification purposes.

Table 11 DB2 back up image file name components

Component Description

DB_ALIAS A 1- to 8-character database alias that identifies the database to which the back up image belongs. (If no database alias exists, the database name is used instead.)

TYPE A number that identifies the back up image type, where: • 0 represents a full, database-level back up image• 3 represents a table space-level back up image• 4 represents a back up image that was generated by the LOAD...COPY TO command

INSTANCE A 1- to 8-character name of the current instance. (This value is obtained from the DB2INSTANCE environment variable.)

NODE#### The database partition number. In single partition database environments, this is always NODE0000. In partitioned database environments, it is NODExxxx, where xxxx is the number that has been assigned to the database partition in the db2nodes.cfg file.

CAT#### The database partition number of the catalog partition for the database. In single partition database environments, this is always CATN0000. In partitioned database environments, it is CATNxxxx, where xxxx is the number that has been assigned to the database partition in the db2nodes.cfg file that contains the system catalog for the database.

TIMESTAMP A 14-character representation of the date and time that the back up image was created. This date/time representation is in the form yyyymmddhhnnss, where: • yyyy represents the year (1995 to 9999) • mm represents the month (01 to 12) • dd represents the day of the month (01 to 31) • hh represents the hour (00 to 23) • nn represents the minutes (00 to 59) • ss represents the seconds (00 to 59)

SEQ_NUM A 3-digit sequence number that is used as a file extension. This number differentiates multiple targets for the same back up image.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 165: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

The DB2 Restore utilityEarlier, we saw that version recovery is the process that returns a database to the state it was in at the time a back up image was made. This means that in order to perform a version recovery operation, at least one back up image must exist and be available. So just how is a version recovery operation initiated? The most common way is by executing the RESTORE DATABASE command. The basic syntax for this command is:

RESTORE [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>> [TABLESPACE ([TS_Name] ,... ) <ONLINE> |

HISTORY FILE <ONLINE>> |COMPRESSION LIBRARY <ONLINE>> |LOGS <ONLINE>]

<INCREMENTAL <AUTO | AUTOMATIC | ABORT>><FROM [SourceLocation] | USE TSM <OPTIONS [TSMOptions]>><TAKEN AT [Timestamp]> <TO [TargetLocation]><DBPATH ON [TargetPath]><INTO [TargetAlias]> <LOGTARGET [LogsLocation]><NEWLOGPATH [LogsLocation]><WITH [NumBuffers] BUFFERS><BUFFER [BufferSize]><REPLACE HISTORY FILE><REPLACE EXISTING><REDIRECT <GENERATE SCRIPT [ScriptFile]>> <PARALLELISM [ParallelNum]> <WITHOUT ROLLING FORWARD><WITHOUT PROMPTING>

or

RESTORE [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>> <REBUILD WITH [TABLESPACE ([TS_Name] ,... )] |

[ALL TABLESPACES IN [DATABASE | IMAGE]]<EXCEPT TABLESPACE ([TS_Name] ,... )>>

<INCREMENTAL <AUTO | AUTOMATIC | ABORT>><FROM [SourceLocation] | USE TSM <OPTIONS [TSMOptions]>><TAKEN AT [Timestamp]> <TO [TargetLocation]><DBPATH ON [TargetPath]><INTO [TargetAlias]> <LOGTARGET [LogsLocation]><NEWLOGPATH [LogsLocation]><WITH [NumBuffers] BUFFERS><BUFFER [BufferSize]><REPLACE HISTORY FILE><REPLACE EXISTING>

Performing back up and recovery operations 165

Page 166: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

166

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

<REDIRECT <GENERATE SCRIPT [ScriptFile]>> <PARALLELISM [ParallelNum]> <WITHOUT ROLLING FORWARD><WITHOUT PROMPTING>

or

RESTORE [DATABASE | DB] [DatabaseName] [CONTINUE | ABORT]

where:

◆ DatabaseAlias — Identifies the alias assigned to the database associated with the back up image that is to be used to perform a version recovery operation.

◆ UserName — Identifies the name assigned to a specific user under whom the version recovery operation is to be performed.

◆ Password — Identifies the password that corresponds to the name of the user under whom the version recovery operation is to be performed.

◆ TS_Name — Identifies the name assigned to one or more specific table spaces that are to be restored from a back up image. (If the table space name has changed since the back up image was made, the new name should be specified.)

◆ SourceLocation — Identifies the directory or device where the back up image to be used for version recovery is stored.

◆ TSMOptions — Identifies options that are to be used by Tivoli Storage Manager (TSM) during the version recovery operation.

◆ Timestamp — Identifies a timestamp that is to be used as search criterion when looking for a particular back up image to use for version recovery. (If no timestamp is specified, it is assumed that there is only one back up image stored at the source location specified.)

◆ TargetLocation — Identifies the directory where the storage containers for the database that will be created are to be stored—if the back up image is to be used to create a new database and automatic storage is used.

◆ TargetPath — Identifies the directory where the metadata for the database that will be created is to be stored—if the back up image is to be used to create a new database and automatic storage is used.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 167: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ TargetAlias — Identifies the alias to be assigned to the new database to be created.

◆ LogsLocation — Identifies the directory or device where log files for the new database are to be stored.

◆ NumBuffers— Identifies the number of buffers that are to be used to perform the version recovery operation. (By default, two buffers are used if this option is not specified.)

◆ BufferSize — Identifies the size, in pages, that each buffer used to perform the back up operation will be. (By default, the size of each buffer used by the RESTORE utility is determined by the value of the restbufsz DB2 Database Manager configuration parameter.)

◆ ScriptFile — Identifies the name of a file to which all commands needed to perform a redirected restore operation are to be written.

◆ ParallelNum — Identifies the number of table spaces that can be read in parallel during the version recovery operation.

Thus, if you wanted to restore a database named SAMPLE (which already exists), using a full back up image stored in a directory named BACKUPS on logical disk drive E:, you could do so by executing a RESTORE DATABASE command that looks something like this:

RESTORE DATABASE sampleUSER db2admin USING ibmdb2FROM E:\backupsREPLACE EXISTINGWITHOUT PROMPTING

On the other hand, if you wanted to restore a table space named TBSP1 from an incremental back up image stored in a directory named BACKUPS on logical disk drive E: while the database it is associated with (named SAMPLE) remains online, you could do so by executing a RESTORE DATABASE command that looks something like this:

RESTORE DATABASE sampleUSER db2admin USING ibmdb2TABLESPACE (tbsp1) ONLINEINCREMENTALFROM E:\backups

Performing back up and recovery operations 167

Page 168: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

168

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Each full database back up image contains, among other things, a copy of the database's recovery history file. However, when an existing database is restored from a full database back up image, the existing recovery history file is not overwritten. But what if the recovery history file for the database happens to be corrupted? Can the recovery history file be restored as well given that a copy exists in the database back up image? The answer is yes. A special form of the RESTORE DATABASE command can be used to restore just the recovery history file from a database back up image. Such a RESTORE DATABASE command looks something like this:

RESTORE DATABASE sampleHISTORY FILEFROM E:\backups

It is also possible to create an entirely new database from a full database back up image, effectively cloning an existing database. Therefore, you could create a new database named SAMPLE_2 that is an exact duplicate of a database named SAMPLE, using a back up image stored in a directory named BACKUPS on logical disk drive E: by executing a RESTORE DATABASE command that looks something like this:

RESTORE DATABASE sampleUSER db2admin USING ibmdb2 FROM E:\backupsINTO sample_2

It is important to note that if a back up image is used to create a new database, the recovery history file stored in the back up image will become the recovery history file for the new database.

You can also perform any of the restore/recovery operations just described (along with many others) using the Restore Data Wizard, which can be activated by selecting the Restore action from the Databases menu found in the Control Center. Figure 44 on page 169 shows the Control Center menu items that must be selected to activate the Restore Data Wizard; Figure 45 on page 170 shows how the first page of the Restore Data Wizard might look immediately after it is activated.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 169: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 44 Invoking the Restore Data Wizard from the Control Center

ICO-IMG-000094

Performing back up and recovery operations 169

Page 170: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

170

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 45 The first page of the Restore Database Wizard

Note: Only users with System Administrator (SYSADM) authority, System Control (SYSCTRL) authority, or System Maintenance (SYSMAINT) authority are allowed to restore a database or any of its table spaces from a back up image; only users with SYSADM authority or SYSCTRL authority are allowed to create a new database from a back up image.

The DB2 Roll-forward utilityWhen a back up image is used to restore a damaged or corrupted database, the database can only be returned to the state it was in at the time the back up image was made. Therefore, all changes that were made to the database after the back up image was created will be lost when a version recovery operation is performed. To return a database to the state it was in at any given point in time, roll-forward

ICO-IMG-000095

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 171: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

recovery must be used instead. And in order to perform a roll-forward recovery operation, the database must be recoverable (that is, the database must be configured to use archival logging), you must have a full back up image of the database available, and you must have access to all archived log files that have been created since the last back up image (full, incremental, or delta) was made.

Roll-forward recovery starts out as a version recovery operation. However, where a version recovery operation will leave a nonrecoverable database in a “Normal” state, the same operation will leave a recoverable database in “Roll-forward pending” state (unless the WITHOUT ROLLING FORWARD option was specified with the RESTORE DATABASE command that was used to recover the database). At that point, either the database can be taken out of “Roll-forward pending” state (in which case all changes made to the database since the back up image used for version recovery was made will be lost), or information stored in the database's transaction log files can be replayed to return the database to the state it was in at any given point in time.

The process of replaying transactions stored in archived log files is known as “rolling the database forward,” and one way to roll a database forward is by executing the ROLLFORWARD DATABASE command. The basic syntax for this command is:

ROLLFORWARD [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>><TO [PointInTime] <USING [UTC | LOCAL] TIME>

<AND [COMPLETE | STOP]> |END OF BACKUP <AND [COMPLETE | STOP]> |END OF LOGS <AND [COMPLETE | STOP]> |COMPLETE |STOP |CANCEL |QUERY STATUS <USING [UTC | LOCAL] TIME>>

<TABLESPACE ONLINE | TABLESPACE <( [TS_Name] ,... )> <ONLINE>>

<OVERFLOW LOG PATH ([LogDirectory] ,...)><RECOVER DROPPED TABLE [TableID] TO [Location]>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database that is to be rolled forward.

◆ UserName — Identifies the name assigned to a specific user under whom the roll-forward operation is to be performed.

Performing back up and recovery operations 171

Page 172: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

172

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ Password — Identifies the password that corresponds to the name of the user under whom the roll-forward operation is to be performed.

◆ PointInTime — Identifies a specific point in time, identified by a timestamp value in the form yyyy-mm-dd-hh.mm.ss.nnnnnn (year, month, day, hour, minutes, seconds, microseconds), to which that the database is to be rolled forward. (Only transactions that took place before and up to the date and time specified will be reapplied to the database.)

◆ TS_Name — Identifies the name assigned to one or more specific table spaces that are to be rolled forward. (If the table space name has changed since the back up image used to restore the database was made, the new name must be specified.)

◆ LogDirectory — Identifies the directory that contains offline archived log files that are to be used to perform the roll-forward recovery operation.

◆ TableID — Identifies a specific table (by ID) that was dropped earlier that is to be restored as part of the roll-forward operation. (The table ID can be obtained by examining the database's recovery history file.)

◆ Location — Identifies the directory to which files containing dropped table data are to be written when the table is restored as part of the roll-forward operation.

If the AND COMPLETE, AND STOP, COMPLETE, or STOP option is specified, the database will be returned to “Normal” state when the roll-forward operation has completed. Otherwise, the database will remain in “Roll-forward pending” state. (When a recoverable database is restored from a back up image, it is automatically placed in “Roll-forward pending” state unless the WITHOUT ROLLING FORWARD option is used with the RESTORE DATABASE command; while a database is in “Roll-forward pending” state, it cannot be accessed by users and applications.)

If the QUERY STATUS option is specified, a list of the log files that have been used to perform the roll-forward recovery operation, along with the next archive file required, and the time stamp of the last committed transaction since roll-forward processing began, is returned.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 173: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Thus, if you wanted to perform a roll-forward recovery operation on a database named SAMPLE that was just restored from a back up image, you could do so by executing a ROLLFORWARD DATABASE command that looks something like this:

ROLLFORWARD DATABASE sample TO END OF LOGS AND STOP

On the other hand, if you wanted to perform a roll-forward recovery operation on a table space named DATA_TBSP in a database named SAMPLE by reapplying transactions that were performed against the table space on or before April 1, 2007 (04/01/2007), you could do so by executing a ROLLFORWARD DATABASE command that looks something like this:

ROLLFORWARD DATABASE sample TO 2007-04-01-00.00.00.0000 AND STOP TABLESPACE (data_tbsp)

It is important to note that the time value specified is interpreted as a Coordinated Universal Time (UTC) — otherwise known as Greenwich Mean Time (GMT) — value. If a ROLLFORWARD DATABASE command that looks something like the following had been executed instead, the time value specified would have been interpreted as a local time value:

ROLLFORWARD DATABASE SAMPLE TO 2007-04-01-00.00.00.0000 USING LOCAL TIME AND STOP TABLESPACE (data_tbsp)

Note: When rolling a table space forward to a specific point in time, the time specified must be greater than the minimum recovery time recorded for the table space. This time can be obtained by executing the command LIST TABLESPACES SHOW DETAIL. Among other things, this command returns the earliest point in time to which each table space can be rolled forward. The minimum recovery time is updated when data definition language (DDL) statements are run against a table space or against tables stored in a table space. A table space must be rolled forward to at least the minimum recovery time so that it becomes synchronized with the information in the system catalog tables. If recovering more than one table space, each table space must be rolled forward to at least the highest minimum recovery time of all the table spaces being recovered.

If you want to roll a table space forward to a specific point in time, and a table in the table space participates in a referential integrity constraint with another table that resides in another table space, you should roll both table spaces forward simultaneously to the same point in time. If you do not, the child table in the referential integrity

Performing back up and recovery operations 173

Page 174: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

174

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

relationship will be placed in “Set integrity pending” state at the end of the roll-forward recovery operation, and constraint checking will have to be performed on the table before it can be used.

You can also initiate a roll-forward recovery operation using the Roll-forward Wizard, which can be activated by selecting the Roll-forward action from the Databases menu found in the Control Center. Figure 46 shows the Control Center menu items that must be selected to activate the Roll-forward Wizard; Figure 47 on page 175 shows how the first page of the Roll-forward Wizard might look immediately after it is activated.

Figure 46 Invoking the Roll-forward Wizard from the Control Center

ICO-IMG-000096

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 175: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 47 The first page of the Roll-forward Wizard

Because a roll-forward recovery operation is typically performed immediately after a database is restored from a back up image, a roll-forward recovery operation can also be initiated by providing the appropriate information on the Roll-forward page of the Restore Data Wizard. Figure 48 on page 176 shows how the Roll-forward page of the Restore Data Wizard normally looks.

ICO-IMG-000097

Performing back up and recovery operations 175

Page 176: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

176

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 48 Roll-forward page of the Restore Data Wizard

Note: Only users with System Administrator (SYSADM) authority, System Control (SYSCTRL) authority, or System Maintenance (SYSMAINT) authority are allowed to perform a roll-forward recovery operation.

A word about the recovery history fileIn Chapter 1, “Introduction to DB2 for Linux, UNIX, and Windows,” we saw that a special file, known as the recovery history file, is created as part of the database creation process. This file is used to log historical information about specific actions that are performed against the database with which the file is associated. Specifically, records are written to the recovery history file whenever any of the following actions are performed:

◆ A table space is created.

ICO-IMG-000098

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 177: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ A table space is altered.◆ A table space is quiesced.◆ A table space is renamed.◆ A table space is dropped.◆ A table is loaded.◆ A table is dropped (when dropped table recovery is enabled).◆ A table is reorganized, using the REORG utility.◆ Statistics for a table are updated, using the RUNSTATS utility.◆ A table is loaded, using the Load utility.◆ The database or one of its table spaces is backed up.◆ The database or one of its table spaces is restored.◆ The database or one of its table spaces is rolled forward.◆ The database is recovered.◆ On-demand log archiving is invoked.◆ A new log file is written to (when using recoverable logging).◆ A log file is archived (when using recoverable logging).◆ The database is automatically rebuilt and more than one image is

restored.

In addition to identifying the event that was performed, each entry in the recovery history file identifies the date and time the event took place, how the event took place, and the table spaces and tables that were affected. If the action was a back up operation, the location where the back up image produced was stored, along with information on how to retrieve it; because the recovery history file contains image location information for each back up image available, it acts as a tracking and verification mechanism during version recovery operations. In fact, the information stored in the recovery history file is what drives automatic recovery — automatic recovery is initiated by executing either the RESTORE DATABASE or the RECOVER DATABASE command with the AUTOMATIC option specified.

Because the recovery history file sits quietly in the background and DB2 is responsible for managing its contents, a database administrator rarely has to interact with it. However, two commands — LIST HISTORY and PRUNE HISTORY — provide a way to both view the contents of a database's recovery history file and remove

Performing back up and recovery operations 177

Page 178: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

178

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

one or more entries stored in it. Additionally, if the recovery history file for a database becomes corrupt, it is possible to restore just the recovery history file from a database back up image.

The DB2 Recover utilityEarlier, we saw how the RESTORE DATABASE command can be used to return a database to the state it was in at the time a back up image was made and how the ROLLFORWARD DATABASE command can be used to replay information recorded in a database's transaction log files to return a database to the state it was in at a specific point in time. If you are restoring the database from a full database back up image, this process is pretty straightforward. However, if you have a full database back up image and several incremental back up images, delta back up images, or table space back up images, the process can be a little complicated. That's where DB2's Recover utility comes in.

Introduced in DB2 9, the Recover utility performs the necessary restore and roll-forward operations to recover a database to a specific point in time, based on information found in the recovery history file. The Recovery utility is invoked by executing the RECOVER DATABASE command. The basic syntax for this command is:

RECOVER [DATABASE | DB] [DatabaseAlias]<TO [PointInTime] <USING [UTC | LOCAL] TIME>

<ON ALL DBPARTITIONNUMS> |END OF LOGS <ON ALL DBPARTITIONNUMS |

ON DBPARTITIONNUM<S> [PartitionNum] ,...>><USER [UserName] <USING [Password]>> <USING HISTORY FILE ([HistoryFile])> <OVERFLOW LOG PATH ([LogDirectory] ,...)><COMPRLIB [CompLibrary]> <COMPROPTS [CompOptions]><RESTART>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database associated with the back up image that is to be used to perform a version recovery operation.

◆ PointInTime — Identifies a specific point in time, identified by a timestamp value in the form yyyy-mm-dd-hh.mm.ss.nnnnnn (year, month, day, hour, minutes, seconds, microseconds), to which the database is to be rolled forward. (Only transactions that took place before and up to the date and time specified will be reapplied to the database.)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 179: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ PartitionNum — Identifies one or more database partitions (as specified in the db2nodes.cfg file) that roll-forward recovery is to be performed on.

◆ UserName — Identifies the name assigned to a specific user under whom the recovery operation is to be performed.

◆ Password — Identifies the password that corresponds to the name of the user under whom the recovery operation is to be performed.

◆ HistoryFile — Identifies the name assigned to the recovery history log file that is to be used by the Recovery utility.

◆ LogDirectory — Identifies the directory that contains offline archived log files that are to be used to perform the roll-forward portion of the recovery operation.

◆ CompLibrary — Identifies the name of the library that is to be used to decompress the data stored in the backup image. (This parameter is only used if the backup image was compressed.)

◆ CompOptions — Describes a block of binary data that is to be passed to the initialization routine in the decompression library used.

Thus, if you wanted to perform a full recovery operation on a database named SAMPLE (which already exists) using information stored in the recovery history file, you could do so by executing a RECOVER DATABASE command that looks something like this:

RECOVER DATABASE sampleTO END OF LOGS

On the other hand, if you wanted to restore a database named SAMPLE and roll it forward to an extremely old point in time that is no longer contained in the current recovery history file, you could do so by executing a RECOVER DATABASE command that looks something like this (assuming you have a copy of an older recovery history file available):

RECOVER DATABASE sampleTO 2005-01-31-04.00.00USING HISTORY FILE (/home/user/old2005files/db2rhist.asc)

Performing back up and recovery operations 179

Page 180: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

180

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Rebuilding invalid indexesSo far we have looked at ways that data can be recovered in the event the storage media being used to hold a database's files becomes corrupted or fails. But what if only indexes are damaged, and a database's data is unaffected (which could be the case if data and indexes are stored in separate table spaces and only the physical device where index data is stored fails)? In this case, the affected indexes are invalidated and can be recovered by being re-created once the faulty media has been replaced.

Whenever the DB2 Database Manager detects that an index is no longer valid, it automatically attempts to rebuild it. However, the point in time at which the DB2 Database Manager attempts to rebuild an invalid index is controlled by the indexrec parameter of the database or the DB2 Database Manager configuration file. There are three possible settings for this parameter:

◆ SYSTEM. Invalid indexes are to be rebuilt at the time specified in the indexrec parameter of the DB2 Database Manager configuration file. (This setting is valid only for database configuration files.)

◆ RESTART. Invalid indexes are to be rebuilt, either explicitly or implicitly, when the database is restarted (i.e., when crash recovery is performed on the database).

◆ ACCESS. Invalid indexes are to be rebuilt the first time they are accessed after they have been marked as being invalid.

So when is the best time to rebuild invalid indexes? If the time needed to perform a crash recovery operation on a database is not a concern, it is better to let the DB2 Database Manager rebuild invalid indexes while it is in the process of returning the database to a consistent state; the time needed to restart a database will be longer because of the index re-creation process, but once the database has been restored, query processing will not be impacted. On the other hand, if indexes are rebuilt as they are accessed, crash recovery will be performed faster, but users may experience a decrease in performance—queries against tables that contain associated invalid indexes will have to wait for the invalid indexes to be rebuilt before they can be processed. Furthermore, unexpected locks may be acquired and held long after an invalid index has been re-created, especially if the transaction that caused the index re-creation to occur is not committed (or rolled back) for some time.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 181: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Although the indexrec parameter of the database or the DB2 Database Manager configuration file can be used to control when indexes are rebuilt as part of a crash recovery operation, it has no effect on how indexes are rebuilt during roll-forward recovery operations. To control that behavior, you must assign the appropriate value to the logindexbuild database configuration parameter. There are two possible settings for this parameter:

◆ ON. Index creation, re-creation, and reorganization operations are to be recorded in the database's transaction log files so that indexes can be reconstructed during roll-forward recovery operations or high availability disaster recovery (HADR) log replay operations.

◆ OFF. Index creation, re-creation, and reorganization operations will not be recorded in the database's transaction log files.

If the LOG INDEX BUILD table attribute is set to its default value of NULL, DB2 will use the value specified for the logindexbuild database configuration parameter. If the LOG INDEX BUILD table attribute is set to ON or OFF, the value specified for the logindexbuild database configuration parameter will be ignored.

Back up and recovery with split mirroringIt was mentioned earlier that as databases increase in size and as heavy usage demands require databases to be available 24 hours a day, 7 days a week, the time and hardware needed to back up and restore a database can increase substantially. Backing up an entire database or several table spaces of a large database can put a strain on system resources, require a considerable amount of additional storage space (to hold the back up images), and reduce the availability of the database system (particularly if the system has to be taken offline in order to be backed up). Therefore, a popular alternative to creating and maintaining back up images of high-availability databases is to use what is known as a split mirror.

A split mirror is an “instantaneous” copy of a database that is made by mirroring the disk or disks that contain the database's data and splitting the mirror when a back up copy of the database is required. Mirroring is the process of writing all database data to two separate disks (or disk subsystems) simultaneously; one disk/subsystem holds the database data while the other holds an exact copy (known as a mirror) of the primary disk/subsystem being used. Splitting a

Back up and recovery with split mirroring 181

Page 182: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

182

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

mirror simply involves separating the primary and secondary copies of the database from each other. Split mirroring provides the following advantages:

◆ The overhead required to create back up images of the database is eliminated.

◆ Entire systems can be cloned very quickly.

◆ It provides a fast implementation of idle standby failover.

To further enhance split mirroring, DB2 provides a way to temporarily suspend (and later resume) all database I/O so that a mirror can be split without having to take a database offline. The command that provides this functionality is the SET WRITE command, and the syntax for this command is:

SET WRITE [SUSPEND | RESUME] FOR [DATABASE | DB]

Therefore, if you wanted to temporarily suspend all I/O for a database, you would do so by establishing a connection to that database and executing a SET WRITE command that looks like this:

SET WRITE SUSPEND FOR DATABASE

When executed, the SET WRITE SUSPEND FOR DATABASE command causes DB2 to suspend all write operations to table space containers and log files that are associated with the current database. (The suspension of writes to table spaces and log files is intended to prevent partial page writes from occurring until the suspension is removed.) All operations, apart from online back up and restore operations, will function normally while database writes are suspended. That's because read-only transactions are not suspended and are able to continue working with a write-suspended database; applications can continue to perform insert, update, and delete operations with data that has been cached in the database's buffer pool(s), but new pages cannot be written to disk. (Data can still be read from disk; only write operations are suspended.) Additionally, new database connections can be established to a write-suspended database provided the system catalog pages required to authenticate the connections already reside in a buffer pool.

I/O for a write-suspended database can be resumed at any time by executing a SET WRITE command that looks like this:

SET WRITE RESUME FOR DATABASE

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 183: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

When executed, the SET WRITE RESUME FOR DATABASE command causes DB2 to lift all write suspensions and to allow write operations to table space containers and log files that are associated with the current database to continue.

IMPORTANT

The SET WRITE RESUME FOR DATABASE command must be executed from the same connection from which the SET WRITE SUSPEND FOR DATABASE command was issued.

Initializing a split mirror with db2inidbBefore a split mirror copy of a DB2 database can be used, it must first be initialized; a split mirror database copy is initialized by executing the system command db2inidb. The syntax for this command is:

db2inidb [DatabaseAlias]AS [SNAPSHOT | MIRROR | STANDBY]<RELOCATE USING [ConfigFile]>

where:

◆ DatabaseAlias — Identifies the alias assigned to the database that the split mirror copy to be initialized references.

◆ ConfigFile — Identifies that the database files contained in the split mirror copy are to be relocated according to information stored in the configuration file specified.

As you can see, a split mirror database copy can be initialized in one of three ways:

◆ SNAPSHOT. The split mirror copy of the database will be initialized as a read/write clone of the primary database.

◆ MIRROR. The split mirror copy of the database will be initialized as a back up image that can be used to restore the existing primary database.

◆ STANDBY. The split mirror copy of the database will be initialized and placed in roll-forward pending state so that it can be continuously synchronized with the primary database. (New logs from the primary database can be retrieved and applied to the copy of the database at any time.) The standby copy of the database can then be used in place of the primary database if, for some reason, the primary database goes down.

Back up and recovery with split mirroring 183

Page 184: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

184

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Note: If you execute the db2inidb command with the STANDBY option specified, you can invoke the DB2 Backup utility immediately afterwards provided there are no SMS table spaces being used for either the system catalogs OR any user data. (SMS temporary table spaces are tolerated.)

Thus, if you wanted to initialize a split mirror copy of a database named SAMPLE and make it a back up image that can be used to restore the primary database, you could do so by executing a db2inidb command that looks like this:

db2inidb SAMPLE AS MIRROR

Changing the DB2-specific metadata associated with a databaseThe <RELOCATE USING [ConfigFile]> option of the db2inidb command can be used to change the DB2-specific metadata associated with the database files when a split mirror database copy is initialized. Such a change can also be made by executing the db2relocatedb command; the basic syntax for this command is:

db2relocatedb -f [ConfigFileName]

where:

◆ ConfigFileName — Identifies the name of a configuration file that contains information that is needed to alter the DB2-specific metadata stored in files associated with a database. The format for this configuration file is:

DB_NAME=[OldName], [NewName]DB_PATH=[OldPath], [NewPath]INSTANCE=[OldInstance], [NewInstance]<NODENUM=[NodeNumber]><LOG_DIR=[OldLogPath], [NewLogPath]><<CONT_PATH=[OldContPath], [NewContPath]> ,...><<STORAGE_PATH=[OldStoragePath], [NewStoragePath]> ,...><FAILARCHIVE_PATH=[NewFailPath]><LOGARCHMETH1=[NewLogArchMeth1]><LOGARCHMETH2=[NewLogArchMeth2]><MIRRORLOG_PATH=[NewMirrorPath]><OVERFLOWLOG_PATH=[NewOverflowPath]>

where:

◆ OldName — Identifies the original name assigned to the database.

◆ NewName — Identifies the new name that is to be assigned to the database.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 185: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ OldPath — Identifies the original path (on UNIX) or drive (on Windows) where the database resided.

◆ NewPath — Identifies the new path (on UNIX) or drive (on Windows) where the database now resides.

◆ OldInstance — Identifies the original instance the database resided under.

◆ NewInstance — Identifies the new instance the database is to reside under.

◆ NodeNumber — Identifies the database partition number the portion of the database resided under (if a multipartitioned database is being cloned).

◆ OldLogPath — Identifies the original directory where the active log files associated with the database were stored.

◆ NewLogPath — Identifies the new directory where the active log files associated with the database are to be stored.

◆ OldContPath — Identifies the original location of a table space container associated with the database.

◆ NewContPath — Identifies the new location of a table space container associated with the database.

◆ OldStoragePath — Identifies the original location of a storage path associated with the database (used only if the database is using automatic storage).

◆ NewStoragePath — Identifies the new location of a storage path associated with the database (used only if the database is using automatic storage).

◆ NewFailPath — Identifies the new directory where the log files associated with the database are to be archived if the DB2 Database Manager fails to archive the log files to either the primary or the secondary archive locations (used only if the database has the failarchpath configuration parameter set).

◆ NewLogArchMeth1 — Identifies a new primary archive location for the database (used only if the database has the logarchmeth1 configuration parameter set).

◆ NewLogArchMeth2 — Identifies a new secondary archive location for the database (used only if the database has the logarchmeth2 configuration parameter set).

Back up and recovery with split mirroring 185

Page 186: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

186

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ NewMirrorPath — Identifies the directory where the log files associated with the database are to be mirrored (used only if the database has the mirrorlogpath configuration parameter set).

◆ NewOverflowPath — Identifies a new location to find log files needed by the database for a rollforward recovery operation, to store active log files retrieved from the archive, and to find and store log files required by the db2ReadLog API (used only if the database has the overflowlogpath configuration parameter set).

The CONT_PATH parameter is an optional parameter used to change the location of one or more table space containers. This parameter can be used any number of times to indicate all of the changes that are to be made; for each entry you specify the old container name and the new container name, separated by a comma. If you need to make multiple table space container changes, but all changes are the same (for example, all table space containers have been moved from one directory to another) you can use the asterisk wild card character in a single CONT_PATH parameter value. For example:

CONT_PATH=C:\Original\*, C:\Clone\*

When a new database is first created, the DB2 Database Manager automatically creates a directory to hold three default table spaces and the various control files that are associated with the database. The location of this directory is based on information provided by the user (the database path) and information obtained from the environment (that is, the instance name and the partition/node number). If no database path is provided by the user when the database is created, the value of the DB2 Database Manager configuration parameter DFTDBPATH is used. By default, this is the instance owner's home directory (Linux and UNIX or the path on which DB2 was installed (Windows). If the table spaces for the database were created using relative paths (that is, absolute directories or file names were not specified), DB2 automatically created them in the database directory. In such situations, if you are changing the database path (with the DB_PATH parameter), it is not necessary to provide CONT_PATH parameter values for each table space used — the db2relocatedb utility will assume that all table space containers located within the database directory were copied to the new directory along with the other files.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 187: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Similarly, STORAGE_PATH is an optional parameter that can be used to change one or more storage locations if automatic storage is used. This parameter can be used multiple times to indicate all of the changes to be made; for each entry you specify the old storage location and the new storage location, separated by a comma.

Thus, if you wanted to change the DB2-specific metadata of a database named TEST, you could do so by executing a command that looks similar to this:

db2relocatedb -f relocate.cfg

where the file relocate.cfg contains the following information:

DB_NAME=TEST,TEST_2 DB_PATH=/mnt/db_data/dbase/,mnt/db_data_cl/dbaseINSTANCE=db2inst1LOG_DIR=/mnt/db_logs/NODE0000,/mnt/db_logs_cl/NODE0000CONT_PATH=/mnt/db_data/*, mnt/db_data_cl/*

When this command is executed, the entry in the system catalog for the original database (TEST) will be modified to reflect the changes made and will contain an entry with the new database name (TEST_2).

The format of the configuration file used with the <RELOCATE USING [ConfigFile]> option of the db2inidb command is the same as that of the configuration file used with the db2relocatedb command. And although both steps (initializing the split mirror image and changing the DB2-specific metadata) can be combined in a single operation, may prefer to break the work into two separate tasks.

Providing continuous availabilityUp until now, we have looked at ways that some of the tools provided with DB2 can be used to prevent catastrophic data loss from occurring when an outage, particularly an unplanned outage, takes place. But how can you provide continuous availability as well as protect against data loss? To answer that question, it helps to understand what “continuous availability” means from a database server perspective. In general, continuous availability is a term that is used to describe systems that are always available to customers. But in order for a database system to be considered continuously available, the following criteria must be met:

Providing continuous availability 187

Page 188: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

188

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

◆ The database server must always be running and the database must be available for transaction processing.

◆ During peak operating periods, transactions must be processed efficiently without sacrificing performance.

◆ Systems must be able to recover quickly when hardware or software failures occur or disaster strikes.

Therefore, if the entire disk subsystem a database is stored on fails, or if the site where the database server resides is damaged or destroyed, the only way you will be able to provide continuous availability is if you have a duplicate copy of the database available (at another site) that can quickly be made accessible to applications and users. (Such a database is commonly referred to as a standby database.)

Log shippingBy backing up a database to some transportable media, shipping the media to a secondary site, and restoring the database to a server located at that site, it’s possible to create a standby database that can be used to take the place of the original (primary) database in the event the primary database becomes unavailable. And although the creation of such a standby database results in a valid disaster recovery (DR) solution, the obvious disadvantage to this approach is that the standby database is rarely, if ever, in sync with the primary database; the DR site is, at best, a version recovery site. A better DR solution would be one that keeps the primary and standby databases "nearly" in sync so that, if a failure occurs at the primary site, applications and users can switch over to the standby database with minimal impact.

One approach that is frequently used to keep a primary and a standby database nearly in sync is a technique known as “log shipping.” This technique, which uses database transaction log files to maintain a second copy of a database, is relatively straightforward. Every transaction that modifies data stored in a DB2 database writes one or more log records to one or more transaction log files — these log records describe exactly how to replay the transaction to reproduce every data modification made. Thus, if you replay transaction log records against another database, all modifications made to the original database when the log records were created will be made to the other database. (It’s important to note that some

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 189: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

operations do not generate log records and the use of these operations must be handled separately in a log shipping environment.)

There are, of course, a number of factors to take into consideration when using log files to keep two databases in sync. For one thing, log records can only be replayed to a database that is identical to the database for which the records were originally generated. Therefore, in order to use log shipping to keep a primary and a standby database nearly in sync, the database stored on the standby server must be an exact duplicate of the database stored on the primary server. And if you want to create a highly available standby system, you must automate both the process of getting log files from the primary server to the standby server and the process of replaying the log records to the standby database. You must also make provisions for replicating operations that are not logged on the primary server (such as load operations and the creation of indexes).

Using log shipping to maintain a standby copy of a database that is nearly in sync with a primary database can be extremely useful in maintaining a highly available environment. However, this DR solution does have its disadvantages. The first, of course, is that you must have additional hardware at a standby site. The standby server does not have to have the exact same configuration (processors, memory, disks, and so on) as the primary server, but if identical hardware is not used, you will need to understand how any differences in configurations will affect application performance should a failover be required. (You should always design your standby server with the intent that you will need to run production workloads at the standby site for a significant amount of time. After all, one of the reasons for having a standby server is for disaster recovery purposes; your primary site could become unavailable for an indefinite period of time should an actual disaster occur.)

Another disadvantage of using log shipping is that applications and users must be able to handle lost transactions — when a failover occurs, there may be some committed transactions in the currently active log file on the primary site that do not make it to the standby site. It might be possible to get these transactions back at a future point by recovering them from the primary server's log files, but there is no guarantee that these logs will always be recoverable (especially in a disaster situation).

Providing continuous availability 189

Page 190: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

190

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Setting up a log shipping environmentSo what is the best way to create a log shipping DR solution? The steps required to set up a log shipping environment are as follows:

1. Configure the primary server so it will ship its log files to the standby server or to some site that is easily accessible from the standby server. This can, and should, be an automated process so that as log files are populated and closed, they are immediately transferred to the standby site for processing.

Several methods can be used to move log files from the primary server to the standby server — one of the easiest solutions to implement, and one that is quite reliable, is to archive log files from the primary database's active log path to a location that the standby database can access via a user exit program. (A user exit program is a custom program you write that DB2 invokes each time it opens or closes a transaction log file.) For example, you can archive log files to disk on the primary server and simply NFS mount that file system on the standby server so that the standby server can read them. The critical issue to always be aware of is that you must ensure that the primary server can archive its log files without any problems. (If, for some reason, the primary server is unable to archive its log files, the database will stop processing transactions.)

2. Create an exact copy of the primary database on the standby server. The easiest way to do this is to create a backup image of the database on the primary site and then use that image to restore the database onto the standby server. An alternative method is to use a split mirror copy of the database.

3. Copy all available transaction logs over to the standby server and roll the standby database forward using these logs.

Once you have an exact copy of the database on the standby site, you must replay all of the transactions that have been written to log files since the backup image used to create the standby database was made. The goal is to make sure that you have already replayed all existing log files before new log files are sent to the standby server.

4. Start a script or application on the standby server that will constantly replay log records to the standby database.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 191: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Ideally, you should set up an automated process to continuously roll forward through log files on the standby server. As new log files are archived by the primary database, the standby server must retrieve them, roll the standby database forward through them, and then wait for more log files to arrive.

One way to automate this process is to create a script that simply executes a command that looks like this:

ROLLFORWARD DATABASE ... TO END OF LOGS

Such a script could be scheduled by an operating system scheduler (such as cron) or it could be run on a regular basis as a task, using the DB2 Task Center. Another approach is to create a script or application that wakes up, looks for new logs and if it finds any calls the ROLLFORWARD DATABASE command, and then goes back to sleep for a period of time before waking up again. This approach has the advantage that it does not rely on any scheduling mechanism and therefore can run continuously in the background.

5. Periodically refresh the standby server with a new backup image.

Re-creating the standby server periodically not only tests your backup and recovery procedures, but also provides a way to replicate data changes not reflected in the log files to the standby site. Without this step, the failover process may take longer or you may incur performance degradation on the standby server as objects like indexes have to be materialized after the failover occurs.

What to do when the primary server fails

In the event the primary server fails, continuous availability is ensured by failing over to the standby server. To fail over (turn the standby server into the primary server), you must first finalize the log replay to bring the standby database as close as possible to the state the primary database was in at the time the failure occurred. If you are performing a controlled failover or if the primary server's storage is still available, this is done by copying any log files that have not yet been archived from the primary server over to the standby server and finalizing the roll forward process on the standby server by stopping the automated roll forward mechanism (script or application) and then executing a command that looks similar to this:

ROLLFORWARD DATABASE ... TO END OF LOGS AND STOP

Providing continuous availability 191

Page 192: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

192

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

This will force DB2 to process any remaining log records and undo any in-flight transactions that exist. (Any transactions that had not committed or rolled back as of the last log file that has been processed on this standby database are rolled back as part of the STOP operation.)

It’s important to note that if you were unable to retrieve the last active log file from the primary server, some of the transactions that are rolled back on the standby database might have actually been committed to the primary database. Thus, if you have the ability to do so, you should have your end users connect to the standby database and verify that the work they recently completed is actually reflected in the standby database.

At this point, the standby database can be used to service applications and users. The final step is to reroute client applications from the primary to the standby server. This can be done by cataloging the standby server on each client workstation and making sure the application connects to the standby database alias.

While it’s possible to create a script or application that detects a failure of the primary server and automatically performs the steps required to fail over, if you elect to automate the failover process, you must be 100 percent certain that the primary server is down and that applications are not going to be able to connect to that server before a failover is initiated. If you end up in a situation where some applications are connected to the primary server and others are connected to the standby thinking the standby is the new primary, you will end up with two active databases that are no longer synchronized. If this happens, you will need to determine what transactions have been applied to each database and then you must try to manually synchronize the two before re-establishing the log shipping environment.

Reversing the roles of primary and standby servers (failing back)When a failover operation is performed and production workloads are rerouted to the standby server, the system is once again in a vulnerable position. (The standby server is now running as the primary and there is no standby to back it up to.) Therefore, it is important to fix or replace the failed primary server as quickly as possible so it can either be used as a new standby server, or returned to the role of primary server. If you decide to make the current

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 193: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

primary database (on what was the standby server) the new primary database, you should back it up as soon a possible and prepare to set up a new standby server using the steps that were outlined earlier.

Rather than making the current primary database (on what was the standby server) the new primary database, another option is to perform a controlled failback operation. If the problem on the original primary server is easily resolved, and there is reasonable assurance that the failure will not occur again, you can easily make that server the primary server again by performing the following steps:

1. Create a backup image of the database on the new primary server (the original standby server) and restore it onto the original primary server.

2. Copy all of the required log files over to the original primary server and roll forward the database on that server to the end of the logs.

3. Force all applications and users off the current primary database (on the original standby server).

4. Copy any remaining log files over to the original primary server.

5. Roll forward through the log files that were copied to the original primary server in the previous step to complete the roll forward process.

At this point, the original primary server can be used as the primary server again and applications and users can connect to the database on that server. Once the failback operation has been performed, rebuild the standby server using the steps that were outlined earlier.

Providing continuous availability 193

Page 194: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

194

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

High availability disaster recovery (HADR)High availability disaster recovery (HADR) is a DB2 database replication feature that provides a high availability solution for both partial and complete site failures. HADR protects against data loss by continually replicating data changes from a source database, called the primary, to a target database, called the standby. In an HADR environment, applications can access the current primary database — synchronization with the standby database occurs by rolling forward transaction log data that is generated on the primary database and shipped to the standby database. (HADR is, essentially, an advanced and fully automated form of log shipping.) And with HADR, you can choose the level of protection you want from a potential loss of data by specifying one of three synchronization modes: synchronous, near synchronous, or asynchronous.

HADR is designed to minimize the impact to a database system when a partial or a complete site failure occurs. A partial site failure can be caused by a hardware, network, or software (DB2 or operating system) malfunction. A complete site failure can occur when a disaster, such as a fire, causes the entire site to be destroyed.

Without HADR, a partial site failure requires restarting the server and the instance where one or more DB2 databases reside. The length of time it takes to restart the server and the instance is unpredictable. If the transaction load was heavy at the time of the partial site failure, it can take several minutes before a database is returned to a consistent state and made available for use. With HADR, the standby database can take over in seconds. Furthermore, you can redirect the clients that were using the original primary database to the standby database (which is now the new primary database) by using Automatic Client Reroute (ACR) and retry logic in the applications that interact with the database. Figure 49 on page 195 illustrates the concept of HADR.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 195: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Figure 49 Concept of HADR in a DB2 LUW environment

After the failed original primary server is repaired, it can rejoin the HADR pair as the standby database server if both copies of the database can be made consistent — that is, achieve what is defined as “peer state.” Once the original primary database is reintegrated into the HADR pair as the standby database, you can switch the roles so that the original primary database once again functions as the primary database. (This is known as failback operation.)

Because HADR uses TCP/IP to communicate between a primary and a standby database, the databases can reside in two different locations. For example, your primary database might be located at your head office in one city, whereas your standby database is located at your sales office in another city. If a disaster occurs at the primary site, data availability is maintained by having the remote standby database take over as the primary database.

Requirements for HADR environmentsTo achieve optimal performance with HADR, the system hosting the standby database should consist of the same hardware and software as the system where the primary database resides. If the system hosting the standby database has fewer resources than the system hosting the primary database, the standby database may not be able

ICO-IMG-000812

High availability disaster recovery (HADR) 195

Page 196: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

196

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

to keep up with the transaction load generated by the primary database. This can cause the standby database to fall behind or the performance of the primary database to suffer. More importantly, if a failover situation occurs, the new primary database may not have the resources needed to adequately service the client applications. And because buffer pool operations performed on the primary database are replayed on the standby database, it is important that the primary and standby database servers have the same amount of memory.

IBM recommends that you use similar host computers for the HADR primary and standby databases. (If possible, they should be from the same vendor and have the same architecture. This will ensure consistent performance on the two servers.) Furthermore, the operating system on the primary and standby database servers should be the same version, including patch levels. You can violate this rule for a short time during a rolling upgrade, but use extreme caution when doing so. A TCP/IP interface must also be available between the HADR host machines, and a high-speed, high-capacity network should be used to connect the two servers.

The DB2 software installed on both the primary and the standby database server must have the same bit size (32 or 64), and the version of DB2 used for the primary and standby databases must be identical; for example, both must be either version 8 or version 9. During rolling upgrades, the modification level (for example, the FixPack level) of the database system for the standby database can be later than that of the primary database for a short while. However, you should not keep this configuration for an extended period of time. The primary and standby databases will not connect to each other if the modification level of the database system for the primary database is later than that of the standby database. Therefore, FixPacks must always be applied to the standby database system first.

Both the primary and the standby database must be a single-partition database, and they both must have the same database name; however, they do not have to be stored on the same database path. The amount of storage space allocated for transaction log files should also be the same on both the primary and the standby database server; the use of raw devices for transaction logging is not supported. (Archival logging is performed only by the current primary database.)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 197: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Table space properties such as table space name, table space type (DMS, SMS, or Automatic Storage), table space page size, table space size, container path, container size, and container type (raw device, file, or directory) must be identical on the primary and standby databases. When you issue a table space statement such as CREATE TABLESPACE, ALTER TABLESPACE, or DROP TABLESPACE on the primary database, it is replayed on the standby database. Therefore, you must ensure that the table space containers involved with such statements exist on both systems before you issue the table space statement on the primary database. (If you create a table space on the primary database, and log replay fails on the standby database because the containers are not available, the primary database does not receive an error message stating that the log replay failed.) Automatic storage databases are fully supported, including replication of ALTER DATABASE statements. Similar to table space containers, the storage paths specified must exist on both the primary and the standby server.

Additionally, once an HADR environment has been established, the following restrictions apply:

◆ Clients cannot connect to the standby database.

◆ Self Tuning Memory Manager (STMM) can be run only on the current primary database.

◆ Backup operations cannot be performed on the standby database.

◆ Redirected restore is not supported. That is, HADR does not support redirecting table space containers. However, database directory and log directory changes are supported.

◆ Load operations with the COPY NO option specified are not supported.

However, starting with DB2 version 9.7 Fix Pack 1, it is possible to perform read-only operations against the standby database in a HADR environment. Read-only operations running against the standby database do not affect the standby's main role of replaying logs shipped from the primary database; read capability is supported in all three HADR synchronization modes (SYNC, NEARSYNC, and ASYNC) and in all HADR states except local catchup.

High availability disaster recovery (HADR) 197

Page 198: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

198

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Setting up an HADR environmentThe process of setting up an HADR environment is fairly straightforward. After ensuring that the systems to be used as primary and standby server are identical and that a TCP/IP connection exists between them, you simply perform the following tasks, in the order shown:

1. Determine the host name, host IP address, and the service name or port number for both the primary and the standby database server.

If a server has multiple network interfaces, ensure that the HADR host name or IP address maps to the intended interface. You will need to allocate separate HADR ports for each protected database — these cannot be the same as the ports that have been allocated to the instance. The host name can map to only one IP address.

2. Create the standby database by restoring a backup image or initializing a split mirror copy of the database that is to serve as the primary database.

Note: If the database is stored on a Symmetrix array, you can use TimeFinder/Clone technology to create the standby database.

3. Set the HADR configuration parameters on both the primary and the standby databases.

After the standby database has been created, but before HADR is started, the HADR configuration parameters shown in Table 12 must be set.

Table 12 HADR-specific database configuration parameters (page 1 of 2)

Parameter Description

hadr_db_role Read-only. Indicates the current role of the database, if it is part of a high availability disaster recovery (HADR) environment. Valid values are STANDARD, PRIMARY, or STANDBY.

hadr_local_host Specifies the local host for high availability disaster recovery (HADR) TCP communication. Either a host name or an IP address can be used.

hadr_local_svc Specifies the TCP service name or port number for which the local high availability disaster recovery (HADR) process accepts connections.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 199: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

4. Connect to the standby instance and start HADR on the standby database.

HADR is started by executing the START HADR command. The basic syntax for this statement is:

START HADR ON [DATABASE | DB] [DatabaseAlias]<USER [UserName] <USING [Password]>> AS [PRIMARY <BY FORCE> | STANDBY]

where:

• DatabaseAlias — Identifies the alias assigned to the database for which HADR is to be started.

• UserName — Identifies the name assigned to a specific user under whom HADR is to be started.

• Password — Identifies the password that corresponds to the name of the user under whom HADR is to be started.

Thus, if you wanted to start HADR on a database named SAMPLE and indicate that it is to act as a standby database, you could do so by executing a START HADR command that looks something like this:

hadr_remote_host Specifies the TCP/IP host name or IP address of the remote HADR node.

hadr_remote_inst Specifies the instance name of the remote server. Administration tools, such as the Control Center, use this parameter to contact the remote server. HADR also checks whether a remote database requesting a connection belongs to the declared remote instance.

hadr_remote_svc Specifies the TCP service name or port number that will be used by the remote HADR node.

hadr_syncmode Specifies the synchronization mode to use for the HADR pair. This determines how primary log writes are synchronized with the standby database when the systems are in peer state. Valid values for this configuration parameter are: SYNC (Synchronous), NEARSYNC (Near Synchronous), and ASYNC (Asynchronous).

hadr_timeout Specifies the time (in seconds) that the HADR process waits before considering a communication attempt to have failed. (The value assigned to this configuration parameter must be the same for both the primary and the standby database.)

Table 12 HADR-specific database configuration parameters (page 2 of 2)

Parameter Description

High availability disaster recovery (HADR) 199

Page 200: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

200

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

START HADR ON DATABASE sample AS STANDBY

5. Connect to the primary instance and start HADR on the primary database.

START HADR ON DATABASE sample AS PRIMARY

You can also set up an HADR environment using the Set Up HADR Databases Wizard, which can be activated by selecting the High Availability Disaster Recovery action from the Databases menu found in the Control Center.

Switching database roles in HADRDuring high availability disaster recovery (HADR), you can use the TAKEOVER HADR command to switch the roles of the primary and standby databases. However, in order to use this command, the following rules apply:

◆ The TAKEOVER HADR command can only be issued on the standby database. If the primary database is not connected to the standby database when the command is issued, the takeover operation will fail.

◆ The TAKEOVER HADR command can only be used to switch the roles of the primary and standby databases if the databases are in peer state. If the standby database is in any other state, an error message will be returned.

You can switch the HADR database roles using the command line processor (CLP), the Manage High Availability Disaster Recovery (HADR) window in the Control Center, or the db2HADRTakeover application programming interface (API).

Planned takeover tothe standby for

maintenance of theprimary node

(role-switch)

Planned takeover, also referred to as role-switching, is performed simply by issuing the TAKEOVER HADR command on the standby node. Role-switch is a useful process for making the standby the new primary and re-routing the clients to the new primary database, for example, during a DB2 FixPack upgrade. A role-switch is performed by executing a command (on the standby database server) that looks something like this:

TAKEOVER HADR ON DB testdb

Role-switching can only be done from the standby while the databases are in the Peer state. The graceful TAKEOVER command fails if the databases are in any other state.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 201: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Forced takeover bystandby during

disaster (failover) andswitching back to the

original roles

When you want the current standby database to become the new primary database because the current primary database is not available, you can perform a failover operation.

You should use the takeover by force only if your primary database is not functional. The BY FORCE option tells the standby to become the new primary without coordinating with the original primary as it does with a planned takeover. The procedure for failover by force consists of the following steps:

1. Ensure that the primary database is down. If a takeover BY FORCE is issued and the primary is not actually down but just not reachable by the standby (for example, due to a network issue), this can result in both databases becoming primary databases. (This scenario is referred to as a “split brain” scenario.)

2. Issue the TAKEOVER HADR command with the BY FORCE option on the standby database. The following is an example of how this command would be executed for a database named TESTDB:

TAKEOVER HADR ON DB testdb BY FORCE

Once the old primary is recovered you bring it back online by reintegrating the old primary as the new standby database. To reintegrate the old primary, perform the following steps:

1. Recover the failed primary, and bring it back online.

2. Restart the failed primary as the new standby using the START HADR command, for example:

START HADR ON DB testdb AS STANDBY

3. Optionally, do a role-switch to convert the new standby (old primary) to the primary node again.

This procedure might cause a loss of data. Please refer to the DB2 Infocenter for more in-depth details on performing HADR failover operations.

High availability disaster recovery (HADR) 201

Page 202: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

202

DB2 for Linux, UNIX, and Windows Disaster Recovery Concepts

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 203: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

4

The EMC Symmetrix Remote Data Facility (SRDF) family of products offers a range of Symmetrix-based disaster recovery, parallel processing, and data migration solutions. Fully leveraging the industry-leading high-end Symmetrix hardware architecture, SRDF products allow users to meet different recovery point objectives (RPOs) within required recovery time objectives (RTO) where:

◆ RTO indicates the time allowed for recovery to a specified point of consistency.

◆ RPO identifies the point of consistency to which applications need to recover.

This chapter is designed to introduce you to the EMC SRDF family. Topics covered include:

◆ Introduction to SRDF....................................................................... 204◆ Symmetrix Remote Data Facility/Synchronous (SRDF/S) ....... 208◆ SRDF/S Consistency Group........................................................... 213◆ Symmetrix Remote Data Facility/Asynchronous (SRDF/A).... 218◆ SRDF/Automated Replication....................................................... 224◆ SRDF/Star ......................................................................................... 230

EMC SRDF Family ofProducts

EMC SRDF Family of Products 203

Page 204: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

204

EMC SRDF Family of Products

Introduction to SRDFThe EMC Symmetrix Remote Data Facility (SRDF) family of products offers a range of Symmetrix-based disaster recovery solutions that are based on active remote mirroring and dependent-write consistent copies of data being maintained at one or more remote locations. Dependent-write consistency is required to ensure transactional consistency once applications are restarted at the remote location.

SRDF configurations require at least two Symmetrix systems, one of which is known as the primary and one that is referred to as the secondary system. Both systems can be located in the same room, in different buildings within close proximity of each other, or in different buildings that are hundreds to thousands of kilometers apart.

In an open systems environment, the production host is typically connected to the primary Symmetrix used. Thus, primary volumes (or devices) on this Symmetrix often contain production data that is remotely mirrored to secondary volumes (or devices) found on the secondary Symmetrix — as long as the production host is in operation. The primary and secondary Symmetrix arrays are connected to each other through SRDF links.

The SRDF family of products can be used in environments configured with EMC Symmetrix VMAX arrays and Symmetrix DMX™ arrays. The only requirement is that the EMC Enginuity Operating Environment for Symmetrix systems must be run on every Symmetrix system that is part of an SRDF solution. Different versions of Enginuity running on different Symmetrix hardware models can be used.

Modes of operation

Each SRDF solution functions in a specific SRDF mode of operation; these modes determine the way primary (R1) volumes are remotely mirrored to secondary (R2) volumes across the SRDF links, as well as how I/Os are processed and when acknowledgements are returned to the production host each time a write I/O command is issued. The SRDF modes of operation available are:

• Synchronous. Available with the SRDF/S product offering, the synchronous mode maintains a real-time mirror image of data between the R1 and R2 devices used. Data must be

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 205: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

successfully stored in Symmetrix cache at both the primary and the secondary site before an acknowledgement is sent to the production host at the primary site.

• Asynchronous. Available with the SRDF/A product offering, the asynchronous mode mirrors R1 devices, maintaining a dependent-write consistent copy of the data on the R2 devices at all times. SRDF/A session data is transferred from the primary to the secondary site in cycles, using what is known as delta sets; thus, the point-in-time copy of the data at the secondary site is only slightly behind that on the primary site.

SRDF/A has little or no impact on performance at the primary site provided the SRDF links used contain sufficient bandwidth, and the secondary system is capable of accepting the data as quickly as it is sent. If the remote copy process is unable to keep pace with I/O activity on the primary site, SRDF/A can throttle host I/Os to catch up.

• Semi-synchronous. Semi-synchronous mode allows the R1 and R2 devices used to be out of synchronization by one write I/O operation. Data must be successfully written to the primary volume before an acknowledgement is sent to the production host; semi-synchronous mode does not allow another write I/O to the R1 volume(s) until a positive acknowledgement is received from the secondary Symmetrix system that the first write operation was received in Symmetrix cache at the secondary site.

Semi-synchronous mode is supported with Enginuity versions prior to 5773.

• Adaptive copy. Adaptive copy mode allows the R1 and R2 devices used to be more than one I/O out of synchronization. (The maximum number of I/Os that can be out of synchronization is referred to as the maximum skew value and can be set using EMC host-based SRDF software.)

SRDF modes of can be categorized as being primary and secondary to indicate how they operate together. Once set, the primary mode is the default mode of operation for a given SRDF volume, range of SRDF volumes, or an SRDF group. Synchronous and semi-synchronous modes are considered primary modes of operation while adaptive copy modes are considered secondary modes of operation. As secondary modes of operation, adaptive copy modes revert to the

Introduction to SRDF 205

Page 206: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

206

EMC SRDF Family of Products

specified primary mode of operation (synchronous or asynchronous) when certain conditions are met. Asynchronous mode is a separate category altogether.

Base productsSRDF base solutions include two disaster-restart and one data mobility/data migration product. These products are:

• Symmetrix Remote Data Facility/Synchronous (SRDF/S) is a disaster-restart solution that maintains a real-time (synchronous) mirrored copy of production data (R1 devices) at a physically separated Symmetrix system (R2 devices) within an SRDF configuration. SRDF/S is a building block of several multisite disaster-restart options such as SRDF/Star and SRDF/AR.

• Symmetrix Remote Data Facility/Asynchronous (SRDF/A) is a disaster-restart solution that mirrors data from the R1 devices while maintaining a dependent-write consistent copy of the data on the R2 devices at all times. The dependent-write consistent copy of the data at the secondary site is typically only seconds behind the primary site. SRDF/A session data is transferred to the secondary Symmetrix system in cycles, or delta sets. This eliminates the redundancy caused by multiple same-track changes written within the same cycle from being transferred over the SRDF links and potentially reduces network bandwidth requirements. SRDF/A provides a long-distance replication solution. This level of protection is intended for customers who require a fast response time while maintaining a dependent-write consistent, restartable image of data at the secondary site.

• Symmetrix Remote Data Facility/Data Mobility (SRDF/DM) is a data migration/data mobility solution that enables fast data transfer from R1 to R2 devices over extended distances. SRDF/DM operates in only SRDF adaptive copy mode and is designed for data replication or migration between two or more Symmetrix systems. SRDF/DM is supported on all Symmetrix hardware models and all Enginuity versions that support SRDF, and can be used for local or remote transfers.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 207: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

OptionsSRDF options are essentially solutions that address specific service level requirements. The SRDF options available are:

• SRDF/Automated Replication combines SRDF/S and SRDF/DM and is available in two-site (single hop) and three-site (multi-hop) configurations. SRDF/AR operates in either SRDF adaptive copy mode (single-hop) or SRDF/S and SRDF adaptive copy mode (multi-hop), which optimizes bandwidth requirements and provides data protection with dependent-write consistency across long distances. This solution is ideal for customers who require dependent-write consistency across long distances but can tolerate RPOs of hours or days. It’s important to note that SRDF/AR requires TimeFinder on the primary Symmetrix system in two-site configurations and on the second-hop Symmetrix system in three-site configurations.

• SRDF/Consistency Group ensures consistency of data spread across multiple volumes and Symmetrix systems located at multiple sites. Such data must be dependent-write consistent to guarantee a restartable copy of data at the remote site if the production site fails.

• SRDF/Star provides advanced multisite business continuity protection along with a disaster-restart solution. It offers the ability to differentially establish and protect the data amongst surviving sites in a multisite disaster recovery implementation. In the event of a primary site failure, SRDF/Star enables the surviving sites to quickly re-establish data, protect it using remote mirroring, and then just as quickly, restore the primary site when conditions permit.

SRDF/Star uses different modes of operation between participating sites (SRDF/A, SRDF/S) and resynchronizes SRDF/S and SRDF/A copies by replicating only the differences between the sessions, allowing for much faster resumption of protected services after a primary site failure.

Introduction to SRDF 207

Page 208: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

208

EMC SRDF Family of Products

Symmetrix Remote Data Facility/Synchronous (SRDF/S)Symmetrix Remote Data Facility/Synchronous or SRDF/S, is a method of replicating production data changes from locations that are no greater than 200 km (125 miles) apart. Synchronous replication takes writes that are inbound to the primary (or source) Symmetrix array and copies them to the secondary (or target) Symmetrix array. The write operation is not acknowledged as complete to the host until both Symmetrix arrays have the data in cache. Figure 50 illustrates the behavior of write operations in an SRDF/S configuration.

Figure 50 SRDF/S replication internals

The numbers shown in Figure 50 correspond to the following steps:

1. A write is received in the source Symmetrix cache. At this time, the host does not receive acknowledgement that the write is complete.

2. The source Symmetrix array uses SRDF/S to push the write to the target Symmetrix.

3. The target Symmetrix array sends an acknowledgement back to the source Symmetrix indicating that the write was received.

4. Acknowledgement that the write is complete, along with ending status of the write is presented to the host.

These steps delay the processing of writes as perceived by the application (which, in this case is a DB2 database) on the source host. The amount of delay depends on the exact configuration of the network, the storage, the write block size, and the distance between the two Symmetrix arrays used. It is important to note that reads to the source Symmetrix array are not affected by the replication process.

Source TargetICO-IMG-000474

2

3

1

4

DB2 LUW

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 209: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

Setting up SRDF/S using a single source SymmetrixThe following steps outline the process for setting up SRDF/S replication using Solutions Enabler (SYMCLI) commands:

1. Before the synchronous mode of SRDF can be established, a baseline full copy of all the volumes that are going to participate in the synchronous replication must take place. (This is usually accomplished using the adaptive copy mode of SRDF.) And the easiest way to work with volumes that are to participate in the synchronous replication process is by placing them in a device group. The following command, when executed, will create a device group named “device_group” that can be used to group the appropriate devices:

symdg create device_group -type rdf1

2. Add the appropriate devices to the device group by executing a set of commands that look similar to this:

symld -g device_group add dev 121 -sid 111symld -g device_group add dev 12f -sid 111

(In this example, the R1 devices 121 and 12f from a Symmetrix whose serial number ends in 111 are added to a device group named “device_group”.)

3. Put the devices assigned to the device group into adaptive copy mode by executing a command that looks like this:

symrdf -g device_group set mode acp_disk -noprompt

4. Instruct the source Symmetrix array to send all the tracks on the source site to the target site (using the current mode) by executing a command that looks similar to this:

symrdf -g device_group establish -full -noprompt

The adaptive copy mode of SRDF has no impact on host application performance. It transmits tracks to the remote site that have never been sent before, or that have changed since the last time the track was sent. It does not preserve write order or dependent-write consistency.

5. When both sides are synchronized, put SRDF into synchronous mode by executing a command that looks like this:

symrdf -g device_group set mode sync -noprompt

Symmetrix Remote Data Facility/Synchronous (SRDF/S) 209

Page 210: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

210

EMC SRDF Family of Products

There is no requirement for a host at the remote site during the synchronous replication — the target Symmetrix itself manages the inbound writes and updates the appropriate volumes in the array.

Running from the secondary Symmetrix in the event of a disasterIn the event of a disaster where the primary source Symmetrix array is lost, database and application services can be run from the disaster recovery (DR) site. However, in order to do this, a host is required at the DR site.

Assuming a host has access to the secondary Symmetrix at the DR site, the first step in making the data available to the host is to write-enable the R2 devices. This is done by executing a SYMCLI command that looks similar to this:

symld -g device_group rw_enable -noprompt

When executed, the symld command shown will write-enable the R2 devices in a device group named “device_group” — assuming the device group exists. If the device group has not yet been built on the host at the DR site, it must be created using the R2 devices that were mirrors of the R1 devices on the source Symmetrix array before it can be used with the symld command. Group Named Services (GNS) can be used to propagate the device group to the remote site if there is a host utilized there; for more details on GNS see the Solutions Enabler Symmetrix Base Management CLI Product Guide.

At this point, the host can issue the commands needed to access the disks. For instance, on a UNIX host, this involves importing the appropriate volume groups, activating the logical volumes, performing a file system check on the appropriate file systems, and then mounting the file systems so they can be used.

In the case of DB2, once the data on the R2 devices is made available to the remote host, any databases stored on the devices can then be restarted. During the restart, transactions that were committed, but not completed (based on information found in the active logs), are applied and completed; transactions that were not committed are rolled back. The result is a transactionally consistent database.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 211: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

Setting up SRDF/S using multiple source Symmetrix arraysWhen a database is spread across multiple Symmetrix arrays, SRDF/S can still be used for remote replication. Consider the architecture depicted in Figure 51.

Figure 51 SRDF/S with multiple source Symmetrix arrays

In this scenario, the easiest way to work with the R1 devices on both source Symmetrix arrays is by placing them in a composite group. Unlike device groups, which are limited to a single Symmetrix, composite groups can be created that encompass all volumes on all Symmetrix arrays that, in this case, will be participating in replication. (Refer to the blue-dotted oval in Figure 51.)

The following steps outline the process for setting up synchronous replication across multiple Symmetrix arrays using Solutions Enabler (SYMCLI) commands:

1. Create a composite group for the source side of the synchronous relationship (the R1 side) by executing a command that looks similar to this:

symcg create composite_group -type rdf1

Archivelogs

Activelogs

Datafiles

Archivelogs

Activelogs

Datafiles

Archivelogs

Activelogs

Datafiles

Archivelogs

Activelogs

Datafiles

Source Target

Syn

chro

no

us

DB2 LUW

ICO-IMG-000477

Symmetrix Remote Data Facility/Synchronous (SRDF/S) 211

Page 212: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

212

EMC SRDF Family of Products

2. Add the appropriate devices to the composite group by executing a set of commands that look like this:

symcg -cg composite_group add dev 121 -sid 111symcg -cg composite_group add dev 12f -sid 111symcg -cg composite_group add dev 135 -sid 222symcg -cg composite_group add dev 136 -sid 222

(In this example, the R1 devices 121 and 12f from a Symmetrix whose serial number ends in 111, and R1 devices 135 and 136 from a Symmetrix whose serial number ends in 222 are added to a composite group named “composite_group”.)

3. Before the synchronous mode of SRDF can be established, a baseline full copy of all the volumes that are going to participate in the synchronous replication must take place. (This is usually accomplished using the adaptive copy mode of SRDF.) To put the devices assigned to the composite group “composite_group” into adaptive copy mode, execute a command that similar to this:

symrdf -cg composite_group set mode acp_disk -noprompt

4. Instruct the source Symmetrix array to send all the tracks on the source site to the target site (using the current mode) by executing a command that looks like this:

symrdf -cg composite_group establish -full -noprompt

The adaptive copy mode of SRDF has no impact on host application performance. It transmits tracks to the remote site that have never been sent before, or that have changed since the last time the track was sent. It does not preserve write order or dependent-write consistency.

5. When both sides are synchronized, put SRDF into synchronous mode by executing a command that similar to this:

symrdf -cg composite_group set mode sync -noprompt

6. Enable consistency protection by executing a command that looks like this:

symcg -cg composite_group enable -noprompt

There is no requirement for a host at the remote site during the synchronous replication — the target Symmetrix itself manages the inbound writes and updates the appropriate volumes in the array.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 213: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

SRDF/S Consistency GroupZero data loss disaster recovery techniques tend to use straightforward application restart procedures. And these procedures work well if all processing and data mirroring come to a stop at the same instant in time at the production site, when a disaster happens (such as when a site power failure occurs).

However, in most cases, it is unlikely that all data processing ceases at the same instant in time. Computing operations can be measured in nanoseconds so even if a disaster takes only a millisecond, several different computing operations could be completed between the time a disaster begins and all data processing ceases. This leads us to the notion of a rolling disaster. A rolling disaster is a series of events that occur over a period of time that comprise a true disaster. The specific period of time that makes up a rolling disaster could be milliseconds (for example, in the case of an explosion), or minutes (for example, in the case of a fire). In both cases, the DR site must be protected against data inconsistency.

SRDF/Consistency Group (SRDF/CG) is an SRDF product offering that is designed to prevent a rolling disaster from affecting data integrity at the secondary site. SRDF/CG is based on dependent-write operations. A dependent-write is a write operation that cannot be issued by an application until a prior, related write I/O operation is completed. An example of a dependent-write is a database update; the sequence of events that take place when an update is performed look something like this:

1. The DBMS writes the changes to the transaction log.

2. The DBMS writes the changes to the actual database.

3. The DBMS writes again to the transaction log (to indicate that the transaction performing the update is complete).

When SRDF/CG detects a write I/O to a R1 device that cannot communicate with its R2 (secondary) device, it suspends the remote mirroring for all volumes defined to the consistency group before completing the intercepted I/O and returning control to the application. In this way, SRDF/CG prevents a dependent-write I/O from reaching the secondary site if the previous I/O only gets as far as the primary site.

SRDF/S Consistency Group 213

Page 214: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

214

EMC SRDF Family of Products

If SRDF/CG is enabled, the I/Os to the primary volumes in the consistency group can still occur even when the R1 devices have their SRDF mirrors in a “Not Ready” state. Such updates are not immediately sent to the secondary site. Instead, they are propagated after the affected links are again operational, and data transfer from the R1 devices to the R2 devices resumes.

Rolling disasterProtection against a rolling disaster is required when the data for an application (such as a database) resides on more than one Symmetrix array or multiple RA groups. Figure 52 depicts a dependent-write I/O sequence, where a predecessor log write is happening before a page flush from a database buffer pool. The log device and data device are on different Symmetrix arrays with different replication paths.

Figure 52 Rolling disaster with multiple production Symmetrix

Figure 52 demonstrates how rolling disasters can affect this dependent-write sequence; the numbers shown in this illustration represent the following:

Host

DBMS

1

R1(Z)

R1(Y)

R1(X)

R2(Y)

R2(Z)

R2(X)

R1(C)

R1(B)

R1(A)

R2(B)

R2(C)

R2(A)

ICO-IMG-000475

Dataaheadof Log

X = Application DataY = DBMS DataZ = Logs

2

3

3

4

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 215: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

1. In this example, a rolling disaster starts with a loss of the synchronous link between the source Symmetrix (bottom) and the target Symmetrix (right). This will prevent the remote replication of data on the source Symmetrix.

2. The Symmetrix, which is now no longer replicating, receives a predecessor log write of a dependent-write I/O sequence. The local I/O is completed, but it is not replicated to the remote Symmetrix and the tracks are marked as being owed to the target Symmetrix. Nothing prevents the predecessor log write from completing the acknowledgement process.

3. Now that the predecessor log write has completed, the dependent data write is issued. This write is received on both the source Symmetrix (top) and the target Symmetrix (right) because the rolling disaster has not yet affected those communication links.

4. If the rolling disaster ended in a complete disaster, the condition of the data at the remote site is such that it creates a data ahead of log condition, which results in an inconsistent state for a database. The severity of the situation is that when the database is restarted, performing an implicit recovery, it may not detect the inconsistencies. (A person extremely familiar with the transactions running at the time of the rolling disaster might be able to detect the inconsistencies. Database utilities could also be run to detect some of the inconsistencies.)

A rolling disaster can happen in such a manner that data links providing remote mirroring support are disabled in a staggered fashion, while application and database processing continue at the production site. The sustained replication during the time when some Symmetrix units are communicating with their remote partners through their respective links while other Symmetrix units are not (due to link failures) can cause data integrity exposure at the recovery site. Therefore, some data integrity problems caused by a rolling disaster cannot be resolved through normal database restart processing and may require a full database recovery using appropriate backup images and archive log files. A full database recovery elongates overall application restart time at the recovery site.

SRDF/S Consistency Group 215

Page 216: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

216

EMC SRDF Family of Products

Protection against a rolling disasterSRDF/CG uses a mechanism known as a consistency group to provide protection against rolling disasters. A consistency group is a set of Symmetrix volumes spanning multiple RA groups and/or multiple Symmetrix frames that replicate as a logical group to other Symmetrix arrays using SRDF/S. (It is not a requirement to span multiple RA groups and/or Symmetrix frames when using consistency groups.) As mentioned earlier, consistency group technology guarantees that if a single source volume is unable to replicate to its partner for any reason, then all the volumes in the group stop replicating. This ensures that the image of the data on the target Symmetrix is consistent from a dependent-write perspective.

Figure 53 depicts a dependent-write I/O sequence, where a predecessor log write is happening before a page is flushed from a database buffer pool. The log device and data device are on different Symmetrix arrays with different replication paths.

Figure 53 Rolling disaster with SRDF consistency group protection

Figure 53 demonstrates how rolling disasters can be prevented using SRDF/CG technology; the numbers shown in this illustration represent the following:

Host 1

DBMS

IOSPowerPath

Solutions EnablerConGroup definition

Host 2

DBMS

IOSPowerPath

Solutions EnablerConGroup definition

2

R1(Z)

R1(Y)

R1(X)

R2(Y)

R2(Z)

R2(X)

R1(C)

R1(B)

R1(A)

R2(B)

R2(C)

R2(A)

ICO-IMG-000476

Suspend R1/R2relationship

DBMSrestartablecopy

E-ConGroupdefinition(X,Y,Z)

E-ConGroupdefinition(X,Y,Z)

X = Application dataY = DBMS dataZ = Logs

1

1

3

45

6

7

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 217: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

1. Consistency group protection is defined for volumes X, Y, and Z on the source Symmetrix array. The consistency group definition must contain all of the devices that are needed to maintain dependent-write consistency and that reside on all participating hosts involved in issuing I/O to these devices. A mix of CKD (mainframe) and FBA (UNIX/Windows) devices can be logically grouped together. In some cases, the entire processing environment may be defined in a consistency group to ensure dependent-write consistency.

2. A rolling disaster begins preventing the replication of changes from volume Z to the remote site.

3. The predecessor log write occurs to volume Z, causing a consistency group (ConGroup) trip.

4. A ConGroup trip will hold the I/O that could not be replicated along with all of the I/O to the logically grouped devices. The I/O is held by PowerPath on the UNIX or Windows hosts, and IOS on the mainframe host. It is held long enough to issue two I/Os per Symmetrix system. The first I/O will put the devices in a suspend-pending state.

5. The second I/O performs the suspend of the R1/R2 relationship for the logically grouped devices, which immediately disables all replication to the remote site. This allows other devices outside of the group to continue replicating provided the communication links are available.

6. After the R1/R2 relationship is suspended, all deferred write I/Os are released allowing the predecessor log write to complete to the host. The dependent data write is issued by the DBMS and arrives at X but is not replicated to the R2(X).

7. If a complete failure occurred from this rolling disaster, dependent-write consistency at the remote site is preserved. If a complete disaster did not occur and the failed links were activated again, the consistency group replication could be resumed once synchronous mode is achieved. (It is recommended to create a copy of the dependent-write consistent image while the resume takes place.) Once the SRDF process reaches synchronization, the dependent-write consistent copy is achieved at the remote site.

SRDF/S Consistency Group 217

Page 218: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

218

EMC SRDF Family of Products

Symmetrix Remote Data Facility/Asynchronous (SRDF/A)Symmetrix Remote Data Facility/Asynchronous, or SRDF/A, is a method of replicating production data changes from one Symmetrix array to another using delta set technology. Delta sets are the collection of changed blocks grouped together by a time interval configured at the source site. The default time interval is 30 seconds. The delta sets are then transmitted from the source site to the target site in the order created. SRDF/A preserves dependent-write consistency of the database at all times at the remote site.

The distance between the source and target Symmetrix arrays is unlimited and there is no host impact. Writes are acknowledged immediately when they hit the cache of the source Symmetrix array. SRDF/A is only available on the DMX and VMAX family of Symmetrix arrays. Figure 54 illustrates the behavior of write operations in an SRDF/A configuration.

Figure 54 SRDF/A replication internals

The numbers shown in Figure 54 correspond to the following steps:

1. A writes is received in the source Symmetrix cache and the host receives immediate acknowledgement that the write is complete. Writes are gathered into what is known as the capture delta set for 30 seconds.

R1N

R1N

N-1

N-1

N-1

N-1

R2N-2

R2N-2

DB2 LUW

ICO-IMG-000478

1 5 2 3 4

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 219: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

2. A delta set switch occurs and the current capture delta set becomes the transmit delta set (this is done by changing a pointer in cache). A new empty capture delta set is then created.

3. SRDF/A sends the changed blocks in the transmit delta set to the remote Symmetrix array. The changes collect in the receive delta set at the target site. When the replication of the transmit delta set is complete, another delta set switch occurs and a new empty capture delta set is created with the current capture delta set becoming the new transmit delta set. The receive delta set becomes the apply delta set.

4. The apply delta set marks all the changes in the delta set against the appropriate volumes as invalid tracks and begins destaging the blocks to disk.

5. The cycle repeats continuously.

If sufficient bandwidth for the source Symmetrix write activity exists, SRDF/A will transmit all changed data within the default 30 seconds. This means that the maximum time the target data will be behind the source is 60 seconds (two replication cycles). At times of high-write activity, it may be impossible to transmit all the changes that occur during a 30-second interval, in which case, the target Symmetrix array will fall behind the source Symmetrix array by more than 60 seconds. Careful design of the SRDF/A infrastructure and a thorough understanding of write activity at the source site are necessary to design a solution that meets the RPO requirements of the business at all times.

Consistency is maintained throughout the replication process on a delta-set boundary. The Symmetrix array will not apply a partial delta set, which would invalidate consistency. Dependent-write consistency is preserved by placing a dependent write in either the same delta set as the write it depends on or a subsequent delta set.

Note: There is no requirement for a host at the remote site during asynchronous replication. The target Symmetrix array manages in-bound writes and updates the appropriate disks in the array.

Different command sets are used to enable SRDF/A depending on whether the SRDF/A group of devices is contained within a single Symmetrix array or is spread across multiple Symmetrix arrays.

Symmetrix Remote Data Facility/Asynchronous (SRDF/A) 219

Page 220: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

220

EMC SRDF Family of Products

Setting up SRDF/A using a single source SymmetrixThe following steps outline the process for setting up SRDF/A replication using Solutions Enabler (SYMCLI) commands:

1. Before the asynchronous mode of SRDF can be established, a baseline full copy of all the volumes that are going to participate in the asynchronous replication must take place. (This is usually accomplished using the adaptive copy mode of SRDF.) And the easiest way to work with volumes that are to participate in the asynchronous replication process is by placing them in a device group. The following command, when executed, will create a device group named “device_group” that can be used to group the appropriate devices:

symdg create device_group -type rdf1

2. Add the appropriate devices to the device group by executing a set of commands that look similar to this:

symld -g device_group add dev 121 -sid 111symld -g device_group add dev 12f -sid 111

(In this example, the R1 devices 121 and 12f from a Symmetrix whose serial number ends in 111 are added to the device group named “device_group”.)

3. Put the devices assigned to the device group into adaptive copy mode by executing a command that looks like this:

symrdf -g device_group set mode acp_disk -noprompt

4. Instruct the source Symmetrix array to send all the tracks on the source site to the target site (using the current mode) by executing a command that looks similar to this:

symrdf -g device_group establish -full -noprompt

The adaptive copy mode of SRDF has no impact on host application performance. It transmits tracks to the remote site that have never been sent before, or that have changed since the last time the track was sent. It does not preserve write order or dependent-write consistency.

5. When both sides are synchronized, put SRDF into asynchronous mode by executing a command that looks like this:

symrdf -g device_group set mode async -noprompt

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 221: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

There is no requirement for a host at the remote site during the asynchronous replication — the target Symmetrix itself manages the inbound writes and updates the appropriate volumes in the array.

Setting up SRDF/A using multiple source Symmetrix arrays

When a database is spread across multiple Symmetrix arrays and SRDF/A is used for long-distance replication, separate software must be used to manage the coordination of the delta-set boundaries between the participating Symmetrix arrays and to stop replication if any of the volumes in the group cannot replicate for any reason. This software must ensure that all delta-set boundaries on every participating Symmetrix array in the configuration are coordinated to give a dependent-write consistent point-in-time image of the database.

SRDF/A Multi-session Consistency (MSC) provides consistency across multiple RA groups and/or multiple Symmetrix arrays. MSC is available on 5671 microcode and later with Solutions Enabler version 6.0 and later. SRDF/A with MSC is supported by an SRDF process daemon that performs cycle-switching and cache recovery operations across all SRDF/A sessions in the group. This ensures that a dependent-write consistent R2 copy of the data exists at the remote site at all times. However, a composite group must be created using the SRDF consistency protection option (-rdf_consistency) and must be enabled using the symcg enable command before the RDF daemon can begin monitoring and managing the MSC consistency group. In addition, the RDF process daemon must be running on all hosts that can write to the set of SRDF/A volumes being protected. At the time of an interruption (for example, if an SRDF link failure occurs), MSC analyzes the status of all SRDF/A sessions and either commits the last cycle of data to the R2 target or discards it.

The process for setting up SRDF/A MSCThe following steps outline the process for setting up SRDF/A replication controlled by MSC using Solutions Enabler (SYMCLI) commands:

1. Create a replication composite group for the SRDF/A devices by executing a command that looks similar to this:

symcg create rcomp_group -rdf_consistency -type rdf1

(The -rdf_consistency option indicates that the devices in the group are to be protected by MSC.)

Symmetrix Remote Data Facility/Asynchronous (SRDF/A) 221

Page 222: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

222

EMC SRDF Family of Products

2. Add the appropriate devices to the replication composite group by executing a set of commands that look something like this:

symcg -cg rcomp_group add dev 121 -sid 111symcg -cg rcomp_group add dev 12f -sid 111symcg -cg rcomp_group add dev 135 -sid 222symcg -cg rcomp_group add dev 136 -sid 222

(In this example, the R1 devices 121 and 12f from a Symmetrix whose serial number ends in 111, and R1 devices 135 and 136 from a Symmetrix whose serial number ends in 222 are added to a replication composite group named “rcomp_group”.)

3. Before the asynchronous mode of SRDF can be established, a baseline full copy of all the volumes that are going to participate in the asynchronous replication must take place. (This is usually accomplished using the adaptive copy mode of SRDF.) To put the devices assigned to the replication composite group “rcomp_group” into adaptive copy mode, execute a command that looks similar to this:

symrdf -cg rcomp_group set mode acp_disk -noprompt

4. Instruct the source Symmetrix array to send all the tracks on the source site to the target site (using the current mode) by executing a command that looks like this:

symrdf -cg rcomp_group establish -full -noprompt

The adaptive copy mode of SRDF has no impact on host application performance. It transmits tracks to the remote site that have never been sent before, or that have changed since the last time the track was sent. It does not preserve write order or dependent-write consistency.

5. When both sides are synchronized, put SRDF into asynchronous mode by executing a command that looks similar to this:

symrdf -cg rcomp_group set mode async -noprompt

6. Enable multisession consistency protection by executing a command that looks like this:

symcg -cg rcomp_group enable -noprompt

There is no requirement for a host at the remote site during the asynchronous replication — the target Symmetrix itself manages the inbound writes and updates the appropriate volumes in the array.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 223: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

How to restart in the event of a disasterIn the event of a disaster where the primary source Symmetrix array is lost, database and application services can be run from the DR site. However, in order to do this, a host is required at the DR site.

Assuming a host has access to the secondary Symmetrix array(s) at the DR site, the first step in making the data available to the host is to write-enable all R2 devices that were mirrors of the R1 devices on the source Symmetrix array(s). If all of the R1 devices being mirrored are on a single Symmetrix array, this is done by executing a SYMCLI command that looks similar to this:

symld -cg device_group rw_enable -noprompt

On the other hand, if the R1 devices span multiple Symmetrix arrays, this is done by executing a SYMCLI command that looks more like this:

symld -cg rcomp_group rw_enable -noprompt

When executed, the symld command shown will write-enable all R2 devices in the device group or composite group specified—assuming the device/composite group exists. If the group has not yet been built on the host at the DR site, it must be created using the appropriate R2 devices before it can be used with the symld command. Here again, Group Named Services (GNS) can be used to propagate the device group to the remote site if there is a host utilized there; for more details on GNS see the Solutions Enabler Symmetrix Base Management CLI Product Guide.

At this point, the host can issue the commands needed to access the disks. For instance, on a UNIX host, this involves importing the appropriate volume groups, activating the logical volumes, performing a file system check on the appropriate file systems, and then mounting the file systems so they can be used.

In the case of DB2, once the data on the R2 devices is made available to the remote host, any databases stored on the devices can then be restarted. During the restart, transactions that were committed, but not completed (based on information found in the active logs), are applied and completed; transactions that were not committed are rolled back. The result is a transactionally consistent database.

Symmetrix Remote Data Facility/Asynchronous (SRDF/A) 223

Page 224: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

224

EMC SRDF Family of Products

SRDF/Automated ReplicationThe SRDF Automated Replication, or SRDF/AR, solution provides a continuous movement of dependent-write consistent data to a remote site using SRDF adaptive copy mode and TimeFinder consistent split technology. SRDF/AR is offered as a two-site configuration (single-hop) operating in adaptive copy mode using SRDF/DM in combination with TimeFinder or as a three-site configuration (multi-hop) using a combination of SRDF/S, SRDF/DM, and TimeFinder. This solution operates in synchronous mode between the primary Symmetrix and the secondary Symmetrix and in adaptive copy mode between the secondary Symmetrix and the third Symmetrix.

The benefits of SRDF/AR are:

◆ It can be used in both mainframe and open system environments.

◆ It provides a disaster restart copy at the secondary Symmetrix and a remote copy at another Symmetrix.

◆ It allows customers to achieve dependent-write consistency in SRDF/AR configurations by using SRDF/CG and TimeFinder/CGs that are offered with SRDF/S and TimeFinder licenses. TimeFinder/CGs are designed for using consistent TimeFinder split at the secondary Symmetrix.

◆ It provides a lower cost solution for remote data protection by utilizing lower-cost communication links.

The limitations of SRDF/AR are:

◆ In a three-site SRDF/AR (multi-hop) configuration, SRDF/S host I/O to the primary Symmetrix is not acknowledged until it the secondary Symmetrix has acknowledged it.

◆ SRDF/S can be implemented over distances only to a maximum of 200 km (125 miles).

SRDF/AR single-hopWhen SRDF/AR is used in a two-site (single-hop) configuration, TimeFinder clones are used to create a dependent-write consistent point-in-time image of the data to be replicated. The clones also have an R1 personality which means that SRDF in adaptive copy mode can be used to replicate the data from the clones to the secondary (target)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 225: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

site. Since the clones are not changing, replication completes in a finite length of time—the actual amount of time required for replication depends on the size of the network pipe between the two locations, the distance between the two locations, the quantity of changed data tracks, and the locality of reference of the changed tracks. On the remote Symmetrix, another clone copy of the data is made using data on the R2 devices. This is necessary because the next SRDF/AR iteration replaces the R2 image in a non-ordered fashion, and if a disaster were to occur while the R2 devices were synchronizing, there would not be a valid copy of the data at the DR site. (For this reason, the clone copy of the data in the remote Symmetrix is commonly called the “gold” copy of the data.) The whole process then repeats.

In an SRDF/AR single-hop configuration, there is no host impact. Writes are acknowledged immediately when they arrive in the cache of the source Symmetrix array.

Figure 55 illustrates the behavior of write operations in an SRDF/AR single-hop configuration.

Figure 55 SRDF/AR single-hop replication internals

The numbers shown in Figure 55 correspond to the following steps:

1. Writes are received into the source Symmetrix cache and are acknowledged immediately. The clones used are already synchronized with the STDs at this point so a consistent split is executed against the STD-TGT pairing to create a point-in-time image of the data on the clone target devices.

STD

STD

TGT/R1

TGT/R1

R2

R2

TGT

TGTDB2 LUW

ICO-IMG-000479a

1

5

2

3 4

SRDF/Automated Replication 225

Page 226: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

226

EMC SRDF Family of Products

2. SRDF transmits the data on the TGT/R1 devices to the R2 devices in the remote Symmetrix array.

3. When the TGT/R1 devices are synchronized with the R2 devices, they are reestablished with the standard devices in the source Symmetrix array. This causes the SRDF links to be suspended. At the same time, an incremental establish is performed on the target Symmetrix array to create a "gold" copy on the clone target devices in that frame.

4. When the TGTs in the remote Symmetrix array are fully synchronized with the R2 devices, they are split and the configuration is ready to begin another cycle.

5. The cycle repeats based on configuration parameters. The parameters can specify that cycles begin at specific times, specific intervals, or are to run immediately after the current cycle completes.

Cycle times for SRDF/AR are usually in the minutes-to-hours range. In a worst-case scenario, the RPO is double the cycle time; this may be acceptable for customers with relaxed RPOs.

The added benefit of having a longer cycle time is that the locality of reference will likely increase. This is because there is a much greater chance of a track being updated more than once in a 1-hour interval than in, for example, a 30-second interval. The increase in locality of reference shows up as reduced bandwidth requirements for the final solution.

Before SRDF/AR is started, a baseline full copy of all the volumes participating in the SRDF/AR replication must be created. This requires a full establish to the clone target devices in the source array, a full SRDF establish of the TGT/R1 devices to the R2 devices, and a full establish of the R2 devices to the TGTs in the target array. There is an option to automate the initial setup of the relationship.

As with other SRDF solutions, SRDF/AR does not require a host at the DR site. The commands to update the R2 devices and manage the synchronization of the clone target devices in the remote site are all managed in-band from the production site.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 227: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

How to restart in the event a disaster occursIn the event of a disaster, it is necessary to determine if the most current copy of the data is located on the remote site TGTs or R2 devices at the remote site. Depending on when in the replication cycle the disaster occurred, the most current version could be on either set of disks.

SRDF/AR multi-hop

A three-site (multi-hop) SRDF/AR configuration is an architecture that allows long-distance replication with zero seconds of data loss through the use of a bunker Symmetrix. Production data is replicated synchronously to the bunker Symmetrix, which is within 200 km of the primary Symmetrix allowing synchronous replication. However, it's also far enough away that potential disasters at the primary site may not affect it. Typically, the bunker Symmetrix is placed in a hardened computing facility.

Clone target devices in the bunker frame are periodically synchronized to the R2 devices and then consistently split in the bunker frame to provide a dependent-write consistent point-in-time image of the data. These bunker clone target devices also have an R1 personality, which means that SRDF in adaptive copy mode can be used to replicate the data from the bunker array to the target site. Since the clone target devices are not changing, the replication can be completed in a finite length of time — the actual amount of time required for replication depends on the size of the pipe between the bunker location and the DR location, the distance between the two locations, the quantity of changed data, and the locality of reference of the changed data. On the remote Symmetrix system, another clone copy of the data is made using the R2 devices. This is because the next SRDF/AR iteration replaces the R2 image, in a non-ordered fashion. If a disaster occurred while the R2 devices were synchronizing, there would not be a valid copy of the data at the DR site. The whole process then repeats.

In a SRDF/AR multi-hop configuration, there is a minimal amount of host impact. Writes are only acknowledged when they hit the cache of the bunker Symmetrix system; at that time, a positive acknowledgment is returned to the source Symmetrix system and forwarded to the host.

Figure 56 on page 228 illustrates the behavior of write operations in an SRDF/AR multi-hop configuration.

SRDF/Automated Replication 227

Page 228: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

228

EMC SRDF Family of Products

Figure 56 SRDF/AR multihop replication internals

The numbers shown in Figure 56 correspond to the following steps:

1. TGTs are synchronized and consistently split against the R2 devices in the bunker Symmetrix system. The write activity is momentarily suspended on the source Symmetrix to get a dependent-write consistent point-in-time image on the R2 devices in the bunker Symmetrix, which creates a dependent-write consistent point-in-time copy of the data on the clone target devices.

2. SRDF transmits the data on the bunker TGT/R1 devices to the R2 devices in the DR Symmetrix array.

3. When the TGT/R1 devices are synchronized with the R2 devices in the DR Symmetrix, the bunker TGT/R1 devices are reestablished with the R2 devices in the bunker Symmetrix. This causes the SRDF links to be suspended between the bunker Symmetrix and the DR Symmetrix. At the same time, an incremental establish is performed on the DR Symmetrix to create a “gold” copy on the clone target devices in that frame.

4. When the TGTs in the DR Symmetrix array are fully synchronized with the R2 devices, they are split and the configuration is ready to begin another cycle.

5. The cycle repeats based on configuration parameters. The parameters can specify that cycles begin at specific times, specific intervals, or are to run immediately after the current cycle completes.

TGT/R1

TGT/R1

R1

R1

R2

R2

R2

R2

TGT

TGT

Short Distance Long Distance

DB2 LUW

Production Bunker

ICO-IMG-000480a

1 5 2

DR

3

4

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 229: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

EMC SRDF Family of Products

Even though cycle times for SRDF/AR multi-hop are usually in the minutes-to-hours range, the most current data is always in the bunker Symmetrix. Unless there is a regional disaster that destroys both the primary site and the bunker site, the bunker Symmetrix will transmit all data to the remote DR site. This results in zero data loss at the point of the beginning of the rolling disaster, or an RPO of 0 seconds. Therefore, this is an excellent solution for customers who require zero data loss and long-distance disaster recovery.

An added benefit of having a longer cycle time means that the locality of reference will likely increase. This is because there is a much greater chance of a track being updated more than once in a 1-hour interval than in, say, a 30-second interval. The increase in locality of reference manifests as reduced bandwidth requirements for the network segment between the bunker Symmetrix and the DR Symmetrix.

Once again, before SRDF/AR starts, a baseline full copy of all the volumes participating in the SRDF/AR replication must be created. In a multi-hop configuration, this means that a full establish of the R1 devices in the source location to the R2 devices in the bunker Symmetrix must be performed. (The R1 devices and the R2 devices need to be synchronized continuously.) This must then be followed by a full establish of the R2 devices to the clone target devices in the bunker Symmetrix, a full SRDF establish of the TGT/R1 devices in the bunker Symmetrix to the R2 devices in the DR Symmetrix, and a full establish of the R2 devices to the clone target devices in the DR Symmetrix. There is an option to automate this process of instantiation.

How to restart in the event a disaster occursIn the event of a disaster, it is necessary to determine if the most current copy of the data is on the R2s on the remote site or on the TGT/R1s in the bunker Symmetrix. Depending on when the disaster occurs, the most current version could be on either set of disks.

SRDF/Automated Replication 229

Page 230: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

230

EMC SRDF Family of Products

SRDF/StarSRDF/Star is a three-site disaster recovery solution that consists of a primary (production), secondary, and tertiary site. The secondary site synchronously mirrors the production site, the tertiary site asynchronously mirrors the production site. In the event of a primary site outage, EMC's SRDF/Star solution allows customers to quickly move operations and re-establish remote mirroring between the remaining sites. Once conditions permit, customers can quickly rejoin the primary site to the configuration, resuming the SRDF/Star operations.

SRDF/Star operates in two basic configurations: concurrent and cascaded. Each configuration addresses different recovery and availability objectives: Concurrent SRDF/Star positions the secondary site or the tertiary site as potential recovery sites, and provides differential resynchronization between the secondary and the tertiary site. To achieve this positioning, some level of reconfiguration intervention is required to access point-of-disaster data. Cascaded SRDF/Star, on the other hand, positions only the tertiary site as the recovery site with minimal intervention required to access point-of-disaster data. This solution provides differential synchronization between the primary and the tertiary site.

It is differential synchronization between two remote sites that allows SRDF/Star to rapidly reestablish cross-site mirroring in the event of a primary site failure. Differential synchronization between the remote sites dramatically reduces the time required to remotely mirror the new production site. SRDF/Star also provides a mechanism to determine which remote site has the most current data in the event of a rolling disaster that affects the primary site.

In all cases, users maintain the ability to select which site to operate from and which site’s data to use when recovering from the primary site failure. SRDF/Star supports the SRDF personality swap between the primary site and the synchronous remote site. In addition, SRDF/Star allows the SRDF/A relationships to be transferred to remote sites during planned outages. These SRDF/A relationship transfers require no data movement.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 231: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

5

The EMC Symmetrix Remote Data Facility (SRDF) family of products provide a business continuance solution in which a mirror image of data (at the device level) is maintained at two or more Symmetrix systems that, ideally, are located at physically separate sites. SRDF reduces backup and recovery costs and can significantly decrease recovery time when an outage (either planned or unplanned) occurs. Thus, SRDF provides an excellent disaster recovery solution for DB2 for Linux, UNIX, and Windows (LUW) databases whose metadata, data, and transaction logs reside on one or more EMC Symmetrix arrays.

This chapter is designed to provide you with guidelines for setting up a two-site SRDF environment for a DB2 LUW database that has been deployed on a Symmetrix storage array. Topics covered include:

◆ A basic two-site SRDF configuration ............................................ 232◆ Planning for remote replication ..................................................... 234◆ Setting up an SRDF environment for a DB2 LUW database ..... 235◆ Cloning a DB2 LUW database stored on R2 devices .................. 257

Note: The procedures outlined in this chapter make the assumption that all necessary Symmetrix standard devices (STDs) have been created and have been made accessible to a primary host and that a DB2 LUW database, along with its transaction log files, has been created on those devices. It is also assumed that the SRDF product license has been enabled and that RDF directors have been configured on both Symmetrix arrays used and that the appropriate zoning has been done to establish connectivity between the two arrays.

Setting up a DB2 LUWDatabase - SRDF

Environment

Setting up a DB2 LUW Database - SRDF Environment 231

Page 232: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

232

Setting up a DB2 LUW Database - SRDF Environment

A basic two-site SRDF configurationA basic two-site SRDF configuration consists of a Symmetrix array at a production site and a Symmetrix array at a recovery site. One or more application servers (hosts) are connected to the Symmetrix array at the production site, and in many cases, one or more application servers are connected to the Symmetrix array at the recovery site as well. The Symmetrix systems at both sites communicate with each other through SRDF links, which are established via one or more remote adapters. When a Symmetrix is configured for SRDF, remote adapters are logically grouped together into RDF groups, which are then used to define relationships between Symmetrix systems. Essentially, an RDF group is a set of SRDF director port connections on one Symmetrix that has been configured to communicate with a set of SRDF director ports in another Symmetrix array.

In a two-site SRDF configuration, individual Symmetrix devices are designated as either being “source” or “target” devices. Devices (or volumes) on the Symmetrix at the production site that contain data that is remotely mirrored are referred to as “source” or “R1” devices; devices on the Symmetrix at the recovery site that contain a mirror copy of the data are known as “target” or “R2” devices. If, for some reason, a source (R1) device fails, data on its corresponding target (R2) device can be accessed immediately by a local host.

Originally, RDF groups were static and were defined whenever the binfile for a Symmetrix was created or updated. Today, dynamic RDF groups and SRDF configurations are both supported and recommended. Dynamic SRDF configurations enable users to dynamically create, delete, and swap SRDF source and target pairing relationships using Solution Enabler CLI (SYMCLI) commands or any other EMC SRDF control software. Dynamic RDF devices are configured in the binfile as DR1, which means they can be dynamically paired as R1 devices, as DR2, which means they can be dynamically paired as R2 devices, or as DRX, which means they can be dynamically paired as either R1 or R2 devices, as well as have their personality swapped while the Symmetrix is online.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 233: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

While SRDF is normally associated with disaster recovery (DR) operations, target (R2) devices can also be used for backup, testing, or decision support operations. When the mirror relationship between the source devices at the primary site and the target devices at the recovery (secondary) site is broken (split), both copies of the data are accessible by attached hosts and can be used in read and write operations. Changes made to the source and target devices are recorded as invalid tracks and when it comes time to resume the mirroring relationship, a decision must be made as to which copy is to be treated as the valid copy. If the copy on the source is valid, changes made to the target devices can be discarded by performing an establish operation; if the copy on the target is valid, changes made to the source devices can be discarded by performing a restore operation.

A basic two-site SRDF configuration 233

Page 234: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

234

Setting up a DB2 LUW Database - SRDF Environment

Planning for remote replicationIf you are planning on using SRDF replication as a DR solution for a database, this must be taken into consideration when deciding on the physical layout to use for the database. Since SRDF replication copies volumes at the physical disk level (as seen by the host), all table space containers for a database should reside on a set of disks that are dedicated to the database and are not shared with other applications and databases. Sharing disks with other applications can cause unnecessary work for the array, wasted bandwidth during replication, and wasted space on the remote replication target devices.

In addition to isolating a database to its own set of dedicated volumes, it is also a good idea to divide the storage for the database into two parts: one for the database and its associated data objects and the other for the database's transaction logs. Such a division allows the two parts to be manipulated independently of each other.

Before SRDF control operations are performed, RDF devices are typically logically grouped together as either part of a SYMAPI device group, composite group, or a device file. (Device groups are used if the source RDF devices reside on a single Symmetrix frame; composite groups are used if the source RDF devices span more than one Symmetrix frame. A device file is simply an ASCII file with two columns that define the pair relationship—one column contains the source Symmetrix device numbers and the other column contains the target device numbers.)

Thus, to facilitate database DR operations when using SRDF, it is a good idea to create two different SYMCLI device or composite groups that contain both the database data and the transaction logs. When creating a device or composite group, the group type (Regular, RDF1, or RDF2) must be specified and a Regular device/composite group cannot contain RDF devices. Therefore, you should create a RDF1 device or composite group on the Symmetrix at the production site and assign it the source (R1) devices. Likewise, you should create a RDF2 device or composite group on the Symmetrix at the recovery site and assign it the target (R2) devices. (Keep in mind that device and composite group definitions are stored in the SYMAPI database on the host where the symdg or symcg command used to create them was executed.)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 235: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

Setting up an SRDF environment for a DB2 LUW databaseThe following section describes how to set up a two-site SRDF environment to provide a disaster restart solution for a DB2 LUW database that already resides on a single Symmetrix array. The procedure outlined in this section was developed using a single partition DB2 LUW database residing on a single Symmetrix array; the database metadata and data was stored on one device and the transaction logs were stored on another device.

To set up an SRDF environment for an existing DB2 database, complete the following steps in the order shown:

At the primary site 1. Add dynamic SRDF capability to the Symmetrix devices that contain the database that is to be remotely replicated by executing the following command at the primary host (as the system administrator or root user):

symconfigure -sid [SymmID] -cmd ”set dev[StartDevName]:[EndDevName] attribute=dyn_rdf;” -v-noprompt commit

where:

• SymmID — Identifies the Symmetrix array, by serial number, where the devices containing the database to be remotely replicated resides.

• StartDevName — Identifies the first Symmetrix device in a range of devices that are to be altered.

• EndDevName — Identifies the last Symmetrix device in a range of devices that are to be altered.

For example, to add dynamic SDRF capability to Symmetrix devices 0090 thru 0091 that reside on a Symmetrix whose serial number ends in 1724, you would execute a command that looks like this:

symconfigure -sid 1724 -cmd ”set dev 0090:0091attribute=dyn_rdf;” -v -noprompt commit

When this command is executed, you should see output that looks something like this:

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change session...........Established.

Setting up an SRDF environment for a DB2 LUW database 235

Page 236: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

236

Setting up a DB2 LUW Database - SRDF Environment

Processing symmetrix 000192601724{

set dev 0090:0091 attribute=DYN_RDF; }

Performing Access checks................................Allowed.Checking Device Reservations............................Allowed.Locking devices.........................................Locked.Initiating COMMIT of configuration changes..............Queued.COMMIT requesting required resources....................Obtained.Step 013 of 022 steps...................................Executing.Local: COMMIT..........................................Done.Terminating the configuration change session............Done.

The configuration change session has successfully completed.

2. Verify that dynamic SRDF capability has been added to the devices that contain the database that is to be remotely replicated by executing the following command at the primary host (as the system administrator or root user):

symdev -sid [SymmID] list dynamic

where:

• SymmID — Identifies the Symmetrix array, by serial number, where the devices containing the database to be remotely replicated resides.

For example, to determine if the devices on a Symmetrix whose serial number ends in 1724 that contain a database that is to be remotely replicated have dynamic SDRF capability enabled, you would execute a command that looks like this:

symdev -sid 1724 list -dynamic

When this command is executed, you should see output that looks something like this:

Symmetrix ID: 000192601724

Device Name Directors Device--------------------------- ------------- ------------------------------------- CapSym Physical SA :P DA :IT Config Attribute Sts (MB)--------------------------- ------------- -------------------------------------

0090 /dev/rhdiskpower8 10F:0 07A:C6 RAID-5 N/Grp'd RW 806250091 /dev/rhdiskpower9 10F:0 08C:C7 RAID-5 N/Grp'd RW 80625

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 237: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

The devices that contain the metadata, data, and transaction logs for the database that is to be remotely replicated should appear in the list produced.

3. Create the dynamic RDF group that will be used to define the relationship between the two Symmetrix arrays that are to be logically connected via SRDF links by executing the following command at the primary host (as the system administrator or root user):

symrdf addgrp -label [GrpLabel] -rdfg [GrpNumber]-sid [SymmID] -dir [DirID] -remote_rdfg [GrpNumber]-remote_sid [RemoteSymmID] -remote_dir [RemoteDirID]

where:

• GrpLabel — Identifies the label that is to be assigned to the dynamic RDF group to be created.

• GrpNumber — Identifies the RDF (RA) number that is to be assigned to the dynamic RDF group to be created.

• SymmID — Identifies the Symmetrix at the primary (production) site, by serial number, that is to be added to the dynamic RDF group being created.

• DirID — Identifies the director(s) on the Symmetrix at the primary (production) site that are to be added to the dynamic RDF group being created.

• RemoteSymmID — Identifies the Symmetrix at the secondary (recovery) site, by serial number, that is to be added to the dynamic RDF group being created.

• RemoteDirID — Identifies the director(s) on the Symmetrix at the secondary (recovery) site, that are to be added to the dynamic RDF group being created.

For example, to create a dynamic RDF group named DB2_RDF and assign it a group number of 6, that logically connects a primary Symmetrix whose serial number is 000192601724 (via director 8F) to a secondary Symmetrix whose serial number is 000194900223 (via director 7h), you would execute a command that looks like this:

symrdf addgrp -label DB2_RDF -rdfg 6 -sid 000192601724-dir 8f -remote_rdfg 6 -remote_sid 000194900223-remote_dir 7h -noprompt

When this command is executed, you should see a message that looks something like this:

Setting up an SRDF environment for a DB2 LUW database 237

Page 238: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

238

Setting up a DB2 LUW Database - SRDF Environment

Successfully Added Dynamic RDF Group 'DB2_RDF' for Symm: 000192601724

4. In order to replicate a database from a primary Symmetrix to a secondary Symmetrix, target devices must be created on the secondary Symmetrix that have the same size and emulation type as the source devices that contain the database. Specify the devices to be created on the secondary Symmetrix by creating a command file (using a text editor, such as Notepad or the UNIX vi Editor) that contains one or more create dev commands that are similar to this:

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,dynamic_capability=dyn_rdf, disk_group=1;

This particular create dev command will create two new devices with a size of 86000 cylinders that are configured as RAID 5 (7+1) devices, that use FBA emulation, that have dynamic SRDF capability enabled, and that reside in disk group 1.

Note: Devices on the secondary Symmetrix should be created with dynamic SRDF capability enabled; this is done by specifying the dynamic_capability=dyn_rdf option with each create dev command used.

5. Execute the create dev command(s) stored in the file created in the previous step by executing a symconfigure command at the primary host (as the system administrator or root user) that looks something like this:

symconfigure -sid [SymmID] -file [CmdFile] -v -nopromptcommit

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symconfigure command is to be executed against. In this case, the serial number for the Symmetrix at the secondary (recovery) site must be specified.

• CmdFile — Identifies, by name, the file that contains one or more create dev commands.

For example, to commit the commands in a command file named adddevices.cmd against a Symmetrix whose serial number ends in 0223, you would execute a command that looks like this:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 239: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

symconfigure -sid 0223 -file adddevices.cmd -v-noprompt commit

When this command is executed, you should see output that looks something like this:

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change session...........Established.

Processing symmetrix 000914900223{

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,dynamic_capability=dyn_rdf, disk_group=1;

}

Performing Access checks................................Allowed.Checking Device Reservations............................Allowed.Initiating COMMIT of configuration changes..............Queued.COMMIT requesting required resources....................Obtained.Step 022 of 047 steps...................................Executing.Step 037 of 162 steps...................................Executing.Step 056 of 162 steps...................................Executing.

...

Step 132 of 162 steps...................................Executing.Step 134 of 162 steps...................................Executing.Step 137 of 162 steps...................................Executing.Local: COMMIT..........................................Done.

New symdevs: 0159:015ATerminating the configuration change session............Done.

The configuration change session has successfully completed.

6. Verify that the desired devices were created by executing the following command at the primary host (as the system administrator or root user):

symdev -sid [SymmID] list

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symdev command is to be executed against. Again, the serial number for the Symmetrix at the secondary (recovery) site must be specified.

Setting up an SRDF environment for a DB2 LUW database 239

Page 240: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

240

Setting up a DB2 LUW Database - SRDF Environment

For example, to see if new devices were successfully created on a Symmetrix whose serial number ends in 0223, execute the following command:

symdev -sid 0223 list

The devices that were just created should be displayed in the list produced.

7. Define a SRDF pairing relationship between the source devices that contain the database (on the primary Symmetrix array) and the target devices that will be used to hold the copy of the database (on the secondary Symmetrix array) by creating a file (using a text editor, such as Notepad or the UNIX vi Editor) that contains the appropriate device pairing information. Such a file will look something like this:

90 15991 15A

(This particular file pairs device 90 on the primary Symmetrix with device 159 on the secondary Symmetrix and device 91 on the primary Symmetrix with device 15A on the secondary Symmetrix.)

8. Create an SRDF pairing relationship between the source devices that contain the database (on the primary Symmetrix array) and the target devices that will be used to hold a copy of the database (on the secondary Symmetrix array) by executing a symrdf createpair command at the primary host (as the system administrator or root user) that references the file created in the previous step. Such a command will look something like this:

symrdf -sid [SymmID] createpair -file [PairsFile] -type R1 -rdfg [GrpNumber] -establish -rdf_modeacp_disk -noprompt

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symrdf command is to be executed against.

• PairsFile — Identifies, by name, the file that contains SRDF device pairing information.

• GrpNumber — Identifies the RDF group number that the symrdf command is to be executed against.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 241: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

For example, to create an SRDF pairing relationship for devices on a Symmetrix whose serial number ends in 1724 using device paring information stored in a file named pairs.txt, and associate it with dynamic RDF group number 6, you would execute a command that looks like this:

symrdf -sid 1724 createpair -file pairs.txt -type R1-rdfg 6 -establish -rdf_mode acp_disk -noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Create Pair' operation execution is in progress for devicefile 'pairs.txt'. Please wait...

Create RDF Pair in (1724,006)....................................Started. Create RDF Pair in (1724,006)....................................Done. Mark target device(s) in (1724,006) for full copy from source....Started. Devices: 0090-0091 in (1724,006)................................ Marked. Mark target device(s) in (1724,006) for full copy from source....Done. Merge track tables between source and target in (1724,006).......Started. Devices: 0090-0091 in (1724,006)................................ Merged. Merge track tables between source and target in (1724,006).......Done. Resume RDF link(s) for device(s) in (1724,006)...................Started. Resume RDF link(s) for device(s) in (1724,006)...................Done.

The RDF 'Create Pair' operation successfully executed for devicefile 'pairs.txt'.

9. Verify that the desired device paring was created by executing the following command at the primary host (as the system administrator or root user):

symrdf list

When this command is executed, you should see output that looks similar to this:

Symmetrix ID: 000192601724

Local Device View---------------------------------------------------------------------------- STATUS MODES RDF S T A T E SSym RDF --------- ----- R1 Inv R2 Inv ----------------------Dev RDev Typ:G SA RA LNK MDATE Tracks Tracks Dev RDev Pair---- ---- -------- --------- ----- ------- ------- --- ---- -------------

0090 0159 R1:6 RW RW RW C.D1. 0 1222599 RW WD SyncInProg0091 015A R1:6 RW RW RW C.D1. 0 1215344 RW WD SyncInProg

Total -------- --------

Setting up an SRDF environment for a DB2 LUW database 241

Page 242: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

242

Setting up a DB2 LUW Database - SRDF Environment

Track(s) 0 2437943 MB(s) 0 152371

Legend for MODES:

M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy D(omino) : X = Enabled, . = Disabled A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off (Mirror) T(ype) : 1 = R1, 2 = R2 (Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A

Symmetrix ID: 000194900223

Local Device View---------------------------------------------------------------------------- STATUS MODES RDF S T A T E SSym RDF --------- ----- R1 Inv R2 Inv ----------------------Dev RDev Typ:G SA RA LNK MDATE Tracks Tracks Dev RDev Pair---- ---- -------- --------- ----- ------- ------- --- ---- -------------

0159 0090 R2:6 RW WD RW C.D2. 0 0 WD RW SyncInProg015A 0091 R2:6 RW WD RW C.D2. 0 0 WD RW SyncInProg

Total -------- -------- Track(s) 0 0 MB(s) 0.0 0.0

Legend for MODES:

M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy D(omino) : X = Enabled, . = Disabled A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off (Mirror) T(ype) : 1 = R1, 2 = R2 (Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A

10. Create a composite group that will be used to reference the devices that are used to hold the database metadata, data, and transaction logs by executing the following command at the primary host (as the system administrator or root user):

symcg create [CompositeGroup] –type rdf1

where:

• CompositeGroup — Identifies the name to be assigned to the SYMCLI composite group being created.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 243: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

For example, to create a composite group named db2_cg that is designed to hold RDF1 devices, you would execute a command that looks like this:

symcg create db2_cg –type rdf1

11. Add the devices used to hold the database metadata, data, and transaction logs to the composite group created in the previous step by executing the following command at the primary host (as the system administrator or root user):

symcg -cg [CompositeGroup] -sid [SymmID]-rdfg [GrpNumber] addall dev

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

• SymmID — Identifies the Symmetrix, by serial number, that devices to be added to the composite group specified reside on.

• GrpNumber — Identifies the RDF group number that contains the RDF devices that are to be added to the composite group specified.

For example, to add devices that reside on a Symmetrix whose serial number ends in 1724 and that have been assigned to RDF group number 6 to a composite group named db2_cg, you would execute a command that looks like this:

symcg -cg db2_cg -sid 1724 -rdfg 6 addall dev

12. When an SRDF pairing relationship was created earlier, a SRDF link was established between the primary and secondary Symmetrix arrays and data on the source devices containing the database (on the primary Symmetrix array) began to be copied to the target devices used to hold the mirror image of the database (on the secondary Symmetrix array). Verify that the copy process is complete and that the RDF devices being used are now in a “Synchronized” state by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] verify -synchronized

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

Setting up an SRDF environment for a DB2 LUW database 243

Page 244: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

244

Setting up a DB2 LUW Database - SRDF Environment

For example, to verify that the RDF devices that have been assigned to a composite group named db2_cg are in a “Synchronized” state, you would execute a command that looks like this:

symrdf -cg db2_cg verify -synchronized

When this command is executed, if the RDF devices that have been assigned to this composite group are in the “Synchronized” state, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Synchronized' state.

If the devices are not in the “Synchronized” state, you will see a message that looks similar to this instead:

None of the devices in the group 'db2_cg' are in 'Synchronized' state.

If the second message appears, continue executing the symrdf verify command until it is reported that all RDF devices in the composite group specified are in the “Synchronized” state.

13. Up to this point, SRDF replication has been conducted using Adaptive Copy mode. To use a different replication mode, execute the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] set mode [Mode] -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

• Mode — Identifies the mode to be used for SRDF replication. Valid values for this parameter are: sync (Synchronous mode), semi (Semi-synchronous mode), async (Asynchronous mode), acp_disk, (Adaptive Copy Disk mode) and acp_wp (Adaptive Copy Write Pending mode).

For example, to set the replication mode for RDF devices that have been assigned to a composite group named db2_cg to synchronous mode, you would execute a command that looks like this:

symrdf -cg [CompositeGroup] set mode sync -noprompt

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 245: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

When this command is executed, you should see a message that looks something like this:

An RDF Set 'Synchronous Mode' operation execution is inprogress for composite group 'db2_cg'. Please wait...

The RDF Set 'Synchronous Mode' operation successfully executedfor composite group 'db2_cg'.

14. Establish a connection to the database that is to be remotely replicated by executing the following command at the primary host (as the database instance user):

CONNECT TO [DBServer]

where:

• DBServer — Identifies the database server or the alias of the database to which an application or user is to connect.

For example, to establish a connection to a database named TEST, you would execute a command that looks like this:

CONNECT TO test

15. Temporarily suspend all I/O activity for the database by executing the following command at the primary host (as the database instance user):

SET WRITE SUSPEND FOR DATABASE

IMPORTANT!At this time, you should not use the db2_all command in conjunction with the SET WRITE SUSPEND FOR DATABASE command to suspend I/O for a multipartitioned database. Doing so can result in a deadlock situation. If you must suspend I/O for a multipartitioned database, IBM recommends that you start with the highest partition and work your way down to the lowest partition (partition number 0), suspending I/O at each partition.

16. If the primary host is an AIX server, temporarily freeze all file systems being used by the database by executing the following command at the primary host (as the system administrator or root user):

chfs –a freeze=[TimeOut] [FSName]

where:

Setting up an SRDF environment for a DB2 LUW database 245

Page 246: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

246

Setting up a DB2 LUW Database - SRDF Environment

• TimeOut — Identifies the duration, in seconds, for which the file system is to be frozen.

• FSName — Identifies the file system, by name, that is to be frozen.

This command must be executed for every file system that is being used by the database. Thus, if a database spanned two file systems (/mnt/data and /mnt/logs) and you wanted to freeze those file systems for one hour, you would execute a set of commands that look like this:

chfs –a freeze=3600 /mnt/datachfs –a freeze=3600 /mnt/logs

Note: The act of freezing a file system produces a nearly consistent on-disk image of the file system by writing all dirty file system metadata and user data to disk. In its frozen state, the file system is read-only, and any application that attempts to modify the file system or its contents must wait for the freeze to end.

17. The configuration of devices, file systems, and the database itself must now be made known to the operating system on the secondary host. However, before this can be done, remote mirroring for the database must be stopped, I/O traffic on the SRDF links must be suspended, and the target devices (on the secondary Symmetrix array) must be write enabled (so they can be accessed by the secondary host). All of these events take place when the SRDF mirror is “split.”

Split the SRDF mirror by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] split -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to stop remote mirroring of all RDF devices in a composite group named db2_cg, execute a command that looks like this:

symrdf –cg db2_cg split –noprompt

When this command is executed, you should see a message that looks something like this:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 247: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

An RDF 'Split' operation execution isin progress for composite group 'db2_cg'. Please wait...

Suspend RDF link(s) for device(s) in (1724,006)...............Done. Read/Write Enable device(s) in (1724,006) on RA at target (R2).Done.

The RDF 'Split' operation successfully executed forcomposite group 'db2_cg'.

18. If the primary host is an AIX host, unfreeze all file systems being used by the database by executing the following command at the primary host (as the system administrator or root user):

chfs –a freeze=off [FSName]

where:

• FSName — Identifies the file system, by name, that is to be unfrozen.

For example, to unfreeze two file systems (/mnt/data and /mnt/logs) that were frozen earlier, you would execute a set of commands that look like this:

chfs –a freeze=off /mnt/datachfs –a freeze=off /mnt/logs

19. Once the SRDF mirror has been split, resume all I/O activity for the database by executing the following command at the primary host (as the database instance user):

SET WRITE RESUME FOR DATABASE

When this command is executed, the database is returned to its normal operating state.

IMPORTANT!The SET WRITE RESUME FOR DATABASE command must be executed from the same connection from which the SET WRITE SUSPEND FOR DATABASE command was issued.

20. Terminate the connection to the database that was established earlier by executing the following command at the primary host (as the database instance user):

CONNECT RESET

Setting up an SRDF environment for a DB2 LUW database 247

Page 248: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

248

Setting up a DB2 LUW Database - SRDF Environment

At the secondary site 21. On the secondary Symmetrix, create a storage group, port group, initiator group, and masking view for the SRDF target (R2) devices that were created earlier (Steps 4, 5, and 6). When this is done, make the devices available to the host by either rebooting the host or by performing an “on-line” SCSI bus scan at the host. The actual command used to initiate an “on-line” SCSI bus scan is operating system dependent.

For example, to initiate a SCSI bus scan on an AIX server, you would execute a command (as the root user) that looks like this:

cfgmgr

On the other hand, to initiate an “on-line” SCSI bus scan on a Linux server, you would need to follow a procedure that looks more like this:

a. Get the WWN from the Symmetrix masking view that was used to configure storage to the host by executing a command that looks like this:

symaccess -sid [SymmID] show view [MaskingViewName] | awk '/WWN/'

b. Compare the WWN obtained in the previous step against the output from the following command:

systool -av -c fc_host | awk '/Class Device =/ || /port_name/'

c. Note the host number ("Class Device" value from systool output), which has a matching WWN from the Symmetrix masking view and the sysfs output ( "port_name" value from systool output).

d. Scan the SCSI bus by executing the following command with the host number identified in the previous step specified:

echo "- - -" > /sys/class/scsi_host/[Host#]/scan

22. Create a composite group that will be used to reference the devices used to hold the replicated database’s metadata, data, and transaction logs by executing the following command at the secondary host (as the system administrator or root user):

symcg create [CompositeGroup] –type rdf2

where:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 249: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

• CompositeGroup — Identifies the name to be assigned to the SYMCLI composite group being created.

For example, to create a composite group named db2_cg that is designed to hold RDF2 devices, you would execute a command that looks like this:

symcg create db2_cg –type rdf2

23. Add the devices used to hold the replicated database metadata, data, and transaction logs to the composite group created in the previous step by executing the following command at the primary host (as the system administrator or root user):

symcg -cg [CompositeGroup] -sid [SymmID]-rdfg [GrpNumber] addall dev

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

• SymmID — Identifies the Symmetrix, by serial number, that devices to be added to the composite group specified reside on.

• GrpNumber — Identifies the RDF group number that contains the RDF devices that are to be added to the composite group specified.

For example, to add devices that reside on a Symmetrix whose serial number ends in 0223 and that have been assigned to RDF group number 6 to a composite group named db2_cg, you would execute a command that looks like this:

symcg -cg db2_cg -sid 0023 -rdfg 6 addall dev

24. Verify that the SRDF target devices that contain a copy of the database are in a “Split” state by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] verify -split

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

Setting up an SRDF environment for a DB2 LUW database 249

Page 250: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

250

Setting up a DB2 LUW Database - SRDF Environment

For example, to verify that the SRDF target devices that have been assigned to a composite group named db2_cg are in a “Split” state, you would execute a command that looks like this:

symrdf -cg db2_cg verify -split

When this command is executed, if the devices are in the “Split” state, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Split' state.

25. Activate all database copy-related volume groups used, along with their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2_data_vg and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

importvg -y’db2_data_vg’ hdiskpower17importvg -y’db2_logs_vg’ hdiskpower18

varyonvg db2_data_vgvaryonvg db2_logs_vg

On the other hand, to activate the same two volume groups on a Linux server, you might execute a set of commands (as the root user) that look more like this:

vgimport db2_data_vg /dev/emcpowerbvgimport db2_logs_vg /dev/emcpowerc

vgchange -a y db2_data_vgvgchange -a y db2_logs_vg

26. Once the appropriate volume groups have been activated, mount all file systems needed to access the database copy. The actual command used to mount a file system is operating system dependent.

Note: Mount points must exist before a file system can be mounted. Typically, mount points are created by constructing one or more directories using the mkdir command. (With AIX 5L and later, mount points are created automatically by the importvg command.)

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 251: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

For example, to mount two file systems named /mnt/data, and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) at the secondary host that look something like this:

mount /mnt/datamount /mnt/logs

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

27. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the secondary host (as the database instance user):

db2start

28. Determine whether the database copy has been cataloged in the system database directory by executing the following command at the secondary host (as the database instance user):

LIST DATABASE DIRECTORY

If no entries exist in the system database directory (indicating that no databases exist for the current instance), when this command is executed you should see a message that looks like this:

SQL1057W The system database directory is empty. SQLSTATE=01606

On the other hand, if one or more databases have been cataloged and exist for the current instance, when this command is executed you should see a message that looks more like this:

System Database Directory

Number of entries in the directory = 1

Database 1 entry:

Database alias = SAMPLE Database name = SAMPLE Local database directory = /home/db2inst1 Database release level = d.00 Comment = Directory entry type = Indirect

Setting up an SRDF environment for a DB2 LUW database 251

Page 252: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

252

Setting up a DB2 LUW Database - SRDF Environment

Catalog database partition number = 0 Alternate server hostname = Alternate server port number =

If a message similar to this one appears, look for the name of the database that was replicated. If the name does not appear in the list of databases provided, the database has not been cataloged; therefore, it cannot be accessed.

29. Catalog the database in the system database directory — if it has not already been cataloged — by executing the following command at the secondary host (as the database instance user):

CATALOG DATABASE [DBName] AS [DBAlias] ON [FileSystem]

where:

• DBName — Identifies the name of the database that is to be cataloged.

• DBAlias — Identifies the alias of the database that is to be cataloged.

• FileSystem — Identifies the file system (path) on which the database being cataloged resides.

For example, to catalog a copy of a database named TEST that resides on an AIX or Linux server file system named /mnt/data, you would execute a command (as the database instance user) that looks something like this:

CATALOG DATABASE test AS test ON /mnt/data

When this command is executed, you can verify that the copy of the database has been cataloged by executing a command that looks like this:

LIST DATABASE DIRECTORY

When this command is executed, the name and alias of the database copy should now appear in the list of databases returned.

30. Terminate all connections to the database by executing one of the following commands at the secondary host (as the database instance user):

DEACTIVATE DATABASE [DBAlias]

where:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 253: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

• DBAlias — Identifies the alias of the database to be deactivated (stopped).

or

FORCE APPLICATION ALL

or

db2stop FORCE

For multipartition databases, the DEACTIVATE DATABASE command will attempt to deactivate all partitions that belong to the database specified. However, this command may successfully deactivate some partitions and fail to deactivate others. Therefore, you must ensure that all partitions of a multipartition database have been deactivated before continuing with this procedure.

The FORCE APPLICATION ALL command will terminate all connections to all databases under the current DB2 Database Manager instance’s control; the db2stop FORCE command will terminate all connections to all databases under the current instance’s control and then stop the instance. (If the db2stop FORCE command is issued and applications do not respond within the time frame specified by the start_stop_time DB2 Database Manager configuration parameter — which, by default is 10 minutes — DB2 will crash the database and it will need to undergo crash recovery before it will be usable.) Therefore, caution should be exercised when using these commands in environments where multiple databases fall under a single instance’s control.

31. At this point, if you want to examine the contents of the database stored on the SRDF target (R2) devices, you should clone those devices and initialize the database image stored on the clone target devices. (If you initialize the database image on the R2 devices, you run the risk of introducing changes to the database or its metadata that will interfere with the remote replication process.) Refer to the section “Cloning a DB2 LUW database stored on R2 devices” on page 257 for detailed information on how to perform this task.

32. Unmount all file systems used by the database to ensure that nothing associated with the underlying devices remains in server memory. The actual command used to unmount a file system is operating system dependent.

Setting up an SRDF environment for a DB2 LUW database 253

Page 254: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

254

Setting up a DB2 LUW Database - SRDF Environment

For example, to unmount two file systems named /mnt/data and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) that look something like this:

umount /mnt/dataumount /mnt/logs

After these commands are executed, you can verify that the file systems have been unmounted by executing a command that looks like this:

df

The file systems should no longer appear in the list of active file systems returned.

Note: If the secondary host were to leave the file systems mounted, it would have an inconsistent picture of the contents, which could cause the system to crash when the devices associated with the file systems became available again (with their contents altered by changes made to the database stored on the primary Symmetrix array.)

33. Once the appropriate file systems have been unmounted, deactivate all database-related volume groups used. Again, the actual command used to deactivate a volume group is operating system dependent.

For example, to deactivate two volume groups named db2_data_vg, and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

varyoffvg db2_data_vgvaryoffvg db2_logs_vg

exportvg db2_data_vgexportvg db2_logs_vg

On the other hand, to deactivate the same two volume groups on a Linux server, you would execute a set of commands (as the root user) that look more like this:

vgchange -a n db2_data_vgvgchange -a n db2_logs_vg

vgexport db2_data_vgvgexport db2_logs_vg

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 255: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

34. Re-establish the SRDF mirror by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] establish –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to re-establish an SRDF mirror for devices that have been assigned to a composite group named db2_cg, you would execute a command that looks like this:

symrdf -cg db2_cg establish –noprompt

When this command is executed, you should see a message that looks something like this:

An RDF 'Incremental Establish' operation execution isin progress for composite group 'db2_cg'. Please wait...

Write Disable device(s) in (0223,006) on RA at target (R2).......Done. Suspend RDF link(s) for device(s) in (0223,006)..................Done. Mark target device(s) in (0223,006) to refresh from source.......Started. Devices: 0159-015A in (0223,006)................................ Marked. Mark target device(s) in (0223,006) to refresh from source.......Done. Merge track tables between source and target in (0223,006).......Started. Devices: 0090-0091 in (0223,006)................................ Merged. Merge track tables between source and target in (0223,006).......Done. Resume RDF link(s) for device(s) in (0223,006)...................Started. Resume RDF link(s) for device(s) in (0223,006)...................Done.

The RDF 'Incremental Establish' operation successfully initiated forcomposite group 'db2_cg'.

35. Verify that the RDF target devices that contain a copy of the database are now in a “Synchronized” state by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] verify -synchronized

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

Setting up an SRDF environment for a DB2 LUW database 255

Page 256: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

256

Setting up a DB2 LUW Database - SRDF Environment

For example, to determine if the RDF target devices that have been assigned to a composite group named db2_cg are in a “Synchronized” state, you would execute a command that looks like this:

symrdf -cg db2_cg verify -synchronized

When this command is executed, if the devices are in the “Synchronized” state, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Synchronized'state.

After completing these steps, you will have correctly configured SRDF mirroring for your DB2 LUW database environment. At that point, the database image stored on the SRDF target devices can be accessed from another database server in the event an outage, either planned or unplanned, occurs.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 257: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

Cloning a DB2 LUW database stored on R2 devicesTimeFinder/Clone can be used to create a point-in-time copy of a database, which can then be used for reporting operations, decision support, data warehouse refreshes, or any other process that requires parallel access to production data. With TimeFinder/Clone, up to 16 simultaneous and immediately available full-size target copies (sessions) of source devices can be created. Both source and target devices can be any combination of standard or business continuance volume (BCV) devices and can have different RAID protection schemes; however, the sizes of the source and target devices used must match. The relationship between a clone source and target is defined when a clone session is created; when the session is later activated, the target device can be instantly accessed by a target's host. Clone target devices can be later refreshed from the source devices (re-activated) or can be used to overwrite their source devices with their content (restored); when the clone session between source and target devices is no longer needed, it can be terminated.

A full copy will take place only during the first time a clone session is created. Any further operations on the clone, such as re-create or restore, will be done incrementally, passing just the final changes between the source and target devices, making TimeFinder/Clone a very fast and scalable database cloning solution, regardless of the database size.

To create a local clone (copy) of a DB2 LUW database stored on SRDF target (R2) devices using EMC TimeFinder/Clone technology, complete the following steps, in the order shown:

At the secondary site 1. In order to replicate a database using TimeFinder/Clone technology, clone target devices must be created on the secondary Symmetrix that have the same size and emulation type as the R2 devices that contain the database. Specify the devices to be created on the secondary Symmetrix by creating a command file (using a text editor, such as Notepad or the UNIX vi Editor) that contains one or more create dev commands that are similar to this:

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,disk_group=1;

Cloning a DB2 LUW database stored on R2 devices 257

Page 258: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

258

Setting up a DB2 LUW Database - SRDF Environment

This particular create dev command will create two new devices with a size of 86000 cylinders that are configured as RAID 5 (7+1) devices, that use FBA emulation, and that reside in disk group 1.

2. Execute the create dev command(s) stored in the file created in the previous step by executing a symconfigure command at the secondary host (as the system administrator or root user) that looks something like this:

symconfigure -sid [SymmID] -file [CmdFile] -v -nopromptcommit

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symconfigure command is to be executed against.

• CmdFile — Identifies, by name, the file that contains one or more create dev commands.

For example, to commit the commands in a command file named adddevices.cmd against a Symmetrix whose serial number ends in 0223, you would execute a command that looks like this:

symconfigure -sid 0223 -file adddevices.cmd -v-noprompt commit

When this command is executed, you should see output that looks something like this:

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change session...........Established.

Processing symmetrix 000914900223{

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,disk_group=1;

}

Performing Access checks................................Allowed.Checking Device Reservations............................Allowed.Initiating COMMIT of configuration changes..............Queued.COMMIT requesting required resources....................Obtained.Step 022 of 047 steps...................................Executing.Step 037 of 162 steps...................................Executing.Step 056 of 162 steps...................................Executing.

...

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 259: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

Step 132 of 162 steps...................................Executing.Step 134 of 162 steps...................................Executing.Step 137 of 162 steps...................................Executing.Local: COMMIT..........................................Done.

New symdevs: 0166:0167Terminating the configuration change session............Done.

The configuration change session has successfully completed.

3. Verify that the desired devices were created by executing the following command at the primary host (as the system administrator or root user):

symdev -sid [SymmID] list

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symdev command is to be executed against.

For example, to see if new devices were successfully created on a Symmetrix whose serial number ends in 0223, execute the following command:

symdev -sid 0223 list

The devices that were just created should be displayed in the list produced.

4. Create a storage group for the devices that were just created by executing the following command at the secondary host (as the system administrator or root user):

symaccess -sid [SymmID] create -name [SGName] -type storage devs [StartDevName]:[EndDevName]

where:

• SymmID — Identifies the Symmetrix, by serial number, that the storage group is to be created on.

• SGName — Identifies the name to be assigned to the storage group being created.

• StartDevName — Identifies the first Symmetrix device in a range of devices that are to be added to the storage group.

• EndDevName — Identifies the last Symmetrix device in a range of devices that are to be added to the storage group.

Cloning a DB2 LUW database stored on R2 devices 259

Page 260: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

260

Setting up a DB2 LUW Database - SRDF Environment

For example, to create a storage group named db2_clone_sg on a Symmetrix whose serial number ends in 0223 and add devices 0166 thru 0167 to it, you would execute a command that looks like this:

symaccess -sid 0223 create -name db2_clone_sg -type storage devs 166:167

5. Create a new masking view using the storage group just created along with the port group and initiator group that already exists for the host by executing the following command at the secondary host (as the system administrator or root user):

symaccess -sid [SymmID] create view -name [MVName] -sg [SGName] -pg [PGName] -ig [IGName]

where:

• SymmID — Identifies the Symmetrix, by serial number, that the masking view is to be created on.

• MVName — Identifies the name that is to be assigned to the masking view being created.

• SGName — Identifies the name of the storage group that is to be associated with the masking view being created.

• PGName — Identifies the name of the port group that is to be associated with the masking view being created.

• IGName — Identifies the name of the initiator group that is to be associated with the masking view being created.

For example, to create a masking view named db2_clone_mv on a Symmetrix whose serial number ends in 0223 and associate it with the storage group db2_clone_sg, the port group D220_pg, and the initiator group D220_ig, you would execute a command that looks like this:

symaccess -sid 0223 create view -name db2_clone_mv -sg db2_clone_sg -pg D220_pg -ig D220_ig

6. Make the clone target devices that were just created and masked available to the secondary host by either rebooting the host or by performing an “on-line” SCSI bus scan at the host. The actual command used to initiate an “on-line” SCSI bus scan is operating system dependent.

For example, to initiate a SCSI bus scan on an AIX server, you would execute a command (as the root user) that looks like this:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 261: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

cfgmgr

On the other hand, to initiate an “on-line” SCSI bus scan on a Linux server, you would need to follow a procedure that looks more like this:

a. Get the WWN from the Symmetrix masking view that was used to configure storage to the host by executing a command that looks like this:

symaccess -sid [SymmID] show view [MaskingViewName] | awk '/WWN/'

b. Compare the WWN obtained in the previous step against the output from the following command:

systool -av -c fc_host | awk '/Class Device =/ || /port_name/'

c. Note the host number ("Class Device" value from systool output), which has a matching WWN from the Symmetrix masking view and the sysfs output ( "port_name" value from systool output).

d. Scan the SCSI bus by executing the following command with the host number identified in the previous step specified:

echo "- - -" > /sys/class/scsi_host/[Host#]/scan

7. Before a target device can be cloned from a source device, both the source and the target device must have been previously associated with a device or composite group. In this case, because a composite group was created earlier and the appropriate SRDF target (R2) devices were added to it, that composite group can be used for any cloning operations desired.

Add the clone target devices to the composite group that was created earlier (on the secondary host) by executing the following command at the secondary host (as the system administrator or root user):

symcg -cg [CompositeGroup] -sid [SymmID]-range [StartDevName]:[EndDevName] addall dev -tgt

where:

• CompositeGroup — Identifies the SYMCLI composite group that contains the R2 devices that hold both the replicated database data and the replicated transaction logs.

Cloning a DB2 LUW database stored on R2 devices 261

Page 262: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

262

Setting up a DB2 LUW Database - SRDF Environment

• SymmID — Identifies the Symmetrix, by serial number, that devices being added to the composite group specified reside on.

• StartDevName — Identifies the first Symmetrix device in a range of devices that are to be altered.

• EndDevName — Identifies the last Symmetrix device in a range of devices that are to be altered.

For example, to add devices 0166 thru 0167 that reside on a Symmetrix whose serial number ends in 0223 to a composite group named db2_cg, you would execute a command that looks like this:

symcg -cg db2_cg -sid 0223 -range 166:167 addall dev -tgt

8. Create a relationship between the SRDF target (R2) devices that contain the database to be cloned and the devices that are to serve as the target for the clone by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] create -precopy -tgt–noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to create a clone of a set of SRDF target devices that have been assigned to a composite group named db2_cg, you would execute a command that looks like this:

symclone -cg db2_cg create -precopy -tgt –noprompt

And when this command is executed, you should see a message that looks something like this:

'Create' operation execution is in progress forcomposite group 'db2_cg'. Please wait...

'Create' operation successfully executed for compositegroup 'db2_cg'.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 263: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

In this case, data will be copied to the target devices in the background immediately after the clone is created because the –precopy keyword was specified with the symclone create command used. (This behavior is required when using asynchronous SRDF.)

9. Verify that the clone was created by executing the following command at the secondary host (as the system administrator or root user):

symclone list

When this command is executed, you should see output that looks something like this:

Symmetrix ID: 000194900223

Source Device Target Device Status------------------------- ---------------------- ------------- ProtectedSym Tracks Sym CGDP SRC <=> TGT------------------------- ---------------------- -------------0159 1140458 0166 XXX. PreCopy015A 1058823 0167 XXX. PreCopy

Total -------- Tracks 2199281 MB(s) 137455

Legend:

(C): X = The background copy setting is active for this pair. . = The background copy setting is not active for this pair.(G): X = The Target device is associated with a group. . = The Target device is not associated with a group.(D): X = The Clone session is a differential copy session. . = The Clone session is not a differential copy session.(P): X = The pre-copy operation has completed one cycle . = The pre-copy operation has not completed one cycle

10. Verify that data stored on the source devices used has been copied to the appropriate target devices and that the clone target devices are in a state that allows them to be accessed (“Active” and “100%” copied) by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] query

where:

Cloning a DB2 LUW database stored on R2 devices 263

Page 264: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

264

Setting up a DB2 LUW Database - SRDF Environment

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to determine whether data has been copied to the set of clone target devices that have been assigned to a composite group named db2_cg, you could execute a command that looks like this:

symclone -cg db2_cg query

When this command is executed, you should see output that looks something like this:

Composite Group Name : db2_cgComposite Group Type : RDF2Number of Symmetrix Units : 1Number of RDF (RA) Groups : 1

CG Symmetrix ID : 000194900223 (Microcode Version: 5874)

Source Device Target Device State Copy--------------------------------- ---------------------------- ------------ ---- Protected Modified ModifiedLogical Sym Tracks Tracks Logical Sym Tracks CGDP SRC <=> TGT (%)--------------------------------- ---------------------------- ------------ ----DEV001 0159 0 0 TGT001 0166 0 XXXX PreCopy 100DEV002 015A 0 0 TGT002 0167 0 XXXX PreCopy 100

Total -------- -------- -------- Track(s) 0 0 0 MB(s) 0.0 0.0 0.0

Legend:

(C): X = The background copy setting is active for this pair. . = The background copy setting is not active for this pair.(G): X = The Target device is associated with this group. . = The Target device is not associated with this group.(D): X = The Clone session is a differential copy session. . = The Clone session is not a differential copy session.(P): X = The pre-copy operation has completed one cycle . = The pre-copy operation has not completed one cycle

11. Once the clone copy operation is complete, activate the clone by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] activate -consistent–tgt -noprompt

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 265: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

Note: The –consistent keyword tells Enginuity to use Enginuity Consistency Assist (ECA) to momentarily suspend writes to the source disks while the clone is being activated.

For example, to activate the clone that was created earlier (whose devices reside in a composite group named db2_cg), you would execute a command that looks like this:

symclone -cg db2_cg activate -consistent -tgt–noprompt

And when this command is executed, you should see a message that looks something like this:

'Activate' operation execution is in progress forcomposite group 'db2_cg'. Please wait...

'Activate' operation successfully executed forcomposite group 'db2_cg'.

12. Activate all database copy-related volume groups used, as well as their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2vg_cl1 and db2vg_cl on an AIX server, you would execute a set of commands (as the root user) that look something like this:

chdev -l hdiskpower19 -a pv=clearchdev -l hdiskpower20 -a pv=clear

recreatevg -y'db2vg_cl1' -Y data_cl hdiskpower19recreatevg -y'db2vg_cl2' -Y logs_cl hdiskpower20

Because the clone devices have the same physical volume identifier (PVID) as the source devices, you must clear the PVID before you can activate the database-copy related volume groups. That’s why the chdev command is needed. The chdev command is used to change the characteristics of a device; the -l flag specifies the device name of the disk and the -a flag specifies a

Cloning a DB2 LUW database stored on R2 devices 265

Page 266: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

266

Setting up a DB2 LUW Database - SRDF Environment

device attribute=value pair (which, in this case is pv=clear). This particular attribute=value pair removes the unique physical volume identifier from a physical disk (PV).

Since both the source R2 devices and the clone devices are addressed by the same host, when the clone devices are imported into the AIX Object Data Manager (ODM), a Logical Volume (LV) naming conflict will occur. The two recreatevg commands are required to prevent such ODM configuration conflicts from occurring. It is important to note that, recreatevg will assign a automatically generated prefix for any duplicate LVM objects encountered; in this example, the prefixes db2vg_cl1 and db2vg_cl2 were used instead.

13. Once the appropriate volume groups have been activated, mount all file systems needed to access the database clone. The actual command used to mount a file system is operating system dependent.

Note: Mount points must exist before a file system can be mounted. Typically, mount points are created by constructing one or more directories using the mkdir command.

Before you can successfully mount the file systems needed, you may find it necessary to modify the entries that are automatically created in the file systems table (the /etc/filesystems file on AIX; the /etc/fstab file on Linux) when the volume groups are activated.

For example, to mount two file systems named /mnt/data_cl, and /mnt/logs_cl on an AIX or Linux server, you would execute a set of commands (as the root user) that look like this:

mount /mnt/data_clmount /mnt/logs_cl

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

14. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the secondary host (as the database instance user):

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 267: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

db2start

15. Database names must be unique within a DB2 instance. Therefore, in order to access a database clone from the instance and server that has access to the source of the clone (in this case, the R2 devices), the name of the clone must first be changed. The underlying DB2 metadata on the devices associated with the clone must be changed as well (to reflect the new mount points) before the database can be used. Both of these operations can be performed by executing the db2relocatedb command and providing it with a configuration file that identifies the source database information, along with the appropriate clone information. Such a configuration file should look something like this:

DB_NAME=test,test_clDB_PATH=/mnt/data,/mnt/data_clINSTANCE=db2inst1NODENUM=0LOG_DIR=/mnt/logs/NODE0000,/mnt/logs_cl/NODE0000CONT_PATH=/mnt/data/*,/mnt/data_cl/*

In this particular configuration file, the source database name is TEST and it has its data on /mnt/data and its logs on /mnt/logs. The clone database is to be renamed TEST_CL; its data resides on /mnt/data_cl and its logs are on /mnt/logs_cl. The DB2 instance name for both the source database and the clone is db2inst1.

Create a configuration file that contains the appropriate source and clone database information.

16. Once the necessary configuration file has been created, rename the database clone and change the log file and table space container metadata associated with the clone by executing the following command at the secondary host (as the database instance user):

db2relocatedb -f [CfgFileName]

where:

• CfgFileName — Identifies the name of a configuration file that contains information that is needed to alter the DB2-specific metadata stored in files associated with the database clone.

Cloning a DB2 LUW database stored on R2 devices 267

Page 268: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

268

Setting up a DB2 LUW Database - SRDF Environment

For example, to change the metadata for a database using information stored in a configuration file named dbrelocate.cfg, you would execute a command that looks like this:

db2relocatedb -f dbrelocate.cfg

And when this command is executed, you should see a message that looks something like this:

Files and control structures were changed successfully.Database was catalogued successfully.DBT1000I The tool completed successfully.

17. At this point, the database clone is accessible; however, because the R2 devices were initialized while all I/O for the database was suspended, the image for the database clone must be initialized and taken out of “Write-Suspended” state before it can be used. Initialize the database image and take it out of “Write-Suspended” state by executing the following command at the secondary host (as the database instance user):

db2inidb [DBName] AS SNAPSHOT

where:

• DBName — Identifies by name, the database that is to be initialized and taken out of “Write-Suspended” state.

For multipartition databases, the db2inidb command must be executed on all partitions that belong to the database specified. This can be accomplished by executing the following command instead:

db2_all || “db2 db2inidb [DBName] AS SNAPSHOT”

For example, to initialize a database named TEST_CL as a clone and take it out of “Write-Suspended” state, you would execute a command that looks like this:

db2inidb test_cl AS SNAPSHOT

And when this command is executed, you should see a message that looks like this:

DBT1000I The tool completed successfully.

18. The execution of the db2relocatedb command will cause the entry for the source database to be removed from the system database directory. Therefore, in order to access the source

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 269: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

database as well as the clone, you will need to recatalog the source database by executing the following command at the secondary host (as the database instance user):

CATALOG DATABASE [DBName] AS [DBAlias] ON [FileSystem]

where:

• DBName — Identifies the name of the database that is to be cataloged.

• DBAlias — Identifies the alias of the database that is to be cataloged.

• FileSystem — Identifies the file system (path) on which the database being cataloged resides.

For example, to catalog a source database named TEST that resides on an AIX or Linux server file system named /mnt/data, you would execute a command that looks something like this (as the database instance user):

CATALOG DATABASE test AS test ON /mnt/data

When this command is executed, you can verify that the source database has been recataloged by executing a command that looks like this:

LIST DATABASE DIRECTORY

When this command is executed, the name and alias of both the source database (that is, the replicated database stored on the SRDF target devices) and the clone should appear in the list of databases returned. For example:

System Database Directory

Number of entries in the directory = 2

Database 1 entry:

Database alias = TEST Database name = TEST Local database directory = /mnt/data Database release level = d.00 Comment = Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number =

Database 2 entry:

Cloning a DB2 LUW database stored on R2 devices 269

Page 270: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

270

Setting up a DB2 LUW Database - SRDF Environment

Database alias = TEST_CL Database name = TEST_CL Local database directory = /mnt/data_cl Database release level = d.00 Comment = Test Database Directory entry type = Indirect Catalog database partition number = 0 Alternate server hostname = Alternate server port number =

19. Inspect the database clone for architectural correctness by executing the following command at the host (as the database instance user):

db2dart [DatabaseName] /db

where:

• DatabaseName — Identifies by name, the database clone that db2dart operations are to be performed against.

Note: The database specified must be inactive when this command is executed.

For example, to examine the architectural correctness of a cloned database named TEST_CL, you would execute a command that looks like this (as the database instance user):

db2dart test_cl /db

When this command is executed you should see a message that looks something like this:

The requested DB2DART processing has completed successfully! Complete DB2DART report found in:/home/db2inst1/sqllib/db2dump/DART0000/TEST_CL.RPT

(The db2dart utility will inspect the entire database for architectural correctness and when finished, it will generate a detailed report; this report contains a summary at the end that will identify whether errors were encountered.)

After completing these steps, your database clone is ready for use. At this point, you should connect to the database and verify that its contents are as expected.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 271: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Setting up a DB2 LUW Database - SRDF Environment

When the copy of the database stored on the clone target device is no longer needed, it can be deleted by terminating the clone target device/SLV device relationship; this is done by executing the following command at the host (as the system administrator or root user):

symclone -cg [CompositeGroup] terminate -tgt –noprompt

where:

◆ CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

However, before you perform this operation, you should uncatalog the database clone by executing the following command at the host (as the database instance user):

UNCATALOG DATABASE [DBAlias]

where:

◆ DBAlias — Identifies the alias of the database that is to be uncataloged.

It is also a good idea to unmount all file systems used by the database clone and deactivate all clone-related volume groups used. The actual commands used to unmount a file system and deactivate a volume group are operating system dependent.

Note: If you plan on cloning the database image stored on the SRDF target devices to create a “gold” copy before performing SRDF failback operations, do not delete the clone target devices that were created. Likewise, do not remove these devices from the consistency group used.

Cloning a DB2 LUW database stored on R2 devices 271

Page 272: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

272

Setting up a DB2 LUW Database - SRDF Environment

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 273: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

6

Failover is a backup operation in which the functions of a primary system component, for example, a server or a storage array, are assumed by a secondary system component when the primary component becomes unavailable, either as a result of a scheduled maintenance outage or an unexpected component failure. Failback is the process of returning functionality to the original component (or to the original location) after an event that caused a failover to occur has been resolved. Failover and failback functionality is an integral part of any mission-critical system that must be constantly available.

This chapter is designed to provide you with guidelines for using SRDF failover and failback functionality to keep DB2 for Linux, UNIX, and Windows (LUW) databases stored on Symmetrix arrays operational during scheduled maintenance windows or in the event an unexpected outage occurs. Topics covered include:

◆ Two-site SDRF recovery operations .............................................. 274◆ Performing two-site SRDF failover operations............................ 275◆ Performing two-site SRDF failback operations ........................... 286◆ Cloning a DB2 LUW database stored on SRDF devices............. 302

Note: The procedures outlined in this chapter make the assumption that the SRDF product license has been enabled and that RDF directors have been configured on both Symmetrix arrays used and that the appropriate zoning has been done to establish connectivity between the two arrays. It is also assumed that an SRDF environment has been established using the procedure outlined in Chapter 5.

Performing SRDFFailover and Failback

Operations

Performing SRDF Failover and Failback Operations 273

Page 274: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

274

Performing SRDF Failover and Failback Operations

Two-site SDRF recovery operationsWith SRDF, many possibilities exist for tailoring a remote protection/disaster recovery solution that meets a particular business objective. However, in two-site SRDF configurations that are operating in synchronous or asynchronous mode, the recovery operations available typically fall into one of the following categories:

◆ Planned failover

A planned failover is a controlled failover operation that is performed to temporarily move production workloads from the primary site to the secondary site. When a planned failover occurs, the secondary site temporarily becomes the primary/production site.

A planned failover may be conducted to perform maintenance at the primary site or to test the robustness of a company’s disaster restart solution. (Every disaster recovery plan should include the time and resources necessary to test the disaster restart solution in a controlled environment. This ensures that a company will be able to protect their business in the event a disaster actually happens.)

◆ Unplanned failover

An unplanned failover is an operation that is performed to move production workloads from the primary site to the secondary site when an unexpected failure of the host and/or the Symmetrix at the primary site occurs. As with a planned failover, the secondary site temporarily becomes the primary/production site.

◆ Failback

A failback is a controlled operation that is performed to move production workloads back from the secondary site to the primary site after a failover operation (planned or unplanned) has occurred.

The process for performing each type of recovery operation in a DB2 LUW database environment is outlined and discussed, in detail, in the remainder of this chapter.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 275: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

Performing two-site SRDF failover operationsThe following sections describe how to perform both planned and unplanned failover operations in environments where SRDF is used to provide a disaster restart solution for one or more DB2 LUW databases. The procedures outlined in these sections were developed using a single partition DB2 LUW database residing on a single Symmetrix array; devices containing the database metadata, data, and transaction logs were synchronously replicated (via SRDF) to similar devices on a second Symmetrix array.

Performing a planned (orderly) failover to the secondary site

Sometimes you will have adequate warning that a primary system component needs to be made temporarily unavailable. For example, you might receive word that a scheduled outage is being planned so that a critical FixPack can be applied to the database server at the primary host. When you know in advance that an outage will occur, you can perform an orderly failover operation to prevent the outage from impacting users and applications that rely on the availability of the primary system.

To perform a orderly failover from the primary server/Symmetrix to the secondary server/Symmetrix in a DB2 LUW-SRDF environment, complete the following steps, in the order shown:

At the primary site 1. Terminate all connections to the database at the primary site by executing one of the following commands at the primary host (as the database instance user):

DEACTIVATE DATABASE [DBAlias]

where:

• DBAlias — Identifies the alias of the database to be deactivated (stopped).

or

FORCE APPLICATION ALL

or

db2stop FORCE

Performing two-site SRDF failover operations 275

Page 276: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

276

Performing SRDF Failover and Failback Operations

For multipartition databases, the DEACTIVATE DATABASE command will attempt to deactivate all partitions that belong to the database specified. However, this command may successfully deactivate some partitions and fail to deactivate others. Therefore, you must ensure that all partitions of a multipartition database have been deactivated before continuing with this procedure.

The FORCE APPLICATION ALL command will terminate all connections to all databases under the current DB2 Database Manager instance’s control; the db2stop FORCE command will terminate all connections to all databases under the current instance’s control and then stop the instance. (If the db2stop FORCE command is issued and applications do not respond within the time frame specified by the start_stop_time DB2 Database Manager configuration parameter — which, by default is 10 minutes — DB2 will crash the database and it will need to undergo crash recovery before it will be usable.) Therefore, caution should be exercised when using these commands in environments where multiple databases fall under a single instance’s control.

2. Unmount all file systems used by the database to ensure that nothing associated with the underlying devices remains in server memory. The actual command used to unmount a file system is operating system dependent.

For example, to unmount two file systems named /mnt/data and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) that look something like this:

umount /mnt/dataumount /mnt/logs

After these commands are executed, you can verify that the file systems have been unmounted by executing a command that looks like this:

df

The file systems should no longer appear in the list of active file systems returned.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 277: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

Note: If the primary host were to leave the file systems mounted, it would have an inconsistent picture of the contents, which could cause the system to crash when the devices associated with the file systems became available again (with their contents changed by new data generated from the secondary host.)

3. Once the appropriate file systems have been unmounted, deactivate all database-related volume groups that are associated with the unmounted file systems. Again, the actual command used to deactivate a volume group is operating system dependent.

For example, to deactivate two volume groups named db2_data_vg, and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

varyoffvg db2_data_vgvaryoffvg db2_logs_vg

exportvg db2_data_vgexportvg db2_logs_vg

On the other hand, to deactivate the same two volume groups on a Linux server, you would execute a set of commands (as the root user) that look more like this:

vgchange -a n db2_data_vgvgchange -a n db2_logs_vg

vgexport db2_data_vgvgexport db2_logs_vg

At the secondary site 4. Make the source (R1) devices that contain the database (on the primary Symmetrix array) unavailable and make the target (R2) devices that contain the copy of the database (on the secondary Symmetrix array) available by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] failover –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

Performing two-site SRDF failover operations 277

Page 278: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

278

Performing SRDF Failover and Failback Operations

For example, to make all primary (R1) devices that have been assigned to a composite group named db2_cg unavailable and make all secondary (R2) devices assigned to the same composite group available, you would execute a command that looks like this:

symrdf -cg db2_cg failover –noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Failover' operation execution isin progress for composite group 'db2_cg'. Please wait...

Write Disable device(s) in (0223,006) on SA at source (R1).....Done. Suspend RDF link(s) for device(s) in (0223,006)...............Done. Read/Write Enable device(s) in (0223,006) on RA at target (R2).Done.

The RDF 'Failover' operation successfully executed forcomposite group 'db2_cg'.

5. Switch the roles of the primary (R1) and the secondary (R2) Symmetrix devices/hosts by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] swap -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to swap roles so that all original secondary system devices (R2 devices) that have been assigned to a device group named db2_cg act as R1 devices and all original primary system devices (R1 devices) assigned to the same composite group act as R2 devices, you would execute a command that looks like this:

symrdf -cg db2_cg swap -noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Swap Personality' operation execution isin progress for composite group 'db2_cg'. Please wait...

Swap RDF Personality in (0223,006)........................Started. Swap RDF Personality in (0223,006)...........................Done.

The RDF 'Swap Personality' operation successfully executed forcomposite group 'db2_cg'.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 279: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

6. When the symrdf failover command was executed earlier, the SRDF link between the source (R1) devices on the primary Symmetrix array and the target (R2) devices on the secondary Symmetrix array was suspended and I/O between the devices was stopped. Resume I/O between the R1 and R2 devices by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] resume -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to resume I/O between the secondary system devices (now the R1 devices) and the primary system devices (now the R2 devices) that have been assigned to a device group named db2_cg, you would execute a command that looks like this:

symrdf -cg db2_cg resume -noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Resume' operation execution isin progress for composite group 'db2_cg'. Please wait...

Resume RDF link(s) for device(s) in (0223,006).............Started. Resume RDF link(s) for device(s) in (0223,006)................Done.

The RDF 'Resume' operation successfully executed forcomposite group 'db2_cg'.

7. Activate all database copy-related volume groups used, along with their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2_data_vg and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

importvg -y’db2_data_vg’ hdiskpower17importvg -y’db2_logs_vg’ hdiskpower18

varyonvg db2_data_vgvaryonvg db2_logs_vg

Performing two-site SRDF failover operations 279

Page 280: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

280

Performing SRDF Failover and Failback Operations

On the other hand, to activate the same two volume groups on a Linux server, you might execute a set of commands (as the root user) that look more like this:

vgimport db2_data_vg /dev/emcpowerbvgimport db2_logs_vg /dev/emcpowerc

vgchange -a y db2_data_vgvgchange -a y db2_logs_vg

8. Once the appropriate volume groups have been activated, mount all file systems needed to access the failover database. The actual command used to mount a file system is operating system dependent.

For example, to mount two file systems named /mnt/data, and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) at the secondary host that look something like this:

mount /mnt/datamount /mnt/logs

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

9. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the secondary host (as the database instance user):

db2start

10. Inspect the database that the secondary host has access to (in other words, the failover database) for architectural correctness by executing the following command at the secondary host (as the database instance user):

db2dart [DatabaseName] /db

where:

• DatabaseName — Identifies by name, the database clone that db2dart operations are to be performed against.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 281: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

Note: The database specified must be inactive when this command is executed.

For example, to examine the architectural correctness of a failover database named TEST, you would execute a command that looks like this (as the database instance user):

db2dart test /db

When this command is executed you should see a message that looks something like this:

The requested DB2DART processing has completed successfully! Complete DB2DART report found in:/home/db2inst1/sqllib/db2dump/DART0000/TEST.RPT

(The db2dart utility will inspect the entire database for architectural correctness and when finished, it will generate a detailed report; this report contains a summary at the end that will identify whether errors were encountered.)

After completing these steps, your failover database is ready for use. At this point, you should connect to it and verify that its contents are as expected. You should also ensure that any applications that were using the database server at the primary site are redirected to the database server at the secondary site. How that is done depends a lot on the environment; one way to automate this process is by using the Automatic Client Reroute functionality that is available with DB2.

Performing an unplanned failover to the secondary siteSometimes a primary system will become unavailable without any warning. This can happen because of a system failure (such as an operating system crash or a loss of connectivity between the primary system and other clients) or because of a physical disaster (such as an earthquake or fire). When an unexpected outage occurs, you can still perform a failover operation to provide availability to users and applications that rely on the primary system; however, you will not have the opportunity to perform an orderly shutdown of the primary system. This means that there may be some visible effects of the failover operation. (For example, with a DB2 LUW database, such a failover might result in one or more aborted transactions whose changes were never externalized to the database.)

Performing two-site SRDF failover operations 281

Page 282: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

282

Performing SRDF Failover and Failback Operations

To perform an unplanned failover from the primary server/Symmetrix to the secondary server/Symmetrix in a DB2 LUW-SRDF environment, complete the following steps, in the order shown:

At the secondary site 1. Make the source (R1) devices that contain the database (on the primary Symmetrix array) unavailable and make the target (R2) devices that contain the copy of the database (on the secondary Symmetrix array) available by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] failover –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to make all primary (R1) devices that have been assigned to a composite group named db2_cg unavailable and make all secondary (R2) devices assigned to the same composite group available, you would execute a command that looks like this:

symrdf -cg db2_cg failover –noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Failover' operation execution isin progress for composite group 'db2_cg'. Please wait...

Write Disable device(s) in (0223,006) on SA at source (R1).....Done. Suspend RDF link(s) for device(s) in (0223,006)...............Done. Read/Write Enable device(s) in (0223,006) on RA at target (R2).Done.

The RDF 'Failover' operation successfully executed forcomposite group 'db2_cg'.

2. Activate all database copy-related volume groups used, as well as their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2_data_vg and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this at the secondary host:

importvg -y’db2_data_vg’ hdiskpower17importvg -y’db2_logs_vg’ hdiskpower18

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 283: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

varyonvg db2_data_vgvaryonvg db2_logs_vg

On the other hand, to activate the same two volume groups on a Linux server, you might execute a set of commands (as the root user) that look more like this:

vgimport db2_data_vg /dev/emcpowerbvgimport db2_logs_vg /dev/emcpowerc

vgchange -a y db2_data_vgvgchange -a y db2_logs_vg

3. Once the appropriate volume groups have been activated, mount all file systems needed to access the database copy. The actual command used to mount a file system is operating system dependent.

Note: Mount points must exist before a file system can be mounted. Typically, mount points are created by constructing one or more directories using the mkdir command. (With AIX 5L and later, mount points are created automatically by the importvg command.)

For example, to mount two file systems named /mnt/data, and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) at the secondary host that look something like this:

mount /mnt/datamount /mnt/logs

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

4. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the secondary host (as the database instance user):

db2start

Performing two-site SRDF failover operations 283

Page 284: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

284

Performing SRDF Failover and Failback Operations

5. Because the original database (stored on the source or R1 devices on the primary Symmetrix array) was abnormally terminated and left in an inconsistent state, the copy of the database (stored on the target or R2 devices on the secondary Symmetrix array) must be returned to a consistent state before it can be accessed. Return the copy of the database to a consistent state by executing the following command at the secondary host (as the database instance user):

RESTART DATABASE [DBName]

where:

• DBName — Identifies the name or alias of the database to be restarted.

For multipartition databases, the RESTART DATABASE command must be executed on all partitions that belong to the database specified. This can be accomplished by executing the following command instead:

db2_all || “db2 RESTART DATABASE [DBName]”

For example, to return take a database named TEST to a consistent state, you would execute a command that looks like this:

RESTART DATABASE test

When this command is executed, you should see a message that looks something like this:

DB20000I The RESTART DATABASE command completed successfully.

6. Inspect the database that the secondary DB2 instance has access to (in other words, the failover database) for architectural correctness by executing the following command at the secondary host (as the database instance user):

db2dart [DatabaseName] /db

where:

• DatabaseName — Identifies by name, the database clone that db2dart operations are to be performed against.

Note: The database specified must be inactive when this command is executed.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 285: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

For example, to examine the architectural correctness of a failover database named TEST, you would execute a command that looks like this (as the database instance user):

db2dart test /db

When this command is executed you should see output that looks something like this:

The requested DB2DART processing has completed successfully! Complete DB2DART report found in:/home/db2inst1/sqllib/db2dump/DART0000/TEST.RPT

(The db2dart utility will inspect the entire database for architectural correctness and when finished, it will generate a detailed report; this report contains a summary at the end that will identify whether errors were encountered.)

After completing these steps, your failover database is ready for use. At this point, you should connect to it and verify that its contents are as expected. You should also ensure that any applications that were using the database server at the primary site are redirected to the database server at the secondary site. One way to automate this process is by using the Automatic Client Reroute functionality that is available with DB2.

Performing two-site SRDF failover operations 285

Page 286: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

286

Performing SRDF Failover and Failback Operations

Performing two-site SRDF failback operationsWhen a failover operation is performed, it is important to keep the data stored on the source devices on the primary Symmetrix array up to date, if possible, with the data stored on the target devices on the secondary Symmetrix array. Depending upon the nature of the failover (planned or unplanned), the primary Symmetrix array might be operational throughout most of the failover event or it could be unavailable for an extended period of time. Regardless, when the primary Symmetrix becomes available, it should be brought up to date to reflect any changes made on the secondary Symmetrix. In most cases, it should also resume the role of acting as the primary Symmetrix array in the SRDF pair.

The following sections describe how to perform failback operations after both planned and unplanned failover events have taken place for environments in which SRDF is used to provide a disaster restart solution for one or more DB2 LUW databases. The procedures outlined in these sections were developed using a single partition DB2 LUW database residing on a single Symmetrix array; devices containing the database metadata, data, and transaction logs were synchronously replicated (via SRDF) to similar devices on a second Symmetrix array.

Performing a failback operation after a planned failover to the secondary site

To perform a failback from the secondary server/Symmetrix to the primary server/Symmetrix after a planned failover event, complete the following steps, in the order shown:

At the secondary site 1. Terminate all connections to the database at the secondary site by executing one of the following commands at the secondary host (as the database instance user):

DEACTIVATE DATABASE [DBAlias]

where:

• DBAlias — Identifies the alias of the database to be deactivated (stopped).

or

FORCE APPLICATION ALL

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 287: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

or

db2stop FORCE

For multipartition databases, the DEACTIVATE DATABASE command will attempt to deactivate all partitions that belong to the database specified. However, this command may successfully deactivate some partitions and fail to deactivate others. Therefore, you must ensure that all partitions of a multipartition database have been deactivated before continuing with this procedure.

The FORCE APPLICATION ALL command will terminate all connections to all databases under the current DB2 Database Manager instance’s control; the db2stop FORCE command will terminate all connections to all databases under the current instance’s control and then stop the instance. (If the db2stop FORCE command is issued and applications do not respond within the time frame specified by the start_stop_time DB2 Database Manager configuration parameter — which, by default is 10 minutes — DB2 will crash the database and it will need to undergo crash recovery before it will be usable.) Therefore, caution should be exercised when using these commands in environments where multiple databases fall under a single instance’s control.

2. Using TimeFinder/Clone, create a backup copy of the database that can be used to return the database that is currently accessible to the secondary host to its current state in the event a problem occurs during the failback operation. The process for creating a backup copy of a DB2 database using TimeFinder/Clone is outlined in the section titled “Cloning a DB2 LUW database stored on SRDF devices” on page 302.

3. Unmount all file systems used by the database to ensure that nothing associated with the underlying devices remains in server memory. The actual command used to unmount a file system is operating system dependent.

For example, to unmount two file systems named /mnt/data and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) that look something like this:

umount /mnt/dataumount /mnt/logs

Performing two-site SRDF failback operations 287

Page 288: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

288

Performing SRDF Failover and Failback Operations

After these commands are executed, you can verify that the file systems have been unmounted by executing a command that looks like this:

df

The file systems should no longer appear in the list of active file systems returned.

Note: If the secondary host were to leave the file systems mounted, it would have an inconsistent picture of the contents, which could cause the system to crash when the devices associated with the file systems became available again (with their contents changed by new data generated from the primary host.)

4. Once the appropriate file systems have been unmounted, deactivate all database-related volume groups that are associated with the unmounted file systems. Again, the actual command used to deactivate a volume group is operating system dependent.

For example, to deactivate two volume groups named db2_data_vg, and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

varyoffvg db2_data_vgvaryoffvg db2_logs_vg

exportvg db2_data_vgexportvg db2_logs_vg

On the other hand, to deactivate the same two volume groups on a Linux server, you would execute a set of commands (as the root user) that look more like this:

vgchange -a n db2_data_vgvgchange -a n db2_logs_vg

vgexport db2_data_vgvgexport db2_logs_vg

At the primary site 5. Verify that the SRDF source and target devices are in a “Synchronized” state by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] verify -synchronized

where:

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 289: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to determine if the SRDF source and target devices that have been assigned to a composite group named db2_cg are in a “Synchronized” state, you would execute a command that looks like this:

symrdf -cg db2_cg verify -synchronized

If the devices are in the “Synchronized” state when this command is executed, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Synchronized'state.

6. Make the current source devices (the R1 devices on the secondary Symmetrix array) unavailable and make the current target devices (the R2 devices on the primary Symmetrix array) available by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] failover –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to make all primary (R1) devices that have been assigned to a composite group named db2_cg unavailable and make all secondary (R2) devices assigned to the same composite group available, you would execute a command that looks like this:

symrdf -cg db2_cg failover –noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Failover' operation execution isin progress for composite group 'db2_cg'. Please wait...

Write Disable device(s) in (1724,006) on SA at source (R1).......Done. Suspend RDF link(s) for device(s) in (1724,006)..................Done. Read/Write Enable device(s) in (1724,006) on SA at target (R2)...Done. Read/Write Enable device(s) in (1724,006) on RA at target (R2)...Done.

The RDF 'Failover' operation successfully executed forcomposite group 'db2_cg'.

Performing two-site SRDF failback operations 289

Page 290: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

290

Performing SRDF Failover and Failback Operations

Note: The symrdf failover command must be used here instead of the symrdf failback command because the symrdf swap command issued during the planned failover operation switched the roles of the primary (R1) and the secondary (R2) Symmetrix devices/hosts. Thus, you are failing over to the original R1 site.

7. Switch the roles of the primary (R1) and the secondary (R2) Symmetrix devices/hosts back to their original state by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] swap -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to swap roles so that all original primary system devices (now R2 devices) that have been assigned to a device group named db2_cg act as R1 devices and all original secondary system devices (now R1 devices) assigned to the same composite group act as R2 devices, you would execute a command that looks like this:

symrdf -cg db2_cg swap -noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Swap Personality' operation execution isin progress for composite group 'db2_cg'. Please wait...

Swap RDF Personality in (1724,006)........................Started. Swap RDF Personality in (1724,006)...........................Done.

The RDF 'Swap Personality' operation successfully executed forcomposite group 'db2_cg'.

8. When the symrdf failover command was executed earlier, the SRDF link between the source (R1) devices on the primary Symmetrix array and the target (R2) devices on the secondary Symmetrix array was suspended and I/O between the devices was stopped. Resume I/O between the R1 and R2 devices by executing the following command at the secondary host (as the system administrator or root user):

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 291: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

symrdf -cg [CompositeGroup] resume -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to resume I/O between the primary system devices (now the R1 devices) and the secondary system devices (now the R2 devices) that have been assigned to a device group named db2_cg, you would execute a command that looks like this:

symrdf -cg db2_cg resume -noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Resume' operation execution isin progress for composite group 'db2_cg'. Please wait...

Resume RDF link(s) for device(s) in (1724,006).............Started. Resume RDF link(s) for device(s) in (1724,006)................Done.

The RDF 'Resume' operation successfully executed forcomposite group 'db2_cg'.

9. Activate all database copy-related volume groups used, along with their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2_data_vg and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

importvg -y’db2_data_vg’ hdiskpower8importvg -y’db2_logs_vg’ hdiskpower9

varyonvg db2_data_vgvaryonvg db2_logs_vg

On the other hand, to activate the same two volume groups on a Linux server, you might execute a set of commands (as the root user) that look more like this:

vgimport db2_data_vg /dev/emcpowerbvgimport db2_logs_vg /dev/emcpowerc

vgchange -a y db2_data_vgvgchange -a y db2_logs_vg

Performing two-site SRDF failback operations 291

Page 292: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

292

Performing SRDF Failover and Failback Operations

10. Once the appropriate volume groups have been activated, mount all file systems needed to access the database copy. The actual command used to mount a file system is operating system dependent.

For example, to mount two file systems named /mnt/data, and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) at the primary host that look something like this:

mount /mnt/datamount /mnt/logs

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

11. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the primary host (as the database instance user):

db2start

12. Inspect the database for architectural correctness by executing the following command at the primary host (as the database instance user):

db2dart [DatabaseName] /db

where:

• DatabaseName — Identifies by name, the database that db2dart operations are to be performed against.

Note: The database specified must be inactive when this command is executed.

For example, to examine the architectural correctness of a failover database named TEST, you would execute a command that looks like this (as the database instance user):

db2dart test /db

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 293: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

When this command is executed you should see a message that looks something like this:

The requested DB2DART processing has completed successfully! Complete DB2DART report found in:/home/db2inst1/sqllib/db2dump/DART0000/TEST.RPT

(The db2dart utility will inspect the entire database for architectural correctness and when finished, it will generate a detailed report; this report contains a summary at the end that will identify whether errors were encountered.)

13. After completing these steps, your database at the primary site is ready for use. At this point, you should connect to it and verify that its contents are as expected. You should also ensure that any applications that were using the database server at the secondary site are redirected to the database server at the primary site. One way to automate this process is by using the Automatic Client Reroute functionality that is available with DB2.

At the secondary site 14. If you used TimeFinder/Clone to create a backup copy of the database at the secondary site and you have determined that the failover operation was successful, there is no longer a need to keep the backup copy available. The TimeFinder/Clone backup copy can be deleted by terminating the clone; this is done by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] terminate -tgt –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to terminate a clone that was created for devices in a composite group named db2_cg, you would execute a command that looks like this:

symclone -cg db2_cg terminate -tgt –noprompt

Once this command is executed, you can verify that the clone was deleted by executing the command symclone list. When this command is executed, you should see a message that looks like this:

No Copy sessions found

Performing two-site SRDF failback operations 293

Page 294: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

294

Performing SRDF Failover and Failback Operations

Performing a failback operation after an unplanned failover to the secondary siteTo perform a failback from the secondary server/Symmetrix to the primary server/Symmetrix after an unplanned failover event, complete the following steps, in the order shown:

At the secondary site 1. Start copying changes made to the database stored on the target (R2) devices (on the secondary Symmetrix array) to the database stored on the source (R1) devices (on the repaired or replaced primary Symmetrix array) by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] update –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to start copying changes made to the database stored on the target (R2) devices that have been assigned to a composite group named db2_cg to the database stored on the source (R1) devices (and assigned to the same composite group), you would execute a command that looks like this:

symrdf -cg db2_cg update –noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Update R1' operation execution isin progress for composite group 'db2_cg'. Please wait...

Suspend RDF link(s) for device(s) in (0223,006)..................Done. Merge track tables between source and target in (0223,006).......Started. Devices: 0090-0091 in (0223,006)................................ Merged. Merge track tables between source and target in (0223,006).......Done. Resume RDF link(s) for device(s) in (0223,006)...................Started. Resume RDF link(s) for device(s) in (0223,006)...................Done.

The RDF 'Update R1' operation successfully initiated forcomposite group 'db2_cg'.

2. Find out how many invalid tracks need to be copied from the database stored on the target (R2) devices to the database stored on the source (R1) devices by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] query

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 295: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to determine how many invalid tracks need to be copied to the database stored on the source (R1) devices that have been assigned to a composite group named db2_cg, you would execute a command that looks like this:

symrdf -cg db2_cg query

When this command is executed, you should see output that looks something like this:

Composite Group Name : db2_cgComposite Group Type : RDF2Number of Symmetrix Units : 1Number of RDF (RA) Groups : 1RDF Consistency Mode : NONE

Symmetrix ID : 000194900223 (Microcode Version: 5874)Remote Symmetrix ID : 000192601724 (Microcode Version: 5874)RDF (RA) Group Number : 6 (05)

Target (R2) View Source (R1) View MODES STATES-------------------------------- ------------------------- ----- ------

------------ ST LI ST C S Standard A N A o uLogical Sym T R1 Inv R2 Inv K T R1 Inv R2 Inv n s RDF PairDevice Dev E Tracks Tracks S Dev E Tracks Tracks MDAE s p STATE-------------------------------- -- ----------------------- ----- ------

------------DEV001 0159 RW 1015 0 RW 0090 WD 999 0 S... . - R1 UpdInProgDEV002 015A RW 2053 0 RW 0091 WD 2024 0 S... . - R1 UpdInProg

Total ------- ------- ------- ------- Track(s) 3068 0 3023 0 MBs 191.8 0.0 188.9 0.0

Legend for MODES:

M(ode of Operation) : A = Async, S = Sync, E = Semi-sync, C = Adaptive Copy D(omino) : X = Enabled, . = Disabled A(daptive Copy) : D = Disk Mode, W = WP Mode, . = ACp off (Consistency) E(xempt): X = Enabled, . = Disabled, M = Mixed, - = N/A

Legend for STATES:

Performing two-site SRDF failback operations 295

Page 296: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

296

Performing SRDF Failover and Failback Operations

Cons(istency State) : X = Enabled, . = Disabled, M = Mixed, - = N/A Susp(end State) : X = Online, . = Offline, P = Offline Pending, - = N/A

Continue executing the symrdf query command until it is reported that less than 30,000 invalid tracks remain to be copied.

3. When less than 30,000 invalid tracks remain to be copied, terminate all connections to the database by executing one of the following commands at the secondary host (as the database instance user):

DEACTIVATE DATABASE [DBAlias]

where:

• DBAlias — Identifies the alias of the database to be deactivated (stopped).

or

FORCE APPLICATION ALL

or

db2stop FORCE

For multipartition databases, the DEACTIVATE DATABASE command will attempt to deactivate all partitions that belong to the database specified. However, this command may successfully deactivate some partitions and fail to deactivate others. Therefore, you must ensure that all partitions of a multipartition database have been deactivated before continuing with this procedure.

The FORCE APPLICATION ALL command will terminate all connections to all databases under the current DB2 Database Manager instance’s control; the db2stop FORCE command will terminate all connections to all databases under the current instance’s control and then stop the instance. (If the db2stop FORCE command is issued and applications do not respond within the time frame specified by the start_stop_time DB2 Database Manager configuration parameter — which, by default is 10 minutes — DB2 will crash the database and it will need to undergo crash recovery before it will be usable.) Therefore, caution should be exercised when using these commands in environments where multiple databases fall under a single instance’s control.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 297: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

4. Using TimeFinder/Clone, create a backup copy of the database that can be used to return the database that is currently accessible to the secondary host to its current state in the event a problem occurs during the failback operation. The process for creating a backup copy of a DB2 database using TimeFinder/Clone is outlined in the section titled “Cloning a DB2 LUW database stored on SRDF devices” on page 302.

5. Unmount all file systems used by the database to ensure that nothing associated with the underlying devices remains in server memory. The actual command used to unmount a file system is operating system dependent.

For example, to unmount two file systems named /mnt/data and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) that look something like this:

umount /mnt/dataumount /mnt/logs

After these commands are executed, you can verify that the file systems have been unmounted by executing a command that looks like this:

df

The file systems should no longer appear in the list of active file systems returned.

6. Once the appropriate file systems have been unmounted, deactivate all database-related volume groups that are associated with the unmounted file systems. Again, the actual command used to deactivate a volume group is operating system dependent.

For example, to deactivate two volume groups named db2_data_vg, and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

varyoffvg db2_data_vgvaryoffvg db2_logs_vg

exportvg db2_data_vgexportvg db2_logs_vg

On the other hand, to deactivate the same two volume groups on a Linux server, you would execute a set of commands (as the root user) that look more like this:

Performing two-site SRDF failback operations 297

Page 298: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

298

Performing SRDF Failover and Failback Operations

vgchange -a n db2_data_vgvgchange -a n db2_logs_vg

vgexport db2_data_vgvgexport db2_logs_vg

7. Make the target (R2) devices that contain the copy of the database (on the secondary Symmetrix array) unavailable and make the source (R1) devices that contain the database (on the primary Symmetrix array) available by executing the following command at the secondary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] failback –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to make all target (R2) devices that have been assigned to a composite group named db2_cg unavailable and make all source (R1) devices assigned to the same composite group available, you would execute a command that looks like this:

symrdf -cg db2_cg failback –noprompt

When this command is executed, you should see output that looks something like this:

An RDF 'Failback' operation execution isin progress for composite group 'db2_cg'. Please wait...

Write Disable device(s) in (0223,006) on RA at target (R2).......Done. Suspend RDF link(s) for device(s) in (0223,006)..................Done. Merge track tables between source and target in (0223,006).......Started. Devices: 0090-0091 in (0223,006)................................ Merged. Merge track tables between source and target in (0223,006).......Done. Resume RDF link(s) for device(s) in (0223,006)...................Started. Resume RDF link(s) for device(s) in (0223,006)...................Done. Read/Write Enable device(s) in (0223,006) on SA at source (R1)...Done.

The RDF 'Failback' operation successfully executed forcomposite group 'db2_cg'.

At the primary site 8. Verify that the SRDF source and target devices are in a “Synchronized” state by executing the following command at the primary host (as the system administrator or root user):

symrdf -cg [CompositeGroup] verify -synchronized

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 299: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

where:

• CompositeGroup — Identifies the SYMCLI composite group that SRDF control operations are to be performed on.

For example, to determine if the SRDF source and target devices that have been assigned to a composite group named db2_cg are in a “Synchronized” state, you would execute a command that looks like this:

symrdf -cg db2_cg verify -synchronized

If the devices are in the “Synchronized” state when this command is executed, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Synchronized'state.

9. Activate all database copy-related volume groups used, along with their associated logical volumes. The actual command used to activate a volume group is operating system dependent.

For example, to activate two volume groups named db2_data_vg and db2_logs_vg on an AIX server, you would execute a set of commands (as the root user) that look something like this:

importvg -y’db2_data_vg’ hdiskpower8importvg -y’db2_logs_vg’ hdiskpower9

varyonvg db2_data_vgvaryonvg db2_logs_vg

On the other hand, to activate the same two volume groups on a Linux server, you might execute a set of commands (as the root user) that look more like this:

vgimport db2_data_vg /dev/emcpowerbvgimport db2_logs_vg /dev/emcpowerc

vgchange -a y db2_data_vgvgchange -a y db2_logs_vg

10. Once the appropriate volume groups have been activated, mount all file systems needed to access the database copy. The actual command used to mount a file system is operating system dependent.

Performing two-site SRDF failback operations 299

Page 300: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

300

Performing SRDF Failover and Failback Operations

For example, to mount two file systems named /mnt/data, and /mnt/logs on an AIX or Linux server, you would execute a set of commands (as the root user) at the secondary host that look something like this:

mount /mnt/datamount /mnt/logs

After these commands are executed, you can verify that the file systems have been mounted by executing a command that looks like this:

df

The file systems needed to access the database copy should now appear in the list of active file systems returned.

11. Start the DB2 Database Manager instance (if it is not already running) by executing the following command at the primary host (as the database instance user):

db2start

12. Inspect the database for architectural correctness by executing the following command at the primary host (as the database instance user):

db2dart [DatabaseName] /db

where:

• DatabaseName — Identifies by name, the database that db2dart operations are to be performed against.

Note: The database specified must be inactive when this command is executed.

For example, to examine the architectural correctness of a failover database named TEST, you would execute a command that looks like this (as the database instance user):

db2dart test /db

When this command is executed you should see a message that looks something like this:

The requested DB2DART processing has completed successfully! Complete DB2DART report found in:/home/db2inst1/sqllib/db2dump/DART0000/TEST.RPT

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 301: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

(The db2dart utility will inspect the entire database for architectural correctness and when finished, it will generate a detailed report; this report contains a summary at the end that will identify whether errors were encountered.)

13. After completing these steps, your database at the primary site is ready for use. At this point, you should connect to it and verify that its contents are as expected. You should also ensure that any applications that were using the database server at the secondary site are redirected to the database server at the primary site. One way to automate this process is by using the Automatic Client Reroute functionality that is available with DB2.

At the secondary site 14. If you used TimeFinder/Clone to create a backup copy of the database at the secondary site and you have determined that the failover operation was successful, there is no longer a need to keep the backup copy available. The TimeFinder/Clone backup copy can be deleted by terminating the clone; this is done by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] terminate -tgt –noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to terminate a clone that was created for devices in a composite group named db2_cg, you would execute a command that looks like this:

symclone -cg db2_cg terminate -tgt –noprompt

Once this command is executed, you can verify that the clone was deleted by executing the command symclone list. When this command is executed, you should see a message that looks like this:

No Copy sessions found

Performing two-site SRDF failback operations 301

Page 302: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

302

Performing SRDF Failover and Failback Operations

Cloning a DB2 LUW database stored on SRDF devicesEarlier, it was mentioned that TimeFinder/Clone can be used to create a point-in-time copy of a database, which can then be used for reporting operations, decision support, data warehouse refreshes, or any other process that requires parallel access to production information. TimeFinder/Clone copies can also serve as backup images and can be used to return devices to the state they were in at the time a copy was made.

The relationship between a clone source and target is defined when a clone session is created; when the session is later activated, the target device can be instantly accessed by a target's host. Clone target devices can be later refreshed from the source devices (re-activated) or can be used to overwrite their source devices with their content (restored); when the clone session between source and target devices is no longer needed, it can be terminated. A full copy will take place only during the first time a clone session is created. Any further operations on the clone, such as re-create or restore, will be done incrementally, passing just the final changes between the source and target devices.

To create a local clone (copy) of a DB2 LUW database stored on SRDF target devices using EMC TimeFinder/Clone technology, complete the following steps, in the order shown:

Note: If you cloned the database when SRDF was set up and if the clone target devices you created are still available and are associated with the same composite group as the SRDF target devices, you can skip the first seven steps of this process and go directly to Step 8.

1. In order to replicate a database using TimeFinder/Clone technology, clone target devices must be created on the secondary Symmetrix that have the same size and emulation type as the SRDF devices that contain the database to be cloned. Specify the devices to be created on the secondary Symmetrix by creating a command file (using a text editor, such as Notepad or the UNIX vi Editor) that contains one or more create dev commands that are similar to this:

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,disk_group=1;

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 303: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

This particular create dev command will create two new devices with a size of 86000 cylinders that are configured as RAID 5 (7+1) devices, that use FBA emulation, and that reside in disk group 1.

2. Execute the create dev command(s) stored in the file created in the previous step by executing a symconfigure command at the secondary host (as the system administrator or root user) that looks something like this:

symconfigure -sid [SymmID] -file [CmdFile] -v -nopromptcommit

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symconfigure command is to be executed against.

• CmdFile — Identifies, by name, the file that contains one or more create dev commands.

For example, to commit the commands in a command file named adddevices.cmd against a Symmetrix whose serial number ends in 0223, you would execute a command that looks like this:

symconfigure -sid 0223 -file adddevices.cmd -v-noprompt commit

When this command is executed, you should see output that looks something like this:

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change session...........Established.

Processing symmetrix 000914900223{

create dev count=2, size=86000 cyl, emulation=FBA,config=RAID-5, data_member_count=7, mvs_ssid=1,disk_group=1;

}

Performing Access checks................................Allowed.Checking Device Reservations............................Allowed.Initiating COMMIT of configuration changes..............Queued.COMMIT requesting required resources....................Obtained.Step 022 of 047 steps...................................Executing.Step 037 of 162 steps...................................Executing.Step 056 of 162 steps...................................Executing.

...

Cloning a DB2 LUW database stored on SRDF devices 303

Page 304: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

304

Performing SRDF Failover and Failback Operations

Step 132 of 162 steps...................................Executing.Step 134 of 162 steps...................................Executing.Step 137 of 162 steps...................................Executing.Local: COMMIT..........................................Done.

New symdevs: 0166:0167Terminating the configuration change session............Done.

The configuration change session has successfully completed.

3. Verify that the desired devices were created by executing the following command at the secondary host (as the system administrator or root user):

symdev -sid [SymmID] list

where:

• SymmID — Identifies the Symmetrix, by serial number, that the symdev command is to be executed against.

For example, to see if new devices were successfully created on a Symmetrix whose serial number ends in 0223, execute the following command:

symdev -sid 0223 list

The devices that were just created should be displayed in the list produced.

4. Create a storage group for the devices that were just created by executing the following command at the secondary host (as the system administrator or root user):

symaccess -sid [SymmID] create -name [SGName] -type storage devs [StartDevName]:[EndDevName]

where:

• SymmID — Identifies the Symmetrix, by serial number, that the storage group is to be created on.

• SGName — Identifies the name to be assigned to the storage group being created.

• StartDevName — Identifies the first Symmetrix device in a range of devices that are to be added to the storage group.

• EndDevName — Identifies the last Symmetrix device in a range of devices that are to be added to the storage group.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 305: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

For example, to create a storage group named db2_clone_sg on a Symmetrix whose serial number ends in 0223 and add devices 0166 thru 0167 to it, you would execute a command that looks like this:

symaccess -sid 0223 create -name db2_clone_sg -type storage devs 166:167

5. Create a new masking view using the storage group just created along with the port group and initiator group that already exists for the host by executing the following command at the secondary host (as the system administrator or root user):

symaccess -sid [SymmID] create view -name [MVName] -sg [SGName] -pg [PGName] -ig [IGName]

where:

• SymmID — Identifies the Symmetrix, by serial number, that the masking view is to be created on.

• MVName — Identifies the name that is to be assigned to the masking view being created.

• SGName — Identifies the name of the storage group that is to be associated with the masking view being created.

• PGName — Identifies the name of the port group that is to be associated with the masking view being created.

• IGName — Identifies the name of the initiator group that is to be associated with the masking view being created.

For example, to create a masking view named db2_clone_mv on a Symmetrix whose serial number ends in 0223 and associate it with the storage group db2_clone_sg, the port group D220_pg, and the initiator group D220_ig, you would execute a command that looks like this:

symaccess -sid 0223 create view -name db2_clone_mv -sg db2_clone_sg -pg D220_pg -ig D220_ig

6. Make the clone target devices that were just created and masked available to the secondary host by either rebooting the host or by performing an “on-line” SCSI bus scan at the host. The actual command used to initiate an “on-line” SCSI bus scan is operating system dependent.

For example, to initiate a SCSI bus scan on an AIX server, you would execute a command (as the root user) that looks like this:

Cloning a DB2 LUW database stored on SRDF devices 305

Page 306: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

306

Performing SRDF Failover and Failback Operations

cfgmgr

On the other hand, to initiate an “on-line” SCSI bus scan on a Linux server, you would need to follow a procedure that looks more like this:

a. Get the WWN from the Symmetrix masking view that was used to configure storage to the host by executing a command that looks like this:

symaccess -sid [SymmID] show view [MaskingViewName] | awk '/WWN/'

b. Compare the WWN obtained in the previous step against the output from the following command:

systool -av -c fc_host | awk '/Class Device =/ || /port_name/'

c. Note the host number ("Class Device" value from systool output), which has a matching WWN from the Symmetrix masking view and the sysfs output ( "port_name" value from systool output).

d. Scan the SCSI bus by executing the following command with the host number identified in the previous step specified:

echo "- - -" > /sys/class/scsi_host/[Host#]/scan

7. Before a target device can be cloned from a source device, both the source and the target device must have been previously associated with a device or composite group. In this case, because a composite group was created earlier and the appropriate SRDF target devices were added to it, that composite group can be used for any cloning operations desired. Add the clone target devices to the composite group that was created earlier (on the secondary host) by executing the following command at the secondary host (as the system administrator or root user):

symcg -cg [CompositeGroup] -sid [SymmID]-range [StartDevName]:[EndDevName] addall dev -tgt

where:

• CompositeGroup — Identifies the SYMCLI composite group that contains the R2 devices that hold both the replicated database data and the replicated transaction logs.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 307: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

• SymmID — Identifies the Symmetrix, by serial number, that devices being added to the composite group specified reside on.

• StartDevName — Identifies the first Symmetrix device in a range of devices that are to be added to the composite group.

• EndDevName — Identifies the last Symmetrix device in a range of devices that are to be added to the composite group.

For example, to add devices 0166 thru 0167 that reside on a Symmetrix whose serial number ends in 0223 to a composite group named db2_cg, you would execute a command that looks like this:

symcg -cg db2_cg -sid 0223 -range 166:167 addall dev -tgt

If you cloned the database when SRDF was set up and if the clone target devices are still available and associated with a composite group, start here

8. Create a relationship between the SRDF target devices that contain the database to be cloned and the devices that are to serve as the target for the clone by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] create -precopy -tgt–noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to create a clone relationship between a set of Symmetrix SRDF devices that have been assigned to a composite group named db2_cg and the devices that are to serve as the target for the clone (which have been assigned to the same composite group), you would execute a command that looks like this:

symclone -cg db2_cg create -precopy -tgt –noprompt

And when this command is executed, you should see a message that looks something like this:

'Create' operation execution is in progress forcomposite group 'db2_cg'. Please wait...

'Create' operation successfully executed for composite

Cloning a DB2 LUW database stored on SRDF devices 307

Page 308: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

308

Performing SRDF Failover and Failback Operations

group 'db2_cg'.

In this case, data will be copied to the target devices in the background immediately after the clone is created because the –precopy keyword was specified with the symclone create command used. (This behavior is required when using asynchronous SRDF.)

9. Verify that the clone was created by executing the following command at the secondary host (as the system administrator or root user):

symclone list

When this command is executed, you should see output that looks something like this:

Symmetrix ID: 000194900223

Source Device Target Device Status------------------------- ---------------------- ------------- ProtectedSym Tracks Sym CGDP SRC <=> TGT------------------------- ---------------------- -------------0159 1140458 0166 XXX. PreCopy015A 1058823 0167 XXX. PreCopy

Total -------- Tracks 2199281 MB(s) 137455

Legend:

(C): X = The background copy setting is active for this pair. . = The background copy setting is not active for this pair.(G): X = The Target device is associated with a group. . = The Target device is not associated with a group.(D): X = The Clone session is a differential copy session. . = The Clone session is not a differential copy session.(P): X = The pre-copy operation has completed one cycle . = The pre-copy operation has not completed one cycle

10. Verify that data stored on the source devices used has been copied to the appropriate clone target devices and that the clone target devices are in a state that allows them to be accessed (“Active” and “100%” copied) by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] query

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 309: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to determine whether data has been copied to the set of clone target devices that have been assigned to a composite group named db2_cg, you could execute a command that looks like this:

symclone -cg db2_cg query

When this command is executed, you should see output that looks something like this:

Composite Group Name : db2_cgComposite Group Type : RDF1Number of Symmetrix Units : 1Number of RDF (RA) Groups : 1

CG Symmetrix ID : 000194900223 (Microcode Version: 5874)

Source Device Target Device State Copy--------------------------------- ---------------------------- ------------ ---- Protected Modified ModifiedLogical Sym Tracks Tracks Logical Sym Tracks CGDP SRC <=> TGT (%)--------------------------------- ---------------------------- ------------ ----DEV001 0159 1207817 0 TGT001 0166 0 XXX. PreCopy 6DEV002 015A 1163606 0 TGT002 0167 0 XXX. PreCopy 9

Total -------- -------- -------- Track(s) 2371423 0 0 MB(s) 148214 0 0

Legend:

(C): X = The background copy setting is active for this pair. . = The background copy setting is not active for this pair.(G): X = The Target device is associated with this group. . = The Target device is not associated with this group.(D): X = The Clone session is a differential copy session. . = The Clone session is not a differential copy session.(P): X = The pre-copy operation has completed one cycle . = The pre-copy operation has not completed one cycle

11. Once the clone copy operation is complete, activate the clone by executing the following command at the secondary host (as the system administrator or root user):

Cloning a DB2 LUW database stored on SRDF devices 309

Page 310: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

310

Performing SRDF Failover and Failback Operations

symclone -cg [CompositeGroup] activate -consistent–tgt -noprompt

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

Note: The –consistent keyword tells Enginuity to use Enginuity Consistency Assist (ECA) to momentarily suspend writes to the source disks while the clone is being activated.

For example, to activate the clone that was created earlier (whose devices reside in a composite group named db2_cg), you would execute a command that looks like this:

symclone -cg db2_cg activate -consistent -tgt–noprompt

And when this command is executed, you should see a message that looks something like this:

'Activate' operation execution is in progress forcomposite group 'db2_cg'. Please wait...

'Activate' operation successfully executed forcomposite group 'db2_cg'.

12. Verify that data stored on the source devices has been copied to the appropriate clone target devices by executing the following command at the secondary host (as the system administrator or root user):

symclone -cg [CompositeGroup] verify -copied

where:

• CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

For example, to determine whether data has been copied to the set of clone target devices that have been assigned to a composite group named db2_cg, you could execute a command that looks like this:

symclone -cg db2_cg verify -copied

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 311: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Performing SRDF Failover and Failback Operations

When this command is executed, you should see a message that looks something like this:

All devices in the group 'db2_cg' are in 'Copied' state.

After completing these steps, you will have a point-in-time copy of the database on the clone target devices that can be used to return the SRDF devices to their current state in the event a problem occurs when trying to fail back to the original primary server/Symmetrix.

When the copy of the database stored on the clone target device is no longer needed, it can be deleted by terminating the clone target device/SLV device relationship. This is done by executing the following command at the host (as the system administrator or root user):

symclone -cg [CompositeGroup] terminate -tgt –noprompt

where:

◆ CompositeGroup — Identifies the SYMCLI composite group that TimeFinder/Clone control operations are to be performed on.

Cloning a DB2 LUW database stored on SRDF devices 311

Page 312: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

312

Performing SRDF Failover and Failback Operations

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 313: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

A

This appendix outlines the steps that were followed to create the environment that was used to test the procedures documented in this TechBook.

◆ Steps used to create the test environment .................................... 314

Test Environment

Test Environment 313

Page 314: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

314

Test Environment

Steps used to create the test environmentThe following shows the steps that were used to create the test environment that was used to develop the procedures outlined in this TechBook:

1. A file named create_devs.txt was created on the primary host (named licod219) using a text editor. This file, which contained commands to create the devices needed on the primary Symmetrix, looked like this:

create dev count=2, size=86000 cyl, emulation=fba, config=RAID5, data_member_count=7;

2. Using information stored in the create_devs.txt file, the devices needed were then created on the primary Symmetrix (1724) by executing the following SYMCLI command:

symconfigure -sid 1724 -f create_devs.txt commit -noprompt

When this command was executed, the following output was produced:

A Configuration Change operation is in progress. Please wait...

Establishing a configuration change session...........Established. Processing symmetrix 000192601724 Performing Access checks.....................Allowed. Checking Device Reservations.................Allowed. Submitting configuration changes...........Submitted. Validating configuration changes...........Validated.

New symdevs: 90:91 Initiating PREPARE of configuration changes.Prepared. Initiating COMMIT of configuration changes.Queued. COMMIT requesting required resources.......Obtained. Step 020 of 078 steps......................Executing.

Step 031 of 078 steps......................Executing. Step 056 of 151 steps......................Executing. Step 066 of 151 steps......................Executing. Step 071 of 151 steps......................Executing. Step 071 of 151 steps......................Executing. Step 076 of 173 steps......................Executing. Step 079 of 173 steps......................Executing. Step 082 of 173 steps......................Executing. Step 082 of 173 steps......................Executing. Step 098 of 173 steps......................Executing.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 315: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Test Environment

Step 099 of 173 steps......................Executing. Step 104 of 173 steps......................Executing. Step 104 of 173 steps......................Executing. Step 109 of 173 steps......................Executing. Step 115 of 173 steps......................Executing. Step 125 of 173 steps......................Executing. Step 125 of 173 steps......................Executing. Step 133 of 173 steps......................Executing. Local: COMMIT.............................Done.

Terminating the configuration change session....Done.

The configuration change session has successfully completed.

3. Then, a storage group was created on the primary Symmetrix (1724) and the new devices (90 and 91) were added to it by executing the following SYMCLI commands:

symaccess create -sid 1724 -name DB2_Source_SG -type storage devs 090:091

4. Next, a port group identifying the appropriate directors to use was created on the primary Symmetrix (1724) by executing the following SYMCLI command:

symaccess create -sid 1724 -name D219_PG -type port -dirport 7E:0, 7F:0, 10E:0, 10F:0

5. Then, an initiator group for the primary AIX server used (licod219) was created on the primary Symmetrix (1724) by executing the following SYMCLI commands:

symaccess -sid 1724 create -name D219_IG -type initiator -wwn 10000000c9577e71

symaccess -sid 1724 -name D219_IG -type initiator-wwn 10000000c9577e72 add

6. Next, a masking view was created on the primary Symmetrix (1724) by executing the following SYMCLI command:

symaccess create view -name D219_DB2_MV -sg D2_Source_SG -pg D219_PG -ig D219_IG

7. Then, an initiator group for the secondary AIX server used (licod220) was created on the secondary Symmetrix (0223) by executing the following SYMCLI commands:

symaccess -sid 0223 create -name D220_IG -type initiator -wwn 10000000c960b5b2

Steps used to create the test environment 315

Page 316: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

316

Test Environment

symaccess -sid 0223 -name D220_IG -type initiator -wwn 10000000c960b5b3 addsymaccess -sid 0223 -name D220_IG -type initiator -wwn 10000000c961f83c addsymaccess -sid 0223 -name D220_IG -type initiator -wwn 10000000c961f83d add

8. Next, a port group identifying the appropriate directors to use on the secondary Symmetrix (0223) was created on the Symmetrix by executing the following SYMCLI command:

symaccess create -sid 0223 -name D220_PG -type port -dirport 7F:0, 8E:0

Note: Storage groups and masking views for the secondary Symmetrix (0223) were created later as part of the testing process.

9. Then, the devices created on the primary Symmetrix (90 and 91) were made available to the primary AIX server (D219) by executing the following command (at the primary AIX server):

cfgmgr

10. Next, the PowerPath device names (for example, hdiskpower8, hdiskpower9) for the devices created on the primary Symmetrix (90 and 91) were obtained by executing the following commands (at the primary AIX server):

powermt configpowermt display dev=all

11. Then, the following script was created and executed on the primary AIX server (D219) to initialize the Symmetrix devices, add them to a volume group, create an JFS2 file system on them, and then mount the new file systems so they were accessible:

# DB2 Test Environment Setup Script

# Initialize The Symmetrix Deviceschdev -l 'hdiskpower8' -a pv='yes'chdev -l 'hdiskpower9' -a pv='yes'

# Create Volume Groups For The Symmetrix Devices/usr/sbin/mkvg -f -s 32 -y'db2_data_vg' hdiskpower8/usr/sbin/mkvg -f -s 32 -y'db2_logs_vg' hdiskpower9

# Create Logical Volumes For The Symmetrix Devices/usr/sbin/mklv -y'db2_data_lv' db2_data_vg 1/usr/sbin/mklv -y'db2_logs_lv' db2_logs_vg 1

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 317: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Test Environment

# Create Mount Points For The Symmetrix Devicesmkdir /mnt/datamkdir /mnt/logs

# Create JFS2 File Systems On The Symmetrix Devicescrfs -v jfs2 -g db2_data_vg -a size=80225M -m /mnt/data -A yes -p rw

crfs -v jfs2 -g db2_logs_vg -a size=80225M -m /mnt/logs -A yes -p rw

# Mount The File Systemsmount /mnt/datamount /mnt/logs

# Change Permissions On The File Systemschmod 777 /mnt/datachmod 777 /mnt/logs

# Verify That Everything Has Been Set Up Correctlydf -g

12. Finally, a recoverable DB2 9.7 database was created on the mounted file sytems, populated, and then used for testing.

Steps used to create the test environment 317

Page 318: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

318

Test Environment

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 319: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

This glossary contains terms related to disk storage subsystems. Many of these terms are used in this book.

Aactuator A set of access arms and their attached read/write heads, which

move as an independent component within a head and disk assembly (HDA).

adapter Card that provides the physical interface between the director and disk devices (SCSI adapter), director and parallel channels (Bus & Tag adapter), director and serial channels (Serial adapter).

alternate track A track designated to contain data in place of a defective primary track. See also ”primary track.”

BBCV device A standard Symmetrix device with special attributes that allow it to

independently support applications and processes. BCVs are active production images that are logically or physically separate from the production volumes with no reliance on the production host, thus providing protection from physical or logical corruption. Once the BCV task is complete, the volume can be resynchronized with the production volume, reassigned to another production volume, or maintained “as is” for another task. See also ”standard device.”

Glossary

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 319

Page 320: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

320

Glossary

BCV mirror A standard device mirror (one of M2, M3, or M4) assigned to the BCV device upon establishing or re-establishing a BCV pair. See also ”establish,” “re-establish,” and “BCV pair.”

BCV pair Consists of a standard device and a BCV device attached together.

Business Continuance(BC) Processes

Processes that allow customers to access and manage instant copies of Symmetrix standard devices. See also ”establish,” “re-establish,” and “split.”

Business ContinuanceVolume (BCV)

See ”BCV device.”

Ccache Random access electronic storage used to retain frequently used data

for faster access by the channel.

cache slot Unit of cache equivalent to one track.

channel director The component in the Symmetrix subsystem that interfaces between the host channels and data storage. It transfers data between the channel and cache.

CKD Count Key Data, a data recording format employing self-defining record formats in which each record is represented by a count area that identifies the record and specifies its format, an optional key area that may be used to identify the data area contents, and a data area that contains the user data for the record. CKD can also refer to a set of channel commands that are accepted by a device that employs the CKD recording format.

concurrentestablished BCV pair

The relationship that establishes two BCV devices as concurrent mirrors of a single standard device that allows two synchronized copies of the standard data to be created simultaneously.

controller ID Controller identification number of the director the disks are channeled to for EREP usage. There is only one controller ID for Symmetrix.

DDASD Direct access storage device, a device that provides nonvolatile

storage of computer data and random access to that data. A DASD is most commonly known as a magnetic disk device.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 321: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Glossary

data availability Access to any and all user data by the application.

define BCV pair The process of identifying a BCV device and a standard device to be established.

delayed fast write There is no room in cache for the data presented by the write operation.

destage The asynchronous write of new or updated data from cache to disk device.

device A uniquely addressable part of the Symmetrix subsystem that consists of a set of access arms, the associated disk surfaces, and the electronic circuitry required to locate, read, and write data. See also ”volume.”

device address The hexadecimal value that uniquely defines a physical I/O device on a channel path in an MVS environment. See also ”unit address.”

device number The value that logically identifies a disk device in a string.

diagnostics System level tests or firmware designed to inspect, detect, and correct failing components. These tests are comprehensive and self-invoking.

director The component in the Symmetrix subsystem that allows Symmetrix to transfer data between the host channels and disk devices. See also ”channel director.”

disk director The component in the Symmetrix subsystem that interfaces between cache and the disk devices.

dual-initiator A Symmetrix feature that automatically creates a back up data path to the disk devices serviced directly by a disk director, if that disk director or the disk management hardware for those devices fails.

dynamic sparing A Symmetrix feature that automatically transfers data from a failing disk device to an available spare disk device without affecting data availability. This feature supports all non-mirrored devices in the Symmetrix subsystem.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 321

Page 322: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

322

Glossary

EESCON Enterprise Systems Connection, a set of IBM and vendor products

that connect mainframe computers with each other and with attached storage, locally attached workstations, and other devices using optical fiber technology and dynamically modifiable switches called ESCON directors. See also ”ESCON director.”

ESCON director Device that provides a dynamic switching function and extended link path lengths (with XDF capability) when attaching an ESCON channel to a Symmetrix serial channel interface.

establish A Business Continuance process that assigns a BCV device as the next available mirror of a standard device.

established The BCV pair condition where the BCV device and standard device are synchronized and functioning as a Symmetrix mirror. A BCV pair is established by the BCV commands establish and re-establish.

Ffast write In Symmetrix, a write operation at cache speed that does not require

immediate transfer of data to disk. The data is written directly to cache and is available for later destaging.

FBA Fixed Block Architecture, disk device data storage format using fixed-size data blocks.

frame Data packet format in an ESCON environment. See also ”ESCON.”

FRU Field Replaceable Unit, a component that is replaced or added by service personnel as a single entity.

Ggatekeeper A small logical volume on a Symmetrix storage subsystem used to

pass commands from a host to the Symmetrix storage subsystem. Gatekeeper devices are configured on standard Symmetrix disks.

GB Gigabyte, 109 bytes.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 323: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Glossary

Hhead and disk

assemblyA field replaceable unit in the Symmetrix subsystem containing the disk and actuator.

home address The first field on a CKD track that identifies the track and defines its operational status. The home address is written after the index point on each track. See also ”CKD.”

hypervolumeextension

The ability to define more than one logical volume on a single physical disk device making use of its full formatted capacity. These logical volumes are user-selectable in size. The minimum volume size is one cylinder and the maximum size depends on the disk device capacity and the emulation mode selected.

IID Identifier, a sequence of bits or characters that identifies a program,

device, controller, or system.

IML Initial microcode program loading.

incremental Establish A time-saving operation similar to an Establish. The source (R1) device copies to the target (R2) device only the new data that was updated on the source R1 device while the SRDF pair was split. Any changed tracks on the target (R2) device are also refreshed from the corresponding tracks on the source (R1) device. The R2 device is write disabled to the target host.

index marker Indicates the physical beginning and end of a track.

index point The reference point on a disk surface that determines the start of a track.

instant Split A method of splitting a BCV that improves the performance of a typical split operation by performing a quick foreground BCV split, which reduces the time the application needs to be frozen and is shorter than using a regular Split.

I/O device An addressable input/output unit, such as a disk device.

KK Kilobyte, 1024 bytes.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 323

Page 324: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

324

Glossary

Lleast recently used

algorithm (LRU)The algorithm used to identify and make available the cache space by removing the least recently used data.

logical volume A user-defined storage device.

long miss Requested data is not in cache and is not in the process of being fetched.

longitude redundancycode (LRC)

Exclusive OR (XOR) of the accumulated bytes in the data record.

MMB Megabyte, 106 bytes.

mirrored pair A logical volume with all data recorded twice, once on each of two different physical devices.

mirroring The Symmetrix maintains two identical copies of a designated volume on separate disks. Each volume automatically updates during a write operation. If one disk device fails, Symmetrix automatically uses the other disk device.

Pphysical ID Physical identification number of the Symmetrix director for EREP

usage. This value automatically increments by one for each director installed in Symmetrix. This number must be unique in the mainframe system. It should be an even number. This number is referred to as the SCU_ID.

primary track The original track on which data is stored. See also ”alternate track.”

promotion The process of moving data from a track on the disk device to cache slot.

protected BCVEstablish

The process of moving all mirrors of locally-mirrored BCV devices to join the mirrors of a standard device.

Rread hit Data requested by the read operation is in cache.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 325: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Glossary

read miss Data requested by the read operation is not in cache.

record zero The first record after the home address.

re-establish A BC process that reassigns a BCV device as the next available mirror of the standard device with which it was previously paired. The BCV mirror is updated with the data that was written to the standard device during the period that the BCV pair was split. The data that was written to the BCV device during the split is overwritten by data from the standard device.

Ssave devices

(SAVDEVs)Device configured for use in TimeFinder/Snap operations and SRDF/A DSE. These devices not mapped to the host that provide polled physical storage space for storing pre-update images of the source device change tracks and new writes during a TimeFinder/Snap virtual copy session.

A collection of Save devices used for Snap operation. Also called Snap Save Pool or Snap Save Device Pool (formerly known as SAVDEVs Pool).

SCSI adapter Card in the Symmetrix subsystem that provides the physical interface between the disk director and the disk devices.

scrubbing The process of reading, checking the error correction bits, and writing corrected data back to the source.

short miss Requested data is not in cache, but is in the process of being fetched.

SLV device A Symmetrix device configured for normal Symmetrix operation under a desired protection method (such as RAID 1, RAID 5, RAID-S, SRDF). See also ”standard device.”

snap device See ”virtual devices (VDEVs)” and “save devices (SAVDEVs).”

snap pool A collection of Save devices used for Snap operation. Also called Snap Save Pool or Snap Save Device Pool (formerly known as SAVDEVs Pool).

source volume (R1) A Symmetrix logical volume that is participating in SRDF operations. It resides in the local Symmetrix system. All CPUs attached to the Symmetrix may access a source volume for read/write operations.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 325

Page 326: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

326

Glossary

All writes to this primary source volume are mirrored (copied to a secondary target volume) in another Symmetrix system, which can be remote. A source volume is not available for local mirroring or dynamic sparing operations.

split A Business Continuance process that removes the BCV mirror from the existing BCV pair and assigns the BCV mirror back to its original device address. The BCV device then holds an instant copy of the data from the standard device.

SSID For 3990 storage control emulations, this value identifies the physical components of a logical DASD subsystem. The SSID must be a unique number in the host system. It should be an even number and start on a zero boundary.

stage The process of writing data from a disk device to cache.

standard device A Symmetrix device configured for normal Symmetrix operation under a desired protection method (such as RAID 1, RAID 5, RAID-S, SRDF).

storage control unit The component in the Symmetrix subsystem that connects Symmetrix to the host channels. It performs channel commands and communicates with the disk directors and cache. See also ”channel director.”

string A series of connected disk devices sharing the same disk director.

Symmetrix LogicalVolume (SLV)

See ”SLV device.”

TTarget volume (R2) A Symmetrix logical volume that is participating in SRDF operations.

It resides in the remote Symmetrix system. This secondary target volume is paired with a primary source volume in the local Symmetrix system and receives all write data from its mirrored pair. This volume is not accessed by user applications during normal I/O operations. A target volume is not available for local mirroring or dynamic sparing operations.

Uunit address The hexadecimal value that uniquely defines a physical I/O device

on a channel path in an MVS environment. See also ”device address.”

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 327: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Glossary

Vvirtual devices

(VDEVs)Host-accessible devices containing track-level location information (pointers), which indicate where the copy session data is located in the physical storage. Virtual devices consume minimal physical disk storage, as they store only the address pointers to the data stored on the source device or a pool of Save devices. Using virtual devices, TimeFinder/Snap operations provide instant snapshot copies.

volume A general term referring to a storage device. In the Symmetrix subsystem, a volume corresponds to a single disk device.

Wwrite hit There is room in cache for the data presented by the write operation.

write miss There is no room in cache for the data presented by the write operation.

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 327

Page 328: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

328

Glossary

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 329: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Index

AAdaptive copy 99ALTER DATABASE 59, 199ALTER TABLESPACE 57Alter Tablespace dialog box 58Asynchronous SRDF 99

BBandwidth 229BCV 117, 124, 134, 224

device, definition of 319mirrors 320volumes, definition of 320, 326

Buffer pools 41

CCache 88, 98, 225Change Tracker 86, 96CKD 102COMMIT 61Composite groups 99Con group trip 100, 217Concurrent SRDF 104Configure

Databases 80Instance 77Servers 64, 71

Consistency group 102Consistency groups 87, 99, 100, 101, 102, 108, 134Containers 41Crash recovery 130CREATE DATABASE 42

Create Database Wizard 42Create Table Space Wizard 56CREATE TABLESPACE 56

DDatabase 37Database recovery 215DB2 Administration Server (DAS) 38DB2 family

DB2 Data Warehouse Edition (DWE) 24DB2 Enterprise Server Edition (ESE) 22DB2 Everyplace 20DB2 Express 21DB2 Express-C 21DB2 for i5/OS 24DB2 for z/OS 25DB2 Personal Edition 21DB2 pureScale 23DB2 Workgroup Server Edition (WSE) 22

DB2 objectsdata objects 41recovery objects 40storage objects 40system objects 40

DB2 Registry management tool 74DB2 tools

Command Editor 31Command Line Processor 34Configuration Assistant 33Control Center 27

DB2_ENABLE_AUTOCONFIG_DEFAULT 51DB2ADMINSERVER 38DB2INSTANCE 37

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 329

Page 330: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

330

Index

db2set 72db2ubind.lst 50DBM Configuration dialog box 78defining BCV pairs 321Dependent-write consistency 102, 108, 217Device group 99dftdbpath 45DR 105

EEMC TimeFinder

TimeFinder/Clone 115, 203, 204, 206, 207TimeFinder/Mirror 115TimeFinder/Snap 115, 203, 205

Enginuity 86, 88, 92Enginuity Consistency Assist 100, 101, 102, 129ESCON 88, 97

FFailover, archival logging 69FBA 102Fibre Channel 88, 97FICON 88

GGET DATABASE CONFIGURATION 81GET DATABASE MANAGER

CONFIGURATION 77Gigabit Ethernet 88, 97

HHADR 22

II/O page cleaners 62IBMDEFAULTBP 48Infinite logging 67Instance 37iSCSI 88

LLocality of reference 229Log mirroring 68

logbufsiz 61

MMirror positions 124mirrors, BCV 320

PPath failover 138Path load balancing 137, 138Path management 137PowerPath 87, 100, 137, 217

RRA group 97, 100, 108, 214, 216RAID 1 88RAID 5 88RAID 6 89Registry variable 71Remote adapter 97Restartable databases 108ROLLBACK 61Rolling disaster 101, 102, 213, 214, 215, 216, 217,

229RPO 229

SSchema 49Servers 37Solutions Enabler 86, 87, 93, 209, 210, 211, 220,

221, 223source volumes (R1) 325split

definition of 326SRDF 86, 96, 97, 98, 99, 102, 103, 105, 107, 108, 117,

209, 212, 220, 222Establish and split operations 66Suspend and resume operations 64

SRDF adaptive copy 99, 224SRDF Consistency Groups 216SRDF Data Mobility 105SRDF establish 106, 107SRDF failback 109, 110SRDF failover 109SRDF restore 108

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 331: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

Index

SRDF Split 107SRDF/A 99SRDF/AR 99, 224SRDF/AR Multihop 229SRDF/CE 112SRM 87standard devices 326SYMAPI 86, 93, 129SYMCLI 93, 96, 101, 133, 135, 136, 209, 211, 220,

221symmir 124, 125, 127symsnap 120, 123Synchronous SRDF 98, 216SYSCATSPACE 48System catalog 48

TTable space

Automatic Storage 53Database Managed Space 53extent 52page 52

System Managed Space 53Tablespaces 41target volumes (R2) 326TEMPSPACE1 48TimeFinder 87, 96, 105, 115TimeFinder/Clone 116, 133TimeFinder/Mirror 115, 117, 125TimeFinder/Mirror establish 117TimeFinder/Snap 116, 120Transaction 61Transaction logging 61

UUPDATE DATABASE CONFIGURATION 81UPDATE DATABASE MANAGER

CONFIGURATION 77USERSPACE1 48

VVirtual Provisioning 140

331Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases

Page 332: Using EMC SRDF to Facilitate Disaster Recovery for DB2 … · Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases 3 provided by third parties

332

Index

Using EMC SRDF to Facilitate Disaster Recovery for DB2 for Linux, UNIX, and Windows Databases