aix下rac環境rman備份策略部署
資料庫備份方案部署過程:
考慮到系統是高可用性系統(7×24),因此採用rman來熱備份db,具體備份步驟部署如下:
1. 把db改為歸檔模式,2個節點的歸檔日誌分別放在各自的/orabak/archlog目錄下
2. 把db的備份檔案放在2個節點各自的/orabak/dbbak目錄下,每次備份的檔案會分佈在2個節點上,這樣做的目的對2個節點來說相對都能節約一些空間,因為/orabak目前暫時掛載在rootvg下了,由於datavg裡已經沒有了空間
3. 備份指令碼存放在節點1的/orabak/script裡面
A.具體os層面的備份指令碼是/orabak/script/dbbak.sh,內容如下:
--環境變數設定,最簡單的辦法就是把oracle使用者的環境變數檔案.profile的內容全部拿過來即可
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
export PATH
if [ -s "$MAIL" ] # This is at Shell startup. In normal
then echo "$MAILMSG" # operation, the Shell checks
fi # periodically.
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/11.1/db_1
CRS_HOME=/opt/oracle/product/11.1/crs
DISPLAY=198.14.2.56:0.0
ORACLE_SID=RACDB1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/network/jlib:$ORACLE_HOME/rdbms/jlib
SHLIB_PATH=$ORACLE_HOME/bin:$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib32
PATH=$PATH:$ORACLE_HOME/bin:$CRS_HOME/bin:/usr/sbin:/usr/local/bin:/usr/lib/builtins:
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORACLE_BASE ORACLE_HOME ORACLE_SID DISPLAY LD_LIBRARY_PATH CLASSPATH SHLIB_PATH PATH ORA_NLS33
NLS_LANG=american_america.zhs16gbk
export NLS_LANG
--備份指令碼
rman target / cmdfile='/orabak/script/dbbak.sql' log='/orabak/script/dbbak.log' append <
B.os層面的備份指令碼/orabak/script/dbbak.sh呼叫的db層面的指令碼/orabak/script/dbbak.sql內容如下:
run{
allocate channel c1 device type disk connect sys/system@racdb1;
allocate channel c2 device type disk connect sys/system@racdb2;
backup as compressed backupset database format='/orabak/dbbak/racdb_%T_%U.bak';
delete noprompt obsolete;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt expired archivelog all;
backup as compressed backupset archivelog all format='/orabak/dbbak/archlog_%T_%U.bak';
}
exit;
EOF
4. 每天晚上11:30系統自動備份db,具體實現指令碼如下:
$ crontab -l
30 23 * * * /orabak/script/dbbak.sh
5.受到/orabak目錄所在的rootvg的空間限制,我們制定了備份保留3天的策略,db的備份和歸檔以及歸檔日誌的備份保留3天之後自動刪除,具體備份策略如下:
$ rman target /
Recovery Manager: Release
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: RACDB (DBID=3428846088)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name RACDB are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
6. 透過測試,發現備份可以成功,目前沒發現任何問題,具體測試時的備份日誌如下:
Recovery Manager: Release
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: RACDB (DBID=3428846088)
RMAN> run{
2> allocate channel c1 device type disk connect *
3> allocate channel c2 device type disk connect *
4> backup as compressed backupset database format='/orabak/dbbak/racdb_%T_%U.bak';
5> delete noprompt obsolete;
6> crosscheck backup;
7> crosscheck archivelog all;
8> delete noprompt expired backup;
9> delete noprompt expired archivelog all;
10> backup as compressed backupset archivelog all format='/orabak/dbbak/archlog_%T_%U.bak';
11> }
12>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=110 instance=RACDB1 device type=DISK
allocated channel: c2
channel c2: SID=112 instance=RACDB2 device type=DISK
Starting backup at 09-JUN-10
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00011 name=/dev/rtbs_big1
input datafile file number=00013 name=/dev/rtbs_big3
input datafile file number=00015 name=/dev/rtbs_zhufo
input datafile file number=00004 name=/dev/rundotbs2
input datafile file number=00002 name=/dev/rsysaux
input datafile file number=00001 name=/dev/rsystem
input datafile file number=00005 name=/dev/rusers
channel c1: starting piece 1 at 09-JUN-10
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00012 name=/dev/rtbs_big2
input datafile file number=00006 name=/dev/rtbs_common
input datafile file number=00007 name=/dev/rtbs_vts
input datafile file number=00008 name=/dev/rtbs_vesm
input datafile file number=00009 name=/dev/rtbs_idx
input datafile file number=00010 name=/dev/rtbs_x3sys
input datafile file number=00014 name=/dev/rtbs_bhjf
input datafile file number=00003 name=/dev/rundotbs1
channel c2: starting piece 1 at 09-JUN-10
channel c1: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/racdb_20100609_09lfqath_1_1.bak tag=TAG20100609T150104 comment=NONE
channel c1: backup set complete, elapsed time: 00:05:40
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 09-JUN-10
channel c1: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/racdb_20100609_0blfqb86_1_1.bak tag=TAG20100609T150104 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 09-JUN-10
channel c1: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/racdb_20100609_0clfqb88_1_1.bak tag=TAG20100609T150104 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c2: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/racdb_20100609_0alfqatu_1_1.bak tag=TAG20100609T150104 comment=NONE
channel c2: backup set complete, elapsed time: 00:05:54
Finished backup at 09-JUN-10
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 4 09-JUN-10
Backup Piece 4 09-JUN-10 /orabak/dbbak/racdb_20100609_03lfq98d_1_1.bak
Backup Set 1 09-JUN-10
Backup Piece 1 09-JUN-10 /orabak/dbbak/racdb_20100609_04lfq98r_1_1.bak
Backup Set 2 09-JUN-10
Backup Piece 2 09-JUN-10 /orabak/dbbak/racdb_20100609_05lfq9j6_1_1.bak
Archive Log 3 09-JUN-10 /orabak/archlog/1_1910_718202824.dbf
Backup Set 3 09-JUN-10
Backup Piece 3 09-JUN-10 /orabak/dbbak/racdb_20100609_06lfq9jc_1_1.bak
Archive Log 4 09-JUN-10 /orabak/archlog/2_367_718202824.dbf
Backup Set 5 09-JUN-10
Backup Piece 5 09-JUN-10 /orabak/dbbak/archivelog_20100609_07lfq9lp_1_1.bak
Backup Set 6 09-JUN-10
Backup Piece 6 09-JUN-10 /orabak/dbbak/archivelog_20100609_08lfq
deleted backup piece
backup piece handle=/orabak/dbbak/racdb_20100609_03lfq98d_1_1.bak RECID=4 STAMP=721233165
deleted archived log
archived log file name=/orabak/archlog/1_1910_718202824.dbf RECID=3 STAMP=721233587
deleted backup piece
backup piece handle=/orabak/dbbak/archivelog_20100609_07lfq9lp_1_1.bak RECID=5 STAMP=721233593
Deleted 3 objects
deleted backup piece
backup piece handle=/orabak/dbbak/racdb_20100609_04lfq98r_1_1.bak RECID=1 STAMP=721233186
deleted backup piece
backup piece handle=/orabak/dbbak/racdb_20100609_05lfq9j6_1_1.bak RECID=2 STAMP=721233515
deleted backup piece
backup piece handle=/orabak/dbbak/racdb_20100609_06lfq9jc_1_1.bak RECID=3 STAMP=721233521
deleted archived log
archived log file name=/orabak/archlog/2_367_718202824.dbf RECID=4 STAMP=721233601
deleted backup piece
backup piece handle=/orabak/dbbak/archivelog_20100609_08lfq
Deleted 5 objects
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabak/dbbak/racdb_20100609_09lfqath_1_1.bak RECID=7 STAMP=721234865
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabak/dbbak/racdb_20100609_0blfqb86_1_1.bak RECID=8 STAMP=721235207
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabak/dbbak/racdb_20100609_0clfqb88_1_1.bak RECID=9 STAMP=721235208
Crosschecked 3 objects
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/orabak/dbbak/racdb_20100609_0alfqatu_1_1.bak RECID=10 STAMP=721234885
Crosschecked 1 objects
specification does not match any archived log in the recovery catalog
specification does not match any archived log in the recovery catalog
Starting backup at 09-JUN-10
current log archived
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1911 RECID=5 STAMP=721235228
channel c1: starting piece 1 at 09-JUN-10
channel c2: starting compressed archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=2 sequence=368 RECID=6 STAMP=721235242
channel c2: starting piece 1 at 09-JUN-10
channel c1: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/archlog_20100609_0dlfqb92_1_1.bak tag=TAG20100609T150713 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
channel c2: finished piece 1 at 09-JUN-10
piece handle=/orabak/dbbak/archlog_20100609_0elfqb
channel c2: backup set complete, elapsed time: 00:00:01
Finished backup at 09-JUN-10
released channel: c1
released channel: c2
Recovery Manager complete.
#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1034302/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle ADG環境下的RMAN備份策略Oracle
- RAC環境下的RMAN 備份指令碼一例指令碼
- RAC模式下的備份策略以及RMAN備份指令碼模式指令碼
- hacmp環境下的rman備份ACM
- RAC模式下的備份策略以及RMAN備份指令碼(轉)模式指令碼
- RAC模式下的備份策略以及RMAN備份指令碼(ZF)模式指令碼
- Aix下使用rman備份Oracle RAC資料庫(轉)AIOracle資料庫
- RMAN備份恢復——RAC環境資料庫的備份(zt)資料庫
- RMAN備份恢復--RAC環境資料庫的備份(十)資料庫
- RMAN備份恢復——RAC環境資料庫的備份(一)資料庫
- RAC下的備份策略
- AIX/Linux生產環境下crontab自動排程RMAN物理備份例子AILinux
- RAC環境歸檔NFS掛載方式RMAN備份錯誤NFS
- rman 備份策略
- 【RAC】rac環境下的資料庫備份與還原資料庫
- Oracle備份及備份策略及基於Linux下 Oracle 備份策略(RMAN)OracleLinux
- 三種Oracle RMAN備份加密策略(下)Oracle加密
- RMAN 備份策略 scripts
- 【RMAN】RMAN的備份保留策略
- 楊廷琨大師總結:RMAN備份恢復--RAC環境資料庫的備份資料庫
- RAC下的備份策略V1.1
- Oracle生產環境RMAN備份指令碼Oracle指令碼
- 基於Linux下 Oracle 備份策略(RMAN)LinuxOracle
- RMAN說,我能備份(9)--RMAN增量備份與備份保留策略
- 【rman備份策略】實驗
- oracle11gRAC環境使用RMAN備份方案Oracle
- windows+oracle環境的RMAN備份計劃WindowsOracle
- RAC環境利用備份恢復RAC資料庫(五)資料庫
- RAC環境利用備份恢復RAC資料庫(四)資料庫
- RAC環境利用備份恢復RAC資料庫(三)資料庫
- RAC環境利用備份恢復RAC資料庫(二)資料庫
- RAC環境利用備份恢復RAC資料庫(一)資料庫
- RAC環境備份歸檔日誌和RMAN恢復啟動資料庫資料庫
- rman備份集的保留策略
- rman備份rac的總結
- Linux環境下的一個rman備份的例項指令碼Linux指令碼
- 在aix oracle rac 環境下,增加lv的步驟AIOracle
- RMAN說,我能備份(18)--制訂備份策略