Oracle Study Notes: Managing redo log files-from Oracle10g

Source: Internet
Author: User

■ Log Switching

SQL> alter system switch logfile;

■ Add a redo log file group

SQL> alter database add logfile

2 group 4 ('/export/home/opt/product/10.1.0.3.0/oradata/ldfsys/redo04.log') Size 10 m;

■ Add members of the redo log file group

SQL> alter database add logfile Member

2 '/export/home/opt/product/10.1.0.3.0/oradata/ldfsys/redo04_1.log' to group 4;

■ View the status information of the Group and its members

SQL> select group #, members, status from V $ log;

■ Check whether the redo log file is archived

SQL> select group #, members, status, archived from V $ log;

■ View the status of the redo log file

SQL> select * from V $ logfile;

If Oracle cannot access the redo log file, the file becomes invalid.

If Oracle finds that the redo log file is incomplete or incorrect, the file changes to the stale state (unused for a long time ).

When the group to which the log file belongs changes to the active group, the invalid log file will become valid again.

■ Delete the redo log file Member

SQL> alter database drop logfile Member

2 '/export/home/opt/product/10.1.0.3.0/oradata/ldfsys/redo04_1.log ';

■ Delete the redo log file group

SQL> alter database drop logfile group 4;

After a redo log file group or member is deleted from the database, the operating system files used by the member are not actually deleted from the disk,

In other words, the control file of the relevant database is updated to delete the member or group from the database structure.

Or group, you must first confirm that the deletion operation is successful, and then use the appropriate operating system command to delete the corresponding redo log file or group.

■ Clear the redo log file group (reinitialize the redo log file group)

SQL> alter database clear logfile group 4;

■ Clear corrupted redo log files and avoid archiving these logs

SQL> alter database clear Unarchived logfile group 4;

■ Change the location or name of the redo log group member

Setup1 suspends other users from using the database

Setup2 determines the status of the redo log group. It can only change to inactive and unused states.

SQL> select group #, status from V $ log;

Setup3 uses the operating system command to rename or change the redo log group members.

Setup4: Modify the control file to repeat the pointer of the log group members

SQL> alter database rename File

2 '/export/home/opt/product/10.1.0.3.0/oradata/ldfsys/redo04.log'

3

4 '/export/home/opt/product/10.1.0.3.0/oradata/ldfsys/new_redo04.log ';

■ View redo log file information

V $ log is the redo log file information of the control file.

V $ logfile redo the status of the log file group, its members, and its members

V $ log_history redo the historical information of the log file

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.