Oracle Simple Cleanup Archive log file __oracle

Source: Internet
Author: User
View Archive
sql> archive log list;
Database log mode            archive mode AutoArchive             enable
archive endpoint            use_db_recovery_file_dest
the oldest online log sequence 2536 the
next archive log sequence   2538
Current log sequence           2538
Check the storage location first
Sql> show parameter recover;
NAME                                 TYPE        VALUE
-----------------------------------------------------------------------------
db_recovery_file_dest                string      D:\app\Administrator\flash_recovery_area
Db_recovery_file_ Dest_size Big           integer 50G
recovery_parallelism                 integer     0


 You can see the archive log D:\app\Administrator\ The Flash_recovery_area directory is not purged periodically, and the time is long, and the folder takes up a lot of space. If you cannot manually delete directly under the operating system, you should use the Rman deletion of Oracle to connect to the target db:
RMAN Target sys/sysoracle123
In the Rman Command window, enter the following command:
Crosscheck Archivelog all;   
--Verifying that the archive log for DB is the file at the specified location of the Log_archive_dest parameter, and that when the archive log is manually deleted, the Rman backup detects that the log is missing and cannot proceed further. So at this point you need to manually perform the crosscheck process, after which Rman backups can be restored to normal.

Delete expired archivelog all;  ---Delete an expired log:
You can also specify a date deletion
DELETE Archivelog all COMPLETED before ' SYSDATE-7 ';
--(Specify to delete archive log 7 days ago)

Other Related orders:

--View archived Log listings: List

archivelog all;

--View the list of failed archive logs: Listing

expired Archivelog all;

Periodically clear Archivelog:

--You can write the following code as a. bat file, add a new scheduled task under the control Surface Task schedule:

RMAN target sys/sysoracle123

crosscheck archivelog all;

Delete Expired archivelog all;

    DELETE noprompt Archivelog all COMPLETED before ' SYSDATE-7 ';
---Notes
have been deleted after the test file, but the directory is not deleted, obsessive-compulsive disorder can be deleted by other means
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.