CHAPTER 18 RMAN Backups and Reporting. Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived.

Slides:



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

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.
1 Chapter 17 Troubleshooting RMAN. 2 Background Authors thought this topic was often glazed over or not covered well Knew that every topic can’t be covered,
1 Chapter 15 Duplicating Databases and Transporting Data.
1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888)
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.
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.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
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.
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.
Backup & Recovery Concepts for Oracle Database
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
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.
CHAPTER 21 Automating Jobs. Introduction to Automating Jobs DBAs rely heavily on automating jobs. DBAs cannot be effective without automation. Listed.
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.
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.
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.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
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.
Sharing experience on RMAN backups ...
RMAN Maintenance.
RMAN Backups.
Recovery Catalog Creation and Maintenance
Backup and Recovery (1) Oracle 10g Hebah ElGibreen CAP364.
Performing Database Backups
Duplicating a Database
Configuring Backup Settings
Performing Database Recovery
Presentation transcript:

CHAPTER 18 RMAN Backups and Reporting

Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived redo log files Spfile Backup pieces RMAN does not backup the online redo logs (it would be pointless to do so). This chapter also focuses on logging and reporting backup operations.

Setting NLS_DATE_FORMAT From the OS, set the operating system variable NLS_DATE_FORMAT to include a time (hours, minutes, and seconds) component. For example: $ export NLS_DATE_FORMAT='dd-mon-yyyy hh24:mi:ss‘ This ensures that when RMAN displays a date, it always includes the hours, minutes, and seconds as part of the output. By default, RMAN only includes the date component (DD- MON-YYYY) in the output. This default is oftentimes not granular enough for troubleshooting issues.

Setting ECHO... Setting ECHO Within RMAN RMAN> set echo on; This instructs RMAN to display the command that it's running in the output, so you can see what RMAN command is running along with any relevant error or output messages associated with the command. This is especially important when you're running RMAN commands within scripts, because you're not directly typing in a command (and may not know what command was issued within the shell script).

Showing Variables RMAN> SHOW ALL; This displays all of the RMAN configurable variables. When troubleshooting, you may not be aware of something that another DBA has configured. This gives you a snapshot of the settings as they were when the RMAN session executed.

Backing up the Entire Database Set the location to where you want the RMAN backup files to be written and with what format and then backup the database: RMAN> configure channel 1 device type disk format '/ora01/O11R2/rman/rman1_%U.bk'; RMAN> backup incremental level=0 database plus archivelog;

Full Backup versus Incremental Level=0 Full and Level 0 backup the same blocks Difference is that a level 0 can be used with subsequent level 1 backups.

Backup Sets versus Image Copies Backup set includes blocks that have been used within the datafiles. RMAN is the only utility that can read from a backup set. Image copy is a block for block copy of a datafile. Image copies can be accessed from the OS. Usually backup sets are more efficient.

Backing up Tablespaces RMAN has the ability to backup datafiles associated with specific tablespaces. You may want to test a backup on a specific tablespace or have a requirement to backup sets of tablespaces. RMAN> backup tablespace system, sysaux;

Backing up Datafiles RMAN provides the ability to backup specific datafiles. You may want to do this to test a backup feature without having to backup the entire database or you may want to backup subsets of datafiles at a time. RMAN> backup datafile 1,3;

Backing up the Control File Always configure the autobackup of the control file feature: RMAN> configure controlfile autobackup on; This ensures that the control file is backed up whenever a backup or copy command is issued. You can manually backup the control file via: RMAN> backup current controlfile;

Backing up the Spfile Whenever you have autobackup of the control file enabled, the spfile (if you’re using an spfile) will also be automatically backed up. To manually backup the spfile: RMAN> backup spfile;

Backing up Archive Redo Logs The safest way to backup archive redo log files is to back them up at the same time you’re backing up your database: RMAN> backup incremental level=0 database plus archivelog; You can manually back them up via: RMAN> backup archivelog all;

Backing up Fast Recovery Area If you’re using a FRA, RMAN can back up its contents to tape or disk: RMAN> configure channel device type sbt_tape parms 'ENV=(OB_MEDIA_FAMILY=RMAN-DB11R2)'; RMAN> backup device type sbt_tape recovery area; RMAN> backup recovery area to destination '/ora01/O11R1/fra_back';

Excluding Tablespaces from Backups You can configure non-critical tablespaces to be not backed up by default: RMAN> configure exclude for tablespace users;

Backing up Datafiles Not Backed Up This is a handy feature when you’ve had some sort of failure with a daily scheduled backup and you want to ensure that everything has been backed up within the last day (for example): RMAN> backup database not backed up since time='sysdate-1';

Skipping Read-Only Tablespaces You don’t necessarily need to backup read-only tablespaces on a regular basis because the data in these tablespaces does not change from backup to backup: RMAN> backup database skip readonly;

Skipping Offline or Inaccessible Files Sometimes a datafile might become corrupt, and you need to take it offline. RMAN will throw an error when it attempts to backup an offline datafile. Instruct RMAN to skip offline: RMAN> backup database skip offline;

Backing Up Large Files in Parallel RMAN has the ability to backup large files with parallel processes. You need to specify a size for the sections and then RMAN figures out how to divvy it up: RMAN> configure device type disk parallelism 2; RMAN> configure channel 1 device type disk format '/ora01/O11R2/rman/r1%U.bk'; RMAN> configure channel 2 device type disk format '/ora02/O11R2/rman/r2%U.bk'; RMAN> backup section size 2500M datafile 10;

Adding RMAN Backup Information to the Repository Very handy feature for repopulating the control file with RMAN backup information. You may have a scenario where you’ve had to re-create your control file; this wipes out any RMAN information; use the CATALOG command to repopulate the control file with RMAN backup information: RMAN> catalog start with '/ora01/O11R2/rman';

Taking Incremental Level Backups Nice feature for backing up large databases that don’t change much from backup to backup. First take a level 0, then take subsequent incremental backups: RMAN> backup incremental level=0 database; RMAN> backup incremental level=1 database;

Making Incrementally Updating Backups The basic idea behind an incrementally updating backup is to create image copies of datafiles and then use incremental backups to update the image copies. In this manner, you have image copies of your database that are kept somewhat current by applying an incremental backup to them. This can be an efficient way to combine image copy backups with incremental backups. RMAN> recover copy of database with tag 'incupdate'; RMAN> backup incremental level 1 for recover of copy with tag 'incupdate' database;

Using Block Change Tracking Uses a binary OS file that records which blocks have changed. Useful for large databases using an incremental backup strategy. 1. If not already enabled, set the DB_CREATE_FILE_DEST parameter to a location. 2. Enable block change tracking via the ALTER DATABASE command.

Using VALIDATE to Check for Corruption Check for missing files or physical corruption in database datafiles, archive redo log files, control files, spfile, and backup set pieces. For example, this command will validate all datafiles and the control files: RMAN> validate database;

Using BACKUP...VALIDATE to Check for Corruption Check to see if datafiles are available and if the datafiles contain any corrupt blocks. For example: RMAN> backup validate database;

Using RESTORE...VALIDATE to Check for Corruption Use RESTORE...VALIDATE to verify backup files that would be used to restore (are available). This command validates backup sets, datafile copies, and archive redo log files: RMAN> restore validate database;

Redirecting Output to a File Shell commands provide a way to capture output Redirect standard out and standard error to a log file: $ rmanback.bsh 1>/home/oracle/bin/log/rmanback.log 2>&1

Capturing Output with tee When you start RMAN, you can send the output you see on your screen to an operating system text file using the tee command: $ rman | tee /tmp/rman.log

Using a Recovery Catalog Recovery catalog provides you with the most options when faced with a recovery Recovery catalog allows you to retain a long history of backups Having said that, many DBAs choose not to implement a recovery catalog (Recovery Catalog, resides in another database that needs to be setup, maintained, upgraded, and so on)

Capturing Output with the script Command The script command is useful because it instructs the operating system to log any output that appears on the terminal to a log file. To capture all output, run the script command before connecting to RMAN: $ script /tmp/rman.log Script started, file is /tmp/rman.log $ rman target / RMAN> backup database; RMAN> exit; To end a script session, type in Ctrl+D or type in exit.

Logging Output to a File An easy way to capture RMAN output is to use the SPOOL LOG command to send the output to a file. This example spools a log file from within RMAN: RMAN> spool log to '/tmp/rmanout.log' RMAN> set echo on; RMAN> RMAN> spool log off;

Querying for Output in the Data Dictionary The V$RMAN_OUTPUT view contains messages recently reported by RMAN: select sid,recid,output from v$rman_output order by recid;

Using LIST for Reporting LIST provides information about backups: RMAN> list backup; RMAN> list copy; RMAN> list archivelog all;

Using REPORT for Reporting Report on the datafiles associated with a database: RMAN> report schema; Report on datafiles that need to be backed up as defined by your retention policy: RMAN> report need backup;

Using SQL for Reporting Robust set of data dictionary views available for reporting on RMAN backup activities: V$RMAN_BACKUP_JOB_DETAILS V$BACKUP V$BACKUP_ARCHIVELOG_DETAILS and so on...

Summary RMAN is a feature-rich utility for backup and recovery. You can implement features as required by your environment. RMAN also contains many reporting capabilities which assist with troubleshooting and maintaining a recoverable database environment.