Oracle correctly deletes the archivelog File
After the archive mode is enabled, Oracle will generate many archivelog files under the specified archive Directory, which is not cleared regularly by default and takes a long time, this folder occupies a lot of space.
Q: How do I regularly and correctly Delete archivelog files?
Many people directly delete files in the archive Directory, which cannot be used to delete file records in the Oracle CLF file.
Correct method:
1. Use RMAN to connect to the target DB:
RMAN target sys/***** @ orcl
2. In the RMAN command window, enter the following command:
Crosscheck archivelog all;
Delete expired archivelog all;
Or delete the archivelog before the specified time:
Delete archivelog all completed before 'sysdate-7'; (DELETE archived logs 7 days ago)
3. Other related commands:
View the archived log list:
List archivelog all;
View the list of invalid archive logs:
List expired archivelog all;
4. regularly clear archivelog:
You can write the following code as a. bat file and add a new scheduled task under the task plan of the control panel:
RMAN target sys/***** @ orcl
Crosscheck archivelog all;
Delete expired archivelog all;
The above content is personal summary only.
This article is from the "when you start watching the cloud" blog