Oracle correctly deletes archivelog files (go)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.