您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關Windows平臺如何實現rman備份和刪除dg備庫歸檔日志腳本的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
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備庫歸檔日志腳本”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。