The database was found to be slow today, and a large number of processes are waiting for log file switch (checkpoint incomplete), and log files are used as follows:
sys@test15>select group#,sequence#,bytes/1024/1024 "bytes (M)", Members,archived,status from V$log;
group# sequence# BYTES (M) members ARC STATUS----------------------------------------------------------- 1 205 2 YES ACTIVE 2 206 2 NO current 3 204 2 YES ACTIVE sys@test15>select group#,status,type,member from V$logfile where type= ' O
Nline ' ORDER by type,group#;
group# STATUS TYPE member------------------------------------------------------------------------------------ 1 Online/data/oradata/orcl/data/redo01a.log 1 online/home/oracle/data/orcl/redo01b . Log 2 Online/data/oradata/orcl/data/redo02a.log 2 online/home/oracle/data/orcl/ Redo02b.log 3 Online/data/oradata/orcl/data/redo03a.log 3 Online/home/oracle/data/orcl/redo03b.log
As you can see from the above, all log files are active or current, indicating that the log file is too small to increase its size.
However, online redo logs cannot be directly resize and need to be done as follows:
1 Add a new log file group and define its size
Sys@test15>alter Database Add logfile Group 4
('/data/oradata/orcl/data/redo04a.log ', '/HOME/ORACLE/DATA/ORCL /redo04b.log ') size 500M
reuse;
Database altered.
2 continue to switch logs until the status=inactive of group 1, and Archived=yes (if archived), as follows:
Sys@test15>alter system switch logfile;
Sys@test15>alter system checkpoint;
Sys@test15>select group#,sequence#,bytes/1024/1024 "bytes (M)
", Members,archived,status from V$log where group #=1;
group# sequence# BYTES (M) members ARC STATUS
------------------------------------------------ -----------
1 214 2 YES INACTIVE
3) Delete Group 1
Sys@test15>alter database drop logfile Group 1;
Database altered.
So we're done with a bigger group 4 instead of the original group 1, as Group 2, Group 3, and so on.
Finally, remember to delete the log files on the operating system.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/