DB2 for z/os Backup and Recovery: Basics, Best Practices, and What's New

Similar documents
IBM DB2 Recovery Expert June 11, 2015

Best Practices for DB2 on z/os Backup and Recovery

SQL-BackTrack the Smart DBA s Power Tool for Backup and Recovery

High Speed Transaction Recovery By Craig S. Mullins

Session: Archiving DB2 comes to the rescue (twice) Steve Thomas CA Technologies. Tuesday Nov 18th 10:00 Platform: z/os

How To Improve Your Database Performance

DB2 9 for LUW Advanced Database Recovery CL492; 4 days, Instructor-led

Snapshot Technology: Improving Data Availability and Redundancy

DB2 for z/os: [Some] Backup and Recovery Utility Enhancements in V8/9/10

Rajan Arora (Deloitte) SAP Business Objects Backup and Recovery Scenarios and Best Practices Session # 3233

Leveraging Virtualization for Disaster Recovery in Your Growing Business

D12CBR Oracle Database 12c: Backup and Recovery Workshop NEW

Backups and Maintenance

DBAs having to manage DB2 on multiple platforms will find this information essential.

Restore and Recovery Tasks. Copyright 2009, Oracle. All rights reserved.

Agenda. Overview Configuring the database for basic Backup and Recovery Backing up your database Restore and Recovery Operations Managing your backups

Simplify and Improve Database Administration by Leveraging Your Storage System. Ron Haupert Rocket Software

State of Tennessee. Enterprise Storage, Backup / Recovery, and Tape Virtualization. Category: Business Continuity and Disaster Recovery

WHITE PAPER. Oracle Backup and Recovery Essentials NFORMATION THAT EVERY ORACLE DATABASE ADMINISTRATOR SHOULD KNOW

Implementing an Enterprise Class Database Backup and Recovery Plan

BMC Mainframe Solutions. Optimize the performance, availability and cost of complex z/os environments

MySQL Enterprise Backup

Four Steps to Disaster Recovery and Business Continuity using iscsi

Oracle Recovery Manager 10g. An Oracle White Paper November 2003

One Solution for Real-Time Data protection, Disaster Recovery & Migration

BUSINESS CONTINUITY AND DISASTER RECOVERY FOR ORACLE 11g

Have a Plan of ATTACK. Not a panic attack. 10 September 2003 IBM Internal Use Only Jarrett Potts, Tivoli Sales Enablement

The 9 Ugliest Mistakes Made with Data Backup and How to Avoid Them

Ingres Backup and Recovery. Bruno Bompar Senior Manager Customer Support

Continuous Data Protection for DB2

IMS Disaster Recovery

RAID5 versus RAID10. First let's get on the same page so we're all talking about apples.

Maximizing Business Continuity and Minimizing Recovery Time Objectives in Windows Server Environments

WHITE PAPER PPAPER. Symantec Backup Exec Quick Recovery & Off-Host Backup Solutions. for Microsoft Exchange Server 2003 & Microsoft SQL Server

SQL Server Training Course Content

Be Very Afraid. Christophe Pettus PostgreSQL Experts Logical Decoding & Backup Conference Europe 2014

NSI Solutions with Microsoft VSS

Once the RTO and RPO objectives are known, the customer is able to determine which disaster recovery methodology works best for their needs.

IDERA WHITEPAPER. The paper will cover the following ten areas: Monitoring Management. WRITTEN BY Greg Robidoux

Module 7: System Component Failure Contingencies

enterpri se 88 professional expertise distilled

D78850GC10. Oracle Database 12c Backup and Recovery Workshop. Summary. Introduction. Prerequisites

How To Use A Recoverypoint Server Appliance For A Disaster Recovery

Oracle Database Backup & Recovery, Flashback* Whatever, & Data Guard

OLTP Meets Bigdata, Challenges, Options, and Future Saibabu Devabhaktuni

Data Deduplication in Tivoli Storage Manager. Andrzej Bugowski Spała

The Benefits of Continuous Data Protection (CDP) for IBM i and AIX Environments

Disaster Recovery. Maximizing Business Continuity and Minimizing Recovery Time Objectives in Windows Server Environments.

11. Configuring the Database Archiving Mode.

STORAGE SOURCE DATA DEDUPLICATION PRODUCTS. Buying Guide: inside

Nimble Storage Best Practices for Microsoft SQL Server

IBM PROTECTIER: FROM BACKUP TO RECOVERY

Breakthrough Data Recovery for IBM AIX Environments

How To Fix A Powerline From Disaster To Powerline

Disaster Recovery for Oracle Database

EMC Backup Storage Solutions: The Value of EMC Disk Library with TSM

DISASTER RECOVERY AND CONTINGENCY PLANNING CHECKLIST FOR ICT SYSTEMS

Complete Storage and Data Protection Architecture for VMware vsphere

Best Practices for DB2 on z/os Schema Management. By Klaas Brant and BMC Software

WHITE PAPER: ENTERPRISE SECURITY. Symantec Backup Exec Quick Recovery and Off-Host Backup Solutions

Library Recovery Center

Data Recovery and High Availability Guide and Reference

Oracle Database 11g: Administration Workshop II DBA Release 2

STORAGECRAFT SHADOWPROTECT 5 SERVER/SMALL BUSINESS SERVER

An Oracle White Paper November Backup and Recovery with Oracle s Sun ZFS Storage Appliances and Oracle Recovery Manager

<Insert Picture Here> Pacific Gas and Electric Backup & Recovery Case Study

WHITE PAPER. Oracle Backup and Recovery Essentials INFORMATION THAT EVERY ORACLE DATABASE ADMINISTRATOR SHOULD KNOW

Objectif. Participant. Prérequis. Pédagogie. Oracle Database 11g - Administration Workshop II - LVC. 5 Jours [35 Heures]

Affordable Remote Data Replication

Near-Instant Oracle Cloning with Syncsort AdvancedClient Technologies White Paper

Oracle Database 11g: Administration Workshop II DBA Release 2

PHILIPS ie33/iu22 HARD DRIVE BACKUP

How To Fix A Fault Fault Fault Management In A Vsphere 5 Vsphe5 Vsphee5 V2.5.5 (Vmfs) Vspheron 5 (Vsphere5) (Vmf5) V

5 Reasons Your Business Needs Network Monitoring

Storage System High-Availability & Disaster Recovery Overview [638]

Best Practices. Using IBM InfoSphere Optim High Performance Unload as part of a Recovery Strategy. IBM Smart Analytics System

Oracle Database 11g: Administration Workshop II Release 2

How To Manage A Data Warehouse On A Database 2 For Linux And Unix

Analyzing IBM i Performance Metrics

Rocket Engineering Corner Mainframe

The Future of PostgreSQL High Availability Robert Hodges - Continuent, Inc. Simon Riggs - 2ndQuadrant

VMware Consolidated Backup: Best Practices and Deployment Considerations. Sizing Considerations for VCB...5. Factors That Affect Performance...

1 Storage Devices Summary

ATA DRIVEN GLOBAL VISION CLOUD PLATFORM STRATEG N POWERFUL RELEVANT PERFORMANCE SOLUTION CLO IRTUAL BIG DATA SOLUTION ROI FLEXIBLE DATA DRIVEN V

Backup/Recovery Strategy and Impact on Applications. Jacek Wojcieszuk, CERN IT Database Deployment and Persistancy Workshop October, 2005

DSK MANAGER. For IBM iseries and AS/400. Version Last Updated September Kisco Information Systems 7 Church Street Saranac Lake, NY 12983

Business Continuity and Disaster Survival Strategies for the Small and Mid Size Business.

always on meet the it department PROPHET managed services ebook Business Group Meet the Always On IT Department

IBM Global Technology Services November Successfully implementing a private storage cloud to help reduce total cost of ownership

Understanding Backup and Recovery Methods

Protecting Microsoft SQL Server

SOLUTION BRIEF KEY CONSIDERATIONS FOR BACKUP AND RECOVERY

Five Reasons Your Business Needs Network Monitoring

Backup and Recovery Solutions for Exadata. Ľubomír Vaňo Principal Sales Consultant

The Microsoft Large Mailbox Vision

Symantec NetBackup 7 Clients and Agents

Benefit from Disaster Recovery... Without a Disaster

Introduction to Microsoft Small Business Server

Oracle Recovery Manager

Oracle Database 11g: Administration Workshop II

Transcription:

Robert Catterall, IBM rfcatter@us.ibm.com DB2 for z/os Backup and Recovery: Basics, Best Practices, and What's New Baltimore / Washington DB2 Users Group June 11, 2015 Information Management 2015 IBM Corporation

Agenda Data backup and recovery more important now than ever Backup and recovery basics Pitfalls things that some folks get wrong Some best practices Backup and recovery-related enhancements delivered with DB2 10 and 11 for z/os 2

Data backup and recovery more important now than ever 3

Recovery: need less likely, speed more important With the growing reliability of hardware and software, data recovery events are more uncommon Higher Likelihood of data recovery event Importance of rapid data recovery Lower Past Present but growing intolerance of application downtime, and growing value of data, put a premium on fast recovery 4

Data unavailability less likely, more costly Some reasons why data recovery events are more uncommon: RAID-based disk subsystems (redundancy of data storage) More solid-state storage devices (literally, fewer moving parts) Greater use of automated operations, and more autonomics built into key subsystems such as DB2 for z/os (reduces chances of human error) Pervasive use of online DB2 REORG (if it fails, only shadow objects affected originals not in RECOVER-pending state Some reasons why data unavailability events are more costly: If your Web site is down, you could lose customers permanently With tight supply chain management, an outage could mean out-of-stock With wired factories, outage could mean idled assembly lines With securities trades, if outage delays trade execution, your company is on the hook for any resulting losses 5

And yet, backup/recovery is under-appreciated Not as sexy as DB2 for z/os and application performance tuning But consider this: an application isn t performing very well when it s down So, pay attention to DB2 backup and recovery 6

Backup and recovery basics 7

Nothing is more important than being prepared If a data loss event COULD occur, you must assume that it WILL occur be ready for it Practice your data recovery procedures On top of that, don t get too set in your ways Review your DB2 data backup and recovery processes and procedures on a regular basis annually, at least Are you taking advantage of backup- and recovery-related enhancements provided by z/os, DB2, and storage systems? Are you aware of data in your DB2 environment that has become more or less critical over time? Do you know what needs to be recovered first? Is the documentation of your DB2 data backup and recovery processes and procedures up to date would you lose critical knowledge if someone on your team were to leave your organization? 8

Some basics For objects that are not read-only, do at least an incremental image copy on a nightly basis Full image copies can be generated weekly Merge incremental image copies into full image copies So DB2 won t have to do that in the event that a recovery is required Keep at least 24 hours of data change information on the active log data sets of a production DB2 subsystem To reduce the likelihood that archive log data sets will be needed for a data recovery operation 9

More basics Partition larger tables So that you can recover individual partitions, versus having to recover the whole thing One of the great things about partition-by-growth universal table spaces: they deliver backup/recovery benefits of partitioning for large tables that do not have a good range-partitioning key Run the MODIFY RECOVERY utility regularly To clear old and unneeded backup records from the SYSCOPY table in the DB2 catalog but see that you retain the records for the two most recent full image copies of every object that you back up The RETAIN option of MODIFY RECOVERY can help in this regard 10

Pitfalls things that some folks get wrong 11

Don t do unnecessary stuff (1) Avoid executing unnecessary image copy jobs At some sites, all table spaces are image copied on a regular basis, including those that have not had any update activity since they were last backed up Wastes CPU cycles, disk space (if you copy to disk more on that later) Table spaces unnecessarily backed up are often of the historical or archival variety Best way to avoid this pitfall: build intelligence into backup procedures Could be accomplished through user programming (often in REXX), along with information from SYSTABLESPACESTATS catalog table (such as COPYUPDATEDPAGES, the number of pages updated since last COPY) Could be accomplished with user programming + IBM-supplied DSNACCOX stored procedure, which uses real-time statistics information to make (among other things) image copy recommendations for database objects Could be accomplished with vendor-supplied DB2 utility automation tool 12

Don t do unnecessary stuff (2) Don t run DB2 QUIESCE utility if you don t need to In the past, QUIESCE was routinely run to establish a log point to which a table space (or table spaces) could be recovered, with consistency Consistency in this context meaning that data in the table space (or spaces) is not affected by any partially done units of work Starting with DB2 In new-function mode, the RECOVER utility can recover an object (or a set of objects) to ANY log point and ensure consistency, even if that log point was not established via QUIESCE How that s done: RECOVER detects any incomplete URs associated with the target table space(s) at the designated recovery log point, and backs out any changes made by those incomplete URs This change to RECOVER should significantly reduce the need to run the QUIESCE utility And that s good, because as DB2 for z/os workloads have gotten bigger, it s become harder to run QUIESCE without disrupting applications 13

A little more on QUIESCE A unit of work might change data in more than one table space keep that in mind if you re counting on RECOVER s ability to back out in-flight URs at any log point If recovering table space XYZ to a prior point in time, include in the RECOVER job any table spaces also updated by programs that update XYZ Still might run some QUIESCE jobs, especially if that can be done in a non-disruptive fashion Can be useful for establishing a recovery point generated just before the start of a data-changing batch job Can speed up execution of RECOVER (no need to back out incomplete URs if recovery log point was generated via QUIESCE) 14

Don t over-rely on point-in-time recovery These days, many (maybe most) organizations do not have a true batch window (i.e., a time when only batch jobs are running) transactions and batch jobs access DB2 tables Point-in-time (PIT) recovery has speed and simplicity advantages when it comes to recovering from data corruption caused by a batch job logic error or a bad input file (recover to point just before job started) Transaction access to tables that are accessed by a batch job can make PIT recovery unfeasible If transactions are updating the same tables that are updated by a batch job, PIT recovery will undo the good changes made by transactions along with the bad changes made by the batch job In that case, undoing batch job-caused data corruption may require a DB2 log analysis tool (available from IBM and other vendors) that can selectively back out changes made by a particular batch job 15

Don t write DB2 archive logs to tape at least, not initially Problem with tape is that it becomes a serializer (in other words, a bottleneck) when recover jobs are run in parallel and multiple jobs want to read from same archive log data set Better idea: write archive log data sets to disk, then migrate them to tape via HSM (but let them stay on disk for 2 or 3 days before you migrate them to tape) 16

Some best practices 17

Prevent accidental dropping of objects Use RESTRICT ON DROP (option of CREATE and ALTER TABLE) for tables in production DB2 subsystems With that option in effect, dropping table can only be accomplished in one of these two ways: Execute the REPAIR utility with the DROP DATABASE option (not recommended) Issue an ALTER TABLE statement with DROP RESTRICT ON DROP, then drop the table the normal way 18

Image copy indexes on larger tables Do-able since DB2 V6 But not used as much as it should be Advantage: for a large table, there s a good chance that RECOVER of an index will be faster than REBUILD of the same index Advantage: if you lose a table space AND its indexes, you can RECOVER indexes WHILE table space is being recovered if indexes were image copied If you rely on REBUILD INDEX, you will have to complete recovery of the table space before you can start the index-rebuild process 19

Consider range-partitioning large tables by date At one time, this was not recommended, because partitioning by a continuously-ascending key was not recommended Reason: you were limited to 254 partitions, and there was concern that you d hit the wall (i.e., the last partition) sooner than desired That changed with table-controlled partitioning (DB2 V8) Up to 4096 partitions You could have a week of data in each partition, and after 20 years you d have used just over 25% of the partition limit ALTER TABLE DROP PARTITION is a known requirement I think that DB2 development will deliver that before you run out of date-based partitions If only data in current partition is updated, no need to repeatedly image copy older partitions 20

Some backup and recoveryrelated enhancements delivered with DB2 10 and 11 for z/os 21

Dynamically add active log data set via command Before DB2 10: if there is trouble with log archiving, and the active log data sets aren t being offloaded as needed and they fill up, you ve got a real problem The DB2 subsystem essentially grinds to a halt To give yourself some breathing room to address the archiving difficulty, you need to add one or more additional active log data sets To add active log data sets, you had to run the DSNJU003 utility To run DSNJU003, DB2 must be down To shut down properly, DB2 needs to write some information to the active log BUT THE ACTIVE LOG IS FULL!!! 22

DB2 10 to the rescue New option for the -SET LOG command: NEWLOG Allows you to add a newly defined data set to the active log inventory Assuming that DB2 can open the data set, it will be immediately available for use, with no need to recycle the DB2 subsystem\ So, you first define the new active log data set with IDCAMS Recommended that you also format the new data set via the DSNJLOGF utility, so that DB2 won t have to do this after opening the data set Issue the -SET LOG NEWLOG command twice to add a new active log data set pair (LOGCOPY1 and LOGCOPY2), if you re doing dual logging 23

Another DB2 10 feature: backward log recovery Consider this scenario: You image copy a table space 23 hours later a batch job kicks off and inserts some bad records into the table space You want to recover the table space to a point in time just before the bad-insert batch job started Given that scenario, what could you do in a pre-db2 10 system? You could run a standard RECOVER job DB2 would restore the most recent image copy of the table space (produced 23 hours ago) and would apply logged data changes from that point forward until reaching the desired recovery point 24

DB2 10: BACKOUT YES New option for RECOVER TABLESPACE UTILITY When specified, RECOVER will start with the target object in its current state (there s no restore of an image copy) and will back logged data changes out until the desired recovery point is reached And if there are any incomplete URs associated with the table space at that recovery point, RECOVER will back those out to ensure that the data in the table space is consistent Result can be significantly reduced RECOVER elapsed time 25

DB2 11: PIT recovery and pending DDL With DB2 10, if pending DDL changes for a table space are materialized via an online REORG, you cannot recover the table space to a point in time prior to that materializing REORG With DB2 11 in new-function mode, that restriction is partially removed You can recover a partition-by-range universal table space (or a LOB table space or an XML table space) to a point in time prior to an online REORG that materialized pending DDL changes for the table space The pending DDL-materializing online REORG must have been run in a DB2 11 NFM environment Following the recovery to the PIT prior to the materializing REORG, the table space will be in a hard REORG-pending state (REORP), and a subsequent REORG will be required to make the data available to applications 26

And that s all thanks for your time Robert Catterall rfcatter@us.ibm.com 27 2014 IBM Corporation