Database Backup and Recovery

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Advertisements

Backing Up a Hard Disk CGS2564. Why Backup Programs? Faster Optimized to copy files Can specify only files that have changed Safer Can verify backed up.
ITEC474 Control File Maintenance
DataBase Administration Scheduling jobs Backing up and restoring Performing basic defragmentation and index rebuilding Using alerts Archiving.
©2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 5 Slide 1 IT390 Business Database Administration Unit 5 :
Chapter 12 - Backup and Disaster Recovery1 Ch. 12 – Backups and Disaster Recovery MIS 431 – Created Spring 2006.
Harvard University Oracle Database Administration Session 10 Database Backups.
Backup The flip side of recovery. Types of Failures Transaction failure –Transaction must be aborted System failure –Hardware or software problem resulting.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Advanced Databases DBA: Backups 1. Advanced Databases Agenda Define backup Discuss Backup Terminology Explain various backup and restore options in Oracle.
Database Backup and Recovery
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
Harvard University Oracle Database Administration Session 11 Database Recovery.
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
Oracle backup and recovery strategy
1. Preventing Disasters Chapter 11 covers the processes to take to prevent a disaster. The most prudent actions include Implement redundant hardware Implement.
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
Navigating the Oracle Backup Maze Robert Spurzem Senior Product Marketing Manager
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
NovaBACKUP 10 xSP Technical Training By: Nathan Fouarge
Backup & Recovery Concepts for Oracle Database
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Oracle 10g Database Administrator: Implementation and Administration
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies.
M ODULE 3 D ATABASE M ANAGEMENT Section 5 Database Backup and Recovery 1 ITEC 450 Fall 2012.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
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.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
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.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
Mark A. Magumba Storage Management. What is storage An electronic place where computer may store data and instructions for retrieval The objective of.
11 DISASTER RECOVERY Chapter 13. Chapter 13: DISASTER RECOVERY2 OVERVIEW  Back up server data using the Backup utility and the Ntbackup command  Restore.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
16 Copyright © 2005, Oracle. All rights reserved. Performing Database Recovery.
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.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
Local Area Networks, 3rd Edition David A. Stamper
Database recovery contd…
SQL Backups for Beginners by Mark Gordon
Database Administration
Backup and Recovery.
Maintaining Windows Server 2008 File Services
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
SQL Backups for Beginners by Mark Gordon
Performing Database Recovery
Presentation transcript:

Database Backup and Recovery One problem: media flaws. Note that if you’re overwriting a file with a newer version of the same, and you hit a bad block, neither the old or new is consistent.

Keeping backups E.g., Daily backups for 7 days, then weekly backups for 8 weeks, then monthly backups for 12 months, then yearly backups. Keep backups off-site RAID reduces failures, but doesn’t give backups Losing 1 day might be unacceptable! Reconstruct instantaneous backups via log files. RU keeps two copies of Fri backup, one off-site. How would *you* do try to keep all data working?

Log Files “Dear journal: today I updated phone# for…” Captures all database transactions (changes) in order to roll a database forward after a tape recovery. Oracle logs each :old and :new Log files should be stored on a separate drive from the data files Log files in Oracle can be multiplexed (mult copies); less common since RAID does this. Every entry in the log has a system-change-number (a sequence used for updates)

Log Modes No Archive Log Mode Archive Log Mode Also called circular logging When the final redo log file in a set fills up, the first redo log file is overwritten Lacks: guaranteed point in time recovery Archive Log Mode The on-line redo logs are archived and numbered before they overwritten Allows point-in-time recovery of the database Requires: more disks ($$)

Backup Modes Hot backup Cold backup allows backup of the database while the database is running and available to users. performance degrades during the backup period takes longer than a cold backup Cold backup requires database shutdown before backup begins physical files are backed up while shutdown database is unavailable to users during backup period faster than a hot backup; no timing issues

Oracle Backup Options Off-line physical backup On-line physical backup is a cold backup technique copies data files, log files, init files, and control files after shutdown On-line physical backup is a hot backup technique temporarily sets tablespaces into backup mode Logical Backup exports all or part of the database by creating SQL scripts necessary to recreate the objects

Off-line physical backup Shut down the database Backup the data files Backup the control files Backup the online redo log files or the archive log files Backup the initialization and password files Restart the database

On-line physical backup Requires the DB to be in Archive Log Mode For each tablespace Set the tablespace into a backup state: read-only, but keep log Backup the datafiles for that tablespace Restore the tablespace to its normal state Backup the archived redo log files Stop the archiving process Note which files are in the archive log directory Restart the archiving process Delete the archived redo log files Backup the control file using the “Alter database backup controlfile” command Backup the initialization and password files E.g. One tablespace for accounting tables, another for registration, etc. DB Admin can assign tablespaces to particular discs. While the table is in backup-mode, any reads read the frozen version followed by the change log. When backing up, it’ll remember the transaction# when the backup started, and backup *all* table spaces to that same point, so that the backup-across-all-tablespaces is consistent. Companies will do test-recoveries in a sandbox; "The only thing worse than not backing up is to *think* you were backing up”. When bob's boss comes saying "I had an email two days ago but accidentally deleted it. Please recover." The program didn't have an option ' best sol'n (Microsoft Exchange server, which sits on top of SQL server, which runs in archive log mode) -- they made a utility which xfers the backup tape to the disc, e-mail used to be one-message-per-file, but that doesn't scale. Now, mail are databases. (e.g. Entourage).

Logical Backup Back up tables -- not disks/files per se Essentially creates SQL scripts that will recreate database objects Use Oracle Export Utility to create .dmp file Use Oracle Import Utility to selectively import database objects from the .dmp file Can perform Complete database backup User (schema) backup Individual table backup Used in conjunction with a recovery server to recover selected objects (not entire database) easy; can be done by end-user: "begin transaction; select * [write to disk]; end transact" Oracle's the .dmp file includes all triggers, , etc. (In a physical backup, you back up files; in a logical database, you back up objects. much slower than a file-level backup.) "Backups are why database administrators are well-paid". In certification courses, there are several exams; one exam is *just* on backing up and restoring. Hurricane Andrew -- 70% of companies that lost their data were bankrupt within 3mos (they had no idea what customers owed them money -- or even what customers they have!) Ask to raise hands: how many people have lost a hw due to a lost file? how many people have had a hard drive fail? how many haven't?

Backup Types Complete (Full) Cumulative (Differential) Incremental copy all database and related files delete the archive log files Cumulative (Differential) copy all archive log files Essentially copies transactions since last full backup clear the archive bit on the log files Incremental copy all archive log files that haven’t already been backed up Essentially copies all transactions since last backup of any kind clear the archive bit on the log files copied Complete (Copy) copy all target data Don’t delete or clear the archive bit on an data files so as not to interfere with normal backup schedule oracle approaches incremental backups by block: each block has a bit 'has this block changed' Another approach: just backup the archive log files for that day. A "differential backup" includes all changes since last full backup; a "incremental backup" only includes changes since last incremental. So suppose: Sunday you did full backup; monday incremental; adn tues afternoon you have a failure. What steps do you need? (three). What if you made a incremental on Tuesday -- how many steps? (four) What if you had done a diff *and* incremental on tues -- only need three steps: sunday restore; tuesday diff [from sunday]; then back up from live log files. The "complete (copy)" is something not part of your usual routine -- it's something you do just do to make a sandbox restore or something. Because RU is part of Oracle Initiative, there is a 40% discount on courses and exams. Studies show that some certifications have some small value, and others are useless. Often when you get a job, the first thing the company will do is send you to a training course.

Oracle Files Overview 343 342 341 1 2 A B C PW Password File Files open when instance is running PW 343 342 341 Password File Data files (for tablespace data) 1 2 A B C Archive Log Files Init. ora Initialization File Control Files On-line redo log files