How to delete archived logs in Oracle 10 GB

Source: Internet
Author: User

Today, a friend asked me how to delete archive logs in Oracle10g and answered the following question:

Archiving logs in Oracle cannot be directly deleted by operating system (OS) commands, because some information of archiving logs is recorded in the control file, in addition, the information in the control file will not change after the OS-level command is directly deleted, and the information in the related system view will not change. The Oracle system still considers archive logs to exist.

How can I delete archive logs correctly?

You can use the following methods:

You can use RMAN to delete archivelog. follow these steps:

1. Use OS-level commands to physically Delete archivelog

2. Enter RMAN

3. crosscheck archivelog all;

4. delete expried archivelog all;

In this way, the corresponding archivelog records cannot be found in some Oracle records.

Ii. directly use RMAN to delete archivelog

In fact, in RMAN, you can use the command to directly Delete ARCHIVELOG. The command is as follows:

RMAN> delete archivelog all completed before 'sysdate-7 ';

This command deletes all archivelog seven days ago. However, the disadvantage of this command is that archivelog cannot be divided in detail.

Iii. Use RMAN to back up aechivelog and delete it

This is the most secure method. Use RMAN to back up archivelog and delete all backups.

Backup format'/u01/arch _ % T _ % s _ % U' archivelog all delete input;

Or

Backup database plus archivelog;

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.