Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Delete archive log script regularly under Oracle

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Error message

A few days ago, the website was suddenly unavailable, and the following error was reported:

Ora-27101: shared memory realm does not exist

Ora-01034: oracle not available 11g

ORA-24324: service handle not initialized

Reason: due to the database archive log is full, can not continue to write data to the database.

Second, check the size of the archive log

Su-oracle

Sqlplus / as sysdba

Show parameter recover

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

You can view the size of the directory, compared with the log space set by the database, the size of the directory cannot be larger than the space set by the database.

Expand the size of the archive log

Alter system set db_recovery_file_dest_size=100G

Fourth, clean up the archive log

After the expansion, you also need to set a regular plan to clean up the archive log, and you need to switch to the oracle account to execute the command.

Rman target /

RMAN > crosscheck archivelog all

RMAN > delete expired archivelog all

RMAN > delete archivelog until time 'sysdate-3'

The interpretation of the above three commands:

1. The first command marks the archivelog of the invalid expired.

2. The second command deletes all expired archive logs directly.

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

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

Fifth, set up automatic scripts

1. Write a script

Su-oracle / / switch to the oracle user to perform the operation

Cd / u01/app

Vim arcclear.sh

#! / usr/binrman target / / u01/app/arcclear.log

Service crond restart

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report