Presentation is loading. Please wait.

Presentation is loading. Please wait.

1-1 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN

Similar presentations


Presentation on theme: "1-1 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN"— Presentation transcript:

1 1-1 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN john.hibbard@oracle.com

2 1-2 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 database buffer cache data file 2 data file 4 rollback file 3 1234 5 XYZ Zack

3 1-3 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 5 database buffer cache data file 2 data file 4 rollback file 3 1234 5 XYZ Zack

4 1-4 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 5 The roll back block is then retrieved from disk to the database buffer cache (unless it ’ s already there) RB1 database buffer cache data file 2 data file 4 rollback file 3 1234 5 XYZ Zack

5 1-5 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 5 The roll back block is then retrieved from disk to the database buffer cache (unless it ’ s already there) RB1 database buffer cache data file 2 data file 4 rollback file 3 The roll back data is created showing the ‘ before image ’ 5 1234 5 XYZ Zack

6 1-6 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 5 The roll back block is then retrieved from disk to the database buffer cache (unless it ’ s already there) RB1 database buffer cache data file 2 data file 4 rollback file 3 The roll back data is created showing the ‘ before image ’ 5 And an entry recording this change is made in the REDO buffer Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack

7 1-7 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack Information is also recorded identifying the location of the data segment being changed. When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234

8 1-8 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack Then the data block is changed... x 10

9 1-9 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack Then the data block is changed... x 10 And an entry recording this change is made in the REDO buffer T1 2 123 41 6 10

10 1-10 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack Then the data block is changed... And an entry recording this change is made in the REDO buffer T1 2 123 41 6 10 x 10

11 1-11 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation data file 2 data file 4 rollback file 3 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 Only the very basic data is stored in the redo. The main redo items are: Keypoint Transaction identifier Column address Value of the column that changed

12 1-12 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 This continues for all changes User # 2 UPDATE prod SET large_col... WHERE id = XYZ

13 1-13 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 This continues for all changes User # 2 UPDATE prod SET large_col... WHERE id = XYZ XYZ Zack

14 1-14 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 This continues for all changes User # 2 UPDATE prod SET large_col... WHERE id = XYZ XYZ Zack RB2 Zack T87 3 65 - - Zack

15 1-15 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 This continues for all changes User # 2 UPDATE prod SET large_col... WHERE id = XYZ XYZ Zack RB2 Zack T87 3 65 - - Zack xx &&&& T87 4 89 28 22 &&&

16 1-16 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation When user enters … User #1 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 This continues for all changes User # 2 UPDATE prod SET large_col... WHERE id = XYZ XYZ Zack RB2 Zack T87 3 65 - - Zack xx &&&& T87 4 89 28 22 &&&& User #1 UPDATE emp SET sal = 20 WHERE id =1234 10 T1 3 12 - - 10 x 20 T1 2 123 41 6 20

17 1-17 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 XYZ Zack RB2 Zack T87 3 65 - - Zack xx &&&& T87 4 89 28 22 &&&& 10 T1 3 12 - - 10 x 20 T1 2 123 41 6 20 Then a user commits User #1 commit;

18 1-18 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 XYZ Zack RB2 Zack T87 3 65 - - Zack xx &&&& T87 4 89 28 22 &&&& 10 T1 3 12 - - 10 x 20 T1 2 123 41 6 20 Then a user commits User #1 commit; And an entry recording the commit is made in the REDO buffer T1 commit SCN time stamp

19 1-19 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation 1234 5 RB1 database buffer cache data file 2 data file 4 rollback file 3 5 Redo Buffer Tran File Block Row Column Value id T1 3 12 - - 5 1234 5 XYZ Zack T1 2 123 41 6 10 x 10 XYZ Zack RB2 Zack T87 3 65 - - Zack xx &&&& T87 4 89 28 22 &&&& 10 T1 3 12 - - 10 x 20 T1 2 123 41 6 20 Then a user commits User #1 commit; And an entry recording the commit is made in the REDO buffer T1 commit SCN time stamp This entry consists of: a “ code ” to indicate this is a commit (as opposed to a rollback or checkpoint) a timestamp the current SCN

20 1-20 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation What is an SCN? Thought you ’ d never ask!!!

21 1-21 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint

22 1-22 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint For Example: 3256 this SCN was assigned to the last transaction that issued a commit

23 1-23 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint For Example: 3256 3257 this SCN was assigned to the last transaction that issued a commit

24 1-24 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint For Example: 3256 3257 3258 this SCN was assigned to the last transaction that issued a commit

25 1-25 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint For Example: 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 this SCN was assigned to the last transaction that issued a commit

26 1-26 Copyright © Oracle Corporation, 2002. All rights reserved. System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “ time ” of a commit, rollback or checkpoint For Example: 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 If one SCN is larger than another it means it was committed after the smaller was committed … and vice versa

27 1-27 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation Log 1Log 2 LGWR The log data will now get written to the logfile by the log writer (LGWR). LGWR writes when: Commit Buffer is 1/3 full Checkpoint 1 Meg of data in buffer DBWR writes 3 seconds Redo Buffer T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp

28 1-28 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation Log 1Log 2 LGWR Notice that even though it was only transaction T1 that committed the data for T87 also was written even though it is not committed. Redo Buffer T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp

29 1-29 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR While this data is being written to the log file other data can continue to be placed in the redo buffer until the buffer is full. Notice the two commits. Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp Log 1Log 2

30 1-30 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR While this data is being written to the log file other data can continue to be placed in the redo buffer until the buffer is full Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp Since LGWR is busy the two commits are “ piggybacked ” LGWR will write both at the same time and will use the same SCN for both T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp Log 1Log 2

31 1-31 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR When LGWR finishes writing the group of log records the user is notified that their data has been committed. LGWR then begins writing the next group of log records. Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp Log 1Log 2

32 1-32 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp Log 1Log 2

33 1-33 Copyright © Oracle Corporation, 2002. All rights reserved. T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp Redo Buffer Operation LGWR Additional data continues to be added to the redo buffer overwriting the previously written data T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp Log 1Log 2

34 1-34 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR Additional data continues to be added to the redo buffer overwriting the previously written data T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Log 1Log 2

35 1-35 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 OUCH! The REDO BUFFER just filled up! Log 1Log 2

36 1-36 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation All the users doing DML get this object on their screen for their efforts!

37 1-37 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation

38 1-38 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Buffer Operation LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Redo Buffer T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Solution: REDO BUFFER needs to be larger Log 1Log 2

39 1-39 Copyright © Oracle Corporation, 2002. All rights reserved. NOW …. To revert back to our discussion about the physical redo logs

40 1-40 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation LGWR continues writing to the log until the log fills up. Log 1Log 2 LGWR

41 1-41 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation LGWR continues writing to the log until the log fills up. Log 1Log 2 LGWR

42 1-42 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation LGWR continues writing to the log until the log fills up. Log 1Log 2 LGWR

43 1-43 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation LGWR continues writing to the log until the log fills up. LGWR then begins writing to the next redo log. This is called a log switch. Log 1Log 2 LGWR

44 1-44 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation Log 1Log 2 For safety ’ s sake redo logs should always be mirrored. ALTER DATABASE ADD LOGFILE MEMBER log1b TO GROUP 1; ALTER DATABASE ADD LOGFILE MEMBER log2b TO GROUP 2; a a b b Note: this method is recommended instead of or in addition to using hardware mirroring Log 1Log 2

45 1-45 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log Operation Log 1Log 2 For safety ’ s sake redo logs should always be mirrored. ALTER DATABASE ADD LOGFILE MEMBER log1b TO GROUP 1; ALTER DATABASE ADD LOGFILE MEMBER log2b TO GROUP 2; a a b b Note: this method is recommended instead of or in addition to using hardware mirroring LGWR will then write to the multiple logs simultaneously Log 1Log 2 LGWR

46 1-46 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery The Oracle recovery process has three parts performed in this order: Roll Forward: all changes made to data blocks that had not been written to the data files on disk are performed again by reapplying (redoing) the images originally recorded on the Redo Log. Open Database: users can begin normal operations Rollback: uncommitted transactions are rolled back

47 1-47 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack When recovery begins the control file is accessed to determine which enty in the redo log is to be used to start the roll foward portion of recovery. Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Control File

48 1-48 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack That entry in the Redo Log is accessed. The referenced block is retrieved from disk to the database buffer cache (unless it ’ s already there). It happens to be a roll back block. RB1 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22

49 1-49 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack That entry in the Redo Log is accessed. The referenced block is retrieved from disk to the database buffer cache (unless it ’ s already there). It happens to be a roll back block. RB1 The roll back data is recreated showing the ‘ before image ’ 5 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22

50 1-50 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 20 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Then …

51 1-51 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Then … The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) Notice that the value in the data block is greater than the redo data!

52 1-52 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 The data block is retrieved from disk to the database buffer cache (unless it ’ s already there) 1234 20 Notice that the value in the data block is greater than the redo data! The data is recreated showing the ‘ after image ’ x 10 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Then …

53 1-53 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 x 10 RB2 Zack Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Then the next entry....

54 1-54 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 x 10 RB2 Zack XYZ Zack xx &&&& Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 and the next......

55 1-55 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 x 10 RB2 Zack XYZ Zack xx &&&& 10 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 etc.,

56 1-56 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 x 20 RB2 Zack XYZ Zack xx &&&& 10 Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Notice that the value in the data block has now been restored to the value on disk. etc.,

57 1-57 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack RB1 5 1234 20 RB2 Zack XYZ Zack xx &&&& 10 C C The transaction has been “ re-committed ” Redo Log Tran File Block Row Column Value id T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 etc., etc., etc. x 20

58 1-58 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value RB1 5 1234 20 RB2 Zack XYZ Zack xx &&&& 10 After processing the remainder of the redo log.... the buffer cache and data files will have been rebuilt to appear as they were at the time of the crash. Keypoint x 20 C C

59 1-59 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value RB1 5 1234 20 RB2 Zack XYZ Zack xx &&&& 10 C C The database is then opened so the users can begin work..... x 20

60 1-60 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery database buffer cache data file 2 data file 4 rollback file 3 1234 20 XYZ Zack Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value RB1 5 1234 20 RB2 Zack XYZ Zack xx &&&& 10 C C The database is then opened so the users can begin work..... then all uncommitted transactions will be rolled back. x 20

61 1-61 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 Beginning with 9i The method for performing the roll forward phase has been changed to improve performance.

62 1-62 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 An entry is placed in the redo log whenever DBWR writes data to disk. It identifies the blocks that were just written. Beginning with 9i

63 1-63 Copyright © Oracle Corporation, 2002. All rights reserved. Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 To improve performance during instance recovery the redo log is processed twice first to identify the entries that need to be processed second to process the selected entries Beginning with 9i

64 1-64 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 First pass of redo data Identify redo that needs to be processed No data blocks are read Very fast Identify the Entries

65 1-65 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Copy the REDO....

66 1-66 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Remove entries for those blocks already written....

67 1-67 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Remove entries for those blocks already written....

68 1-68 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Remove entries for those blocks already written....

69 1-69 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Remove entries for those blocks already written....

70 1-70 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Remove entries for those blocks already written....

71 1-71 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 Finish the list....

72 1-72 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77

73 1-73 Copyright © Oracle Corporation, 2002. All rights reserved. Identify the Entries Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Tran File Block Row Column Value DBWn 3 / 12 2/123 3 / 65 4 / 89 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77

74 1-74 Copyright © Oracle Corporation, 2002. All rights reserved. T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Second Second pass of redo data Recover using these selected entries Process the Entries

75 1-75 Copyright © Oracle Corporation, 2002. All rights reserved. This concludes the demonstration of Redo Logs and Recovery

76 1-76 Copyright © Oracle Corporation, 2002. All rights reserved.


Download ppt "1-1 Copyright © Oracle Corporation, 2002. All rights reserved. Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN"

Similar presentations


Ads by Google