280 likes | 457 Views
Chapter 5 User-Managed Incomplete Recovery. Chapter Summary. Explain the difference between a complete and incomplete database recovery State when an incomplete database recovery is required Identify the command to perform a database recovery. Chapter Summary (Cont.).
E N D
Chapter 5User-Managed Incomplete Recovery Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary • Explain the difference between a complete and incomplete database recovery • State when an incomplete database recovery is required • Identify the command to perform a database recovery Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary (Cont.) • Identify the options available for performing an incomplete recovery • Explain the disadvantages of performing a cancel-based recovery • Perform a time-based recovery Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary (Cont.) • Explain the advantage of performing a change-based recovery • Identify the purpose of using LogMiner to analyze redo log file • Use LogMiner to perform an analysis of the online redo log files Oracle9i DBA II: Backup/Recovery and Network Administration
Incomplete Recovery • Database must be in ARCHIVELOG mode • Not all data contained in redo log files is applied • Uses RECOVER DATABASE UNTIL command Oracle9i DBA II: Backup/Recovery and Network Administration
Incomplete Recovery • Sequence number of logs must be reset using RESETLOGS option • Always perform cold backup before and after recovery Oracle9i DBA II: Backup/Recovery and Network Administration
Incomplete Recovery Options • Cancel-based recovery • Time-based recovery • Change-based recovery Oracle9i DBA II: Backup/Recovery and Network Administration
Cancel-based Recovery • Recovery stops before contents of specified archived redo log file is applied • Even valid transactions from specified file are lost • Normally results in the greatest amount of data loss • Use UNTIL CANCEL option of RECOVER DATABASE command Oracle9i DBA II: Backup/Recovery and Network Administration
Cancel-based Recovery (Cont.) Oracle9i DBA II: Backup/Recovery and Network Administration
Cancel-based Recovery Example Oracle9i DBA II: Backup/Recovery and Network Administration
Time-based Recovery • Uses timestamp to terminate recovery process • May lose valid transactions committed at the same time as problematic transaction • Requires the correct time to be known • Use UNTIL TIME option of RECOVER DATABASE command Oracle9i DBA II: Backup/Recovery and Network Administration
Time-based Recovery (Cont.) Oracle9i DBA II: Backup/Recovery and Network Administration
Time-based Recovery Example Oracle9i DBA II: Backup/Recovery and Network Administration
Change-based Recovery • Uses SCN to terminate recovery process • Can use LogMiner to determine appropriate SCN • Results in the least amount of data loss • Use UNTIL CHANGE option of RECOVER DATABASE command Oracle9i DBA II: Backup/Recovery and Network Administration
Change-based Recovery (Cont.) Oracle9i DBA II: Backup/Recovery and Network Administration
LogMiner Package Oracle9i DBA II: Backup/Recovery and Network Administration
Procedure for using LogMiner • Extract data dictionary • Specify redo log files to analyze • Perform analysis • Query for desired DML or DDL operations • Terminate LogMiner session Oracle9i DBA II: Backup/Recovery and Network Administration
Extracting a Data Dictionary • Can be stored in: • Redo log files • An online catalog • Flat file • Specify destination location using UTL_FILE_DIR parameter in INIT.ORA file • Execute DMBS_LOGMNR_D.BUILD procedure Oracle9i DBA II: Backup/Recovery and Network Administration
Specifying Log Files • Determine files to be analyzed • Execute appropriate package: • DMBS_LOGMNR.ADD_LOGFILE with DBMS_LOGMNR.NEW option for first file • DMBS_LOGMNR.ADD_LOGFILE with DBMS_LOGMNR.ADDFILE option for remaining files Oracle9i DBA II: Backup/Recovery and Network Administration
Creating Analysis List Example Oracle9i DBA II: Backup/Recovery and Network Administration
Performing the Analysis • Must include destination for the results • Specify starting and ending parameters • Specify DDL_DICT_TRACKING option to include DDL operations Oracle9i DBA II: Backup/Recovery and Network Administration
Accessing LogMiner Results Results stored in V$LOGMNR_CONTENTS view Oracle9i DBA II: Backup/Recovery and Network Administration
Ending a LogMiner Session END_LOGMNR procedure terminates session Oracle9i DBA II: Backup/Recovery and Network Administration
Change-based Recovery Example Use RECOVER DATABASE command after acquiring appropriate SCN Oracle9i DBA II: Backup/Recovery and Network Administration
Opening Database after an Incomplete Recovery Must execute ALTER DATABASE OPEN RESETLOGS; statement to reset log sequence Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary • Not all available transactions are applied during an incomplete recovery • Data loss occurs • Use RECOVER DATABASE command with UNTIL CHANGE, UNTIL TIME, or UNTIL CANCEL keywords Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary (Cont.) • Perform a cold backup before and after an incomplete recovery • Cancel-based recovery is the least flexible • Time-based recovery requires DBA to know when the transaction was committed Oracle9i DBA II: Backup/Recovery and Network Administration
Chapter Summary (Cont.) • Change-based recovery results is least data loss • LogMiner utility can determine SCN of a specific transaction • Use SCN as termination point of a change-based recovery Oracle9i DBA II: Backup/Recovery and Network Administration