■ 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