Windows平台如何实现rman备份和删除dg备库归档日志脚本
这篇文章给大家分享的是有关Windows平台如何实现rman备份和删除dg备库归档日志脚本的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
创新互联从2013年成立,是专业互联网技术服务公司,拥有项目成都网站设计、网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元万载做网站,已为上家服务,为万载各地企业和个人服务,联系电话:13518219792
rman备份脚本
--backup_oracle.bat文件 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文件 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/rman/full_%U.rman'; sql 'alter system archive log current'; backup filesperset = 50 as compressed backupset archivelog all format 'd:/backup/rman/arch_%U.rman' delete input; DELETE noprompt OBSOLETE; crosscheck backup; delete noprompt expired backup; backup format 'd:/backup/rman/ctl_%U.rman' current controlfile; backup spfile format 'd:/backup/rman/spfile_%U.rman' ; exit;
backup_oracle.bat文件加入到计划任务即可。
删除dg备库归档日志(已经应用)
--delete_dg_archivelog.bat rem 注意修改 部署目录 cd D:\win_xifenfei d: rem 注意delete_archive.sql 查询是否有记录 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
delete_dg_archivelog.bat加入到计划任务即可。
感谢各位的阅读!关于“Windows平台如何实现rman备份和删除dg备库归档日志脚本”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
网站标题:Windows平台如何实现rman备份和删除dg备库归档日志脚本
网站链接:http://cdiso.cn/article/pdgcio.html