Oracle

RMAN 中備份集的行為如何?

  • July 23, 2019

我在 WEB 上找到了這個定義:

當您發出 RMAN 備份命令時創建的備份文件的邏輯分組(備份片段)。備份集是與備份關聯的文件集合的 RMAN 名稱。備份集由一個或多個備份片段組成。

但我不明白為什麼當我對整個數據庫進行一次備份時,rman 會創建多個備份集

這是我製作的一個備份的輸出(我使用了並行度 4)

[oracle@orcl12 ~]$ rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Sat Jul 20 12:48:52 2019

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (DBID=1525136414)

RMAN> list backup;

using target database control file instead of recovery catalog

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


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
161     3.92M      DISK        00:00:01     20/07/2019 12:06:12
       BP Key: 161   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120610
       Piece Name: /u01/app/oracle/recovery_area/ORCL/backupset/2019_07_20/o1_mf_annnn_TAG20190720T120610_gm6ch3t2_.bkp

 List of Archived Logs in backup set 161
 Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
 ---- ------- ---------- ------------------- ---------- ---------
 1    58      14688057   20/07/2019 11:55:34 14693433   20/07/2019 12:06:09

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
162     Full    307.59M    DISK        00:03:59     20/07/2019 12:10:15
       BP Key: 162   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F4405983DB33E47E055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6chcwh_.bkp
 List of Datafiles in backup set 162
 Container ID: 3, PDB Name: ORCLPDB
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 10      Full 14693446   20/07/2019 12:06:16              NO    /u01/app/oracle/oradata/orcl/orclpdb/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
163     Full    276.60M    DISK        00:04:11     20/07/2019 12:10:27
       BP Key: 163   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F43A22D9E7528CCE055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6chg3m_.bkp
 List of Datafiles in backup set 163
 Container ID: 2, PDB Name: PDB$SEED
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 6       Full 1441967    12/01/2019 11:41:59              NO    /u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
164     Full    503.65M    DISK        00:05:59     20/07/2019 12:12:14
       BP Key: 164   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6ch8s4_.bkp
 List of Datafiles in backup set 164
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 3       Full 14693445   20/07/2019 12:06:16              NO    /u01/app/oracle/oradata/orcl/sysaux01.dbf
 7       Full 14693445   20/07/2019 12:06:16              NO    /u01/app/oracle/oradata/orcl/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
165     Full    738.59M    DISK        00:06:22     20/07/2019 12:12:37
       BP Key: 165   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6ch803_.bkp
 List of Datafiles in backup set 165
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 1       Full 14693444   20/07/2019 12:06:15              NO    /u01/app/oracle/oradata/orcl/system01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
166     Full    285.26M    DISK        00:01:08     20/07/2019 12:13:58
       BP Key: 166   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6cvr4x_.bkp
 List of Datafiles in backup set 166
 Container ID: 4, PDB Name: HOMOL
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 57      Full 14693594   20/07/2019 12:12:54              NO    /u01/app/oracle/oradata/orcl/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/datafile/o1_mf_sysaux_glh6b049_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
167     Full    198.24M    DISK        00:01:35     20/07/2019 12:15:22
       BP Key: 167   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F43A22D9E7528CCE055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6cxvsl_.bkp
 List of Datafiles in backup set 167
 Container ID: 2, PDB Name: PDB$SEED
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 5       Full 1441967    12/01/2019 11:41:59              NO    /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
168     Full    222.91M    DISK        00:02:53     20/07/2019 12:15:49
       BP Key: 168   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F4405983DB33E47E055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6cxov8_.bkp
 List of Datafiles in backup set 168
 Container ID: 3, PDB Name: ORCLPDB
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 9       Full 14693605   20/07/2019 12:13:22              NO    /u01/app/oracle/oradata/orcl/orclpdb/system01.dbf
 12      Full 14693605   20/07/2019 12:13:22              NO    /u01/app/oracle/oradata/orcl/orclpdb/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
169     Full    204.08M    DISK        00:02:21     20/07/2019 12:17:20
       BP Key: 169   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d1dhk_.bkp
 List of Datafiles in backup set 169
 Container ID: 4, PDB Name: HOMOL
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 56      Full 14693679   20/07/2019 12:15:52              NO    /u01/app/oracle/oradata/orcl/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/datafile/o1_mf_system_glh69zz4_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
170     Full    3.07M      DISK        00:02:04     20/07/2019 12:18:00
       BP Key: 170   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F4405983DB33E47E055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d4lp2_.bkp
 List of Datafiles in backup set 170
 Container ID: 3, PDB Name: ORCLPDB
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 11      Full 14693696   20/07/2019 12:16:40              NO    /u01/app/oracle/oradata/orcl/orclpdb/undotbs01.dbf
 60      Full 14693696   20/07/2019 12:16:40              NO    /u01/app/oracle/product/12.2.0/dbhome_1/dbs/brelele

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
171     Full    7.98M      DISK        00:00:36     20/07/2019 12:18:13
       BP Key: 171   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F4405983DB33E47E055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d5kdw_.bkp
 List of Datafiles in backup set 171
 Container ID: 3, PDB Name: ORCLPDB
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 55      Full 14693724   20/07/2019 12:17:54              NO    /u01/app/oracle/oradata/orcl/ORCL/7F4405983DB33E47E055FAC8EF8905E8/datafile/o1_mf_rman_gldpgddc_.dbf
 61      Full 14693724   20/07/2019 12:17:54              NO    /u01/app/oracle/product/12.2.0/dbhome_1/dbs/brelele2

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
172     Full    37.42M     DISK        00:00:34     20/07/2019 12:18:44
       BP Key: 172   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/7F43A22D9E7528CCE055FAC8EF8905E8/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d61cl_.bkp
 List of Datafiles in backup set 172
 Container ID: 2, PDB Name: PDB$SEED
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 8       Full 1441967    12/01/2019 11:41:59              NO    /u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
173     Full    2.57M      DISK        00:00:31     20/07/2019 12:19:01
       BP Key: 173   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d6nnb_.bkp
 List of Datafiles in backup set 173
 Container ID: 4, PDB Name: HOMOL
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 58      Full 14693749   20/07/2019 12:18:34              NO    /u01/app/oracle/oradata/orcl/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/datafile/o1_mf_undotbs1_glh6b04c_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
174     Full    1.04M      DISK        00:00:32     20/07/2019 12:19:16
       BP Key: 174   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d7mhm_.bkp
 List of Datafiles in backup set 174
 Container ID: 4, PDB Name: HOMOL
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 59      Full 14693756   20/07/2019 12:18:51              NO    /u01/app/oracle/oradata/orcl/ORCL/8D6E79BBBC2A140CE0531400A8C06C3B/datafile/o1_mf_users_glh795h1_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
175     Full    16.57M     DISK        00:00:16     20/07/2019 12:19:21
       BP Key: 175   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T120613
       Piece Name: /u01/app/oracle/recovery_area/ORCL/backupset/2019_07_20/o1_mf_nnndf_TAG20190720T120613_gm6d7q9r_.bkp
 List of Datafiles in backup set 175
 File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
 ---- -- ---- ---------- ------------------- ----------- ------ ----
 4       Full 14694166   20/07/2019 12:19:15 14694171     NO    /u01/app/oracle/oradata/orcl/undotbs01.dbf
 28      Full 14694166   20/07/2019 12:19:15              NO    /u01/app/oracle/oradata/orcl/ORCL/datafile/o1_mf_haha_gb1k1h6b_.dbf

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
176     4.99M      DISK        00:00:00     20/07/2019 12:19:37
       BP Key: 176   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T121936
       Piece Name: /u01/app/oracle/recovery_area/ORCL/backupset/2019_07_20/o1_mf_annnn_TAG20190720T121936_gm6d89jz_.bkp

 List of Archived Logs in backup set 176
 Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
 ---- ------- ---------- ------------------- ---------- ---------
 1    59      14693433   20/07/2019 12:06:09 14694370   20/07/2019 12:19:30

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
177     Full    18.09M     DISK        00:00:05     20/07/2019 12:19:54
       BP Key: 177   Status: AVAILABLE  Compressed: NO  Tag: TAG20190720T121948
       Piece Name: /u01/app/oracle/recovery_area/ORCL/autobackup/2019_07_20/o1_mf_s_1014121189_gm6d8tj6_.bkp
 SPFILE Included: Modification time: 20/07/2019 12:18:10
 SPFILE db_unique_name: ORCL
 Control File Included: Ckp SCN: 14694951     Ckp time: 20/07/2019 12:19:49

rman 不應該為一個備份創建一個備份集,並且在這個備份集中包含所有備份片段嗎?

我的 RMAN 配置:

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/12.2.0/dbhome_1/dbs/snapcf_orcl.f'; # default

使用備份數據庫加上archivelog rman 將執行幾個步驟:

  1. 日誌開關(創建新的歸檔日誌)
  2. 存檔日誌的備份
  3. 數據文件的備份
  4. 日誌開關(創建新的歸檔日誌)
  5. 數據庫備份時歸檔日誌的備份
  6. 備份控製文件和spfile;

所以這裡 rman 將創建至少 4 個備份集:兩個 - 帶有歸檔日誌,一個 - 帶有數據文件,一個帶有 CF 和 spfile。

如果您使用 4 的並行性 - 那麼 rman 將在 4 個程序(執行緒)中工作,並且每個程序都將生成自己的備份集。

對於數據文件,rman 會將這項工作分配給 4 個程序,每個程序都會備份它們的數據文件。

歸檔日誌也是如此——如果有很多的話——你會看到它們有 4 個備份集。

引用自:https://dba.stackexchange.com/questions/243372