9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.

Slides:



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

17 Copyright © 2005, Oracle. All rights reserved. Performing Flashback.
10 Copyright © 2009, Oracle. All rights reserved. Managing Undo Data.
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
RMAN Restore and Recovery
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
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.
Configuring Recovery Manager
4 Copyright © 2008, Oracle. All rights reserved. Configuring Backup Specifications.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
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.
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
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.
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
7 Copyright © 2006, Oracle. All rights reserved. Dealing with Database Corruption.
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.
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.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
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.
6 Copyright © 2006, Oracle. All rights reserved. Flashback.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
7 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
© 2006 Northgate Information Solutions plc and its associated companies. All rights reserved. Slide 1.
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.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
11 Copyright © 2007, Oracle. All rights reserved. Using Flashback Technology.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
6 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
What is Flashback? Technology that allows you to revert the database to a point in time in the past Several versions of flashback available Different types.
23 Copyright © 2004, Oracle. All rights reserved. Preferring the Past: Flashback.
9 Copyright © 2005, Oracle. All rights reserved. Managing Undo Data.
10 Copyright © 2007, Oracle. All rights reserved. Managing Undo Data.
Recovery Catalog Creation and Maintenance
Performing Flashback.
Performing Tablespace Point-in-Time Recovery
Performing Tablespace Point-in-Time Recovery
Performing Database Recovery
Oracle 12R2 Database Flashback Technologies
Presentation transcript:

9 Copyright © 2004, Oracle. All rights reserved. Flashback Database

9-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to: Describe Flashback Database architecture Enable and disable the Flashback Database Monitor the Flashback Database Use the Enterprise Manager Recovery Wizard

9-3 Copyright © 2004, Oracle. All rights reserved. Flashback Any Error Flashback Database brings the database to a prior point in time by undoing all changes made since that time. Flashback Table recovers a table to a point in time in the past without restoring a backup. Flashback Drop restores accidentally dropped tables.

9-4 Copyright © 2004, Oracle. All rights reserved. Flashback Technology Benefits Flashback technology is a revolutionary advance in recovery Traditional recovery techniques are slow –Entire database or file has to be restored, not just the incorrect data –Every change in the database log must be examined Flashback is fast –Changes are indexed by row and by transaction –Only the changed data is restored Flashback commands are easy –No complex multi-step procedures

9-5 Copyright © 2004, Oracle. All rights reserved. When to Use Flashback Technology Object Level ScenarioFlashback Technology DatabaseDrop UserFlashback Database Truncate TableFlashback Database Batch job: partial changesFlashback Database TableDrop TableFlashback Drop Update with wrong WHERE clause Flashback Table Comparing current data against the data at some time in the past Flashback Query TxBatch Job runs twice, but not really sure of the objects affected Flashback Query

9-6 Copyright © 2004, Oracle. All rights reserved. Flashback Database Overview The Flashback Database operation: Works like a rewind button for the database. Can be used in cases of logical data corruptions made by users. Corrupted database Database is "rewound" Press the rewind button Users generate errors

9-7 Copyright © 2004, Oracle. All rights reserved. Flashback Database Reduces Restore Time Backup User error Apply logs forward Restore files Generate logs Repaired database Incomplete Recovery Backup User error Apply Flashback logs backward Flashback logs Repaired database Flashback Database

9-8 Copyright © 2004, Oracle. All rights reserved. Flashback Database Architecture Flashback Buffer Redo Log Buffer SGA LGWR RVWR 8Mb16Mb Flashback Logs Redo Logs …… Buffer Cache Write direction Apply direction 1 Log block before images periodically Back out changes to database without restore Forward media recovery Every change Not every change! 2

9-9 Copyright © 2004, Oracle. All rights reserved. Configuring Flashback Database 1. Configure the flash recovery area 3. Enable Flashback Database 2. Set the retention target SQL> ALTER DATABASE FLASHBACK ON; SQL>ALTER SYSTEM SET 2DB_FLASHBACK_RETENTION_TARGET=2880 3SCOPE=BOTH;

9-10 Copyright © 2004, Oracle. All rights reserved. Configure Flashback Database with EM Make sure the database is in ARCHIVELOG mode.

9-11 Copyright © 2004, Oracle. All rights reserved. Configure Flashback Database with EM Enable Flashback logging and specify flash recovery area

9-12 Copyright © 2004, Oracle. All rights reserved. Monitoring Flashback Database Adjust the flash recovery area disk quota: Determine the current flashback window: Monitor logging in the Flashback Database logs: SQL> SELECT estimated_flashback_size, 2 flashback_size 3 FROM V$FLASHBACK_DATABASE_LOG; SQL> SELECT * 2 FROM V$FLASHBACK_DATABASE_STAT; SQL> SELECT oldest_flashback_scn, 2 oldest_flashback_time 3 FROM V$FLASHBACK_DATABASE_LOG;

9-13 Copyright © 2004, Oracle. All rights reserved.

9-14 Copyright © 2004, Oracle. All rights reserved. Monitoring Flashback Database with EM

9-15 Copyright © 2004, Oracle. All rights reserved. Monitoring Flash Recovery Area with EM

9-16 Copyright © 2004, Oracle. All rights reserved. Best Practices for the Database and Flash Recovery Area Use the flash recovery area for recovery-related files: Simplifies location of database backups Automatically manages the disk space allocated for recovery files Does not require changes to existing scripts Puts database backups, archive logs, and control file backups in the flash recovery area

9-17 Copyright © 2004, Oracle. All rights reserved. Backing Up the Flash Recovery Area RMAN> BACKUP RECOVERY FILES;

9-18 Copyright © 2004, Oracle. All rights reserved. Flash Recovery Area Space Usage Configure the retention policy to the minimum value appropriate for your database Backup the archive log files regularly and delete the files upon completion of the backup Use the RMAN REPORT OBSOLETE and DELETE OBSOLETE commands to remove unneeded backups and file copies

9-19 Copyright © 2004, Oracle. All rights reserved. Flashback Database Examples RMAN> FLASHBACK DATABASE TO TIME = 2> TO_DATE(' :00:00', 3> 'YYYY-MM-DD HH24:MI:SS'); RMAN> FLASHBACK DATABASE TO SCN=23565; RMAN> FLASHBACK DATABASE 2> TO SEQUENCE=223 THREAD=1; SQL> FLASHBACK DATABASE 2 TO TIMESTAMP(SYSDATE-1/24); SQL> FLASHBACK DATABASE TO SCN 53943;

9-20 Copyright © 2004, Oracle. All rights reserved. Flashback Database with EM Select object and operation type

9-21 Copyright © 2004, Oracle. All rights reserved. Flashback Database with EM Launching Recovery Wizard

9-22 Copyright © 2004, Oracle. All rights reserved. Flashback Database Using EM

9-23 Copyright © 2004, Oracle. All rights reserved. Excluding Tablespaces from Flashback Database Take the tablespace offline before you perform the Flashback Database recovery. Drop the tablespace or recover the offline files with traditional point-in-time recovery. ALTER TABLESPACE FLASHBACK {ON|OFF} SQL> SELECT tablespace_name, flashback_on 2 FROM v$tablespace;

9-24 Copyright © 2004, Oracle. All rights reserved. Flashback Database Considerations When the Flashback Database operation completes, open the database: –In read-only mode to verify that the correct target time or SCN was used –With a RESETLOGS operation to allow for updates The opposite of flashback is recover You cannot use Flashback Database in the following situations: –The control file has been restored or re-created. –A tablespace has been dropped. –A data file has been shrunk. –You want to flashback before RESETLOGS operation.

9-25 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Describe Flashback Database architecture Enable and disable Flashback Database Monitor Flashback Database Use the Enterprise Manager Recovery Wizard

9-26 Copyright © 2004, Oracle. All rights reserved. Practice 9 Overview: Flashback Database These practices cover the following topics: Configuration of Flashback Database Using the Flashback Database RMAN interface Using Flashback Database through the EM Database Control Console Managing and monitoring Flashback Database operations

9-27 Copyright © 2004, Oracle. All rights reserved.

9-28 Copyright © 2004, Oracle. All rights reserved.