異地備份將WH DB backup 到CQ/LH 解决方案:
最终确认采用NFS For RMAN Backup standbydb
1、異地部署NFS Server 設置共享目錄
2、本地mount遠程目錄,執行rman備份腳本(本策略部署在standbydb)
# cat /root/rmanbackup/mount_rman.sh
umount -l /mnt
mount -t nfs -o timeo=3,udp IP:/NFS_linux /mnt
su - oracle -c "sh /home/oracle/dba/rmanbackup/rman_backup_lv10.sh"
ping 127.0.0.1 -c 30
cp /u01/app/oracle/oradata/ygzhoudb/control01.ctl /mnt/fullbackup/ygzhoudb/`date +%Y%m%d%H%M%S`_control01.ctl
ping 127.0.0.1 -c 30
cd ~
umount /mnt
umount -l /mnt
mount -t nfs -o timeo=3,udp IP:/NFS_linux /mnt
su - oracle -c "sh /home/oracle/dba/rmanbackup/rman_backup_lv10.sh"
ping 127.0.0.1 -c 30
cp /u01/app/oracle/oradata/ygzhoudb/control01.ctl /mnt/fullbackup/ygzhoudb/`date +%Y%m%d%H%M%S`_control01.ctl
ping 127.0.0.1 -c 30
cd ~
umount /mnt
# cat /home/oracle/dba/rmanbackup/rman_backup_lv10.sh
ORACLE_HOME=/u01/app/oracle/product/11.2.0.;export ORACLE_HOME
ORACLE_SID=ygzhoudb;export ORACLE_SID
ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE
PATH=$ORACLE_HOME/bin:$PATH:.;export PATH
rman target / log/mnt/fullbackup/ygzhoudb/`date +%Y%m%d%H%M%S`_rmanbackup.log <run {
allocate channel db01 type disk ;
allocate channel db02 type disk ;
#allocate channel db03 type disk ;
ORACLE_SID=ygzhoudb;export ORACLE_SID
ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE
PATH=$ORACLE_HOME/bin:$PATH:.;export PATH
rman target / log/mnt/fullbackup/ygzhoudb/`date +%Y%m%d%H%M%S`_rmanbackup.log <
allocate channel db01 type disk ;
allocate channel db02 type disk ;
#allocate channel db03 type disk ;
#allocate channel db04 type disk ;
set limite allocate channel db01 kbytes 4000000;
set limite allocate channel db01 kbytes 4000000;
#set limite allocate channel db01 kbytes 4000000;
#set limite allocate channel db01 kbytes 4000000;
#set limite allocate channel db01 kbytes 4000000;
delete noprompt obsolete recovery window of 15 days;
backup incremental level 0 database format '/mnt/fullbackup/ygzhoudb/database_level0_%T_%U.bak';
#filesperset 1;
backup incremental level 0 database format '/mnt/fullbackup/ygzhoudb/database_level0_%T_%U.bak';
#filesperset 1;
backup archivelog all format '/mnt/fullbackup/ygzhoudb/archivelog_%T_%U.bak' filesperset 20;
}
}
exit;
EOF
EOF
以上為最終確定腳本。
測試中遇到以下error,在備份32GB的datafile途中,自動斷開備份
Redo thread mounted by this instance: 1
Oracle process number: 451
Unix process pid: 31440, image: oracle@ygzhou(TNS V1-V3)
*** 2012-11-13 08:59:22.772
*** SESSION ID:(1231.30025) 2012-11-13 08:59:22.772
*** CLIENT ID:() 2012-11-13 08:59:22.772
*** SERVICE NAME:(SYS$USERS) 2012-11-13 08:59:22.772
*** MODULE NAME:(backup full datafile) 2012-11-13 08:59:22.772
*** ACTION NAME:(0000017 STARTED16) 2012-11-13 08:59:22.772
ORA-27052: unable to flush file data
Linux-x86_64 Error: 5: Input/output error
Additional information: 1
ORA-19510: failed to set size of 94333 blocks for file ''/mnt/fullbackup/ygzhoudb/database_20121113_vgnq6k3j_1_1.bak" (block si
ze=8192)
ORA-27059: could not reduce file size
Linux-x86_64 Error: 1: Operation not permitted
Additional information: 2
Oracle process number: 451
Unix process pid: 31440, image: oracle@ygzhou(TNS V1-V3)
*** 2012-11-13 08:59:22.772
*** SESSION ID:(1231.30025) 2012-11-13 08:59:22.772
*** CLIENT ID:() 2012-11-13 08:59:22.772
*** SERVICE NAME:(SYS$USERS) 2012-11-13 08:59:22.772
*** MODULE NAME:(backup full datafile) 2012-11-13 08:59:22.772
*** ACTION NAME:(0000017 STARTED16) 2012-11-13 08:59:22.772
ORA-27052: unable to flush file data
Linux-x86_64 Error: 5: Input/output error
Additional information: 1
ORA-19510: failed to set size of 94333 blocks for file ''/mnt/fullbackup/ygzhoudb/database_20121113_vgnq6k3j_1_1.bak" (block si
ze=8192)
ORA-27059: could not reduce file size
Linux-x86_64 Error: 1: Operation not permitted
Additional information: 2
將4通道更改為2通道、并設置備份集 < 4GB
懷疑NFS 單顆雙核CPU導致、后續將nfs server端半雙工1Gb網卡切換為全雙工測試