對於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]
修改之后,我們在設置:
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的歸檔文件刪除策略。
---------------------------------------------------------------------------------------------------
Blog:http://blog.csdn.net/tianlesoftware
網上資源:http://tianlesoftware.download.csdn.net
相關視頻:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1群:62697716(滿); DBA2群:62697977(滿) DBA3群:62697850(滿)
DBA超級群:63306533(滿); DBA4群:83829929 DBA5群:142216823
聊天 群:40132017
--加群需要在備注說明Oracle表空間和數據文件的關系,否則拒絕申請