首页 > 代码库 > 『ORACLE』RAC—增删日志组
『ORACLE』RAC—增删日志组
SYS@RACDB1 rac1>select group#,thread#,members,status,bytes/1024/1024 as size_m from v$log;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------------------- ------------------ -------------- ----------------- ----------
1 1 1 CURRENT 50
2 1 1 INACT 50
3 2 1 INACTIVE 50
4 2 1 CURRENT 50
SYS@RACDB1 rac1>select group#,member from v$logfile order by 1;
GROUP# MEMBER
------------ ----------------------------------------------------------------------------------------
1 +DATA/racdb/onlinelog/group_1.261.942339581
2 +DATA/racdb/onlinelog/group_2.262.942339581
3 +DATA/racdb/onlinelog/group_3.266.942339807
4 +DATA/racdb/onlinelog/group_4.267.942339809
SYS@RACDB1 rac1>alter database add logfile thread 1 group 5 ‘+DATA‘ size 50M;
Database altered.
SYS@RACDB1 rac1>alter database add logfile thread 2 group 6 ‘+DATA‘ size 50M;
Database altered.
SYS@RACDB1 rac1>select group#,thread#,members,status,bytes/1024/1024 as size_m from v$log;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 1 CURRENT 50
2 1 1 INACTIVE 50
3 2 1 INACTIVE 50
4 2 1 CURRENT 50
5 1 1 UNUSED 50
6 2 1 UNUSED 50
SYS@RACDB1 rac1>select group#,member from v$logfile order by 1;
GROUP# MEMBER
-------------- ----------------------------------------------------------------------------------------
1 +DATA/racdb/onlinelog/group_1.261.942339581
2 +DATA/racdb/onlinelog/group_2.262.942339581
3 +DATA/racdb/onlinelog/group_3.266.942339807
4 +DATA/racdb/onlinelog/group_4.267.942339809
5 +DATA/racdb/onlinelog/group_5.271.942452713
6 +DATA/racdb/onlinelog/group_6.272.942452765
6 rows selected.
删除日志组
注:如果要删除的日志组的状态为current或active,让其变为inactive
alter system switch logfile;
alter system checkpoint;
SYS@RACDB1 rac1>alter database drop logfile group 5;
Database altered.
SYS@RACDB1 rac1>alter database drop logfile group 6;
Database altered.
SYS@RACDB1 rac1>select group#,thread#,members,status,bytes/1024/1024 as size_m from v$log;
GROUP# THREAD# MEMBERS STATUS SIZE_M
---------- ---------- ---------- ---------------- ----------
1 1 1 CURRENT 50
2 1 1 INACTIVE 50
3 2 1 INACTIVE 50
4 2 1 CURRENT 50
SYS@RACDB1 rac1>select group#,member from v$logfile order by 1;
GROUP# MEMBER
-------------- ----------------------------------------------------------------------------------------
1 +DATA/racdb/onlinelog/group_1.261.942339581
2 +DATA/racdb/onlinelog/group_2.262.942339581
3 +DATA/racdb/onlinelog/group_3.266.942339807
4 +DATA/racdb/onlinelog/group_4.267.942339809
『ORACLE』RAC—增删日志组