線上重建redo log日誌組

ddlovefish發表於2013-12-08

-------8月在gx行做的,按照行內標準,實現了將原50M每組共5個redolog日誌組重建成100M每組共10組。
  1 檢視目前的redolog日誌組,得知在用的為group4

SQL> select group#,members,bytes/1024/1024,status from v$log;                                                            
    GROUP#    MEMBERS BYTES/1024/1024 STATUS                
---------- ---------- --------------- ----------------      
         1          2              50 INACTIVE              
         2          2              50 INACTIVE              
         3          2              50 INACTIVE              
         4          2              50 CURRENT                
         5          2              50 INACTIVE          

  2新增group6-10日誌組,大小為100m
alter database add logfile thread 1 group 6('/oradata/CCFICBC/redo06.log','/oradata/CCFICBCredo/redo06b.log') size 100m;                                  
alter database add logfile thread 1 group 7('/oradata/CCFICBC/redo07.log','/oradata/CCFICBCredo/redo07b.log') size 100m;
alter database add logfile thread 1 group 8('/oradata/CCFICBC/redo08.log','/oradata/CCFICBCredo/redo08b.log') size 100m;
alter database add logfile thread 1 group 9('/oradata/CCFICBC/redo09.log','/oradata/CCFICBCredo/redo09b.log') size 100m;
alter database add logfile thread 1 group 10('/oradata/CCFICBC/redo10.log','/oradata/CCFICBCredo/redo10b.log') size 100m;

  3 drop掉group1235日誌組,因為group4在用,所以需要先切換日誌組。切完後用查狀態語句確認group4不在用,然後再drop .
alter database drop logfile group 1;  
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 5;
alter system switch logfile;
select group#,members,bytes/1024/1024,status from v$log;
alter database drop logfile group 4;

  4在作業系統層面上刪除日誌檔案
rm /oradata/CCFICBC/redo01.log  
rm /oradata/CCFICBCredo/redo01b.log
rm /oradata/CCFICBC/redo02.log                      
rm /oradata/CCFICBCredo/redo02b.log
rm /oradata/CCFICBC/redo03.log                      
rm /oradata/CCFICBCredo/redo03b.log
rm /oradata/CCFICBC/redo05.log                      
rm /oradata/CCFICBCredo/redo05b.log
rm /oradata/CCFICBC/redo04.log                      
rm /oradata/CCFICBCredo/redo04b.log
  5再重新建立group1-5組,大小為100M
alter database add logfile thread 1 group 1('/oradata/CCFICBC/redo01.log','/oradata/CCFICBCredo/redo01b.log') size 100m;
alter database add logfile thread 1 group 2('/oradata/CCFICBC/redo02.log','/oradata/CCFICBCredo/redo02b.log') size 100m;
alter database add logfile thread 1 group 3('/oradata/CCFICBC/redo03.log','/oradata/CCFICBCredo/redo03b.log') size 100m;
alter database add logfile thread 1 group 4('/oradata/CCFICBC/redo04.log','/oradata/CCFICBCredo/redo04b.log') size 100m;
alter database add logfile thread 1 group 5('/oradata/CCFICBC/redo05.log','/oradata/CCFICBCredo/redo05b.log') size 100m;
     
  6用此語句確認完成
SQL>  select group#,members,bytes/1024/1024,status from v$log;

    GROUP#    MEMBERS BYTES/1024/1024 STATUS
---------- ---------- --------------- ----------------
         1          2             100 CURRENT
         2          2             100 UNUSED
         3          2             100 UNUSED
         4          2             100 UNUSED
         5          2             100 UNUSED
         6          2             100 INACTIVE
         7          2             100 ACTIVE
         8          2             100 UNUSED
         9          2             100 UNUSED
        10          2             100 UNUSED

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29306197/viewspace-1062697/,如需轉載,請註明出處,否則將追究法律責任。

相關文章