1. Overview
Oracle introduces Redo log for data recovery
Related Oracle processes: redo the log write process (LGWR)
Related data dictionaries v $ log, v $ logfile
Author permission: sys, system permission
2. View redo log information
View redo log group information
Select * from v $ log;
Meaning of common States displayed in the status column:
- Inactive: This set of logs is not required when the instance is restored.
- Active: indicates that the group is active but not the current group. This group of logs is required for instance recovery.
- Current: indicates that the group of logs is in the current group, and the online redo log group is active.
- Unused: indicates that the log group has never been written. The redo log is just added to the status. View information about redo log group members
Select * from v $ logfile;
Meaning of common States displayed in the status column:
- Blank: indicates that this document is being used.
- Stale: indicates that the content in the file is incomplete.
- Invalid: indicates that the file cannot be accessed.
- Deleted: indicates that the file is no longer in use.
3. Switch the work log Group
4. Add a redo log Group
Add redo log Group
SQL> alter database add logfile ('e: \ oracle \ product \ redo4.log ') size 4096 k;
The above are two minor errors during the creation of the redo log group. We do not need to add the group during the creation because Oracle will automatically assign the group number to the new group during the creation.
Delete redo log Group
SQL> alter database drop logfile group 4;
Database altered
Note: there is a space between the keyword group and group number 4. The currently working log group cannot be deleted. You can delete it after switching.
4. Redo group member operations
Add redo logs to existing groups
SQL> alter database add logfile member 'e: \ oracle \ product \ 10.2.0 \ redo03c. log' to group 3;
Delete redo logs of existing groups
SQL> alter database drop logfile member 'e: \ oracle \ product \ 10.2.0 \ redo03c. log ';
After modifying the redo log, you can use the data dictionary v $ log, v $ logfile to check whether the change is successful.