Backup & Recovery 1.

Slides:



Advertisements
Similar presentations
Best Practices for Backing Up Your System
Advertisements

® IBM Software Group © IBM Corporation QUY Thai Duy – ITFac DLU Lesson 7: Movement, backup and restore data.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Oracle Architecture. Instances and Databases (1/2)
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
File Management Systems
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 121 Today’s class Operating System Machine Level.
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Database Backup and Recovery
Backup and Recovery Part 1.
Configuring Recovery Manager
4 Copyright © 2008, Oracle. All rights reserved. Configuring Backup Specifications.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
CHAPTER 18 RMAN Backups and Reporting. Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived.
Using RMAN to Perform Recovery
Navigating the Oracle Backup Maze Robert Spurzem Senior Product Marketing Manager
Backup & Recovery Concepts for Oracle Database
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Recovery Manager Overview Target Database Recovery Catalog Database Enterprise Manager Recovery Manager (RMAN) Media Options Server Session.
Database Administration TableSpace & Data File Management
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
5 Copyright © 2008, Oracle. All rights reserved. Using RMAN to Create Backups.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Maintaining File Services. Shadow Copies of Shared Folders Automatically retains copies of files on a server from specific points in time Prevents administrators.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
7202ICT – Database Administration
Mark A. Magumba Storage Management. What is storage An electronic place where computer may store data and instructions for retrieval The objective of.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
High Availability in DB2 Nishant Sinha
CS333 Intro to Operating Systems Jonathan Walpole.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
File Systems cs550 Operating Systems David Monismith.
11.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 11.5 Free-Space Management Bit vector (n blocks) … 012n-1 bit[i] =  1  block[i]
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
IT Database Administration Section 05. Rollback Segments: An Introduction  What are they?  Space within a database used to store “before” images.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
Oracle Database Architectural Components
Unit 8: Database and Storage Pool Backup and Recovery.
Database Recovery Techniques
Jonathan Walpole Computer Science Portland State University
Maintaining Windows Server 2008 File Services
Recovery Catalog Creation and Maintenance
Chapter 9: Virtual-Memory Management
Process Description and Control
Performing Database Recovery
Presentation transcript:

Backup & Recovery 1

Agenda Backup Types Backup Process Model Backup Performance Tunning Restore Types Restore Process Model Restore Performance Tunning RollForward Performance Tunning 2

Backup Backup Types Online or Offline Database Level backup or Tablespace Level backup Full, Incremental or Delta 3

Offline Backup Database needs to be offline Internally establishes connection to the specified database Faster than online Default option 4

Online Backup Database is accessible Needs archival logging enabled Slower than offline backup Log files are included by default Incremental and delta 5

Incremental Backup Copy of all data that has been updated since the last full successful backup Cumulative backup Need to maintain only the last incremental backup and last full backup Database parameter TRACKMOD should be enabled Incremental backup is not permitted until a full backup is taken to set a base from which it can recover 6

Incremental Delta Backup Copy of all data that has been updated since the last any successful backup (full, incremental or delta) Non cumulative Need to maintain all backup images since the last full backup 7

Incremental Backup Granularity of tracking is at Tablespace level Entire Large Objects are backed up if any other object in that Tablespace is modified Normal data is backed up only if it has changed In addition to the changed data incremental backup also includes the database's metadata Not enabled by default due to minimal performance impact while tracking changes 8

Backup Process Model db2bm Buffer Manipulator Reads data from the disk and writes into shared memory buffer db2med Media Controller Reads from shared memory buffer and writes the pages out to the target devices db2agent Controls the flow between db2bm and db2med 9

Backup Process Model db2bm Controlled by PARALLELISM option Reads data from disk into backup buffer Sends full buffer message on the full queue for db2med 10

Backup Process Model db2bm Function stack trace while waiting for the next available buffer sqluReadAdrFromQueue sqlubGetNextBuffer Function stack trace while reading pread64 sqloReadBlocks Function stack trace after completing reading data sqluReadMessageFromQueue sqlubbuf 11

Backup Process Model db2med Controlled by number of output destinations or Open Sessions clause when using TSM Reads data from full buffers and writes to the media Sends empty buffer message on the empty queue for db2bm 12

Backup Process Model db2med Function stack trace while waiting for full buffer notification sqluReadAdrFromQueue sqluMCContinueBackup Function stack trace while writing write sqlowrite 13

Backup Process Model db2agent Responsible for setting up the message queues and spawn db2med and db2bm Once backup starts db2agent process will wait for the backup complete notification Function stack while waiting for notification sqluReadMessageFromQueue SqluxReadAgentQueue sqlubcka 14

Backup Process Model Message queues. Communication between db2agent, db2bm and db2med is managed by message queues Following message queues created 1 message queue for the db2agent 1 message queue for full buffers 1 message queue for empty buffers 1 message queue for each db2bm edu 1 message queue for each db2med edu 15

Backup Process Model db2med with TSM db2vend process used db2med invokes the TSM code inside db2vend 16

Backup Process Model db2vend Independent process to execute the vendor API code Similar to db2fmp Runs outside DB2 address space Prevents unexpected API errors from crashing DB2 17

Backup Performance Tuning Backup command options WITH num-buffers BUFFERS PARALLELISM n BUFFER buffer-size 18

Backup Performance Tuning Backup command options WITH num-buffers BUFFERS Use at least twice as many buffers as backup sessions which will not cause the target devices to wait for data PARALLELISM n Number of processes that are started to read data from the database Set n equal to the number of tablespaces being backed up BUFFER buffer-size Buffer-size is a multiple of the table space extent size plus one page 19

Backup Performance Tuning If no options specified optimal values for number of buffers buffer size and parallelism are selected automatically db2diag.log entry shows the values that are selected FUNCTION: DB2 UDB, database utilities, sqluxGetDegreeParallelism, probe:537 DATA #1 : <preformatted> Autonomic BAR - using parallelism = 10. FUNCTION: DB2 UDB, database utilities, sqlubTuneBuffers, probe:898 Autonomic backup - tuning enabled. Using buffer size = 4481, number = 10. 20

Backup Performance Tuning UTIL_HEAP_SZ Uitlity Heap Size Maximum memory that can be used simultaenously by Backup, Restore and LOAD Used for backup buffers More than buffer-size * number of buffers 21

Backup Performance Tuning Fragmentation db2bm reads contiguous blocks of data Fragmentation due free extents can affect performance REORG should be done to reduce fragmentation 22

Backup Performance Tuning Prefetching I/O performed by db2bm if tablespace has only one container I/O performed by Prefetchers (db2pfchr) for tablespace with multiple containers Parallel I/O improves performance 23

Backup Performance Tuning Contention during online backup db2bm must guarantee that the block of data being backed up does not change during the read operation db2bm will wait on other shared users to complete their I/O operations to get exclusive access db2n 24

Backup Process Model 25

Restore Restore Types Full database restore Tablespace restore Redirect restore Incremental Restore 26

Redirect Restore Used to restore database on a different machine Restores tablespaces to a different location Add, Change or remove containers of a DMS tablespace Modify containers of a SMS tablespace 27

Redirect Restore Issue RESTORE command with REDIRECT option db2 restore db sample redirect Use SET TABLESPACE CONTAINERS command for each tablespace to specify the new container location db2 set tablespace containers for 2 using (path '<path>') Issue RESTORE command with CONTINUE option db2 restore db sample continue 28

Redirect Restore Automatic Storage Use ON option to set the path for automatic storage tablespaces db2 restore db sample on <path> redirect If no normal tablespaces then CONTINUE command db2 restore db sample continue 29

Incremental Restore Identify and restore the last incremental backup image This restore only restores the metadata and not the actual data Identify and restore the most recent full backup image Restore the last incremental backup image again This time the actual data will be restored 30

Incremental Restore Use db2ckrst utility to get the correct restore sequence db2ckrst -d <dbname> -t <timestamp> Timestamp should be that of the last incremental backup you want to restore Reads the database history file to give the correct restore sequence 31

Redirect Incremental Restore Restore Incremental backup image first db2 restore db sample incremental taken at <ts2> redirect SET TABLESPACE CONTAINERS command db2 set tablespace containers for 5 using (file '<path>') CONTINUE command db2 restore db sample continue Restore the full backup and incremental after this db2 restore db mydb incremental taken at <ts1> db2 restore db mydb incremental taken at <ts2> 32

Restore Process Model db2bm Buffer Manipulator Reads data from buffer and writes to the disk db2med Media Controller reads from the backup image and writes to the buffer db2agent Controls the flow between db2bm and db2med 33

Restore Performance Tunning Increase the restore buffer size Multiple of the backup buffer size specified during the backup operation Increase the number of buffers Increase the value of the PARALLELISM parameter More number of db2bm will be used for write operation Increase the utility heap size Tablespaces with multiple containers will benefit from parallel I/O Multiple page cleaners (db2pclnr) will write data parallely 34

Restore Performance Tunning Increase the restore buffer size Multiple of the backup buffer size specified during the backup operation Increase the number of buffers Value of the PARALLELISM parameter equal to number of tablespaces One db2bm for each tablespace will be used for write operation Increase the utility heap size Tablespaces with multiple containers will benefit from parallel I/O Multiple page cleaners (db2pclnr) will write data parallely 35

Restore Performance Tuning If no options specified optimal values for number of buffers buffer size and parallelism are selected automatically db2diag.log entry shows the values FUNCTION: DB2 UDB, database utilities, sqluxGetDegreeParallelism, probe:537 DATA #1 : <preformatted> Autonomic BAR - using parallelism = 14. FUNCTION: DB2 UDB, database utilities, sqludTuneBuffers, probe:898 Autonomic restore - tuning enabled. Using buffer size = 3841, number = 14. 36

Restore Process Model 37

RF Performance Tunning PREC_NUM_AGENTS Recovery agents (db2redow) PREC_NUM_AGENTS=number of online CPUs+1 PREC_NUM_QSETSIZE Message Queue size Increase it if you reduce the PREC_NUM_QSETS PREC_NUM_QSETS Number of message queues Decrease the size if PREC_NUM_QSETS is a high value 38

RF Performance Tunning Setting the parameters Create DB2BPVARS.cfg file with the following details PREC_NUM_AGENTS=<value> PREC_NUM_QSETS=<value> PREC_NUM_QSETSIZE=<value> db2set DB2BPVARS=<path to file/DB2BPVARS.cfg> Recycle the instance 39

RF Performance Tunning db2diag.log entry FUNCTION: DB2 UDB, recovery manager, sqlpAllocatePRCB, probe:2000 DATA #1 : <preformatted> Using parallel recovery with 9 agents 16 QSets 48 queues and 0 chunks PREC_NUM_AGENTS=9 PREC_NUM_QSETS=16 PREC_NUM_QSETSIZE=4 40

Thank You 41