1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888) 235-8916

Slides:



Advertisements
Similar presentations
LA Oracle Users Group Succeeding with RMAN Tim Gorman Principal SageLogix, Inc.
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
ITEC474 Control File Maintenance
CERN - IT Department CH-1211 Genève 23 Switzerland t Backup & Recovery with RMAN LCG 3D Workshop, Bologna June 12 th, 2007 Jacek Wojcieszuk.
Backup and recovery Basics of Backup and restoration Types of recovery Defining strategy Starting up and shutting down 80/20 rule SLA’s.
1 Chapter 15 Duplicating Databases and Transporting Data.
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
RMAN Restore and Recovery
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.
Oracle’s Backup and Recovery Tool
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.
Backup & Recovery with RMAN
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
CHAPTER 17 Configuring RMAN. Introduction to RMAN RMAN was introduced in Oracle 8.0. RMAN is Oracle’s tool for backup and recovery. RMAN is much more.
The Oracle Recovery Manager (RMAN)
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CHAPTER 18 RMAN Backups and Reporting. Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived.
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
Backup Infrastructure – Additional Information Gordon D. Brown, RAL Carlos Fernando Gamboa, BNL 3D Workshop, CNAF, Bologna, Italy 13 th June 2007.
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.
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.
Recovery Manager Overview Target Database Recovery Catalog Database Enterprise Manager Recovery Manager (RMAN) Media Options Server Session.
SRUTHI NAGULAVANCHA CIS 764, FALL 2008 Department of Computing and Information Sciences (CIS) Kansas State University -1- Back up & Recovery Strategies.
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.
Backup and Recovery Protects From Data Loss. Backup and Recovery Protects From Data Loss Provides for Media Recovery.
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.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
11g(R1/R2) Data guard Enhancements Suresh Gandhi
A Guide to Oracle9i1 Database Instance startup and shutdown.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
7 Copyright © 2004, Oracle. All rights reserved. Recovering from Noncritical Losses.
Chapter 8Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 8 Complete Recovery with Recovery Manager.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
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.
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.
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.
10 Copyright © 2007, Oracle. All rights reserved. Using RMAN Enhancements.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
RMAN Maintenance.
RMAN Maintenance.
Recovery Catalog Creation and Maintenance
Database Recovery.
Duplicating a Database
Using the RMAN Recovery Catalog
Performing Database Recovery
Chapter 5 The Redo Log Files.
Oracle 12c Multitenant Database
Presentation transcript:

1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888)

2 Agenda Introduction Create a Catalog & Configure Key Parameters Backup and Validate with RMAN Scripts Recover a DB with RMAN Duplicate a DB with RMAN Wrap Up

3 Getting The Most Out of RMAN Introduction

4 Who Is This Guy? Technology Consultant for various customers World-Wide –Leverage the advantages of Remote Support to offer customers Senior-level expertise at affordable prices –Customers on six continents Specialties Include –Oracle DBA –Complete System Performance Diagnostics and Tuning

5 Who Is In The Audience? –Oracle DBA –Database Manager –Responsible for Disaster Recovery –Anybody else?

6 What Is He Talking About? Recovery MANager –Configure it –Use it Backup Databases Recover Databases Duplicate Databases –Monitor it Reports Validation

7 Why Do I Care? RMAN simplifies backup and restore –Central Catalog for all backup metadata –Reusable backup scripts in the Catalog RMAN simplifies DB cloning –Use the Catalog metadata to move a DB RMAN provides backup reporting –Great for Managers and Auditors

8 Getting The Most Out of RMAN Create a Catalog & Configure Key Parameters

9 Can I Use RMAN? RMAN Compatibility Matrix Executable <= target DB Catalog => Executable Target DBExecutableCatalog / – Target DBExecutable+

10 Pro and Con of a Catalog Pro –Keep metadata for all DBs in one place –Keep more historical metadata –Store backup scripts Con –Maintain and Backup an additional DB –Must be online for restores (standard RMAN backup)

11 Create the Catalog Conn as Create user rman identified by rman default tablespace rman temporary tablespace temp; Grant recovery_catalog_owner to rman; Grant connect, resource to rman;

12 Create the Catalog (continued) C:\ Rman target catalog \ RMAN> create catalog; RMAN> register database;

13 Configure RMAN Parameters RMAN> configure retention policy to none; RMAN> configure channel device type disk format ‘c:\orabackup\fttprod\backup\%U’ maxpiecesize 2000M; RMAN> configure exclude for tablespace nolog;

14 Configure RMAN Parameters (continued) RMAN> configure controlfile autobackup on; RMAN> configure controlfile autobackup format for device type disk to ‘c:\orabackup\fttprod\backup\%F’; RMAN> configure snapshot controlfile name to ‘c:\orabackup\fttprod\backup\sncffttprod.ora’; RMAN> show all;

15 Getting The Most Out of RMAN Backup and Validate with RMAN Scripts

16 Create a FULL Backup Script RMAN> create script fullbu { Crosscheck backup; Crosscheck archivelog all; Backup database; Sql ‘alter system archive log current’; Backup archivelog all not backed up 2 times delete input; Backup current controlfile; Report unrecoverable; Report obsolete orphan; }

17 Create an ARCHIVELOG Backup Script RMAN> create script archbu { Crosscheck backup; Crosscheck archivelog all; Sql ‘alter system archive log current’; Backup archivelog all not backed up 2 times delete input; Backup current controlfile; Report unrecoverable; Report obsolete orphan; }

18 Consider 10g New Feature: “Backup as Copy” Can restore files without the Catalog –Great for total disaster –Great if the catalog is corrupt Still have the catalog for metadata –Simplifies hot backup –Stores metadata for hot backup Simple command changes –Backup as copy database; –Backup as copy archivelog all not backed up 2 times delete input;

19 Run a Full Backup RMAN> configure controlfile autobackup off; RMAN> spool log to c:\orabackup\fttprod\backup\fullbu.log RMAN> run {execute script fullbu;} RMAN> list backup summary; RMAN> spool log off; RMAN> configure controlfile autobackup on;

20 Run an Archivelog Backup RMAN> configure controlfile autobackup off; RMAN> spool log to c:\orabackup\fttprod\backup\archbu.log RMAN> run {execute script archbu;} RMAN> list backup summary; RMAN> spool log off; RMAN> configure controlfile autobackup on;

21 Backup Automation Create shell/batch scripts to run backups Use rman <<EOF Make connections inside of the shell scripts –Rman command shows up in process list –Connect target –Connect catalog –See sample script Guard permissions for the scripts

22 Do I Have a Good Backup? Review the Log –Look for “validation failed” –Look for “ORA-” errors –Look at the reports Report unrecoverable Report obsolete orphan List backup summary Restore database validate;

23 Getting The Most Out of RMAN Recover a DB with RMAN

24 Create a Disaster Shutdown abort Remove all datafiles Keep controlfiles and and online redo logs –They should not be lost in most cases because they should be multiplexed!

25 Perform RMAN Recovery Mount the DB RMAN> restore database; RMAN> recover database skip tablespace nolog; SQL> Alter database datafile ‘c:\oradata\fttprod\nolog01.dbf’ offline; Open the DB Drop and recreate nolog tablespace

26 Total Disaster If your controlfiles are lost –Recover them from the RMAN backup –Open resetlogs –Add a tempfile –nid If your online redo logs are lost –Recover until SCN or until time –Open resetlogs –Add a tempfile –nid

27 Example Recovery for Total Disaster SQL> Startup nomount RMAN> restore controlfile; SQL> Alter database mount Review v$log_history to identify your recovery time/SCN

28 Example Recovery for Total Disaster (continued) RMAN> run { Set until time ‘Feb :00:00’; # or set until sequence 400; Restore database; Recover database; }

29 Example Recovery for Total Disaster (continued) SQL> Alter database open resetlogs; SQL> Alter tablespace temp > add tempfile ‘c:\oradata\fttprod\temp01.dbf’ > size reuse > autoextend on > next maxsize unlimited;

30 Example Recovery for Total Disaster (continued) Use nid to set a new DBID –Necessary before you can backup the new incarnation of the DB –Shutdown and mount the DB –Host Nid –Shutdown the DB –Create a new password file for the DB –Open the DB with resetlogs

31 Getting The Most Out of RMAN Duplicate a DB with RMAN

32 Create the new Instance Configure Ora*Net Create oradata and dump folders Create an init file Create the service and/or password file Create an spfile, if desired Start (force nomount) the new instance

33 Duplicate the DB Rman target catalog auxiliary Run { Set newname for datafile 1 to ‘c:\oradata\fttdev\system01.dbf’; Set newname for datafile 2 to ‘c:\oradata\fttdev\undotbs01.dbf’; Set newname for datafile 3 to ‘c:\oradata\fttdev\sysaux01.dbf’; Set newname for datafile 4 to ‘c:\oradata\fttdev\users01.dbf’;

34 Duplicate the DB (continued) Set newname for tempfile 1 to ‘c:\oradata\fttdev\temp01.dbf’; Duplicate target database to fttdev skip tablespace nolog logfile group 1 (‘c:\oradata\fttdev\redo01.log’) size 10M, group 2 (‘c:\oradata\fttdev\redo02.log’) size 10M; }

35 Other Duplication Scenarios You can duplicate to a time or SCN You can resynchronize a duplicate DB with the master You can duplicate to an auxiliary DB on another host You can duplicate to test your backups You must use nid if you want to register a cloned DB with the same catalog as the master DB

36 Getting The Most Out of RMAN Wrap Up

37 Summary Use RMAN to simplify and centralize DB backup and cloning procedures Use stored scripts for backups Be careful of password usage Consider backup as copy for 10g DBs Use RMAN reports and validation procedures to ensure that your backups are good Guard your controlfiles and online redo logs

38 Summary (continued) All of your traditional recovery options are still available Use nid to reset the DBID after you use ‘open resetlogs’ Use RMAN duplication procedures as a method to test backups or to create new DBs Don’t forget to backup the catalog! –Export or Cold Backup during business hours is usually OK

39 This Presentation This document is not for commercial re-use or distribution without the consent of the author Neither Remote Control DBA, nor the author guarantee this document to be error free Submit questions/corrections/comments to the author: –Charles Pfeiffer,

40 Are We Done Yet? Final Q&A Contact Me –