【DataGuard】DG系列之邏輯備庫非即時更新小問題處理
一、概述
DataGuard越來越成為資料庫中災備和分擔壓力的重要工具,作為傳說中的DBA來說,你要下得了廚房、上得了廳堂。扯遠了,看看這個小問題吧,弱爆了。
二、處理過程:
這裡所說非即時,並不是人為延遲資料轉送、更新,主要問題在於當主庫更新表資料後備庫無法及時更新過來,在主庫手動歸檔後資料才傳輸過來。也就是當主庫操作後備庫備庫並沒有接收該事務(日誌),主庫切換歸檔後備庫讀取歸檔日誌資料才提取完成。為DG傳輸串流程
查看主庫、備庫相關參數配置,並無異常,也曾參照該dg配置搭建了一套測試的dg環境,而該測試環境資料則是即時更新的。在查看dg配置文檔時,發現測試環境開機記錄應用語句中多一個immediate; 此前並無查看官方及相關文檔,只是認為多一個它是立即開機記錄應用。通過查看官方文檔,得知,immediate的意思是立即應用日誌。說明如下:
To start SQL Apply, start the logical standby database and issue the following statement:
SQL> ALTER DATABASE START LOGICAL STANDBY APPLY;
To start real-time apply on the logical standby database to immediately apply redo data from the standby redo log files on the logical standby database, include the IMMEDIATE keyword as shown in the following statement:
SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
If the real-time apply feature is enabled, log apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have been applied already to the standby database by the time the failover or switchover begins.
Use the ALTER DATABASE statement to enable the real-time apply feature, as follows:
· For physical standby databases, issue the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE statement.
· For logical standby databases, issue the ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE statement.
Standby redo log files are required to use real-time apply
停止日誌應用,再次啟動(當然這次加了IMMEDIATE),查看錶資料,當然資料為即時更新。
三、總結
這個其實沒啥可總結的,基礎知識不牢固,還沒認真查看相關文檔,不多說了。
在CentOS 6.4下安裝Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虛擬機器中安裝步驟
Debian 下 安裝 Oracle 11g XE R2
Oracle Data Guard 重要配置參數
基於同一主機配置 Oracle 11g Data Guard
探索Oracle之11g DataGuard
Oracle Data Guard (RAC+DG) 歸檔刪除策略及指令碼
Oracle Data Guard 的角色轉換
Oracle Data Guard的日誌FAL gap問題
Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby 處理方法