在ORACLE中對線上重做日誌檔案進行調整

football2006發表於2008-07-13

在ORACLE中對線上重做日誌檔案進行調整

1.增加線上歸檔日誌

alter database add logfile group 4 ('/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo04.log') size 50M;
alter database add logfile group 5 ('/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo05.log',

'/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo05.log') size 50M;

alter database add logfile member '/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo042.log' to group 4;

2.檢查線上重做日誌檔案狀態

select * from v$log;

3.轉換線上重做日誌檔案

alter system switch logfile;
alter system switch logfile;

alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;

也可以刪除其中一個成員:

alter database drop logfile member '/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo05.log';
4、作業系統下刪除原日誌組1、2、3中的檔案
rm /home/oracle/oracle/product/10.2.0/oradata/gdimp/redo01.log
rm /home/oracle/oracle/product/10.2.0/oradata/gdimp/redo02.log
rm /home/oracle/oracle/product/10.2.0/oradata/gdimp/redo03.log

5、重建日誌組1、2、3
alter database add logfile group 1 ('/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo01.log') size 500M;
alter database add logfile group 2 ('/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo02.log') size 500M;
alter database add logfile group 3 ('/home/oracle/oracle/product/10.2.0/oradata/gdimp/redo03.log') size 500M;

6、切換日誌組
alter system switch logfile;
alter system switch logfile;
alter system switch logfile;


7、刪除中間過渡用的日誌組4、5
alter database drop logfile group 4;
alter database drop logfile group 5;

8、到作業系統下刪除原日誌組4、5中的檔案
rm /home/oracle/oracle/product/10.2.0/oradata/gdimp/redo04.log
rm /home/oracle/oracle/product/10.2.0/oradata/gdimp/redo05.log

9、備份當前的最新的控制檔案
SQL> connect internal
SQL> alter database backup controlfile to trace;

[@more@]

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

相關文章