多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 數據庫 > 數據庫應用 > Overview of the Online Redo Log --- 在線重做日志概述

Overview of the Online Redo Log --- 在線重做日志概述

來源:程序員人生   發布時間:2015-01-04 09:01:51 閱讀次數:3708次

對 oracle 恢復來講最重要的數據結構莫過于online redo log(在線重做日志), 在線重做日志包括最少兩個預先分配好的,用來存儲數據庫變化的文件。在線重做日志記錄著數據文件中的變化。



Online Redo Log有甚么作用


Oracle 數據庫通過在線重做日志文件來確保數據不丟失。特別是當實例失敗后, oracle數據庫可以通過在線重做日志文件恢復已提交但還沒有寫到數據文件中的數據。

Oracle 數據庫把每一個事務先同步寫到 redo log buffer,然后再寫到在線重做日志文件中。日志的內容包括未提交的事務,undo數據,模式對象管理聲明。

Oracle 數據庫使用在線重做日志僅僅用于恢復。數據庫管理員也能夠使用 LogMiner這個工具來查詢在線重做日志。在線重做日志文件是1個有用的反應數據庫歷史的信息源。



Oracle數據庫怎樣寫 Online Redo Log


數據庫實例的在線重做日志通常也被稱為 redo線程。在單實例的環境中,僅僅只有1個實例訪問數據庫,因此只有1個 redo線程正在運行。而在 Oracle RAC環境中,通常有兩個或兩個以上的實例并發的訪問數據庫,每一個數據庫實例具有1個redo線程。每一個實例具有單獨的redo線程是為了不對唯1的在線重做日志文件的競爭。

在線重做日志1般包括兩個或兩個以上的日志文件。Oracle數據庫要求最少包括兩個日志文件來保證其中1個對寫可用,而另外1個用來歸檔(如果數據庫運行在歸檔模式下)



Online Redo Log切換


Oracle Database uses only one online redo log file at a time to store records written from the redo log buffer. The online redo log file to which the log writer (LGWR) process is actively writing is called the current online redo log file.


Oracle 數據庫同1時間只能使用1個在線重做日志文件來存儲 redo log buffer 中的數據。LGWR進程正在寫的在線重做日志文件稱為當前的在線重做日志文件。


A log switch occurs when the database stops writing to one online redo log file and begins writing to another. Normally, a switch occurs when the current online redo log file is full and writing must continue.However, you can configure log switches to occur at regular intervals,regardless of whether the current online redo log file is filled, and force logs witches manually.


日志切換產生在數據庫停止往1個在線重做日志文件并且開始往另外一個日志文件寫的時候。1般來講,鐺鐺前的在線重做日志文件已滿了并且還必須繼續寫的是偶,日志切換就會產生。然后,你可以設置日志切換定期產生,不管當前的在線重做日志文件是不是已充滿,強迫手動履行日志切換。


Log writer writes to online redo log files circularly. When log writer fills the last available online redo log file, the process writes to the first log file, restarting the cycle. Figure 11⑹ illustrates the circular writing of the redo log.


LGWR 循環的寫在線重做日志文件。當 LGWR 寫滿了最后1個在線重做日志文件,這個進程會重新往第1個日志文件中寫新的數據。


Figure 11⑹ Reuse of Online Redo Log Files




The numbers in Figure 11⑹ shows the sequence in which LGWR writes to each online redo log file. The database assigns each file a new log sequence number when a log switches and log writers begins writing to it. When the database reuses an online redo log file, this file receives the next available log sequence number.

Filled online redo log files are available for reuse depending on the archiving mode:

  • If archiving is disabled, which means that the database is in NOARCHIVELOG mode, then a filled online redo log file is available after the changes recorded in it have been checkpointed (written) to disk by database writer (DBW).
  • If archiving is enabled, which means that the database is in ARCHIVELOG mode, then a filled online redo log file is available to log writer after the changes have been written to the data files and the file has been archived.

已填充滿的在線重做日志文件是不是可以重用取決因而否是在歸檔模式下:

如果不是在歸檔模式下,當在線重做日志文件中的變化的記錄已被 DBW 進程寫到了磁盤上以后,已填充滿的在線重做日志文件可以重用;

如果是在歸檔模式下,當在線重做日志文件中變化的記錄已寫到數據文件中并且文件已歸檔后,已填充滿的在線重做日志文件可以重用;


In some circumstances, log writer may be prevented from reusing an existing online redo log file. For example, an online redo log file may be active (required for instance recovery) rather than inactive (not required for instance recovery). Also, an online redo log file may be in the process of being cleared.



Online Redo Log Files多個備份


Oracle Database can automatically maintain two or more identical copies of the online redo log in separate locations. An online redo log group consists of an online redo log file and its redundant copies. Each identical copy is a member of the online redo log group. Each group is defined by a number, such as group 1, group 2, and so on.


Oracle 數據庫能夠自動管理兩個或多個不同位置的在線重做日志文件的相同備份集。1個在線重做日志文件組包括1個在線重做日志文件和它的冗余備份。每一個完全相同的備份是在線重做日志文件組中的1個成員。每一個組用數字來定義,例如 group 1, group 2 等等。


Maintaining multiple members of an online redo log group protects against the loss of the redo log. Ideally, the locations of the members should be on separate disks so that the failure of one disk does not cause the loss of the entire online redo log.


保存在線重做日志文件組的多個成員來保證重做日志不丟失。理論上說,日志文件組的成員的寄存位置應當放在磁盤上的不同位置,這樣即便1個磁盤破壞也不會致使全部在線重做日志文件丟失。


In Figure 11⑺, A_LOG1 and B_LOG1 are identical members of group 1, while A_LOG2 and B_LOG2 are identical members of group 2. Each member in a group must be the same size. LGWR writes concurrently to group 1(members A_LOG1 and B_LOG1), then writes concurrently to group2 (members A_LOG2 and B_LOG2), then writes to group 1, and so on. LGWR never writes concurrently to members of different groups.


在圖 11⑺ 中,A_LOG1 和 B_LOG1 是 group 1 中的相同的成員,而 A_LOG2 和 B_LOG2 是 group 2中的相同的成員。每一個組中的成員必須大小1致。后臺進程 LGWR 并發的寫數據到 group 1,然后并發的寫數據到 group 2,然后再并發的寫數據到 group 1. LGWR 從不會并發寫數據到不同的組。


Figure 11⑺ Multiple Copies of Online Redo Log Files




注意: 

Oracle recommends that you multiplex the online redo log. The loss of log files can be catastrophic if recovery is required. When you multiplex the online redo log, the database must increase the amount of I/O it performs. Depending on your system, this additional I/O may impact overall database performance.

Oracle 推薦保存多份在線重做日志文件。日志文件的丟失對恢復來講將是致命的。但是當你保存多份在線重做日志時,數據庫必須增加履行 I/O 的數量。這類額外的 I/O 是不是會影響數據庫的整體性能取決于你的系統

 

Archived Redo Log Files(歸檔重做日志文件)


歸檔日志文件是在線重做日志文件的1個備份,也不認為是數據庫的1部份,但是歸檔日志文件是數據庫創建的在線重做日志文件的離線備份并且可以寫到指定的位置。

歸檔日志文件是和恢復策略中非常重要的部份,你可使用歸檔日志文件用來:

  • Recover a database backup (恢復數據庫)
  • Update a standby database (更新備用數據庫)
  • Obtain information about the history of a database using the LogMiner utility (通過logminer獲得數據庫的歷史信息)

歸檔是產生歸檔日志文件的1個操作,歸檔這個操作只有在數據庫運行在歸檔日志模式才有效,可以自動也能夠手動


An archived redo log file includes the redo entries and the log sequence number of the identical member of the online redo log group. In Figure 11⑺, files A_LOG1 and B_LOG1 are identical members of Group 1. If the database is in ARCHIVELOG mode, and if automatic archiving is enabled, then the archiver process (ARCn) will archive one of these files. If A_LOG1 is corrupted, then the process can archive B_LOG1. The archived redo log contains a copy of every group created since you enabled archiving.


1個歸檔日志文件包括redo entries(重做條目)和在線重做日志文件組相同的日志序列號。在圖 11⑺ 中,文件 A_LOG1 和 B_LOG1 是 Group 1 相同的成員。如果數據庫運行在歸檔日志模式下并且開啟了自動歸檔,那末歸檔進程(ARCn)將他們中1個進行歸檔。如果 A_LOG1 破壞了,歸檔進程可以對 B_LOG1 進行歸檔。如果你開啟了歸檔,已歸檔的重做日志文件將包括每一個在線重做日志文件組的備份。



Online Redo Log結構


在線重做日志中包括許多 redo records(重做記錄).1條重做記錄由1組改變向量組成,每一個改變向量描寫了對1個數據塊的修改。例如,在employees表中修改salary就會產生1條redo記錄,用來描寫這個表的數據段產生的變化,undo段數據塊和undo段的事務表。

重做記錄包括改變的所有相干的基本元數據,具體以下:

  • 改變時的SCN和時間戳
  • 產生這個變化的事務的ID
  • 事務提交的SCN和時間戳(如果已提交)
  • 產生變化的操作類型
  • 被修改的數據段的名字和類型

 

原文來自文檔:http://docs.oracle.com/cd/E11882_01/server.112/e40540/physical.htm#CNCPT1113

生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产九九精品 | aaaaaa级特色特黄的毛片 | 一区二区三区网站 | 伊人黄色 | 精品国产高清毛片 | 欧美日韩一区二区视频免费看 | 午夜精品久久久久久91 | 日韩欧美一区二区久久 | 久久久久久国产精品免费免 | 明星三级国产免费播放 | xxxx免费大片| 一二三四视频观看中文在线看 | 2020在线不卡观看视频 | 亚洲欧美日韩精品 | 在线看视频 | 亚洲一区 欧美 | 国产成人久视频免费 | 色婷婷成人| 一级黄色免费片 | 日本中文字幕在线视频 | 亚洲综合精品一区二区三区中文 | 98国内自拍在线视频 | 黄色大片aa | 欧美性受xxxx黑人xyx | 羞羞影院免费观看网址在线 | 久久国产精品一区二区三区 | 欧美yw精品日本国产精品 | 色老头福影院韩国激情影院 | 呦女亚洲一区精品 | 日本人成免费大片 | 亚洲免费网 | 激情综合色综合久久综合 | 波多野结衣中文一区 | 性欧美视频videos6一9 | 黄色免费网站大全 | 久久中文字幕日韩精品 | 影院成人区精品一区二区婷婷丽春院影视 | 亚洲第一影院 | 羞羞人成午夜爽爽影院 | 一本大道香蕉在线高清视频 | 中文字幕亚洲无线码a |