Presentation is loading. Please wait.

Presentation is loading. Please wait.

Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.

Similar presentations


Presentation on theme: "Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen."— Presentation transcript:

1 Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen

2 Outline Introduction Backup and Recovery, Why? Principle of Backup and Recovery Backup Recovery  Recovery Commands  Forms of Data Recovery (Choosing the Right Strategy)  Flashback Technology  Flash Recovery Area  Enterprise Manager: Perform Recovery Configure Recovery Settings  Practice CAP3642 Hebah ElGibreen

3 Recovery Commands: Overview The two most important Recovery Manager commands for repairing a database are RESTOR and RECOVER. The words restore and recover have specialized technical meanings for the database administrator.  The word restore refers to the operation of replacing a damaged or missing file from a backup copy.  The word recover refers to the process of replaying transactions recorded in the redo logs and making the database usable again. CAP3643 Hebah ElGibreen

4 Recovery Commands: Overview When attempts to open a database, Recovery is caused when the database files are not synchronized on shutdown. After the instance is open, Restore is needed if the instance failed, this happens in case of the loss of: Any control file A data file belonging to the system or undo tablespaces. An entire redo log group. CAP3644 Hebah ElGibreen

5 Recovery Commands: Instance Recovery Instance Recovery Phases: 1. Data files out of sync. 2. Roll forward (redo). 3. Committed and noncommitted data in files. 4. Roll back (undo). 5. Only committed data in files. CAP3645 Hebah ElGibreen Database Undo Instance Background processes Data file SCN: 99 Data file SCN: 129 Data file SCN: 140 Control file SCN: 143 Control file SCN: 143 Redo log group SCN 74-101 Redo log group SCN 102-143 SGA

6 Recovery Commands: Restore Loss of a Control File: If a control file is lost or corrupted, the instance normally aborts, and you must perform the following steps: 1. Shutdown the instance, if it is still open. 2. Restore the missing control file by copying an existing control file. You can copy one of the remaining control files to some other location and update the instances parameter file to point to the new location. OR, you can delete the reference to the missing control file from the initialization parameter file (Oracle recommends must have at least two control files at all times). 3. Start the instance. Control files CAP364 6 Hebah ElGibreen

7 Recovery Commands: Restore Loss of a Redo Log File: If a member of a redo log file group is lost, as long as the group still has at least one member, then: 1.Determine whether there is a missing log file by examining the alert log. 2.Restore the missing file by first dropping the lost redo log member. 3.Then add a new member to replace the lost redo log member. 4.If the media failure is due to the loss of a disk drive or controller, rename the missing file. 5.If the group has already been archived, or if you are in NoArchiveLog mode, you may choose to solve the problem by clearing the log group to re-create the missing file or files. CAP3647 Hebah ElGibreen

8 Recovery Commands: Restore Loss of a Data File in NOARCHIVELOG Mode: If the database is in NOARCHIVELOG mode, and any data file is lost, perform the following tasks: 1. Shut down the instance if it is not already down. 2. Restore the entire database, including all data and control files, from the backup. 3. Open the database. 4. Have users reenter all changes made since the last backup. User CAP3648 Hebah ElGibreen

9 Recovery Commands: Restore Loss of a Noncritical Data File in ARCHIVELOG Mode:  With the database in ArchiveLog mode, the loss of any data file not belonging to the SYSTEM or UNDO tablespaces only affects objects that are in the missing file. The rest of the database remains available for users to continue work.  Because the database is in ArchiveLog mode, recovery up to the time of the last commit is possible and users are not required to reenter any data. Users CAP3649 Hebah ElGibreen

10 Recovery Commands: Restore Loss of a System-Critical Data File in ARCHIVELOG Mode: If a data file is lost or corrupted, and that file belongs to the SYSTEM or UNDO tablespace: 1.The instance may or may not shut down automatically. If it does not, use SHUTDOWN ABORT to bring the instance down. 2.Mount the database 3.Restore and recover the missing data file 4.Open the database Users CAP36410 Hebah ElGibreen

11 Forms of Data Recovery (Choosing the Right Strategy) Datafile Media Recovery. Complete, Incomplete and Point-In-Time Recovery. Crash Recovery. CAP36411 Hebah ElGibreen

12 Forms of Data Recovery (Choosing the Right Strategy) Datafile Media Recovery: Restore Datafiles, Apply Redo. Several situations force you to perform media recovery:  To restore a lost or damaged datafile, SPFILE or control file  To restore a datafile that its changes were recorded in the redo logs but not in this datafile. For a datafile to be available for media recovery, one of two things must be true:  The database that the datafile belongs to must not be open;  The specific datafile needing recovery must be offline, if the database is open. A datafile that needs media recovery cannot be brought online until media recovery has been completed. CAP36412 Hebah ElGibreen

13 Forms of Data Recovery (Choosing the Right Strategy) Complete, Incomplete and Point-In-Time Recovery.  Occasionally, you need to return a database to its state at a past point in time. For example, to undo the effect of a user error, such as dropping or deleting the contents of a table, you may want to return the database to its contents before the delete occurred.  Point-in-time recovery is one possible response to a data loss caused by, for instance, a user error or logical corruption that goes unnoticed for some time.  Point-in-time recovery is also your only option if you have to perform a recovery and discover that you are missing an archived log covering time between the backup you are restoring from and the target SCN for the recovery. Without the missing log, you have no record of the updates to your datafiles during that period. Your only choice is to recover the database from the point in time of the restored backup, then abandon all changes in or after the missing log. CAP36413 Hebah ElGibreen

14 Forms of Data Recovery (Choosing the Right Strategy) Crash Recovery: Automatic Recovery After Instance Failure. Archived logs are never used during crash recovery, and datafiles are never restored from backup.  It uses only the online redo log files and current online datafiles. There are a number of important differences between the crash and media recovery: 1. Media recovery must be explicitly invoked by a user. 2. Media recovery applies needed changes to datafiles that have been restored from backup, not to online datafiles left over after a crash. 3. Media recovery must use archived logs as well as the online logs, to find changes reaching back to the time of the datafile backup. CAP36414 Hebah ElGibreen

15 Flashback Technology Oracle Flashback Technology is an alternatives to Point-in- Time Recovery. Oracle Flashback Technology provides a set of features that provide useful alternatives to support  Viewing past states of data,  Winding data back and forth in time, without requiring you to restore large portions of your database from backup or perform point-in-time recovery. CAP364 Hebah ElGibreen 15

16 Flash Recovery Area The flash recovery area is a space set aside on the disk to contain archived logs, backups, flashback logs, mirrored control files, and mirrored redo logs. Flash recovery area automates management of backup-related files.  Using a flash recovery area minimizes the need to manually manage disk space for your backup-related files and balance the use of space among the different types of files. Monitor the flash recovery area to:  Configure flashback logging.  Size the recovery area.  View current space consumption. CAP36416 Hebah ElGibreen

17 Enterprise Manager Oracle 10g… Perform Recovery Configure Recovery Settings CAP364 17 Hebah ElGibreen

18 References “Beginning Oracle Database 11g Administration: From Novice to Professional”, By Iggy Fernandez, Apress. Backup and Recovery Basics 10g Release 2, By Antonio Romero, Lance Ashdown, Oracle® Database, 2005. Oracle Database 10g: Administration Workshop I, student guide. CAP36418 Hebah ElGibreen


Download ppt "Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen."

Similar presentations


Ads by Google