Scheduled removal of archive log scripts under Oracle

Source: Internet
Author: User

First, error message

A few days ago the website suddenly can't access, and reported the following error:

Ora-27101:shared Memory realm does not exist

Ora-01034:oracle Not Available 11g

Ora-24324:service Handle not initialized


Cause: Because the database archive log is full, you cannot continue to write data to the database.


Second, check the archive log size

Su-oracle

Sqlplus/as SYSDBA

Show parameter recover


You can see the archive log directory as:/u01/app/oracle/fast_recovery_area/******/archivelog

You can view the size of the directory, and compare the log space set by the database, which cannot be larger than the database settings.


Third, expand the archive log size

alter system set db_recovery_file_dest_size=100g;


Iv. cleaning up the archive log

After the expansion, you need to set a schedule to clean up the archive log and switch to the Oracle Account Execution command.

Rman Target/

Rman> crosscheck Archivelog All;

rman> Delete expired Archivelog all;

rman> Delete archivelog until time ' sysdate-3 '

Explanation of the above three commands:

1, the first command can be invalid expired archivelog marked out.

2. The second command deletes the expired archive log directly.

3. The third command deletes all archived logs three days ago.

Reference: https://www.2cto.com/database/201308/235338.html


V. Setting up automatic scripts

1. Writing scripts

Su-oracle//Switch to Oracle user to perform actions

Cd/u01/app

Vim arcclear.sh

#!/usr/binrman target/<<eofdelete Force noprompt Archivelog all completed before ' sysdate-3 '; exit; Eof

chmod +x arcclear.sh


2. Add to Scheduled Tasks

Crontab-e

1 * * * sh/u01/app/arcclear.sh >>/u01/app/arcclear.log

Service Crond Restart








Scheduled removal of archive log scripts under Oracle

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.