[20190522]rman備份問題.txt
[20190522]rman備份問題.txt
--//連結http://www.itpub.net/thread-2116768-1-1.html,提到的一個問題,主要指令碼里面出現2次database.
--//導致備份出現2次,1次備份到閃回區,導致閃回區空間不足的情況.
backup as compressed backupset incremental level= 1 skip inaccessible filesperset 5 Database format='/home/oracle/ora_bak/orcl_lev1_%U_%T' tag='orcl_lev1_0520' database
include current controlfile ;
--//注意看可以發現出現2次database.我認為應該刪除第2個database,zergduan指出
不對, 標準的Backup 語法是
Backup + Backup_Operand + Backup_Spec
format 子句屬於 operand
database 屬於 spec
所以應該是 backup format=xxx database, 這樣才標準~
具體可以參考 rman 的官方文件 reference那本
--//我個人喜歡放在最後,例子:
http://blog.itpub.net/267265/viewspace-2089074/=>[20160427]rman tag format標識.txt
--//我還是測試看看:
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
--//CONFIGURE CHANNEL DEVICE TYPE SBT_TAPE clear;
--//CONFIGURE DEFAULT DEVICE TYPE TO DISK;
--//CONFIGURE CHANNEL 1 DEVICE TYPE DISK clear;
2.測試:
RMAN> backup as compressed backupset datafile 9 tag='file 9' format '/home/oracle/backup/datafile9_%U' datafile 9 tag='filex 9' format '/home/oracle/backup/datafile9x_%U';
Starting backup at 2019-05-22 09:35:43
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/T01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-22 09:35:44
channel ORA_DISK_1: finished piece 1 at 2019-05-22 09:35:45
piece handle=/home/oracle/backup/datafile9_2vu260jg_1_1 tag=FILE 9 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/T01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-22 09:35:45
channel ORA_DISK_1: finished piece 1 at 2019-05-22 09:35:46
piece handle=/home/oracle/backup/datafile9x_30u260jh_1_1 tag=FILEX 9 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-05-22 09:35:46
$ ls -l /home/oracle/backup/datafile9*
-rw-r----- 1 oracle oinstall 3284992 2019-05-22 09:35:44 /home/oracle/backup/datafile9_2vu260jg_1_1
-rw-r----- 1 oracle oinstall 3284992 2019-05-22 09:35:46 /home/oracle/backup/datafile9x_30u260jh_1_1
--//感覺我寫的是對的.修改如下:
RMAN> backup as compressed backupset datafile 9 tag='file 9' format '/home/oracle/backup/datafile9_%U' datafile 9 ;
Starting backup at 2019-05-22 09:41:25
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/T01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-22 09:41:25
channel ORA_DISK_1: finished piece 1 at 2019-05-22 09:41:26
piece handle=/home/oracle/backup/datafile9_31u260u5_1_1 tag=FILE 9 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/T01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-22 09:41:26
channel ORA_DISK_1: finished piece 1 at 2019-05-22 09:41:27
piece handle=/u01/app/oracle/fast_recovery_area/BOOK/backupset/2019_05_22/o1_mf_nnndf_TAG20190522T094125_gg9b66j0_.bkp tag=TAG20190522T094125 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-05-22 09:41:27
RMAN> backup as compressed backupset tag='file 9' format '/home/oracle/backup/datafile9_%U' datafile 9 ;
Starting backup at 2019-05-22 09:42:51
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00009 name=/mnt/ramdisk/book/T01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-05-22 09:42:51
channel ORA_DISK_1: finished piece 1 at 2019-05-22 09:42:52
piece handle=/home/oracle/backup/datafile9_33u2610r_1_1 tag=FILE 9 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-05-22 09:42:52
--//感覺前面沒有什麼區別,這樣看來前後沒有什麼區別,只不過oracle自動"分組".
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2645146/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20180423]關於rman備份的問題2.txt
- [20190510]rman備份的疑問8.txt
- [20190510]rman備份的疑問7.txt
- [20190509]rman備份的疑問5.txt
- [20190313]備份問題.txt
- [20190515]熱備份模式與rman衝突.txt模式
- [20210527]rman與undo表空間備份.txt
- [20190116]rman的老問題.txt
- 【RMAN】RMAN備份至ASMASM
- RMAN備份概述
- 【RMAN】RMAN的備份保留策略
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- [20221028]rman使用tape與增量備份測試2.txt
- RMAN備份進度
- rman 備份指令碼指令碼
- RMAN的備份原理
- [20190522]DISABLE TABLE LOCK.txt
- RMAN備份恢復技巧
- 【rman備份策略】實驗
- Oracle RMAN備份實戰Oracle
- Oracle OCP(60):RMAN 備份Oracle
- rman 增量備份恢復
- [20221121]rman刪除歸檔日誌問題.txt
- 【RMAN】同時建立多個備份(建立多重備份)
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- RMAN 備份相關的概念
- RMAN備份異機恢復
- RMAN備份詳解(轉載)
- 使用RMAN備份資料庫資料庫
- [20211020]改變備庫的rman配置.txt
- 分享Oracle Rman的備份指令碼Oracle指令碼
- RMAN備份恢復效能優化優化
- RMAN加密備份的三種方式加密
- RMAN備份中發現壞塊
- RMAN自動備份任務新增
- oracle 12c rman備份pdbOracle
- 利用RMAN備份重建資料庫資料庫
- RMAN備份與恢復測試