From :Http://www.itpub.net/thread-1636118-6-1.html
When Oracle opens the archive mode, it generates a lot of archivelog files in the specified archive directory, and the default is not to be purged periodically, and the folder takes up a lot of space for a long time.
Question: How do I periodically delete archivelog files correctly?
Many people delete files directly in the archive directory, which in fact does not achieve the effect of deleting file records in an Oracle CLF file.
Correct method:
1. Connect the target db with Rman:
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 '; (Specify to delete archive logs up to 7 days ago)
---supplementary---:
Here's the straight line:
RMAN Target sys/***** @orcl
DELETE noprompt ARCHIVELOG all completed before ' SYSDATE-7 ';
Or
RMAN Target sys/***** @orcl
DELETE noprompt ARCHIVELOG UNTIL Time "to_date (' xxxx-xx-xx ', ' yyyy-mm-dd ')";
Add:
noprompt don't need confirmation .
is to manually enter Yes & no
--------------------------------------------------------------------------------------------------------------- -----------
3. Other Related commands:
To view a list of archived logs:
List Archivelog all;
To view a list of failed archive logs:
List expired Archivelog all;
4. Regular removal of Archivelog:
You can write the following code into a. bat file and add a new scheduled task under the Task Schedule for Control Panel:
RMAN Target sys/***** @orcl
Crosscheck Archivelog All;
Delete Expired Archivelog all;
Oracle correctly deletes archivelog files (go)