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
- 【RMAN】在多租戶環境下的RMAN備份及恢復
- 【RMAN】RMAN的備份保留策略
- 【rman備份策略】實驗
- IBM /AIX 環境快速部署MySQLIBMAIMySql
- oracle10g RMAN增量備份策略Oracle
- 【AIX】AIX7.1 C編譯環境部署指導說明AI編譯
- AIX 5.3/6.1環境下安裝Oracle 10gR2 RAC常見報錯AIOracle 10g
- KingbaseES RAC部署案例之---SAN環境構建RAC
- 【RMAN】RMAN備份至ASMASM
- Oracle 11.2.0.4 rac for aix acfs異常環境的克隆環境ASM磁碟組掛載緩慢OracleAIASM
- RMAN備份概述
- RMAN之環境配置(二)---Backups to a Media Manager備份到介質管理器
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- RAC和ASM環境下打patchASM
- RAC環境下建立物理DATAGUARD(1)
- RAC環境下建立物理DATAGUARD(2)
- RMAN備份進度
- rman 備份指令碼指令碼
- RMAN的備份原理
- ubuntu下AI伺服器環境的部署準備UbuntuAI伺服器
- Oracle RAC 環境下的連線管理Oracle
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- rman 增量備份恢復
- Oracle RMAN備份實戰Oracle
- Oracle OCP(60):RMAN 備份Oracle
- RMAN備份恢復技巧
- Networker備份oracle racOracle
- Oracle RAC一鍵部署001(主機環境校驗)Oracle
- RMAN之環境配置(一)
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- openstack 部署(Q版)—–環境準備篇
- 【RMAN】同時建立多個備份(建立多重備份)
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- 10g RAC on AIXAI
- RMAN備份詳解(轉載)
- [20190522]rman備份問題.txt
- RMAN 備份相關的概念
- 使用RMAN備份資料庫資料庫