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

Oracle 11g production environment cleanup archive log script

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Recently, several customer production environments have encountered some failures, due to the opening of archiving, no deployment of delete archiving scheduled tasks, the following you can refer to, after my test, normal operation in the production environment. * * roidba delete archive log script * * 1. RHEL6 server-based archive log deletion script production library deployment environment: database: Oracle 11.2.0.4 operating system: RHEL 6.6 first step: set control_file_record_keep_time this parameter is very important. Backup records, archive records and other records will be stored in the control file. This parameter provides a period of time for keeping records. The default is 7 days. Usually we want to set this parameter to be greater than the period of time for which the backup file is retained. Here we set 31 days. The operation is as follows: SQL > show parameter keep_timeNAME TYPE VALUE -control_file_record_keep_time integer 7SQL > SQL > alter system set control_file_record_keep_time=31 scope=both -- dynamic parameters SQL > show parameter keep_timeNAME TYPE VALUE -control_file_record_keep_time integer 31 step 2: create the detele_archivelog.sh script to choose the path $mkdir-p / home/oracle/scripts to store the script-- create the script storage directory $cd / home/oracle/scripts-- open / home/oracle$ touch delete_archivelog.sh-- create the script $chmod 755 delete_archivelog.sh-- grant read and write access to $vi delete_archivelog. Sh-Editing scripts pay attention to modifying ORACLE_SID Log path should be written as absolute path. Not writing absolute path will lead to successful execution alone. No corresponding log script can be found during scheduled task execution: cat > / home/oracle/scripts/delete_archivelog.sh

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