RHEL5下RMAN的自動備份

來源:互聯網
上載者:User

RHEL5下RMAN的自動備份指令碼,編寫指令碼放在伺服器端定時執行:

要求

(1)資料庫全備,同時備份控制檔案和歸檔記錄檔,在完成歸檔記錄檔備份後,自動刪除已備份的歸檔日誌

(2)備份保留14天,到期自動刪除

(3)保留rman動作記錄

 

編寫RMAN批次檔:

#!/bin/bash
run {
CONFIGURE RETENTION POLICY TO REDUNDANCY 14;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to

'/u01/scripts/controlfile_%F';
allocate channel c1 device type disk format '/u01/scripts/db_bak_%U';
backup database skip inaccessible
plus archivelog filesperset 20
delete all input;
release channel c1;
}
allocate channel for maintenance device type disk;
crosscheck backupset;
delete noprompt obsolete;

編寫命令執行批處理:


#!/bin/bash
Oracle_HOME=/u01/app/oracle/10.2.0/db_1
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=orcl
$ORACLE_HOME/bin/rman target / cmdfile='/u01/scripts/orcl_bak.rman'

 

 

推薦閱讀:

RMAN 配置歸檔日誌刪除策略

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.