Oracle deletes log files
The syntax for deleting a log file is as follows:
Alter database drop logfile member logfile_name;
Note the following when deleting a log file:
1. The log file group of the log file cannot be in the current status. You need to perform a manual log switch to change the status of the log file group to inactive.
2. The log file group of the log file must contain other log members.
3. If the database is running in archive mode, make sure that the log file group to which the database belongs has been archived before deleting the log file. Otherwise, data will be lost.
Status value of the log file group:
Active current inactive unused
Status value of the Oracle log file:
Valid invalid stale
Delete a log file group
Syntax:
Later database drop logfile group group_number;
Note the following when deleting a log file group:
1. A database requires at least two Log File groups.
2. The log file group cannot be in the current state. '
3. If the database is running in archive mode, make sure that the log file has been archived.
SQL> alter database drop logfile member
2 'f: \ oracledata \ redo4.log ';
The preceding SQL statement only deletes the data log file in the control file and data dictionary, but is not deleted in the operating system.
The database has been changed.
The Database Log File Group in the following Query System
SQL> select group #, member from v $ logfile;
GROUP # MEMBER
-------------------------------------------------------------------------------
3 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO03.LOG
2 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO02.LOG
1 D: \ ORACLE \ ORADATA \ ORACLE12C \ REDO01.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO1.LOG
4 F: \ ORACLEDATA \ LOGFILE \ REDO2.LOG
The above content comes from the Learning Record.