Agenda Overview Configuring the database for basic Backup and Recovery Backing up your database ...

14
Agenda Overview Configuring the database for basic Backup and Recovery Backing up your database Restore and Recovery Operations Managing your backups

Transcript of Agenda Overview Configuring the database for basic Backup and Recovery Backing up your database ...

Page 1: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Agenda

Overview Configuring the database for basic

Backup and Recovery Backing up your database Restore and Recovery Operations Managing your backups

Page 2: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview

Backup and Recovery generally focuses on the physical backup of database files

Logical-level backups are a useful supplement to physical backups - exporting database objects like tables or tablespaces

Oracle's flashback (10g feature )features provide a range of physical and logical data recovery tools as efficient, easy-to-use alternatives to physical and logical backups

Oracle Enterprise Manager's physical backup and recovery features are built on Oracle's Recovery Manager (RMAN) command-line client

Page 3: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: Types of Backup

Consistent Backup: database is offline and no changes in the redo log that have not already been applied to the datafiles at the time of the backup

Inconsistent Backup: database is open, the redo logs contain changes that have not yet been applied to the datafiles. The datafiles are not in a transaction-consistent state. The database must be run in ARCHIVELOG mode to preserve the redo log, and the online redo log at the moment of the backup must be archived and backed up along with the datafiles, to preserve these changes

Page 4: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: Media Recovery

If you restore archived redo logs and the datafiles from backup, Oracle will perform the media recovery process when you try to open the database.

Media recovery requires a control file, datafiles (typically restored from backup) and online and archived redo logs containing changes since the time the datafiles were backed up.

It is most often used to recover from a media failure, such as the loss of a file or disk, or a user error, like the deletion of the contents of a table.

Page 5: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: Media Recovery

Complete recovery: datafiles are restored from backup, and all changes from the archived and online redo logs are applied to the datafiles

Point-in-time (incomplete) recovery: returns database to its contents from the start time of backup to a target time. All changes after the target time are discarded

Page 6: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: The Flash Recovery Area A simplified approach to backup and recovery Designate a location (typically, a directory on disk) and a

maximum disk quota for the flash recovery area, and a retention policy to specify your database recoverability goals.

Oracle automatically manages this storage, deleting files that are no longer required on disk to meet your recoverability objectives.

Space management in the flash recovery area is governed by a backup retention policy. Retention policy determines when files are obsolete, meaning that they are no longer needed to meet your data recovery objectives.

Page 7: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: The Flash Recovery Area

File types found in FRA:

Archived Redo logs Control file Control file auto backups Flashback logs Redo logs RMAN data file copies RMAN backup and other related files

Page 8: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: The RMAN Utlity

Recovery Manager is Oracle’s utility to manage the backup, and more importantly the recovery, of the database. It eliminates operational complexity while providing superior performance and availability of the database.

Recovery Manager determines the most efficient method of executing the requested backup, restore, or recovery operation and then executes these operations in concert with the Oracle database server.

Page 9: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: The RMAN Utility

Page 10: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Overview: The RMAN Repository Every backup action through RMAN or

Enterprise Manager is recorded in the RMAN repository

The primary store for the RMAN repository is in the control file. This is one more reason why protecting control file is a vital part of a backup strategy. In some installations, a second copy of the RMAN repository for one or more Oracle databases is stored in a separate Oracle database called the Recovery Catalog.

Page 11: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Configuring the Database for Basic

Backup and Recovery To take maximum advantage of Oracle Database features that automatically manage backup and recovery files and processes, configure your database as follows:

Use a flash recovery area, which automates storage management for most backup-related files.

Run your database in ARCHIVELOG mode, so that you can perform online backups and have data recovery options such as complete and point-in-time media recovery.

Use the flash recovery area as an archived log destination for your database.

You must also set a number of policies governing which files are backed up, what format is used to store backups on disk, and when files become eligible for deletion from the flash recovery area.

Page 12: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Restore and Recovery OperationsThe database files that RMAN backs up and can recover include the controlfile, server parameter file, datafiles and archived redo log files. The twomost important RMAN commands used in databaserecovery are:

RESTORE, which retrieves files from RMAN backups based on the contents of the RMAN repository

RECOVER, which performs complete or point-in-time media recovery using available datafiles and redo logs.

Typically, you will set the state of the database appropriately for the data recovery operation to be performed, allocate or configure channels required to communicate with the disk and media manager, and then run a series of RESTORE and RECOVER commands. RMAN retrieves all needed files from backup and performs media recovery on all restored datafiles, to return your database to the desired state.

Page 13: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

Managing BackupsA backup recorded in the RMAN repository can be in one of the following states:

Available, meaning that the backup is still present on disk or tape, as recorded in the repository

Expired, meaning that the backup no longer exists on disk or tape but is still listed in the repository

Unavailable, meaning that the backup is temporarily not available for data recovery operations (because, for example, it is stored on a tape that is stored off-site or a disk that is not mounted at the moment)

Backups can also be obsolete. An obsolete backup is one which, based on thecurrently configured retention policy, is no longer needed to satisfy data recoverygoals.

Backup maintenance tasks that you can perform in Enterprise Manager include thefollowing: Viewing details about your backups Crosschecking your repository, which checks whether backups listed in the

repository exist and are accessible and marks as expired any backups not accessible at the time of the crosscheck

Deleting the record of expired backups from your RMAN repository Deleting obsolete backups from the repository and from disk Validating backups, to ensure that a given backup is still available and has not

been corrupted

Page 14: Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.

References:

Oracle Database 10g RMAN Backup and Recovery: Mathew Hart and Robert G. Freeman

Documentation Library: http://www.oracle.com/pls/db102/homepage

http://stanford.edu/dept/itss/docs/oracle/10g/index.htm