rman備份方法之 增量備份

2021-12-30 13:09:46 字數 2279 閱讀 7644

使用型別:系統負載集中在某那個時間段,如白天8小時,晚上基本很閒,所以在晚上就可以對資料進行備份

與之相對應的是全庫備份:

1、env:

ip: 10.244.171.180/181

oracle database oracle 11.2.0.3

os rhel 5.5

backup toos:rman,shell,crontab

2、備份計畫(增量計畫)

sunday :execute level 0 incremental back

monday :execute level 2 incremental back

tuesday :execute level 2 incremental back

wednesday:execute level 1 incremental back

thursday :execute level 2 incremental back

friday :execute level 2 incremental back

saturday :execute level 2 incremental back

3、在node2規劃backup 目錄

--先建立儲存備份指令碼的目錄

$mkdir -p /data/scripts/rman/

--建立備份資料的目錄

$mkdir -p /data/rmandata/ --存放備份的資料目錄

3、制定*.sql和rman_backup.sh指令碼

--全備lv0級:

$cd /data/scripts/rman/

$vi backup_lv0.sql

run--增量備lv1級:

vi backup_lv1.sql

run--累計備lv2級:

$vi backup_lv2.sql

run4、編寫shell指令碼

--指令碼要實現的功能:

1.正確判斷星期

2.記錄每個rman備份執行的時間

#!/bin/bash

source /home/oracle/.bash_profile

myweek=`date +%a`

mydate=`date +%y%m%d`

mydir=/data/

#monday

if [ "$myweek" == "mon" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv2.sql

fi#tuesday

if [ "$myweek" == "tue" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv2.sql

fi#wednesday

if [ "$myweek" == "wed" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv1.sql

fi#thursday

if [ "$myweek" == "thu" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv2.sql

fi#friday

if [ "$myweek" == "fri" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv2.sql

fi#saturday

if [ "$myweek" == "sat" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv2.sql

fi#sunday

if [ "$myweek" == "sun" ]; then

rman target sys/oracle msglog=$/backup_$.log cmdfile=$/scripts/rman/backup_lv0.sql

fi5、crontab指令碼指定

$crontab -e

30 20 * * * sh /data/script/rman/rman_backup.sh;

rman增量備份指令碼

配置rman 登入rman rman target rman show all 2 using target database control file instead of recovery catalog rman configuration parameters for database wi...

使用Rman配置自動增量備份

1.在 home nacec backupdatabase 下建立backuplevel0.sh和backuplevel1.sh指令碼 backuplevel0.sh內容 bin bash script.bakuplevel0.sh creater liu shiming date 2010 6 2...

RMAN 增量備份 的 物件測試

在練習 rman incremental backup 時 參照 ocp tk 042 對於 rman 增量備份的物件 官網摘入如下 you can make incremental backups of databases,individual tablespaces or datafiles.顯...