310 likes | 863 Views
Backup and Recovery (1). Oracle 11g. Outline. Introduction Backup and Recovery, Why? Principle of Backup and Recovery Backup Backup Solutions: Overview Backup Methods Backup Strategies (Choosing the right backup ) Configuring for Recoverability Enterprise Manager:
E N D
Backup and Recovery (1) Oracle 11g Hebah ElGibreen
Outline • Introduction • Backup and Recovery, Why? • Principle of Backup and Recovery • Backup • Backup Solutions: Overview • Backup Methods • Backup Strategies (Choosing the right backup) • Configuring for Recoverability • Enterprise Manager: • Configuring Backup • Schedule Backup • Managing Backup • Viewing Backup Job • Recovery (Next Lecture…) Hebah ElGibreen
Introduction • Backup and recovery refers to the various strategies and procedures involved in protecting your database against data loss and reconstructing the database after any kind of data loss. Hebah ElGibreen
Backup and Recovery, Why? • The database administrators goal is to ensure that the database is open and available when users need it. • Failures can generally be divided into the following categories: • Statement failure • User process failure • Network failure • Instance failure • User error • Media failure Hebah ElGibreen
Principle of Backup and Recovery • Reconstructing the contents of all or part of a database typically involves two phases: • Retrieving a copy of the data file from a backup. • Reapplying changes to the file, to bring the database to a desired SCN since the last backup. • ARCHIVELOG mode • ARCHIVELOG mode is on • NOARCHIVELOG mode is off Hebah ElGibreen
Scenario of Backup and Recovery Hebah ElGibreen
Backup Solutions: Overview • Backups can be performed by using: • Recovery Manager • Oracle Secure Backup • A user-managed Backup Hebah ElGibreen
Backup Methods • Logical Backup (User level) • Export Backup • Import Backup • Physical Backup (DBA centric) • Offline Backup (cold or consistent backup) • Online Backup (hot or inconsistent backup) Hebah ElGibreen
Backup Strategies …Choosing the right backup • Tape vs. Disk Backups • Physical vs. Logical Backups • Whole vs. Partial Backups • Consistent vs. Inconsistent Backups • Hot vs. Cold Backups • Full vs. Incremental Backups • Image Copies vs. Backupsets Hebah ElGibreen
Backup Strategies …Choosing the right backup • Tape vs. Disk Backups • A common practice is to make backup copies on disk when possible and have them copied to tape in a separate operation. • Physical vs. Logical Backups • A logical backup can be much smaller than physical backup. • Logical backups cannot be used to restore the database; they can only be used to re-create the data. • If the database is restored from physical backups, then the redo logs can be used to recover all modifications to the data made since the physical backup was initiated. • If a logical backup is used to re-create data, any modifications to the data made after the logical backup was initiated are lost (i.e. “point in time” backup). Hebah ElGibreen
Backup Strategies …Choosing the right backup • Whole vs. Partial Backups • If the database is very large, we may not have the time and resources to create a backup of the entire database in a single operation. • Instead, we might spread the activity over the course of a week and create a backup of just a portion of the database every night. • Consistent vs. Inconsistent Backups • A physical backup can be classified by being consistent or inconsistent. • Consistent backups are taken when the database is shut down normally or in a MOUNT state. • A database should be in ARCHIVELOG mode to be able to use an inconsistent backup method. Hebah ElGibreen
Backup Strategies …Choosing the right backup • Hot vs. Cold Backups • Hot backup are generally considered synonymous with inconsistent backup, while cold backup are considered synonymous with consistent backup; but, if the database was not shut down gracefully, a cold backup also may contain inconsistencies. • Cold backups are similar to export backups because they are point-in-time backups and therefore of less value if up-to-the minute recovery of the database is required and the database is not in archivelogmode. • Another downside to cold backups is the amount of downtime necessary to perform the backup; any one will not be able to access the database during it. • Hot backups are inconsistent because, with the database open, there is no guarantee that the data files are synchronized with the control files. Inconsistent backups require recovery in order to be used. Hebah ElGibreen
Backup Strategies …Choosing the right backup • Full vs. Incremental Backups • A distinct advantage to using an incremental backup in a recovery strategy is that archived and online redo log files may not be necessary to restore a database or tablespace to a consistent state. • Oracle Database 11g supports two levels of incremental backup. • A level 0 or baseline backup, like a full backup, contains all data blocks. • A level 1 incremental back up can be one of two types: cumulative or differential. • A cumulative backup backs up all changes since the last level 0 backup. • A differential backup backs up all changes since the last incremental backup (which could be a level 0 or a level 1). Hebah ElGibreen
Backup Strategies …Choosing the right backup • Image Copies vs. Backupsets • Backup sets use less space on the disk or tape and it can be compressed to further reduce the space requirements of the backup. • Backupsets can be created and restored only with RMAN. • Image copies are full backups created by almost any backup environment (e.g. RMAN or operating system commands). Backup set Image copies Data file #4 Data file #1 Data file #5 Data file #2 Data file #6 Data file #3 Hebah ElGibreen
Member 1 Member 2 Member 1 Disk 1 Disk 2 Member 2 Member 1 Member 2 Group 1 Group 2 Group 3 Configuring for Recoverability • To configure your database for maximum recoverability, you must: • Schedule regular backups • Multiplex control files • Multiplex redo log groups • Retain archived copies of redo logs Control files Archive log files Online redo log files Hebah ElGibreen
Enterprise Manager : Backup Oracle 11g… Configuring Backup Schedule Backup Managing Backup Viewing Backup Job Hebah ElGibreen
Configuring Backup Hebah ElGibreen
Configuring Backup: Device Hebah ElGibreen
Configuring Backup: Backup Set Hebah ElGibreen
Configuring Backup: Policy Hebah ElGibreen
Scheduling Backups: Strategy Hebah ElGibreen
Scheduling Backups: Options Hebah ElGibreen
Scheduling Backups: Settings Hebah ElGibreen
Scheduling Backups: Schedule Hebah ElGibreen
Scheduling Backups: Review Hebah ElGibreen
Scheduling Backups: Review Hebah ElGibreen
Managing Backup: Backup Sets Hebah ElGibreen
Managing Backup: Image Copies Hebah ElGibreen
Viewing Backup Job Hebah ElGibreen
Viewing Backup Job: Edit Hebah ElGibreen
References • “Beginning Oracle Database 11g Administration: From Novice to Professional”, By Iggy Fernandez, Apress. • Backup and Recovery Basics 11g Release 2 (11.2) [Online]. Available: http://docs.oracle.com/cd/B19306_01/backup.102/b14192.pdf • Oracle Database 11g: Administration Workshop I, student guide. Hebah ElGibreen