【聽海日誌】之DATAGUARD新增redo log
最近在整理資料庫發現dataguard主庫的線上日誌切換非常頻繁,檢查發現是因為建庫的時候把redo log設定的太小造成的,為了使日誌切換不太頻繁,所以手工新增了大的日誌檔案,然後刪除了舊的日誌檔案,主要流程如下:
一、At the primary site1.1 設定STANDBY_FILE_MANAGEMENT為手工管理
Set STANDBY_FILE_MANAGEMENT to MANUAL:
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
1.2 增加新日誌組Add the new redo logfile groups of the required sizes:
SQL> ALTER DATABASE ADD LOGFILE GROUP 1 ('/opt/oracle/oradata/dbserver1/redo01.log') SIZE 512M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 2 ('/opt/oracle/oradata/dbserver1/redo02.log') SIZE 512M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 3 ('/opt/oracle/oradata/dbserver1/redo03.log') SIZE 512M;
1.3 刪除舊日誌組Drop the old groups, this may involve performing log switches to ensure the old logs have been archived correctly or could be performed later once oracle has finished with the logs.
SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
SQL> ALTER DATABASE DROP LOGFILE GROUP 2;
SQL> ALTER DATABASE DROP LOGFILE GROUP 3;
1.4 重新設定STANDBY_FILE_MANAGEMENT為自動管理Set STANDBY_FILE_MANAGEMENT to AUTO.
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
二、At the standby site2.1 停止redo apply service
Stop Redo apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
2.2 修改STANDBY_FILE_MANAGEMENT為手工管理Set STANDBY_FILE_MANAGEMENT to MANUAL:
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='MANUAL';
2.3 增加日誌組Add Redolog File Group:
SQL> ALTER DATABASE ADD LOGFILE GROUP 4 ('/home/oracle/oracle/oradata/dbserver1/redo04.log') SIZE 50M;
SQL> ALTER DATABASE ADD LOGFILE GROUP 4 SIZE 50M;
注:如果不指定檔名,系統會預設生成一個日誌組成員,名字系統自己生成,以後自己新增的日誌組成員也不能指定名字,否則會顯示無效。所以DG中最好用第一種方法新增日誌組。
SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
SQL> ALTER DATABASE DROP LOGFILE GROUP 2;
SQL> ALTER DATABASE DROP LOGFILE GROUP 3;
SQL> Add as many Redo Logfile Groups (or Members) you want to add.
2.4 修改STANDBY_FILE_MANAGEMENT為自動管理Set STANDBY_FILE_MANAGEMENT to AUTO :
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
2.5 檢查線上日誌組Check the Status of the Online Redolog Group:
SQL> SELECT GROUP#, STATUS FROM V$LOG;
GROUP# STATUS
---------- ----------------
1 CLEARING_CURRENT
3 CLEARING
2 CLEARING
If Status is CLEARING_CURRENT then you cannot drop Online Redolog Group. You will get ORA-01623 if you try to drop a Redolog Group with Status CLEARING_CURRENT.
For Status CLEARING, UNUSED, INACTIVE please follow below steps.
2.6 清理線上日誌組Clear the Online Redo Logfile Group:
SQL> ALTER DATABASE CLEAR LOGFILE GROUP 2;
2.7 刪除線上日誌組Drop the Online Redo Logfile Group:
SQL>ALTER DATABASE DROP LOGFILE GROUP 2;
If you have skipped ‘Set STANDBY_FILE_MANAGEMENT to AUTO’ then you will get ORA-01624 while droping the Online Redolog Group with Status CLEARING. Then set STANDBY_FILE_MANAGEMENT to AUTO:
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO';
2.8 開啟redo apply serviceStart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/751371/viewspace-731949/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【聽海日誌】之SCN與OracleOracle
- 【聽海日誌】之Oracle SQL*LOADEROracleSQL
- 【聽海日誌】之ORACLE恢復案例Oracle
- MySQL重做日誌(redo log)MySql
- redo log日誌挖掘(二)
- redo log日誌挖掘(一)
- 線上重建redo log日誌組
- 【聽海日誌】之ORA-01455故障排查
- 【聽海日誌】之ORACLE遞迴查詢學習Oracle遞迴
- MySQL 日誌系統 redo log、binlogMySql
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- 【聽海日誌】之ORACLE 10G AWR安裝使用Oracle 10g
- Oracle調整redo log日誌大小Oracle
- 【聽海日誌】之Oracle 10g閃回資料庫Oracle 10g資料庫
- 重做日誌(redo log)相關總結
- mysql日誌:redo log、binlog、undo log 區別與作用MySql
- 資料庫篇:mysql日誌型別之 redo、undo、binlog資料庫MySql型別
- 10G DATAGUARD增加REDO日誌組、刪除日誌組、刪除日誌成員實驗
- DB2 的事務日誌(redo log)DB2
- 【REDO】刪除REDO LOG重做日誌組後需要手工刪除對應的日誌檔案
- REDO日誌管理
- dataguard之物理standby 日誌切換
- 【REDO】重做日誌檔案(redo log files)管理(增,刪,改,查,切)
- 分散式系統原理--日誌技術Redo Log分散式
- 如何在DATAGUARD中新增刪除聯機日誌
- 管理監聽器日誌listener.log
- MySQL更新資料時,日誌(redo log、binlog)執行流程MySql
- 新增redo日誌的時候,錯誤新增了一個節點的redo,怎麼辦?
- oracle聯機日誌檔案REDO LOGFILE簡述Oracle
- redo日誌損壞
- redo重做日誌管理
- MySQL 日誌 undo | redoMySql
- rac scan listener log 清理監聽日誌 oracleOracle
- 必須瞭解的mysql三大日誌-binlog、redo log和undo logMySql
- listener_scan1.log、listener.log監聽日誌清理
- 監聽狀態對dataguard及其日誌傳輸的影響
- 線上修改REDO LOG的大小及增加新的日誌組