M ODULE 3 D ATABASE M ANAGEMENT Section 5 Database Backup and Recovery 1 ITEC 450 Fall 2012.

Slides:



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

Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
Recovery CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Backup and recovery Basics of Backup and restoration Types of recovery Defining strategy Starting up and shutting down 80/20 rule SLA’s.
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.
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
Backup and Recovery Part 1.
Harvard University Oracle Database Administration Session 11 Database Recovery.
Database Backup & Recovery David Konopnicki. Introduction A major responsibility of the database administrator is to prepare for the possibility of hardware,
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.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
Oracle9i Database Administrator: Implementation and Administration
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
Introduction to Oracle Backup and Recovery
Using RMAN to Perform 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.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
Backup & Recovery Concepts for Oracle Database
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
Oracle 10g Database Administrator: Implementation and Administration
Recovery Manager Overview Target Database Recovery Catalog Database Enterprise Manager Recovery Manager (RMAN) Media Options Server Session.
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.
15 Copyright © 2005, Oracle. All rights reserved. Performing Database Backups.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
©2006 Merge eMed. All Rights Reserved. Energize Your Workflow 2006 User Group Meeting May 7-9, 2006 Disaster Recovery Michael Leonard.
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.
A Guide to Oracle9i1 Database Instance startup and shutdown.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
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.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
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.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Oracle Standby Implementation Tantra Invedy. Standby Database Introduction Fail over Solution Disaster Recovery Solution if remote Ease of implementation.
RMAN Maintenance.
Database recovery contd…

Database Administration
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
Oracle9i Database Administrator: Implementation and Administration
Performing Database Recovery
Chapter 5 The Redo Log Files.
Database Backup and Recovery
Presentation transcript:

M ODULE 3 D ATABASE M ANAGEMENT Section 5 Database Backup and Recovery 1 ITEC 450 Fall 2012

I NTRODUCTION TO B ACKUP AND R ECOVERY Backup is the process of making some kind of copies of parts of a database, or an entire database Recovery is the process of rebuilding a database after some part of a database has been lost Restoration is the process of copying files from a backup Recovery is the process of executing procedures in Oracle Database to update the recovered backup files to an up to date state Fall ITEC 450

W HAT IS B ACKUP ? Fall ITEC 450

W HAT IS R ESTORATION ? Fall ITEC 450

C ATEGORIES OF D ATABASE F AILURES Instance failures – service interruption, no data loss DBMS internal exception Operating system failure Hardware-related failures except storage media: CPU, Memory board, disk controller Human error – hardest to prevent, data issue Programs are run at the wrong time, wrong order, or wrong input Media failure – data unavailable, recovery needed Disk damage, file system failures, data file deletion Tape degradation or damage Fall ITEC 450

D ATABASE B ACKUP C HOICES Backup strategies are driven by the recovery requirements. Full and incremental backups Full – a complete copy at the time the backup was run. Incremental (differential) – the backup of changes since the last full or incremental backup Consistent and inconsistent backups Consistent – the data in the backup is from a same point in time Inconsistent – the backup is done while the database is open and there are changes Physical and logical backups Physical – copy physical data files to a backup device Logical – export of (selected) data from database to a file or a backup device Fall ITEC 450

B ACKUP G UIDELINES The DBA must assure a recoverable environment. Make at least two copies of backup to avoid a single point of failure such as a damaged tape Coordinate local backup strategy with disaster recovery strategy Consider backups to disk, and then migrating to tape Be sure to include the system catalog objects in the backup Verify the correctness of the backup once a while Database data and application metadata should be backed up at the same time. Fall ITEC 450

B ACKUP L EVELS AND C OVERAGE Backup levels Level 0 (full) – a full backup of the database: all physical files associate the database Level 1 (cumulative) – a backup of all of the data that has changed since the last level 0 backup Level 2 (incremental) – a backup of all of the data that has changed since the last backup of any level (0, 1 or 2) Backup coverage Log archiving – it is required for up-to-time recovery System catalog – containing backup and recovery information Database object definition – It’s nice to have it over time to track what changed, and be able to recreate objects if necessary Fall ITEC 450

R ECOVERY S TEPS Identify the failure Analyze the situation Determine what needs to be recovered Locate the required image copy backup Restore the image copy backup Roll forward through the database log Fall ITEC 450

R ECOVER TO C URRENT Recovery to current usually responds to a media failure, such as accidentally deleted, or disk crashed. Restored database can be from full, cumulative, and/or incremental. Fall ITEC 450

P OINT -I N -T IME R ECOVERY The PIT recovery responds non-media failures, such as application-level problem or user error. It will restore the whole database back to the time before the error. All changes between the time of the error and current will be rolled back. Recovery description: Restore whole database backup Apply the database change logs from the time of backup to the time just before the error Open the database as the moment before the error Fall ITEC 450

W HAT IS R ECOVERY ? Redo logs and archive logs consist of records of all transactions made to a database Controlfiles contain pointers to datafiles, dictating where datafiles should be in relation to redo log entries If a datafile is restored from a backup, then the controlfile will be ahead of the datafile in time Restoration of recovered backup is a simple process of applying redo log entries to the datafile, until the datafile “catches up” to the time indicated by controlfile Archive logs are copies of old redo log files, copied just before redo log files are reused Restoration can utilize entries in both redo log files and archive log files to complete a recovery Fall ITEC 450

T RANSACTION R ECOVERY Transaction recovery addresses an error from a specific transaction. respond non-media failures, such as application-level problem or user error. Recovery options are: PIT recovery – remove all changes including the error and other transactions UNDO recovery – remove only the effects of the bad transaction REDO recovery – PIT recovery and then redo the good transactions only Fall ITEC 450

A LTERNATIVES TO B ACKUP AND R ECOVERY Other high-availability alternatives can be used: Standby database or database mirroring – an identical copy of an online production database that is close to being up-to-date. Data replication or transactional replication – storing and maintaining redundant data in a separate database Hardware redundancy with disk replication locally or remotely – allocating a secondary device that contains a duplicate copy of the primary device Fall ITEC 450

D ISASTER P LANNING Disaster recovery planning, also called contingency planning is the process for: Any unplanned, extended loss of critical business applications due to lack of computer processing capabilities for more than a 48-hour period. Any event that has a small chance of transpiring, a high-level of uncertainty, and a potentially devastating outcome. Examples: floods, earthquakes, hurricanes, fires, terrorist attacks Fall ITEC 450

D ISASTER R ECOVERY G UIDELINES The goals are to minimize downtime and loss of data. Analyze business risks, and not technical needs and issues Rank applications into groups Plan for enterprise wide business functions and operational activities Build an off-site location Establish a written plan and distribute to all key personnel Testing disaster plans Fall ITEC 450

D ATABASE P LANNING FOR D ISASTER R ECOVERY Database strategies for disaster recovery: Tape backups, and ship them to the remote site Storage management software to make point-in- time copies of entire disk packs Remote mirroring of data to the alternate site over the network Standby or database mirroring at a different physical site from the primary database location Fall ITEC 450

M ODULE 3 D ATABASE M ANAGEMENT Section 6 Oracle Backup and Recovery 18 ITEC 450 Fall 2012

B ACKUP AND R ECOVERY C ONCEPTS Archivelog and noarchivelog modes Archivelog – Oracle saves the filled redo logs as archivelogs. You may recover the database to any point in time. Noarchivelog – Oracle overwrites the filled redo logs. You can’t recover the database changes since the last cold backup took place. Restoring and Recovery Restoring a database means copying the physical files from a backup medium. Recovery is the process of updating database files restored from a backup with the changes made to the database after the backup, typically using redo log files. Fall ITEC 450

C ONSISTENT AND I NCONSISTENT B ACKUPS Consistent Backups (closed, cold) To make a consistent backup, the database is shutdown cleanly and remain closed for the duration of the backup. All committed changes are written to the datafiles, so the datafiles are in a transaction-consistent sate. When you restore your datafiles from a consistent backup, you can open the database immediately. Inconsistent Backups (open, online, hot) If a database is in ARCHIVELOG mode, then you can make inconsistent backups that are recoverable using archived redo log files. The redo logs must be archived and then backed up with the datafiles to ensure recoverability. An inconsistent backup is robust a form of backup as a consistent backup. It is common for production environments. Fall ITEC 450

M ETHODS OF B ACKUP AND R ECOVERY Two basic methods of backup and recovery: Cold backups Hot backups Fall ITEC 450

T OOLS FOR B ACKUP AND R ECOVERY Tools used for backup and recovery of an Oracle database are as follows: Export and Import Utilities Backup Mode Tablespace Copies RMAN (Recovery Manager) Oracle Enterprise Manager and the Database Control Fall ITEC 450

W HAT IS A C OLD B ACKUP ? Fall ITEC 450

C OLD B ACKUPS For a cold backup, shut down the database completely and then copy all the files All datafiles All redo log files All archive log files All controlfiles Optionally you can also back up parameter files and any networking configuration files Restore at least all the datafiles and controlfiles Optionally use more current redo log files, archive log files, and controlfiles—allowing a recovery by applying redo log entries to datafiles Fall ITEC 450

W HAT IS A H OT B ACKUP ? Hot backup: performed when DB is online, active, and available for use Many tools and methods for performing hot backups Takes a snapshot of a database one file or type of file at a time Not necessarily consistent across all files in backup Made of pieces of a DB, where those files making up a complete DB backup are not recoverable to a working database as a group Individual files can be slotted into a running DB, and can be recovered individually, or as a group Fall ITEC 450

S ETTING THE D ATABASE IN A RCHIVE L OG M ODE In archive log mode, the database will create archive logs for you Archive logs are files that are copied from redo logs when a redo log file is switched out for recycling Redo logs contain entries of all transactional activity in a database as transactions occur Redo logs are recycled If a redo log is recycled, unless the redo log is copied to an archive log, all entries in that redo log group are effectively lost A database must be in archive log mode to duplicate redo logs to archive logs Fall ITEC 450

S ETTING THE D ATABASE IN A RCHIVE L OG M ODE ARCHIVE LOG LIST; ARCHIVE LOG STOP; SHUTDOWN IMMEDIATE; STARTUP MOUNT; ALTER DATABASE NOARCHIVELOG; ALTER DATABASE OPEN; SHUTDOWN IMMEDIATE; STARTUP MOUNT; ALTER DATABASE ARCHIVELOG; ALTER DATABASE OPEN; Fall ITEC 450

C ONSISTENT B ACKUPS U SING E XPORTS Export can be used to create a consistent backup Export can scan through all types of data, including tables, redo and archive logs, and undo data Allows for a consistent backup (export) based on a snapshot of data In other words, regardless of any changes occurring to DB, during an export, the export utility will read datafiles and undo space to get a consistent backup Examples: exp file=classmate.dat owner=classmate consistent=Y exp file=classmatetables.dat tables=(client,customer) Fall ITEC 450

T ABLESPACE B ACKUPS In a tablespace backup, you switch a tablespace into a special mode called backup mode This allows a physical operating system-level copy of that tablespace In Oracle 10 g, allows a backup mode setting to be applied to all tablespaces at once Problem with backup mode is a performance issue Forces all change activity for that tablespace to be copied to the redo logs If there are enough redo entries produced to recycle a redo log group, then archive log files will be used too The longer a tablespace remains in backup mode, the more performance is affected, the longer any potential recovery is, and more redo log data is produced Fall ITEC 450

O THER A PPROACHES TO B ACKUP AND R ECOVERY Fall ITEC 450

C ONFIGURATION OF B ACKUP AND R ECOVERY Configure a flash recovery area – storing most backup related files Run database in ARCHIVELOG mode It is required for online backup It enables recovery options such as compete and point-in-time media recovery RMAN is the backup and recovery tool for Oracle database. Fall ITEC 450

O RACLE R ECOVERY S TRATEGY Response to media failure – recovery to current Response to non-media failure – PIT recovery, flash back Instance failure – Oracle performs instance recovery automatically: all you need to do is restart the database. A power outage causes the server to crash The server becomes unavailable because of hardware problems The operating system crashes One of the Oracle background processes fails. You issue a SHUTDOWN ABORT statement Fall ITEC 450

W RAP U P Assignment 8-1 Using a specific DBMS example to present database security management Hands-on practice to understand Oracle security: create a user, try to login and create a table Detailed steps are on the course website Assignment 3-1-3: Lab3 – Backup and Recovery Reference to “assginment3-1-3 help.pdf”, otherwise take you a lot of effort to read Oracle documents Hands-on practice: Cold backup Hands-on practice: Hot backup Challenges and technical Fall ITEC 450