Oracle Database Online log file management

Source: Internet
Author: User

Querying online log files sql> col member for a50sql> select group#,status,type,member  From v$logfile;       group# status    ts  type         member---------- --------- --------- ------ --------------------------------------------------          3           ONLINE           /u01/app/oracle/oradata/king/redo03.log          2           ONLINE           /u01/app/oracle/oradata/king/redo02.log          1           ONLINE      &nbSp;    /u01/app/oracle/oradata/king/redo01.log


Querying online log Groups sql> select group#,sequence#,members,bytes,status,archived from v$log;     GROUP#  SEQUENCE#    MEMBERS       bytes status    archived---------- ---------- ---------- ------- --- --------- ---------         1           4          1    52428800 INACTIVE  YES         2           5           1   52428800 INACTIVE  YES          3          6           1&nbsP;  52428800 current   no 


Delete online log group sql> ALTER DATABASE drop logfile Group 1; Sql> host Rm-rf/u01/app/oracle/oradata/king/redo01.log Create an online log group sql> ALTER DATABASE add logfile Group 1 ('/u01/app/ Oracle/oradata/king/redo01a.log ', '/u01/app/oracle/oradata/king/redo01b.log ') size 50M;


sql> ALTER DATABASE drop logfile Group 2; Sql> host rm-rf/u01/app/oracle/oradata/king/redo02.logsql> ALTER DATABASE add logfile Group 2 ('/u01/app/oracle/ Oradata/king/redo02a.log ', '/u01/app/oracle/oradata/king/redo02b.log ') size 50M;


sql> alter system switch logfile; Sql> alter system checkpoint;


sql> ALTER DATABASE drop logfile Group 3; Sql> host rm-rf/u01/app/oracle/oradata/king/redo03.logsql> ALTER DATABASE add logfile Group 3 ('/u01/app/oracle/ Oradata/king/redo03a.log ', '/u01/app/oracle/oradata/king/redo03b.log ') size 50M;


sql> select group#,status,type,member from v$logfile;    group#  Status    TS Type          MEMBER---------- --------- --------------- --------------------------------------------------          3            online          /u01/app/oracle/oradata/king/ redo03a.log         2            online          /u01/app/oracle/ oradata/king/redo02a.log         1            online          /u01/app /oracle/oradata/king/redo01a.log         1            online          /u01/app/oracle/oradata/king/ redo01b.log         2            online          /u01/app/oracle/ oradata/king/redo02b.log         3            online          /u01/app /oracle/oradata/king/redo03b.log


sql> select group#,sequence#,members,bytes,status,archived from v$log;     GROUP#  SEQUENCE#    MEMBERS       bytes status    archived---------- ---------- ---------- ----------  --------- ---------         1           7          2    52428800 CURRENT   NO         2           0           2   52428800 UNUSED    YES          3          0          &nbsP;2   52428800 unused    yes 


Add an online log file to the log group sql> ALTER DATABASE add logfile member '/u01/app/oracle/oradata/king/redo01c.log ' to group 1, '/u01/app/ Oracle/oradata/king/redo02c.log ' to group 2, '/u01/app/oracle/oradata/king/redo03c.log ' to group 3;


sql> select group#,status,type,member from v$logfile;    group#  Status    TS Type          MEMBER---------- --------- --------------- --------------------------------------------------          3            online          /u01/app/oracle/oradata/king/ redo03a.log         2            online          /u01/app/oracle/ oradata/king/redo02a.log         1            online          /u01/app /oracle/oradata/king/redo01a.log         1            online          /u01/app/oracle/oradata/king/ redo01b.log         2            online          /u01/app/oracle/ oradata/king/redo02b.log         3            online          /u01/app /oracle/oradata/king/redo03b.log         1 invalid    online          /u01/app/oracle/oradata/king/ redo01c.log         2 invalid   online           /u01/app/oracle/oradata/king/redo02c.log          3 invalid   online          /u01/ App/oracle/oradata/king/redo03c.log


sql> select group#,sequence#,members,bytes,status,archived from v$log;     GROUP#  SEQUENCE#    MEMBERS       bytes status    archived---------- ---------- ---------- ----------  --------- ---------         1           7          3    52428800 CURRENT   NO         2           0           3   52428800 UNUSED    YES          3          0          &nbsP;3   52428800 unused    yes 


Delete the online log files in the log group sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo02c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo02c.log


sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo03c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo03c.log


sql> alter system switch logfile; Sql> alter system checkpoint;


sql> ALTER DATABASE drop logfile member '/u01/app/oracle/oradata/king/redo01c.log '; Sql> Host Rm-rf/u01/app/oracle/oradata/king/redo01c.log


Oracle Database Online log file management

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.