oracle全量 增量備份

2022-06-22 12:27:11 字數 2252 閱讀 9924

採用0221222增量備份策略,7天乙個輪迴

也就是週日0級備份,周1 2 4 5 6 採用2級增量備份,周3採用1級增量備份

開啟控制檔案自動備份

configure controlfile autobackup on; 

配置控制檔案備份路徑

configure controlfile autobackup format for device type disk to '/file/backup/rman/controlfile_%f'; 

將過期天數設為7天

rman> configure retention policy to recovery window of 7 days; 

---全備

vim rman_bak_level0.sh    

#! /bin/bash  

export oracle_base=/u01/oracle 

export oracle_home=$oracle_base/product/11.2.0/db_1 

export path=$oracle_home/bin:$path 

export oracle_sid=neal    --資料庫oracle_sid 

export nls_lang='american_america.zhs16gbk'   --字符集 

rman target / backup incremental level 0 database format '/file/backup/rman/level0_%d_%s_%p_%u.bkp';   --備份級別、輸出格式、路徑 

sql 'alter system archive log current';    --對當前redo日誌進行歸檔 

backup archivelog all delete input format '/file/backup/rman/archivelog_%d_%s_%p_%u.bkp';  --備份歸檔日誌並刪除 

crosscheck backup;   --檢查備份 

delete noprompt obsolete;  --靜默刪除過期備份 

release channel d1;  --釋放通道d1 

release channel d2;  --釋放通道d2  }   

eof  

---0級備份指令碼

vim rman_bak_level0.sh 

#! /bin/bash 

export oracle_base=/u01/oracle 

export oracle_home=$oracle_base/product/11.2.0/db_1 

export path=$oracle_home/bin:$path 

export oracle_sid=neal 

export nls_lang='american_america.zhs16gbk' 

rman target / eof 

--1級備份指令碼

vim rman_bak_level1.sh 

#! /bin/bash 

export oracle_base=/u01/oracle 

export oracle_home=$oracle_base/product/11.2.0/db_1 

export path=$oracle_home/bin:$path 

export oracle_sid=neal 

export nls_lang='american_america.zhs16gbk' 

rman target / eof 

--2級備份指令碼

vim rman_bak_level2.sh 

#! /bin/bash  export oracle_sid=neal 

export nls_lang='american_america.zhs16gbk' 

/u01/oracle/product/11.2.0/db_1/bin/rman target / eof 

--加入到crontab中

crontab -e 

#週日0級備份  00 23 * * 0 /server/scripts/rman_bak_level0.sh 

#周一、二、四、五、六2級增量備份  00 23 * * 1,2,4,5,6 /server/scripts/rman_bak_level2.sh 

#週三1級增量備份  00 23 * * 3 /server/scripts/rman_bak_level1.sh 

oracle全量增量 oracle全量 增量備份

採用0221222增量備份策略,7天乙個輪迴 也就是週日0級備份,周1 2 4 5 6 採用2級增量備份,周3採用1級增量備份 開啟控制檔案自動備份 configure controlfile autobackup on 配置控制檔案備份路徑 configure controlfile autoba...

增量備份和全量備份

1.全量備份full backup 每隔一段時間對系統進行一次完全備份,這樣在備份時間間隔內一旦系統發生故障導致資料丟失,就可以用上一次的備份資料恢復到上一次備份時的情況。例如,星期一用一盤磁帶備份整個系統,星期二再用另一盤磁帶 備份,依次類推 這種備份策略的有點 備份的資料最全面且最完整,當發生資...

Mysql增量備份與全量備份

1.首先確保已開啟binlog日誌功能。在my.cnf中包含下面的配置以啟用二進位制日誌 mysqld log bin mysql bin 2.建立兩份指令碼檔案,乙份為增量備份的指令碼檔案,另乙份為全量備份的指令碼檔案。指令碼檔案放這裡 全量備份指令碼start bin bash program ...