Dataguard環境修改主庫和standby庫online redo log&standby redo log大小
當前環境:
Oracle 11.0.2.4 primary+standby
3組redo log group(每組200M),4組standby redo log
因為業務增加日誌切換頻繁,計劃修改redo logfile 到250M
select * from v$logfile
1 ONLINE /data/mes/redo01.log
2 ONLINE /data/mes/redo02.log
3 ONLINE /data/mes/redo03.log
11 STANDBY /data/mes/standbylog11.log
12 STANDBY /data/mes/standbylog12.log
13 STANDBY /data/mes/standbylog13.log
14 STANDBY /data/mes/standbylog14.log
分析說明:
1> 因為redo logfile不能直接修改大小,計劃先新增log group後,再刪除原log group
2> 因為dataguard環境涉及到主庫和standby的redo log、standby redo log相對複雜,分為下面8個步驟
具體步驟:
1. Standby 上增加新standby redo log
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database add standby logfile group 31 ('/data/mes/standbylog31.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 32 ('/data/mes/standbylog32.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 33 ('/data/mes/standbylog33.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 34 ('/data/mes/standbylog34.log') size 250M;
Database altered.
2. Standby 上刪除原standby redo log
SQL> alter database drop logfile group 11;
Database altered.
SQL> alter database drop logfile group 12;
Database altered.
SQL> alter database drop logfile group 13;
Database altered.
SQL> alter database drop logfile group 14;
Database altered.
3. 主庫上建立新redo log
SQL> alter database add logfile group 21 ('/data/mes/standbylog21.log') size 250M;
Database altered.
SQL> alter database add logfile group 22 ('/data/mes/standbylog22.log') size 250M;
Database altered.
SQL> alter database add logfile group 23 ('/data/mes/standbylog23.log') size 250M;
Database altered.
4.主庫上刪除原redo log
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance mes (thread 1) - cannot drop
ORA-00312: online log 3 thread 1: '/data/mes/redo03.log'
注:切換主庫redo logfile,待log group 3不為current和active時再刪除
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 3;
Database altered.
5. Standby上增加新redo log
SQL> show parameter standby
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SQL> alter system set standby_file_management=manual;
System altered.
SQL> alter database add logfile group 21 ('/data/mes/standbylog21.log') size 250M;
Database altered.
SQL> alter database add logfile group 22 ('/data/mes/standbylog22.log') size 250M;
Database altered.
SQL> alter database add logfile group 23 ('/data/mes/standbylog23.log') size 250M;
Database altered.
6.Standby上刪除原redo log
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
alter database drop logfile group 3
*
ERROR at line 1:
ORA-01623: log 3 is current log for instance mes (thread 1) - cannot drop
ORA-00312: online log 3 thread 1:
'/u01/product/fast_recovery_area/MESDG/onlinelog/o1_mf_3_f46lgbqp_.log'
在standby中查詢 v$log group 3為CURRENT狀態固不能drop 所以報錯
在主庫和standby分別執行下列SQL:
SELECT DISTINCT THREAD#,max(SEQUENCE#) OVER(PARTITION BY THREAD#) A FROM V$ARCHIVED_LOG;
主庫SEQUENCE#: 67,standby SEQUENCE#:65
standby運用下新產生的日誌以便switch current狀態的group 3
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
檢視standby中v$log 3 不為CURRENT 了,取消MRP再次drop group 3成功
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
7.主庫增加新standby redo log
SQL> alter database add standby logfile group 31 ('/data/mes/standbylog31.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 32 ('/data/mes/standbylog32.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 33 ('/data/mes/standbylog33.log') size 250M;
Database altered.
SQL> alter database add standby logfile group 34 ('/data/mes/standbylog34.log') size 250M;
Database altered.
8.主庫刪除原standby redo log
SQL> alter database drop logfile group 11;
Database altered.
SQL> alter database drop logfile group 12;
Database altered.
SQL> alter database drop logfile group 13;
Database altered.
SQL> alter database drop logfile group 14;
Database altered.
最後,standby中開啟MRP後,所有操作完成
SQL> alter system set standby_file_management=auto;
System altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
select * from v$logfile
21 ONLINE /data/mes/standbylog21.log
22 ONLINE /data/mes/standbylog22.log
23 ONLINE /data/mes/standbylog23.log
31 STANDBY /data/mes/standbylog31.log
32 STANDBY /data/mes/standbylog32.log
33 STANDBY /data/mes/standbylog33.log
34 STANDBY /data/mes/standbylog34.log
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-2149421/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 線上修改online redo logfiles size 大小Oracle
- 修改oracle redo log的大小Oracle Redo
- 【操作】調整Online Redo Logs大小(Resizing Oracle Online Redo Logs)Oracle
- Data Guard 環境下 主備庫Redo log 的新增與刪除
- Oracle Dataguard Standby Redo Log的兩個實驗Oracle
- 修改online redo日誌檔案大小
- online redo log 操作 -- 更改RAC資料庫日誌檔案大小資料庫
- 主庫新增redo log或刪除redo log,這些資訊不會同步到備庫
- standby redo log的理解
- 線上修改redo.log檔案的大小
- 主庫歷經open resetlogs後,如何redo apply 物理備庫_flashback physical standby dbAPP
- Oracle DataGuard環境主備庫日誌組數和大小調整Oracle
- Online Redo Log 結構
- Dataguard主庫上與redo transport service相關的等待事件事件
- 【DATAGUARD 學習】測試standby應用REDO
- 增大redo log檔案大小
- 如何設定redo log的OMF 及如何修改log檔案大小
- Redo Log Buffer的大小設定
- Oracle Standby Redo Log實驗兩則Oracle
- 4.2.1.6 選擇資料庫並設定 Redo Log 塊的大小資料庫
- undo log和redo log
- 線上修改REDO LOG的大小及增加新的日誌組
- MySQL 5.6修改REDO日誌的大小和個數MySql
- Oracle調整redo log日誌大小Oracle
- DG學習筆記(5)_Standby Redo Log筆記
- 【聽海日誌】之DATAGUARD新增redo log
- Redo Log之一:理解Oracle redo logOracle Redo
- RAC和Dataguard環境下主備庫切換演練模板
- Failover過程涉及standby redo log的實驗和理解AI
- Oracle RAC+DG 調整redo/standby log fileOracle
- MySQL如何計算統計redo log大小MySql
- archive log檔案大小與redo log檔案大小關係探究Hive
- redo log 丟失(非歸檔模式,資料庫正常關閉,redo log 被誤刪除!)模式資料庫
- redo的等待log file sync和log file parallel write和redo size設定Parallel
- 【DATAGUARD 學習】監控primary庫和standby庫
- Usage, Benefits and Limitations of Standby Redo Logs (SRL) [ID 219344.1]MIT
- [筆記]RAC上改變redo logfile大小筆記
- MySQL中的redo log和undo logMySql