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 線上調整redoOracle
- redo log file 最佳化
- How to Dump Redo Log File Information --metalinkORM
- Oracle redo解析之-1、oracle redo log結構計算Oracle Redo
- Oracle-真實環境的丟失current redo log file的故障恢復Oracle
- 調整innodb redo log files數目和大小的具體方法和步驟
- 更改online redo log file 提示 ORA-01511 ORA-01141
- undo log和redo log
- mysql之 redo logMySql
- MySQL的Redo log 以及Bin logMySql
- oracle12.2 adg ORA-46952: standby database format mismatch for password fileOracleDatabaseORM
- Oracle RAC+DG搭建Oracle
- MySQL Undo Log和Redo Log介紹MySql
- MySQL中的redo log和undo logMySql
- oracle rac+adg調整redo日誌組導致adg備庫ogg抽取程式abendOracle
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- 【REDO】Oracle redo advice-sqlOracle RedoSQL
- 【REDO】Oracle redo undo 學習Oracle Redo
- 【TUNE_ORACLE】等待事件之日誌等待“log file sync”Oracle事件
- log file switch
- MySQL redo log最佳化MySql
- MySQL重做日誌(redo log)MySql
- Oracle Redo and UndoOracle Redo
- 【REDO】Oracle redo內部結構Oracle Redo
- Oracle的快照standbyOracle
- ORACLE19C RAC+DGOracle
- Oracle 19C CBD Active DataGuard Standby passwd file 注意事項 ORA-01017Oracle
- 【TUNE_ORACLE】等待事件之日誌等待“log file parallel write”Oracle事件Parallel
- InnoDB文件筆記(二)—— Redo Log筆記
- MySQL中的redo log和checkpointMySql
- Layui+larave-log-view日誌頁面調整UIView
- 邏輯STANDBY建立中碰到ORA-16146: standby destination control file enqueue unavailableENQAI
- mysql日誌:redo log、binlog、undo log 區別與作用MySql
- MySQL中redo log、undo log、binlog關係以及區別MySql
- 硬核乾貨!一文掌握 binlog 、redo log、undo log
- 深入理解MySQL系列之redo log、undo log和binlogMySql
- MySQL 日誌系統 redo log、binlogMySql