Beruflich Dokumente
Kultur Dokumente
Objectives
After completing this lesson, you should be able to: Perform complete or incomplete user-managed recovery Identify situations where incomplete recovery is necessary Perform complete or incomplete recovery by using RMAN Perform incomplete recovery based on time, SCN, log sequence, restore points, or the cancel method Recover an automatically backed up control file Use Enterprise Manage to perform recovery Recover read-only tablespaces
5-2
Recovery Methods
RMAN recovery
Files are managed automatically. Use RMAN functionality including all repository maintenance and reporting capabilities. This can be done by using Enterprise Manager. Oracle Corporation recommends using this method.
5-3
Restore the damaged data files from a backup and then recover the data files:
Or:
SQL> RECOVER DATAFILE 2> '/oradata/indx01.dbf'
5-4
User man. > RMAN CLI EM Complete Incomplete Control file RO TBS
run{ sql "ALTER TABLESPACE inv_tbs OFFLINE IMMEDIATE"; RESTORE TABLESPACE inv_tbs; RECOVER TABLESPACE inv_tbs DELETE ARCHIVELOG; sql "ALTER TABLESPACE inv_tbs ONLINE"; }
5-5
User man. RMAN CLI > EM Complete Incomplete Control file RO TBS
With the Enterprise Manager Recovery Wizard, you can create and run an RMAN script to perform the recovery.
5-6
There are two types of recovery: Complete recovery brings the database up to the present, including all data changes made to the point in time when the recovery was requested.
Complete recovery Incomplete recovery Restore from this backup Missing transactions after incomplete recovery Recovery task started at this time
Incomplete recovery brings the database up to a specified point in time in the past, before the recovery operation was requested.
Copyright 2006, Oracle. All rights reserved.
5-7
Complete Recovery
Archived log Archived log Online Redo log Changes applied Database opened
User man. RMAN CLI EM > Complete Incomplete Control file RO TBS
Undo applied
4 1
Restored data files
3
Data files containing committed and uncommitted transactions
Copyright 2006, Oracle. All rights reserved.
6
Recovered data files
5-8
Incomplete Recovery
Archived log Archived log Online Redo log
User man. RMAN CLI EM Complete > Incomplete Control file RO TBS
Database opened
Undo applied
4 1
Restored data files from as far back as necessary
5 6
PIT-recovered data files
3
Data files containing committed and uncommitted Transactions up to PIT
Copyright 2006, Oracle. All rights reserved.
5-9
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-11
There are four types of incomplete recovery: Time-based recovery Cancel-based recovery Change-based recovery Log sequence recovery
5-12
5-14
5-15
5-16
5-18
5-19
5-20
5-21
5-23
5-24
The following are some best practices regarding the alert log in incomplete recovery scenarios: Check the alert log before and after recovery. Look for error information, hints, and SCNs. Confirm that steps in the recovery process were successful.
5-25
Restore Points
A restore point: Serves as an alias for an SCN or a specific point in time Is stored in the control file Can be used with:
RECOVER DATABASE FLASHBACK DATABASE FLASHBACK TABLE
before_load
1 2
5-26
Plan for and practice scenarios ahead of time. Investigate and verify that incomplete recovery is necessary. Follow all steps carefully. Take whole database backups before and after recovery. Always verify that the recovery was successful. Take advantage of restore points.
5-27
User man. RMAN CLI EM Complete Incomplete > Control file RO TBS
5-29
SYSTEM
USERS
Parameter file
SYSAUX INDEX
Password file
UNDO TEMP
5-31
5-32
*
Case 1
User man. RMAN CLI EM Complete Incomplete Control file > RO TBS
*
Case 2 Read-only Read/write
*
Case 3 Read/write Read-only
Control file * backup to be
Backup
5-33
Special considerations must be taken for read-only tablespaces when: Re-creating a control file Renaming data files Using a backup control file
5-35
Summary
In this lesson, you should have learned how to: Perform complete or incomplete user-managed recovery Perform complete or incomplete recovery by using RMAN Identify situations where incomplete recovery is necessary Perform incomplete recovery based on time, SCN, log sequence, restore points, or the cancel method Recover a control file autobackup Use Enterprise Manage to perform recovery Recover read-only tablespaces
5-37
5-38