您好,登錄后才能下訂單哦!
一、環境描述
Oracle 12c 單實例DataGuard
Rhel 7.3
二、測試過程
主庫操作
1.關閉DG,切換日志
SQL> alter system set log_archive_dest_state_2=defer;
System altered.
SQL> show parameter log_archive_dest_state_2
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_state_2 string DEFER
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL>
2.rman刪除歸檔
RMAN> list archivelog all;
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - --------------------
40 1 31 A 26-NOV-2017 19:15:13
Name: /oracle/arch/1_31_958415134.dbf
42 1 32 A 26-NOV-2017 19:22:34
Name: /oracle/arch/1_32_958415134.dbf
RMAN> delete noprompt archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/oracle/arch/1_32_958415134.dbf thread=1 sequence=32
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================
Key Thrd Seq S Low Time
------- ---- ------- - --------------------
40 1 31 A 26-NOV-2017 19:15:13
Name: /oracle/arch/1_31_958415134.dbf
deleted archived log
archived log file name=/oracle/arch/1_31_958415134.dbf RECID=40 STAMP=961096954
Deleted 1 objects
RMAN>
三、小結
當我們DG環境,人為或者異常情況導致DG異常,沒有被應用的歸檔日志是不會被刪除的。這里可能會出現一個問題就是
當我們的磁盤空間緊張,可能生成大量的日志占滿磁盤,導致數據庫無法寫入的問題。需要我們有監控系統,發現DG異常及時處理
,千萬不要等著影響業務才被動的去處理。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。