Oracle redo log file (Code instance), oracle Log File

Source: Internet
Author: User

Oracle redo log file (Code instance), oracle Log File

1. query information about the redo log file group.

select group#,sequence#,members,status,archived from v$log;

2. query the information of the redo log file

select group#,type,member from v$logfile order by group#;

3. Add a new redo log group group4 for the case Database

alter database add logfile 'E:\orc\aa.log' size 10M;

4. Add a new redo log group and specify the group number.

alter database add logfile group 8 'E:\orc\cc.log' size 10M;

5. Add a new log file to the log group.

alter database add logfile member 'E:\orc\dd.log' to group 4;

6. view log switching status

select * from v$logfile;

7. manually switch logs

alter system switch logfile;

8. Move the redo log file aa. log to E: \ orc \ ldj.

conn system/123456 as sysdba;shutdown immediate;

When shutting down the database, manually copy the log file to be moved to the target location,

You can change the name here.

startup mount;alter database rename file 'E:\orc\aa.log'to 'E:\orc\ldj\aa.log';alter database open;

9. Delete the newly added log File dd. log from the log group.

alter database drop logfile member 'E:\orc\dd.log';

10. Delete the newly added 4th redo log file groups

alter database drop logfile group 4;

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.