程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> 驗證控制文件、歸檔文件、不同BLOCK大小的數據文件對應的RMAN備份集不在同一PIECE

驗證控制文件、歸檔文件、不同BLOCK大小的數據文件對應的RMAN備份集不在同一PIECE

編輯:DB2教程

驗證控制文件、歸檔文件、不同BLOCK大小的數據文件對應的RMAN備份集不在同一PIECE


實驗為了證明如下:---數據庫版本 11.2.0.3.
RMAN備份中,歸檔日志、控制文件和數據文件不能放在同一個備份集裡,因為數據文件所在的備份集以Oracel 數據塊為最小單位,
而控制文件塊大小為作為16384,16K。歸檔日志文件所在的備份集也是以操作系統塊為最小單位,此處為512字節。
所以歸檔日志文件備份集、控制文件備份集和數據文件備份集不能在同一個備份集裡面。
---以上都是默認參數時的,當然可以使用piece=N或者maxpiecesize=1g之類參數來調整。
證明以上以後,創建不同塊大小的表空間,測試不同塊大小的表空間,也不能備份到同一個備份PIECE中。
######################

實驗一:驗證歸檔日志文件備份集、控制文件備份集和數據文件備份集不能在同一個備份集裡面


當前數據庫中數據文件、控制文件、日志文件塊大小:
SQL> col name for a50
SQL> select file#,name,block_size from v$datafile;

FILE# NAME BLOCK_SIZE
---------- -------------------------------------------------- ----------
1 +DATA01/bys9/datafile/system.260.876770855 8192
2 +DATA01/bys9/datafile/sysaux.261.876770927 8192
3 +DATA01/bys9/datafile/undotbs1.262.876770987 8192
4 +DATA01/bys9/datafile/users.264.876771015 8192

SQL> select members,bytes/1024/1024 M,blocksize from v$log;

MEMBERS M BLOCKSIZE
---------- ---------- ----------
2 50 512
2 50 512
2 50 512

SQL> select name,block_size from v$controlfile;

NAME BLOCK_SIZE
-------------------------------------------------- ----------
+DATA01/bys9/controlfile/current.256.876770817 16384
+FLASH/bys9/controlfile/current.256.876770821 16384
########備份測試情況:
可以看到歸檔文件的備份集、數據文件的備份集、控制文件的備份集是不在同一個備份PIECE中。
RMAN> backup database format "/home/oracle/full_%d_%T_%s"
2> plus archivelog delete all input;


Starting backup at 12-MAY-15
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=15 RECID=1 STAMP=877627122
input archived log thread=1 sequence=16 RECID=2 STAMP=879547905
input archived log thread=1 sequence=17 RECID=3 STAMP=879548073
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t225434_0.263.879548075 tag=TAG20150512T225434 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FLASH/bys9/archivelog/2015_04_21/thread_1_seq_15.260.877627115 RECID=1 STAMP=877627122
archived log file name=+FLASH/bys9/archivelog/2015_05_12/thread_1_seq_16.261.879547905 RECID=2 STAMP=879547905
archived log file name=+FLASH/bys9/archivelog/2015_05_12/thread_1_seq_17.262.879548073 RECID=3 STAMP=879548073
Finished backup at 12-MAY-15

Starting backup at 12-MAY-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA01/bys9/datafile/system.260.876770855
input datafile file number=00002 name=+DATA01/bys9/datafile/sysaux.261.876770927
input datafile file number=00003 name=+DATA01/bys9/datafile/undotbs1.262.876770987
input datafile file number=00004 name=+DATA01/bys9/datafile/users.264.876771015
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=/home/oracle/full_BYS9_20150512_2 tag=TAG20150512T225442 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
Finished backup at 12-MAY-15

Starting backup at 12-MAY-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=18 RECID=4 STAMP=879548173
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t225614_0.261.879548175 tag=TAG20150512T225614 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FLASH/bys9/archivelog/2015_05_12/thread_1_seq_18.262.879548173 RECID=4 STAMP=879548173
Finished backup at 12-MAY-15

Starting Control File and SPFILE Autobackup at 12-MAY-15
piece handle=+FLASH/bys9/autobackup/2015_05_12/s_879548179.262.879548187 comment=NONE
Finished Control File and SPFILE Autobackup at 12-MAY-15

RMAN> list backup of controlfile;


List of Backup Sets
===================


BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Full 9.36M DISK 00:00:09 12-MAY-15
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: TAG20150512T225618
Piece Name: +FLASH/bys9/autobackup/2015_05_12/s_879548179.262.879548187
Control File Included: Ckp SCN: 259666 Ckp time: 12-MAY-15

RMAN> list backup of archivelog all;


List of Backup Sets
===================


BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1 11.22M DISK 00:00:03 12-MAY-15
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20150512T225434
Piece Name: +FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t225434_0.263.879548075

List of Archived Logs in backup set 1
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 15 214735 11-APR-15 239087 21-APR-15
1 16 239087 21-APR-15 259310 12-MAY-15
1 17 259310 12-MAY-15 259604 12-MAY-15

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
3 4.00K DISK 00:00:02 12-MAY-15
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20150512T225614
Piece Name: +FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t225614_0.261.879548175

List of Archived Logs in backup set 3
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 18 259604 12-MAY-15 259652 12-MAY-15

RMAN> list backup of database;


List of Backup Sets
===================


BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 434.60M DISK 00:01:20 12-MAY-15
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20150512T225442
Piece Name: /home/oracle/full_BYS9_20150512_2
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 259619 12-MAY-15 +DATA01/bys9/datafile/system.260.876770855
2 Full 259619 12-MAY-15 +DATA01/bys9/datafile/sysaux.261.876770927
3 Full 259619 12-MAY-15 +DATA01/bys9/datafile/undotbs1.262.876770987
4 Full 259619 12-MAY-15 +DATA01/bys9/datafile/users.264.876771015

##########





######################

實驗二:創建不同塊大小的表空間,測試不同塊大小的表空間,也不能備份到同一個備份PIECE中。

SQL> select file#,name,block_size from v$datafile;


FILE# NAME BLOCK_SIZE
---------- -------------------------------------------------- ----------
1 +DATA01/bys9/datafile/system.260.876770855 8192
2 +DATA01/bys9/datafile/sysaux.261.876770927 8192
3 +DATA01/bys9/datafile/undotbs1.262.876770987 8192
4 +DATA01/bys9/datafile/users.264.876771015 8192
5 +DATA01/bys9/datafile/test1_4k.266.879548657 4096
6 +DATA01/bys9/datafile/test1_16k.267.879548689 16384

RMAN> backup as compressed backupset database include current controlfile plus archivelog delete all input;


Starting backup at 12-MAY-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=23 RECID=9 STAMP=879549561
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t231922_0.265.879549563 tag=TAG20150512T231922 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FLASH/bys9/archivelog/2015_05_12/thread_1_seq_23.264.879549561 RECID=9 STAMP=879549561
Finished backup at 12-MAY-15

Starting backup at 12-MAY-15
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=00001 name=+DATA01/bys9/datafile/system.260.876770855
input datafile file number=00002 name=+DATA01/bys9/datafile/sysaux.261.876770927
input datafile file number=00003 name=+DATA01/bys9/datafile/undotbs1.262.876770987
input datafile file number=00004 name=+DATA01/bys9/datafile/users.264.876771015
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.264.879549565 tag=TAG20150512T231925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA01/bys9/datafile/test1_4k.266.879548657
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.260.879549591 tag=TAG20150512T231925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA01/bys9/datafile/test1_16k.267.879548689
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.261.879549595 tag=TAG20150512T231925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/ncsnf0_tag20150512t231925_0.262.879549601 tag=TAG20150512T231925 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 12-MAY-15

Starting backup at 12-MAY-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=24 RECID=10 STAMP=879549604
channel ORA_DISK_1: starting piece 1 at 12-MAY-15
channel ORA_DISK_1: finished piece 1 at 12-MAY-15
piece handle=+FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t232004_0.266.879549605 tag=TAG20150512T232004 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+FLASH/bys9/archivelog/2015_05_12/thread_1_seq_24.263.879549603 RECID=10 STAMP=879549604
Finished backup at 12-MAY-15

-----------

RMAN> list backup of controlfile;


List of Backup Sets
===================


BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
21 Full 1.03M DISK 00:00:04 12-MAY-15
BP Key: 21 Status: AVAILABLE Compressed: YES Tag: TAG20150512T231925
Piece Name: +FLASH/bys9/backupset/2015_05_12/ncsnf0_tag20150512t231925_0.262.879549601
Control File Included: Ckp SCN: 261966 Ckp time: 12-MAY-15

RMAN> list backup of archivelog all;


List of Backup Sets
===================


BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
17 9.50K DISK 00:00:01 12-MAY-15
BP Key: 17 Status: AVAILABLE Compressed: YES Tag: TAG20150512T231922
Piece Name: +FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t231922_0.265.879549563

List of Archived Logs in backup set 17
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 23 261837 12-MAY-15 261945 12-MAY-15

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
22 3.00K DISK 00:00:02 12-MAY-15
BP Key: 22 Status: AVAILABLE Compressed: YES Tag: TAG20150512T232004
Piece Name: +FLASH/bys9/backupset/2015_05_12/annnf0_tag20150512t232004_0.266.879549605

List of Archived Logs in backup set 22
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 24 261945 12-MAY-15 261973 12-MAY-15

RMAN> list backup of database;


List of Backup Sets
===================


BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
18 Full 101.58M DISK 00:00:23 12-MAY-15
BP Key: 18 Status: AVAILABLE Compressed: YES Tag: TAG20150512T231925
Piece Name: +FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.264.879549565
List of Datafiles in backup set 18
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 261954 12-MAY-15 +DATA01/bys9/datafile/system.260.876770855
2 Full 261954 12-MAY-15 +DATA01/bys9/datafile/sysaux.261.876770927
3 Full 261954 12-MAY-15 +DATA01/bys9/datafile/undotbs1.262.876770987
4 Full 261954 12-MAY-15 +DATA01/bys9/datafile/users.264.876771015

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
19 Full 1.01M DISK 00:00:03 12-MAY-15
BP Key: 19 Status: AVAILABLE Compressed: YES Tag: TAG20150512T231925
Piece Name: +FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.260.879549591
List of Datafiles in backup set 19
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 Full 261963 12-MAY-15 +DATA01/bys9/datafile/test1_4k.266.879548657

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
20 Full 1.03M DISK 00:00:02 12-MAY-15
BP Key: 20 Status: AVAILABLE Compressed: YES Tag: TAG20150512T231925
Piece Name: +FLASH/bys9/backupset/2015_05_12/nnndf0_tag20150512t231925_0.261.879549595
List of Datafiles in backup set 20
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
6 Full 261965 12-MAY-15 +DATA01/bys9/datafile/test1_16k.267.879548689






  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved