3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.

Slides:



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

5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
Backup and Recovery Part 1.
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.
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.
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
Oracle Recovery Manager (RMAN) 10g : Reloaded
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.
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.
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.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
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.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
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.
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.
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.
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.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
10 Copyright © 2007, Oracle. All rights reserved. Using RMAN Enhancements.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
RMAN Maintenance.
Sharing experience on RMAN backups ...
Using Recovery Manager
Introduction.
RMAN Maintenance.
RMAN Backups.
Recovery Catalog Creation and Maintenance
Configuring for Recoverability
Performing Database Backups
Configuring Recovery Manager
Duplicating a Database
Configuring Backup Settings
Configuring for Recoverability
Performing Database Recovery
Presentation transcript:

3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager

3-2 Copyright © 2006, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Use the RMAN BACKUP command to create backup sets and image copies Manage the backups and image copies taken with RMAN Commands BACKUP Block C.T. Inc. Update LIST REPORT DELETE

3-3 Copyright © 2006, Oracle. All rights reserved. Issuing Recovery Manager Commands Interactive client –Enter commands at RMAN prompt. –Use when performing analysis, or when running reports or stored scripts. Batch mode –Use with automated jobs. –Specify a command file when starting RMAN. –Specify the log file name to capture session log. Pipe interface –Specify the PIPE command-line argument. –Use to communicate data between sessions or between RMAN and an external application.

3-4 Copyright © 2006, Oracle. All rights reserved. Issuing Recovery Manager Commands (notes only slide)

3-5 Copyright © 2006, Oracle. All rights reserved. Types of RMAN Commands RMAN commands are of the following types: Stand-alone command: –Is executed individually at the RMAN prompt –Cannot appear as subcommands within RUN Job command: –Must be within the braces of a RUN command –Is executed as a group Some commands can be executed as either a stand-alone or a job command.

3-6 Copyright © 2006, Oracle. All rights reserved. Job Commands: Example Job commands appear inside a RUN command block: RMAN>RUN { 2>BACKUP AS BACKUPSET 3>FORMAT '/u01/db01/backup/%d_%s_%p' 4> DURATION 10:00 MINIMIZE LOAD 5>(DATABASE); 6>SQL 'alter system archive log current'; 7>}

3-7 Copyright © 2006, Oracle. All rights reserved. RMAN Commands: Overview Target database REPORT LIST Catalog database Enterprise Manager RESTORE RECOVER FLASHBACK SPFILE BACKUP Control file Archived log files RMAN Catalog maintenance CROSSCHECK DELETE…EXPIRED CHANGE Stored scripts

3-8 Copyright © 2006, Oracle. All rights reserved. RMAN Command Overview (notes only slide)

3-9 Copyright © 2006, Oracle. All rights reserved. BACKUP Command RMAN> BACKUP AS BACKUPSET 2> FORMAT '/BACKUP/df_%d_%s_%p.bus' 3> TABLESPACE hr_data; Backup set Data file 1 Data file 2 Data file 3 Data file 1 Data file 2 Data file 3 Tablespace HR_DATA Commands > BACKUP Block C.T. Inc. Update LIST REPORT DELETE

3-10 Copyright © 2006, Oracle. All rights reserved. Backup Constraints The database must be mounted or open. You cannot back up online redo logs. Only “clean” backups are usable in NOARCHIVELOG mode. Only “current” data file backups are usable in ARCHIVELOG mode.

3-11 Copyright © 2006, Oracle. All rights reserved. Parallelization of Backup Sets For performance, allocate multiple channels and assign files to specific channels. Data file 4 Data file 1 Data file 5 Channel MML Backup piece 1 Backup piece 2 Data file 2 Data file 3 Data file 9 Channel MML Data file 6 Data file 7 Data file 8 Backup Piece 3 Channel MML

3-12 Copyright © 2006, Oracle. All rights reserved.

3-13 Copyright © 2006, Oracle. All rights reserved. Compressed Backups RMAN> BACKUP AS 2> COMPRESSED BACKUPSET 3> DATABASE; RMAN> CONFIGURE DEVICE TYPE 2> DISK PARALLELISM 2 3> BACKUP TYPE TO 4> COMPRESSED BACKUPSET; Compressed backup files Database files

3-14 Copyright © 2006, Oracle. All rights reserved. Image Copy Copy of data file 3 Copy of archived log Data file 3 Archived log file Data file 3 Archived log file RMAN> BACKUP AS COPY 2> DATAFILE '/ORADATA/users_01_db01.dbf' 3> FORMAT '/BACKUP/users01.dbf'; RMAN> BACKUP AS COPY 4> ARCHIVELOG LIKE 'arch_1060.arc' 5> FORMAT 'arch_1060.bak';

3-15 Copyright © 2006, Oracle. All rights reserved.

3-16 Copyright © 2006, Oracle. All rights reserved. Tags for Backups and Image Copies A tag is a logical name assigned to a backup set or image copy. month_full_backupweek_full_backup Data file 3 Data file 4 Backup set Data files 1,3 Data files 2,4 Backup set

3-17 Copyright © 2006, Oracle. All rights reserved. BACKUP Command Options Check for physical block corruptions. Scan for logical corruptions and physical corruptions. Set a threshold on the number of detected corruptions allowed before aborting. Validate the target input files before performing a backup operation. Duplex the backup set. Overwrite an existing backup set or image copy. Pass control of the data transfer between storage devices and the data files on disk to the media management layer. Encrypt the backup files.

3-18 Copyright © 2006, Oracle. All rights reserved.

3-19 Copyright © 2006, Oracle. All rights reserved. Backing Up Archived Redo Logs Online redo log file switch is automatic. Archived log failover is performed. You can specify a range of archived redo logs to back up. Backup sets of archived redo log files cannot contain any other type of file. RMAN> BACKUP 2> FORMAT '/disk1/backup/ar_%t_%s_%p' 3> ARCHIVELOG FROM SEQUENCE=234 4> DELETE INPUT;

3-20 Copyright © 2006, Oracle. All rights reserved. Backing Up Archived Redo Logs (notes only slide)

3-21 Copyright © 2006, Oracle. All rights reserved. Whole Database Backup RMAN> BACKUP DATABASE PLUS ARCHIVELOG; Archived log file copies SPFILE Control file Data file copies

3-22 Copyright © 2006, Oracle. All rights reserved. RMAN Backup Types A full backup contains all used data file blocks. A level 0 incremental backup is equivalent to a full backup that has been marked as level 0. A cumulative level 1 incremental backup contains only blocks modified since the last level 0 incremental backup. A differential level 1 incremental backup contains only blocks modified since the last incremental backup. Differential incremental backup Cumulative incremental backup Full, or "level 0 incremental backup"

3-23 Copyright © 2006, Oracle. All rights reserved.

3-24 Copyright © 2006, Oracle. All rights reserved. Differential Versus Cumulative A differential incremental backup contains all blocks changed since the last incremental backup. A cumulative incremental backup contains all blocks changed since the last level 0 incremental backup. Lvl Day SunMonTueWedThuFriSatSun Level 0 111c1100

3-25 Copyright © 2006, Oracle. All rights reserved. Block Change Tracking The backup process can be streamlined by enabling block change tracking, which: Records changed blocks in a change tracking file Is used automatically by RMAN, if enabled Optimizes incremental backups by avoiding full data file scans during backup List of changed blocks Redo generation Redo log Change tracking file SGA CTWR Commands BACKUP >Block C.T. Inc. Update LIST REPORT DELETE

3-26 Copyright © 2006, Oracle. All rights reserved. Enabling Block Change Tracking SQL> ALTER DATABASE ENABLE 2> BLOCK CHANGE TRACKING 3> USING FILE '/mydir/rman_change_track.f' 4> REUSE;

3-27 Copyright © 2006, Oracle. All rights reserved. Incrementally Updating Backups Incremental backup files Recovered data file Image copy of data file Image copy of data file updated to a more recent state RMAN> RECOVER COPY OF 2> DATAFILE {n|'file_name'} 3> WITH TAG 'incr_upd_df1'; Commands BACKUP Block C.T. >Inc. Update LIST REPORT DELETE

3-28 Copyright © 2006, Oracle. All rights reserved. LIST Command List backup sets and copies of data files: List backup sets and copies of any data file for a specified tablespace: List backup sets and copies containing archive logs for a specified range: RMAN> LIST BACKUP OF DATAFILE 2> "/db01/ORADATA/u03/users01.dbf"; RMAN> LIST BACKUP OF DATABASE; RMAN> LIST COPY OF TABLESPACE "SYSTEM"; RMAN> LIST COPY OF DATABASE ARCHIVELOG 2> FROM TIME='SYSDATE-7'; Commands BACKUP Block C.T. Inc. Update > LIST REPORT DELETE

3-29 Copyright © 2006, Oracle. All rights reserved. REPORT Command Produces a detailed analysis of the repository Produces reports to answer: –What are the data files in the database? –Which files need a backup? –Which backups can be deleted? –Which files are unrecoverable? Commands BACKUP Block C.T. Inc. Update LIST > REPORT DELETE

3-30 Copyright © 2006, Oracle. All rights reserved. REPORT NEED BACKUP Command Lists all data files that require a backup Assumes that the most recent backup is used during a restore Provides four options: –Incremental –Days –Redundancy –Recovery window Uses the current retention policy configuration if no options are specified

3-31 Copyright © 2006, Oracle. All rights reserved. REPORT NEED BACKUP : Examples Files that need more than three incremental backups for recovery: Files that have not been backed up for three days: Backup needed if there are not two or more backups already: Backup needed to recover to three days ago: RMAN> REPORT NEED BACKUP days 3; RMAN> REPORT NEED BACKUP incremental 3; RMAN> REPORT NEED BACKUP redundancy 2; RMAN> REPORT NEED BACKUP 2> recovery window of 3 days;

3-32 Copyright © 2006, Oracle. All rights reserved. REPORT OBSOLETE and DELETE OBSOLETE Find all recovery files that are deemed obsolete according to the current retention policy settings: List the obsolete recovery files, if no more than two backup copies are needed: Delete the backup set with a backup set key of 4: Delete the recovery files considered obsolete, because they have more than two backups: RMAN> REPORT OBSOLETE REDUNDANCY 2; RMAN> REPORT OBSOLETE; RMAN> DELETE BACKUPSET 4; RMAN> DELETE OBSOLETE REDUNDANCY 2; Commands BACKUP Block C.T. Inc. Update LIST REPORT > DELETE

3-33 Copyright © 2006, Oracle. All rights reserved. Managing Backups with EM Navigation aid: Database home page > Maintenance > Manage Current Backups

3-34 Copyright © 2006, Oracle. All rights reserved. RMAN Dynamic Views V$ARCHIVED_LOG V$BACKUP_CORRUPTION V$BACKUP_DEVICE V$BACKUP_FILES V$BACKUP_PIECE V$BACKUP_REDOLOG V$BACKUP_SET V$BACKUP_SPFILE V$COPY_CORRUPTION V$RMAN_CONFIGURATION

3-35 Copyright © 2006, Oracle. All rights reserved.

3-36 Copyright © 2006, Oracle. All rights reserved. Monitoring RMAN Backups Correlate server sessions with channels by using the SET COMMAND ID command. Query V$PROCESS and V$SESSION to determine which sessions correspond to which RMAN channels. Query V$SESSION_LONGOPS to monitor the progress of backups and copies. Use an operating system utility to monitor the process or threads.

3-37 Copyright © 2006, Oracle. All rights reserved.

3-38 Copyright © 2006, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Use the RMAN BACKUP command to create backup sets and image copies List backups and image copies taken with RMAN Report and delete obsolete RMAN backups

3-39 Copyright © 2006, Oracle. All rights reserved. Practice Overview: Backing Up Your Database This practice covers the following topics: Enabling archival of redo logs for a database Using RMAN to display the database structure Using Recovery Manager to back up data files and the control file Using Recovery Manager to make image copies of data files Creating a compressed backup of a database Scheduling a backup job

3-40 Copyright © 2006, Oracle. All rights reserved.