How Oracle increases the online redo log file size

Source: Internet
Author: User
Tags file size

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.