The Oracle redo log operation aims to record data changes and provide database recovery. The following describes how to run the redo log, hoping to help you.
1. ORACLE introduces redo logs to record data changes and restore the database.
1. log files need to be grouped. The information stored by each member in the same redo log group is identical.
2. redo log files in each group are called members.
3. It is best to have two or three members in each group and place different physical disks separately. This ensures high security.
4. At least two redo log groups are required
Ii. Oracle redo log operation process:
Oracle redo logs are used in an ordered loop. When a group of log files is filled up, the next group of log files is repeatedly overwritten. This is called Log switching. The checkpoint operation also occurs at this time. The checkpoint operation is used for synchronization. It writes the header information of the data file and controls the file. In archive mode, when a group of log files is filled up, the ARCH archive write process copies the set to archive log files. The redo log file LGWR being written by ARCH cannot be written)
1. Oracle redo log files are finalized by the LGWR background process.
2. The redo log group being written by LGWR is called the current redo log group.
3. redo log files ------ online log files; archive log files ------ offline log files
3. query redo log groups:
1. Log group:
Select group #, sequence #, members, bytes, status, archived from v $ log;
Significance of values in the Status column:
Current: Current group.
Inactive: This set of logs is no longer required for instance recovery.
Activie: this group of logs is active, but not the current group. For example, archiving.
Unused: this group has never been written. Is the status in which Zhigang is added to the DB.
2. log files:
Select * from v $ logfile;
Meanings of values in the Status column:
Blank: this file is in use.
Stale: The file content is incomplete.
Invalid: the file cannot be accessed. For example
Deleted: this file is no longer useful.
4. Create and delete redo log file groups:
1. add or delete a redo log file group:
Alter database add logfile ('d: \ **. log', 'e: \ **. log') size15m;
(The two redo log files created in this way are in the same group)
Alter database drop logfile group 4;
Delete the redo log group with the specified group number. The actual file is not deleted after deletion. You need to delete it manually)
The following restrictions apply to the deletion process:
The current log group cannot be deleted. to delete the current log group, you must first switch the current log group and run the alter system switch logfile command;
Active log group active log groups cannot be deleted
No archived log group logs that are not archived cannot be deleted, provided that they are running in archive Mode)
2. Add/delete redo log files:
Alter database add logfile member 'd: \ red004.log 'to group 1, 'd: \ red005.log' to group2;
Alter database drop logfile member 'd: \ red004.log ';
Restrictions on Deletion:
You cannot delete members in the current group. to delete a redo log, run alter system switch logfile;
Active log group activity log members cannot be deleted
No archived log group logs that are not archived cannot be deleted only when they are running in archive mode)
At least one member per group only has one log member.
Special case:
Sometimes, when deleting the redo log file, the following error occurs:
ERROR is located in row 1st:
ORA-00362: requires that a member be input to form a valid log file in group 4
ORA-01517: log Member: 'C: \ ORACLE \ ORADATA \ GXCNC \ redo041.log'
The reason why you cannot drop logfile member from group 2 is that the status of other redo log files in group 2 is incorrect. In this case, perform the alter system switch logfile several times to change the status of other redo log files in group 2 to normal .)
Oracle Log File Management
Oracle Password File Management
Oracle creates and deletes user instances
How to create an Oracle instance in unix
Statement statement of acle time addition and subtraction