Oracle RAC+DG 調整redo/standby log file
環境:
Oracle 11.2.0.4.0 RAC+DG
其中DG主庫和備庫均為兩節點RAC
調整:
調整redo/standby log file大小,由1G調大2G。
操作如下:
一、主庫CJC資料庫(節點1)
1、檢查ASM磁碟組空間是否足夠
調整redo/standby log file su - grid sqlplus / as sysasm select name,free_mb,total_mb from v$asm_diskgroup; su – oracle sqlplus / as sysdba
2、先為兩個例項分別新增兩組(每組兩個)redolog檔案
alter database add logfile thread 1 group 35 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 36 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 37 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 38 ('+CJC_DATA','+CJC_ARCH') size 2g;
3、查詢當前redo所在組,手動切換日誌到新增redolog檔案上
select * from v$log; 在兩個節點執行,直至到達新增log上 alter system switch logfile; 手動生成檢查點: alter system checkpoint;
4、查詢log資訊,刪除非活動日誌
select thread#,group#,members,bytes/1024/1024 mb,status from v$log order by thread#,2; alter database drop logfile group 1; alter database drop logfile group 2; alter database drop logfile group 3; alter database drop logfile group 4; alter database drop logfile group 5; alter database drop logfile group 6; alter database drop logfile group 7; alter database drop logfile group 8; alter database drop logfile group 9; alter database drop logfile group 10; alter database drop logfile group 11; alter database drop logfile group 12; alter database drop logfile group 13; alter database drop logfile group 14; alter database drop logfile group 15; alter database drop logfile group 16;
5、刪除asm磁碟組上舊的log group
說明: 如果在建立redo log file時,沒有指定具體redo log 名稱,即透過OMF管理指定生成redo log名稱,在執行drop logfile時,ASM磁碟組內的redo log也會自動刪除。 如果在建立redo log file時,指定了具體redo log 名稱,例如redo01.log,redo02.log等,在執行drop logfile時,ASM磁碟組內的redo log不會自動刪除,如果空間不足,可以考慮手動刪除。 su - grid asmcmd cd +BJ_SY_BFESB_DATA rm group_1到group_16 確保刪除的log不在select * from v$logifle裡。
6、重新新增redo,每個例項新增8組日誌
alter database add logfile thread 1 group 1 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 2 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 3 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 4 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 5 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 6 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 7 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 8 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 9 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 10 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 11 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 12 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 13 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 14 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 1 group 15 ('+CJC_DATA','+CJC_ARCH') size 2g; alter database add logfile thread 2 group 16 ('+CJC_DATA','+CJC_ARCH') size 2g;
7、刪除臨時新增的group 35,36,37,38
select * from v$logfile; alter database drop logfile group 35; alter database drop logfile group 36; alter database drop logfile group 37; alter database drop logfile group 38; 刪除asm磁碟組上舊的log group su - grid asmcmd cd +CJC_DATA rm group_35到group_38 確保刪除的log不在select * from v$logifle裡。
8、查詢standbylog資訊,並刪除非活動的
select * from v$standby_log; alter database drop standby logfile group 17; alter database drop standby logfile group 18; alter database drop standby logfile group 19; alter database drop standby logfile group 20; alter database drop standby logfile group 21; alter database drop standby logfile group 22; alter database drop standby logfile group 23; alter database drop standby logfile group 24; alter database drop standby logfile group 25; alter database drop standby logfile group 26; alter database drop standby logfile group 27; alter database drop standby logfile group 28; alter database drop standby logfile group 29; alter database drop standby logfile group 30; alter database drop standby logfile group 31; alter database drop standby logfile group 32; alter database drop standby logfile group 33; alter database drop standby logfile group 34;
9、刪除asm磁碟組上舊的standby log group
su - grid asmcmd cd +CJC_DATA rm standby_17到standby_34 確保刪除的log不在select * from v$standby_log裡。
10、新增standby log,每個例項9組
alter database add standby logfile thread 1 group 17 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 18 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 19 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 20 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 21 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 22 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 23 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 24 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 25 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 26 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 27 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 28 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 29 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 30 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 31 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 32 ('+CJC_DATA') size 2g; alter database add standby logfile thread 1 group 33 ('+CJC_DATA') size 2g; alter database add standby logfile thread 2 group 34 ('+CJC_DATA') size 2g;
11、再次查詢v$log日誌資訊
set line 200 pagesize 999 col member for a60 col dbid for a20 select * from v$log;
二、備庫CJC資料庫
1、調整standby_file_management
sqlplus / as sysdba ---將standby_file_management由auto調整為mamual show parameter standby_file_management alter system set standby_file_management=MANUAL scope=both; show parameter standby_file_management
2、斷開備庫備庫日誌應用
select process,status,thread#,sequence#,block#,blocks from v$managed_standby; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; select process,status,thread#,sequence#,block#,blocks from v$managed_standby;
3、查詢當前redo所在組,手動切換日誌到新增redolog檔案上
select * from v$log;
4、透過查詢v$log,刪除非活動日誌
Current狀態日誌組無法刪除,需要先跳過。 如果redo log file狀態是active,嘗試手動生成檢查點。 set line 300 set pagesize 100 col member for a65 select * from v$log; select * from v$logfile; select thread#,group#,members,bytes/1024/1024 mb,status from v$log order by thread#,2; alter database drop logfile group 1; alter database drop logfile group 2; alter database drop logfile group 3; alter database drop logfile group 4; alter database drop logfile group 5; alter database drop logfile group 6; alter database drop logfile group 7; alter database drop logfile group 8; alter database drop logfile group 9; alter database drop logfile group 10; alter database drop logfile group 11; alter database drop logfile group 12; alter database drop logfile group 13; alter database drop logfile group 14; alter database drop logfile group 15; alter database drop logfile group 16;
如果刪除失敗,可以先執行clear,在執行drop。
alter database clear logfile group 1; alter database clear logfile group 2; alter database clear logfile group 3; alter database clear logfile group 4; alter database clear logfile group 5; alter database clear logfile group 6; alter database clear logfile group 7; alter database clear logfile group 8; alter database clear logfile group 9; alter database clear logfile group 10; alter database clear logfile group 11; alter database clear logfile group 12; alter database clear logfile group 13; alter database clear logfile group 14; alter database clear logfile group 15; alter database clear logfile group 16; 如果執行clear後仍不能drop,可以嘗試調整LOG_FILE_NAME_CONVERT引數。
5、刪除asm磁碟組上舊的log group
su - grid asmcmd cd +CCC_DATA rm group_1到group_16 確保刪除的log不在select * from v$logifle裡。
6、重新新增redo,每個例項新增8組日誌,每組日誌包括兩個日誌檔案
alter database add logfile thread 1 group 1 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 2 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 3 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 4 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 5 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 6 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 7 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 8 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 9 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 10 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 11 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 12 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 13 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 14 ('+CCC_DATA') size 2g; alter database add logfile thread 1 group 15 ('+CCC_DATA') size 2g; alter database add logfile thread 2 group 16 ('+CCC_DATA') size 2g;
7、查詢standbylog資訊,並刪除非活動的standby logfile
select * from v$standby_log; alter database drop standby logfile group 17; alter database drop standby logfile group 18; alter database drop standby logfile group 19; alter database drop standby logfile group 20; alter database drop standby logfile group 21; alter database drop standby logfile group 22; alter database drop standby logfile group 23; alter database drop standby logfile group 24; alter database drop standby logfile group 25; alter database drop standby logfile group 26; alter database drop standby logfile group 27; alter database drop standby logfile group 28; alter database drop standby logfile group 29; alter database drop standby logfile group 30; alter database drop standby logfile group 31; alter database drop standby logfile group 32; alter database drop standby logfile group 33; alter database drop standby logfile group 34;
如果有ACTIVE狀態standby log無法刪除,在主庫主庫切換一組日誌後再行刪除備庫standby log。 如果仍然無法切換為非ACTIVE狀態,需要再啟停一次MRP程式,然後確認ACTIVE狀態standby log轉為UNASSIGNED 狀態後,再行刪除。 select process,status,thread#,sequence#,block#,blocks from v$managed_standby; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; select process,status,thread#,sequence#,block#,blocks from v$managed_standby; select * from v$standby_log;
8、刪除asm磁碟組上舊的standby log group
su - grid asmcmd cd +CCC_DATA rm standby_17到group_34 確保刪除的log不在select * from v$standby_log裡。
9.重新新增standby log
alter database add standby logfile thread 1 group 17 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 18 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 19 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 20 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 21 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 22 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 23 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 24 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 25 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 26 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 27 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 28 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 29 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 30 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 31 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 32 ('+CCC_DATA') size 2g; alter database add standby logfile thread 1 group 33 ('+CCC_DATA') size 2g; alter database add standby logfile thread 2 group 34 ('+CCC_DATA') size 2g; 每個例項9組standby日誌
10、資料庫需調整引數
show parameter standby_file_management alter system set standby_file_management=AUTO scope=both; show parameter standby_file_management #啟用備庫日誌非實時 應用 select process,status,thread#,sequence#,block#,blocks from v$managed_standby; ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; select process,status,thread#,sequence#,block#,blocks from v$managed_standby;
###2021-02-23 22:20 chenjuchao###
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2758861/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE RAC+DG調整redo大小Oracle
- Oracle調整redo log日誌大小Oracle
- Oracle Dump Redo Log FileOracle
- oracle 線上調整redoOracle
- Oracle Standby Redo Log實驗兩則Oracle
- 【操作】調整Online Redo Logs大小(Resizing Oracle Online Redo Logs)Oracle
- standby redo log的理解
- Oracle Dataguard Standby Redo Log的兩個實驗Oracle
- zt_Oracle Dump Redo Log File 說明Oracle
- 調整oracle redologOracle Redo
- redo log file 優化優化
- redo的等待log file sync和log file parallel write和redo size設定Parallel
- Dataguard環境修改主庫和standby庫online redo log&standby redo log大小
- Redo Log之一:理解Oracle redo logOracle Redo
- DG學習筆記(5)_Standby Redo Log筆記
- Oracle DG 出現 RFS[6]: No standby redo logfiles created for thread 1Oraclethread
- oracle redo log operationOracle Redo
- Oracle redo log重組Oracle Redo
- Usage, Benefits and Limitations of Standby Redo Logs (SRL) [ID 219344.1]MIT
- Oracle redo解析之-1、oracle redo log結構計算Oracle Redo
- Alert.log shows No Standby Redo Logfiles Of Size 153600 Blocks AvailableBloCAI
- 修改oracle redo log的大小Oracle Redo
- Oracle redo log 常見操作Oracle Redo
- redo log file 物理結構學習與測試
- Oracle-真實環境的丟失current redo log file的故障恢復Oracle
- Failover過程涉及standby redo log的實驗和理解AI
- How to Add/Drop/Resize Redo Log with Physical Standby in place. [ID 473442.1]
- oracle 效能調整Oracle
- oracle redo internal 之 dump logfileOracle Redo
- oracle redo internal 之 dump logfileOracle
- oracle檔案管理之 redo logOracle
- weblogic 記憶體調整Web記憶體
- 調整WebLogic的時間Web
- 使用LOGMNR工具分析Oracle Redo Log和Archive Log教程Oracle RedoHive
- stream不能實時傳送standby redo log問題的解決
- Oracle DG建立Logical Standby DatabaseOracleDatabase
- Oracle效能調整之--DML語句效能調整Oracle
- Oracle11g調整redo日誌大小、組數和每組成員數Oracle