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

How to implement rman backup and deletion of DG Database Archive Log script on Windows platform

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about how the Windows platform implements rman backup and deletes the DG repository archive log script. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Rman backup script

-- backup_oracle.bat file rman target / cmdfile=D:\ backup\ rman\ backup_db.rman log=d:/backup/rman/logfile/rmanlog%date:~0,4%%date:~5,2%%date:~8,2%.log-- backup_db.rman file CONFIGURE RETENTION POLICY TO REDUNDANCY = 2; CONFIGURE DEVICE TYPE DISK PARALLELISM 2; CONFIGURE DEFAULT DEVICE TYPE TO DISK; backup filesperset = 5 as compressed backupset database format'd Backup filesperset = 50 as compressed backupset archivelog all format'd delete input; DELETE noprompt OBSOLETE; crosscheck backup; delete noprompt expired backup; backup format'r current controlfile; backup spfile format'r current controlfile; backup spfile format'r exit'; exit

The backup_oracle.bat file can be added to the scheduled task.

Delete dg repository archive log (applied)

-- delete_dg_archivelog.bat rem Note to modify the deployment directory cd D:\ win_xifenfei d: rem Note whether the delete_archive.sql query has records echo delete archivelog staring > delete_archivelog.bak sqlplus / as sysdba @ delete_archive.sql echo rman target / cmdfile=rman_checkcross.rman > > delete_archivelog.bat delete_archivelog.bat > > delete_dg_archivelog_%DATE:~0,4%%DATE:~5,2%%DATE:~8,2% ".log exit-- delete_archive.sql set lines 150 col name for a150 Set pagesize 0 feedback off verify off heading off echo off spool delete_archivelog.bat select 'del' | | name from v$archived_log where APPLIED='YES' AND NAME IS NOT NULL and DEST_ID=1 Spool off exit;-rman_checkcross.rman crosscheck archivelog all; delete noprompt expired archivelog all; exit

Just add delete_dg_archivelog.bat to the scheduled task.

Thank you for reading! On the Windows platform how to achieve rman backup and delete DG database archive log script, this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, you can share it for more people to see it!

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

Servers

Wechat

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

12
Report