1. 程式人生 > >dg的幾個redo解釋及備庫目錄

dg的幾個redo解釋及備庫目錄

dg恢復操作的幾個最主要的結構就是線上redo,歸檔redo,與standby redo,主庫上的redo被備庫上的remote file server(rfs)程序接受,rfs程序寫redo檔案到歸檔日誌檔案或是standby redo檔案中,redo資料可以再歸檔redo檔案中被應用或是在stand by redo檔案中被直接應用。

線上redo日誌

主庫與備庫上的每個例項都有一個線上日誌來保護資料庫防止例項故障,物理備庫不適用線上redo日誌,因為物理備庫不在讀寫模式開啟,物理備庫上不會有改變,新的redo不會生成。

歸檔redo檔案

歸檔檔案是用來保持備庫和主庫事務一致性的,主庫,物理與邏輯備庫都使用歸檔redo檔案。與物理備庫不同,邏輯備庫是開啟資料庫的,會產生redo資料,有很多的日誌檔案,包含,線上日誌檔案,歸檔日誌檔案,和standby 日誌檔案。

standby redo 檔案

standby日誌檔案與線上日誌檔案類似,但是standby日誌檔案是用來存放別的庫傳來的redo資料的。如果要實現下面的事情,就需要standby redo log

1最大保護和最大可用性級別的資料保護。

2實時應用

3級聯目的地

standby redo日誌提供下面的好處:

1standby日誌能放到裸裝置上

2standby能放多分

3在故障轉移的時候,dg可以在standby redo檔案中恢復和應用redo資料,而不是隻在歸檔中

4arc程序和lgwr程序可以直接傳輸主庫上的redo到備庫的redo檔案上,消除了註冊歸檔日誌檔案的步驟。

備庫的路徑可能有下面的幾個形式

Standby System Directory Structure Consequences
Same as primary system Different than primary system (required)
  • You must set the DB_UNIQUE_NAME initialization parameter.
  • You can either manually rename files or set up the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters on the standby database to automatically update the path names for primary database datafiles and archived redo log files and standby redo log files in the standby database control file. (See Section 3.1.4

    .)

  • The standby database does not protect against disasters that destroy the system on which the primary and standby databases reside, but it does provide switchover capabilities for planned maintenance.

Separate system Same as primary system
  • You do not need to rename primary database files, archived redo log files, and standby redo log files in the standby database control file, although you can still do so if you want a new naming scheme (for example, to spread the files among different disks).
  • By locating the standby database on separate physical media, you safeguard the data on the primary database against disasters that destroy the primary system.

Separate system Different than primary system
  • You can either manually rename files or set up the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters on the standby database to automatically rename the datafiles (see Section 3.1.4).
  • By locating the standby database on separate physical media, you safeguard the data on the primary database against disasters that destroy the primary system.