【轉載】Oracle Data Guard 主庫 歸檔檔案 刪除策略

renjixinchina發表於2013-04-11

【轉載david的一片文章】:http://blog.csdn.net/tianlesoftware/article/details/6227965 

  對於Oracle Data Guard Maximum Availability Maximum Performance 兩種模式下的主庫歸檔檔案的刪除,必須是在歸檔檔案在備庫應用以後才可以刪除。

       對於Maximum Protection 模式,這種模式的日誌是同時寫到主庫和備庫的,所以這種模式下的主庫刪除歸檔,沒有限制。 可以直接刪除。

 

       那麼在Maximum Availability Maximum Performance下,RMAN 備份歸檔檔案的時候,如果我們加上delete input,那麼如何確定歸檔問及愛你該不該刪除。

 

  在10g之前的版本,只能透過作業系統指令碼的方式,在刪除歸檔檔案之前,首先對Standby端資料庫的歸檔檔案應用狀態作判斷,應用之後才能在Primary端執行正常刪除。

       Oracle 10g 後,RMAN提供了配置歸檔檔案刪除策略:    configure archivelog deletion policy

該策略對應兩個值:

APPLIED ON STANDBY 設定為該值時,當透過附加的 DELETE INPUT 子句刪除Standby資料庫仍需要的日誌時,會提示RMAN-08137錯誤。不過仍然可以手動地透過 DELETE ARCHIVELOG 方式刪除。

NONE 設定為該值時,則不啟用歸檔檔案的刪除策略。預設情況下就是NONE

 

 

我們配置一下:

RMAN> configure archivelog deletion policy to applied on standby;

 

old RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

new RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

new RMAN configuration parameters are successfully stored

RMAN-08591: WARNING: invalid archivelog deletion policy

 

這裡有個警告, 解決方法,執行如下命令:

SQL>alter system set "_log_deletion_policy"=ALL scope=spfile sid='*';

 

設定該引數以後,DB 需要重啟。

 

具體參考:

RMAN backups in Max Performance/Max Availability Data Guard Environment [ID 331924.1]

http://blog.csdn.net/tianlesoftware/archive/2011/03/07/6227944.aspx

 

修改之後,我們在設定:

RMAN> configure archivelog deletion policy to applied on standby;

 

using target database control file instead of recovery catalog

old RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

new RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

new RMAN configuration parameters are successfully stored

 

RMAN> configure archivelog deletion policy to none;

 

old RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

new RMAN configuration parameters:

CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

new RMAN configuration parameters are successfully stored

 

修改之後成功修改RMAN 的歸檔檔案刪除策略。

 

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

相關文章