Oracle 11g Data Guard 物理備庫開啟日誌延時應用流程

feelpurple發表於2015-11-30

1、在備庫上面,關閉日誌實時應用。

如果物理備庫開啟日誌實時應用,則會導致引數設定失敗。如果不是延時應用,則只有當主庫發生歸檔時,備庫才會啟動歸檔日誌的應用,在備庫啟動日誌應用後,會按照設定的DELAY值進行延時應用。

sqlplus / as sysdba

 

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

 

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;


2、在主庫上面,設定 DELAY 引數

sqlplus / as sysdba

--查詢遠端歸檔日誌的目錄

Show parameter log_archive_dest_2

 

--設定 DELAY 引數,DELAY引數的單位是分,如設定2小時,則為120

alter system set LOG_ARCHIVE_DEST_2='SERVICE=misdbdg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=misdbdg DELAY=120' scope=both;

 

--切換歸檔日誌

alter system switch logfile;


3、備庫關閉日誌延時應用,恢復到日誌實時應用

在備庫上面執行下面命令

sqlplus / as sysdba

 

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

 

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;


如果物理備庫沒有開啟日誌的實時應用,則在備庫使用下面命令關閉 DELAY 引數

sqlplus / as sysdba

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;



4、如果是物理備庫,並開啟了實時應用的話,會導致引數設定失效

下面是主庫 alert 日誌的報錯資訊

ALTER SYSTEM SET log_archive_dest_2='SERVICE=newdbdg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=newdbdg DELAY=5' SCOPE=BOTH;
Tue Nov 24 17:29:58 2015
Thread 1 advanced to log sequence 51 (LGWR switch)
  Current log# 5 seq# 51 mem# 0: /u01/app/oracle/oradata/newdb/redo05a.log
  Current log# 5 seq# 51 mem# 1: /u01/app/oracle/oradata/newdb/redo05b.log
Tue Nov 24 17:29:58 2015
******************************************************************
TT00: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
Tue Nov 24 17:29:58 2015
Archived Log entry 68 added for thread 1 sequence 50 ID 0xbae9db91 dest 1:
Tue Nov 24 17:29:59 2015
WARNING: Managed Standby Recovery started with REAL TIME APPLY 
  DELAY 5 minutes specified at primary ignored
WARNING: Managed Standby Recovery started with REAL TIME APPLY 
  DELAY 5 minutes specified at primary ignored
TT00: Standby redo logfile selected for thread 1 sequence 51 for destination LOG_ARCHIVE_DEST_2

下面是備庫 alert 日誌的報錯資訊


Thu Nov 26 15:07:17 2015
WARNING: Managed Standby Recovery started with REAL TIME APPLY
  DELAY 5 minutes specified at primary ignored


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1849880/,如需轉載,請註明出處,否則將追究法律責任。

相關文章