Understanding the redo (6) log but the process and REDO analysis of direct path Loading

Source: Internet
Author: User

Before the server process obtains the redo allocation latch for redo log buffer allocation, You need to sniff the redo log file to check whether there is sufficient space. If the space is insufficient, the sp will send a request for the switch log file and wait until the log file switch completion event is complete.

After a log request is sent, CKPT performs an incremental checkpoint event, while LGWR initiates a log change.

The specific process is as follows:

1) The LGWR process will find an available redo log file through the two-way linked list in the control file as the new current redo log.

The algorithm is as follows:

The log file is inactive and has been archived.

Prioritize unused Log File groups

2) flush the redo entries not written in the redo log buffer to the current online redo log file, the SCN of the last redo entries is recorded in the redo log header as the high SCN of the current log file, and the current online redo log file is closed.

3) conduct the second control file transaction and mark the closed redo log as ACTIVE (this is an incremental checkpoint event, the reason why it is identified as active, this is because the dirty buffer it protects may not be written to the data file. If it has all been written to the disk, it can be identified as inactive.) mark the new redo log as CURRENT, if the database is in archive mode, you need to record the old log group to the Control File Archive list record and notify ARCn to archive the log file.

4) LGWR opens all the members of the new log group and records the current log sequence # And the SCN (low scn) of the First redo block in the log file header)

5) LGWR modifies the flag in the SGA to generate new redo log information.

To sum up, log switching is an expensive operation. During the change period, all transactions to the database will be blocked. However, increasing the size of the redo log file is irrelevant to the amount of data lost. Reason:

1) redo entries is written in sequence, and one or more are written, which is the same for recovery.

2) Storage faults are certainly affected by all redo log files.

In ARCHIVE mode, direct path Loading records REDO. In non-archive log mode, direct path loading does not record REDO, But Oracle generates REDO because of system changes that require maintenance of segments, partitions, and tablespaces.

The redo log file is dumped to dump.

  1. 09:29:36 sys @ ORCL (^ ω ^) conn hr/hr
  2. Connected.
  3. 09:34:57 hr @ ORCL (^ ω ^)Create TableTestAs Select*FromDba_objectsWhere1 = 2;
  4. The table has been created.
  5. 09:35:41 hr @ ORCL (^ ω ^)SelectDbms_flashback.get_system_change_numberFromDual;
  6. GET_SYSTEM_CHANGE_NUMBER
  7. ------------------------
  8. 2804230
  9. 09:36:06 hr @ ORCL (^ ω ^)Select Group#, StatusFromV $ log;
  10. GROUP# STATUS
  11. ------------------------------------------
  12. 1CURRENT
  13. 2 INACTIVE
  14. 3 INACTIVE
  15. 09:36:26 hr @ ORCL (^ ω ^) col memberForA72
  16. 09:36:36 hr @ ORCL (^ ω ^)Select Group#, MemberFromV $ logfile;
  17. GROUP# MEMBER
  18. ----------------------------------------------------------------------------------
  19. 3 D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_3_7TQZWZOY_.LOG
  20. 3 D: \ ORACLE \ PRODUCT \ 10.2.0 \ FLASH_RECOVERY_AREA \ ORCL \ ONLINELOG \ O1_MF_3_7TQZ
  21. X11D_.LOG
  22. 2 D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_2_7TQZWXO2_.LOG
  23. 2 D: \ ORACLE \ PRODUCT \ 10.2.0 \ FLASH_RECOVERY_AREA \ ORCL \ ONLINELOG \ O1_MF_2_7TQZ
  24. WYPH_.LOG
  25. 1 D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_1_7TQZWVDD_.LOG
  26. 1 D: \ ORACLE \ PRODUCT \ 10.2.0 \ FLASH_RECOVERY_AREA \ ORCL \ ONLINELOG \ O1_MF_1_7TQZ
  27. WWJ8_.LOG
  28. You have selected 6 rows.
  29. 09:37:24 hr @ ORCL (^ ω ^)SelectDbms_flashback.get_system_change_numberFromDual;
  30. GET_SYSTEM_CHANGE_NUMBER
  31. ------------------------
  32. 2804353
  33. 09:37:59 hr @ ORCL (^ ω ^)Insert/* + Append */IntoTestSelect*FromDba_objects;
  34. You have created 50453 rows.
  35. 09:39:15 hr @ ORCL (^ ω ^)Commit;
  36. Submitted.
  37. 09:39:21 hr @ ORCL (^ ω ^)SelectDbms_flashback.get_system_change_numberFromDual;
  38. GET_SYSTEM_CHANGE_NUMBER
  39. ------------------------
  40. 2804521
  41. 09:39:29 hr @ ORCL (^ ω ^)AlterSystem dump logfile'D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_1_7TQZWVDD_.LOG'
  42. 09:40:25 2 scnMin2804353 scnMax2804521;
  43. The system has been changed.
  44. 09:40:57 hr @ ORCL (^ ω ^) conn/AsSysdba
  45. Connected.
  46. 09:41:09 sys @ ORCL (^ ω ^) archive log list
  47. Database Log mode archiving Mode
  48. Enable automatic archiving
  49. Archiving end point USE_DB_RECOVERY_FILE_DEST
  50. Oldest online log sequence 3
  51. Next archive log sequence 5
  52. Current Log sequence 5
  53. 09:41:19 sys @ ORCL (^ ω ^)AlterSystem dump logfile'D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_1_7TQZWVDD_.LOG'
  54. 09:43:23 2 scnMin2804230 scnMax2804521;
  55. The system has been changed.
  56. 09:44:03 sys @ ORCL (^ ω ^) conn hr/hr
  57. Connected.
  58. 09:45:58 hr @ ORCL (^ ω ^)SelectDbms_flashback.get_system_change_numberFromDual;
  59. GET_SYSTEM_CHANGE_NUMBER
  60. ------------------------
  61. 2804801
  62. 09:46:07 hr @ ORCL (^ ω ^)Insert/* + APPEND */IntoTextSelect*FromDba_objects;
  63. Insert/* + APPEND */IntoTextSelect*FromDba_objects
  64. *
  65. Row 3 has an error:
  66. ORA-00942: Table or view does not exist
  67. 09:47:42 hr @ ORCL (^ ω ^)Insert/* + APPEND */IntoTestSelect*FromDba_objects;
  68. You have created 50453 rows.
  69. 09:47:53 hr @ ORCL (^ ω ^)Commit;
  70. Submitted.
  71. 09:47:58 hr @ ORCL (^ ω ^)SelectDbms_flashback.get_system_change_numberFromDual;
  72. GET_SYSTEM_CHANGE_NUMBER
  73. ------------------------
  74. 2805155
  75. 09:48:10 hr @ ORCL (^ ω ^)Select Group#, StatusFromV $ log;
  76. GROUP# STATUS
  77. ------------------------------------------
  78. 1CURRENT
  79. 2 INACTIVE
  80. 3 INACTIVE
  81. 09:48:50 hr @ ORCL (^ ω ^)AlterSystem dump logfile'D: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ ONLINELOG \ O1_MF_1_7TQZWVDD_.LOG'
  82. 09:49:32 2 scnMin2804801 scnMax2805155;
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.