码迷,mamicode.com
首页 > 其他好文 > 详细

验证控制文件、归档文件、不同BLOCK大小的数据文件对应的RMAN备份集不在同一PIECE

时间:2015-05-13 10:34:51      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

实验为了证明如下:---数据库版本 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






验证控制文件、归档文件、不同BLOCK大小的数据文件对应的RMAN备份集不在同一PIECE

标签:

原文地址:http://blog.csdn.net/haibusuanyun/article/details/45677805

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!