An Oracle archive log is often full, as the file space occupied by/oraarchive is 100%. Everyone must complain about why Oracle does not have an archive maintenance tool. Many people delete the file directly. Wrong, Oracle has, it is intelligent to delete archive and FLASHBACK correctly. However, it is important to remember that Oracle archive logs are important for Oracle data recovery and backup. You cannot delete archive logs unless necessary.
Deleting archived logs
Log on to the database server host as an Oracle user or connect to the database server through a network
Go to Oracle Data Backup Tool
Rman target/
Or rman target/@ orcl
Run
Delete archivelog all completed before 'sysdate-7 ';
Description
SYSDATA-7, indicating the current system time 7 days ago, the before keyword indicates the archived log 7 days ago, and if the flash back function is used, the flash back data is also deleted.
In the same way, you can delete all the logs from the past seven days to the present. However, this command should be clear. After this deletion, it is best to back up the database immediately.
Delete archivelog from time 'sysdate-7 ';
In UNIX/LINUX, you can also use FIND to FIND the archived data seven days ago and delete it using the EXEC sub-operation.
Find/oraarchive-xdev-mtime + 7-name "*. dbf"-exec rm-f {};
In this way, unmanaged archive files will still be left in RMAN.
You still need to execute the following two commands in RMAN
Crosscheck archivelog all;
Delete expired archivelog all;
So it is not as easy to use as the above method, but the advantage of using FIND is that you can perform a lot of operations on the condition and the EXEC subitem to implement more complex functions.