Oracle Log Archive Space cleanup

Source: Internet
Author: User
Tags sqlplus

Enter the machine and set the environment variables, such as:

Export oracle_home=/main/app/oracle/product/11.2. 0/db_1export oracle_sid=devdb

Then switch Oracle user, admin mode login Sqlplus

su - oracle[[email protected]~]$ sqlplus/nologsql> Connect/as sysdba

Check the use of Flash recovery area, you can see the archivelog is very large, up to 99.94

SQL>Select* from V$flash_recovery_area_usage;

3, now to clean up the Archivelog archive log, production environment recommended backup

Query Log directory Location

Show parameter recover;

4, Exit Sqlplus, log in with root, delete archive log after backup

Enter a target address first; Create a new Oracle archive log backup directory

mkdir Oracle Archive Log Backups

Enter the archive log source file directory (Devdb is the DB instance name):

cd/mnt/install/ora_11g/app/oracle/flash_recovery_area/devdb/archivelog/

Go outside the Archivelog directory first:

Cd..

Backup Archivelog The following archive log to the previously created Oracle archive log backup directory:

CP-RF archivelog/mnt/oracle Archive Log backup/

After waiting for the backup to complete, delete the archived logs that have been backed up

5, after deleting the archive log, the control file must be maintained with Rman, otherwise the space display still does not release

Use the Oracle User Login server to enter Rman maintenance:

Check out some useless archivelog.

Rman> crosscheck Archivelog All;

Delete all Archivelog up to the first 5 days

until  Time ' sysdate-5 ' ;

6, re-query the use of Flash recovery area:

First follow step 1, enter the Sqlplus environment, and then use the following command to query the discovery, only use 0.66%, the clear archive log success!

Select * from V$flash_recovery_area_usage;

Oracle Log Archive Space cleanup

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.