9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.

Slides:



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

Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
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.
Harvard University Oracle Database Administration Session 11 Database 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.
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.
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
Oracle9i Database Administrator: Implementation and Administration
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
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.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
20 Copyright © 2004, Oracle. All rights reserved. Database Recovery.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
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.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
5 Copyright © 2004, Oracle. All rights reserved. Controlling the Database.
15 Copyright © 2007, Oracle. All rights reserved. Performing Database Backups.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
7 Copyright © 2004, Oracle. All rights reserved. Recovering from Noncritical Losses.
6 Copyright © 2006, Oracle. All rights reserved. Flashback.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
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.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
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.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
1 Copyright © 2006, Oracle. All rights reserved. Introduction.
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.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
5 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
Database Recovery.
Performing User-Managed Backup and Recovery
Performing Database Recovery
Chapter 5 The Redo Log Files.
Presentation transcript:

9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery

9-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to: Explain reasons for incomplete recovery Describe incomplete recovery methodology Recover the database to a specific point in time using: –User-managed backups –RMAN-managed backups –Enterprise Manager Database Control Console

9-3 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery Overview Instance SGA Redo log buffer Data buffer Large PoolLocks Shared pool Data dict. cache Shared SQL and PL/SQL PMON DBWn SMON LGWRCKPTARCn User process Server process PGA User process Server process PGA Parameter file Password file Archived log files Database 1 Data file 1 1 Data file 2 1 Data file 3 1 Control files 1 Redo log file 1 0 Redo log file 2

9-4 Copyright © 2004, Oracle. All rights reserved. Situations Requiring Incomplete Recovery Complete recovery fails because of a missing archived log file One or more unarchived redo log files and a data file are lost A backup of the control file is used to open or recover the database

9-5 Copyright © 2004, Oracle. All rights reserved. Types of Incomplete Recovery There are four types of incomplete recovery: Time-based recovery Cancel-based recovery Change-based recovery Log sequence recovery

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

9-7 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery Best Practices Follow all steps carefully. Take whole database backups before and after recovery. Always verify that the recovery was successful. Back up and remove archived logs.

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

9-9 Copyright © 2004, Oracle. All rights reserved. Using RECOVER for Incomplete Recovery Recover a database until time: Recover a database until cancel: Recover using backup control file: SQL> RECOVER DATABASE UNTIL CANCEL; SQL> RECOVER DATABASE UNTIL 2 TIME ' :12:10:03'; SQL> RECOVER DATABASE 2 UNTIL TIME ' :12:10:03' 3 USING BACKUP CONTROLFILE;

9-10 Copyright © 2004, Oracle. All rights reserved. Shut down and back up 1 Mount the database 2 UNTIL TIME Recovery Example Restore all data files 3 Open with Resetlogs 5 Back up the database 6 Database 146 Data file Data file Data file Control files 146 Redo log file Redo log file 2 OE.ORDERS Recovered Database 1 Data file 1 1 Data file 2 1 Data file 3 1 Control files 1 Redo log file 1 0 Redo log file 2 OE.ORDERS Restored Database 144 Data file Data file Data file Control files 146 Redo log file Redo log file Archived log file 4 OE.ORDERS

9-11 Copyright © 2004, Oracle. All rights reserved. UNTIL TIME Recovery Steps 1.Shutdown database 2.Restore data files 3.Mount the database 4.Recover the database 5.Open database with RESETLOGS option 6.Backup the database SQL> shutdown immediate $ cp /BACKUP/* /u01/db01/ORADATA SQL> startup mount SQL> recover database until time ' :11:44:00'; SQL> alter database open resetlogs; SQL> shutdown; $ cp /u01/db01/ORADATA/* /BACKUP

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

9-13 Copyright © 2004, Oracle. All rights reserved. Cancel-Based Recovery: Example Scenario: The current time is 12:00 p.m. on May 28, The ORDERS table was dropped while someone was trying to fix corrupted data blocks. Log files exist on the same disk as the data files. The table was dropped at approximately 11:45 a.m. Staff are currently in a meeting.

9-14 Copyright © 2004, Oracle. All rights reserved. Cancel-Based Recovery: Example Findings: Redo logs are not multiplexed. One of the online redo logs is missing. The missing redo log is not archived. The redo log contained information from 11:34 a.m. Twenty-six minutes of data will be lost. Users can recover their data.

9-15 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery and the Alert Log Check the alert log before and after recovery Look for error information, hints, and SCNs Confirm steps in the recovery process were successful

9-16 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery of a Database Using RMAN 1.Mount the database. 2.Allocate multiple channels for parallelization. 3.Restore all data files. 4.Recover the database by using UNTIL TIME, UNTIL SEQUENCE, or UNTIL SCN. 5.Open the database by using RESETLOGS. 6.Perform a whole database backup.

9-17 Copyright © 2004, Oracle. All rights reserved. RMAN Incomplete Recovery UNTIL TIME : Example RMAN> RUN { 2> SET UNTIL TIME = ' :11:44:00'; 3> RESTORE DATABASE; 4> RECOVER DATABASE; 5> ALTER DATABASE OPEN RESETLOGS; }

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

9-19 Copyright © 2004, Oracle. All rights reserved. RMAN Incomplete Recovery UNTIL SEQUENCE : Example RMAN> RUN { 2> SET UNTIL SEQUENCE 120 THREAD 1; 3> ALTER DATABASE MOUNT; 4> RESTORE DATABASE; 5> RECOVER DATABASE; # recovers through log 119 6> ALTER DATABASE OPEN RESESTLOGS; 7> }

9-20 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Log in as a user with the SYSDBA privilege

9-21 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Click on the Maintenance tab

9-22 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select Perform Recovery

9-23 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select Whole Database and enter OS login credentials

9-24 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select data files

9-25 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Final review

9-26 Copyright © 2004, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Recognize a situation that requires incomplete recovery Describe the incomplete recovery methodology Recover the database to a specific point in time using: –User-managed backups –RMAN-managed backups –Enterprise Manager Database Control Console

9-27 Copyright © 2004, Oracle. All rights reserved. Practice 9 Overview: Incomplete Recovery This practice covers the following topics: Traditional recovery from user failure Point-in-time recovery using RMAN Database recovery using the Database Control Console

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