Download presentation
Presentation is loading. Please wait.
Published byBenedict Morgan Modified over 8 years ago
1
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery
2
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
3
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
4
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
5
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
6
9-6 Copyright © 2004, Oracle. All rights reserved.
7
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.
8
9-8 Copyright © 2004, Oracle. All rights reserved.
9
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 '2003-12-14:12:10:03'; SQL> RECOVER DATABASE 2 UNTIL TIME '2003-12-14:12:10:03' 3 USING BACKUP CONTROLFILE;
10
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 1 146 Data file 2 146 Data file 3 146 Control files 146 Redo log file 1 145 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 1 144 Data file 2 144 Data file 3 146 Control files 146 Redo log file 1 145 Redo log file 2 144 Archived log file 4 OE.ORDERS
11
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 '2004-05-28:11:44:00'; SQL> alter database open resetlogs; SQL> shutdown; $ cp /u01/db01/ORADATA/* /BACKUP
12
9-12 Copyright © 2004, Oracle. All rights reserved.
13
9-13 Copyright © 2004, Oracle. All rights reserved. Cancel-Based Recovery: Example Scenario: The current time is 12:00 p.m. on May 28, 2004. 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.
14
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.
15
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
16
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.
17
9-17 Copyright © 2004, Oracle. All rights reserved. RMAN Incomplete Recovery UNTIL TIME : Example RMAN> RUN { 2> SET UNTIL TIME = '2004-05-28:11:44:00'; 3> RESTORE DATABASE; 4> RECOVER DATABASE; 5> ALTER DATABASE OPEN RESETLOGS; }
18
9-18 Copyright © 2004, Oracle. All rights reserved.
19
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> }
20
9-20 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Log in as a user with the SYSDBA privilege
21
9-21 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Click on the Maintenance tab
22
9-22 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select Perform Recovery
23
9-23 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select Whole Database and enter OS login credentials
24
9-24 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Select data files
25
9-25 Copyright © 2004, Oracle. All rights reserved. Recovery Using Enterprise Manager Final review
26
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
27
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
28
9-28 Copyright © 2004, Oracle. All rights reserved.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.