暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ORACLE 查看 RMAN 备份大小

原创 楚枫默寒 2024-11-01
95


查看 RMAN 历史备份情况及大小

select to_char(start_time, 'yyyy-mm-dd') start_time,
       INCREMENTAL_LEVEL,
       BACKUP_TYPE,
       device_type,
       to_char(start_time, 'day') day,
       round(sum(OUTPUT_BYTES) / 1024 / 1024 / 1024, 2) SIZE_GB
  from v$backup_set_details
 group by to_char(start_time, 'yyyy-mm-dd'),
          to_char(start_time, 'day'),
          INCREMENTAL_LEVEL,
          BACKUP_TYPE,device_type
 order by start_time desc;
复制

最后一次全备时间及大小

incremental_level = 0

select *
  from (select to_char(start_time, 'yyyy-mm-dd') start_time,
               INCREMENTAL_LEVEL,
               BACKUP_TYPE,
               device_type,
               to_char(start_time, 'day') day,
               round(sum(OUTPUT_BYTES) / 1024 / 1024 / 1024, 2) SIZE_GB
          from v$backup_set_details
         where incremental_level = 0
         group by to_char(start_time, 'yyyy-mm-dd'),
                  INCREMENTAL_LEVEL,
                  BACKUP_TYPE,
                  device_type,
                  to_char(start_time, 'day')
         order by start_time desc) c
 where rownum = 1;
复制


v$backup_set_details displays information about backup sets from the control file. A backup set record is inserted after the backup set is successfully completed.

ColumnDatatypeDescription
RECIDNUMBERBackup set record ID
STAMPNUMBERBackup set record stamp
SET_STAMPNUMBER

Backup set stamp. The backup set stamp and

count uniquely identify the backup set.
Primary key for theV$BACKUP_SET table, and

the foreign key for the following tables:

V$BACKUP_PIECE,V$BACKUP_DATAFILE,

V$BACKUP_REDOLOG,V$BACKUP_CORRUPTION.
备份集标记。备份集标记和计数唯一地标识了备份集。

SET_COUNTNUMBER

Backup set count. The backup set count is incremented

by one every time a new backup set is started (if the

backup set is never completed the number is "lost").

If the control file is re-created then the count is reset to 1.

Therefore the count must be used with the stamp to

uniquely identify a backup set.
Primary key for theV$BACKUP_SET table, and the

foreign key for the following tables: V$BACKUP_PIECE,V$BACKUP_DATAFILE,

V$BACKUP_REDOLOG,V$BACKUP_CORRUPTION
备份集计数。每次一个新的备份集开始备份集计数会增加 1。(如果备份集从来没有完成则编号 “丢失”)。如果控制文件被重新创建则计数重置为 1,因此计数必须和标记一起使用来唯一地标识一个备份集。

BACKUP_TYPEVARCHAR2(1)Type of files that are in this backup. If the backup contains archived redo logs, the value is L. If this is a datafile full backup, the value is D. If this is an incremental backup, the value is I.
CONTROLFILE_INCLUDEDVARCHAR2(3)Set to YES if there is a control file included in this backup set, otherwise set to NO
INCREMENTAL_LEVELNUMBERLocation where this backup set fits into the database's backup strategy. Set to NULL for full datafile, archivelog, controlfile, and spfile backups, set to 0 for incremental level 0 datafile backups, and set to 1 for incremental level 1 datafile backups.
PIECESNUMBERNumber of distinct backup pieces in the backup set
START_TIMEDATEStarting time
COMPLETION_TIMEDATETime that this backup set completed
ELAPSED_SECONDSNUMBERThe number of elapsed seconds
BLOCK_SIZENUMBERBlock size of the backup set
INPUT_FILE_SCAN_ONLYVARCHAR2(3)YES indicates no actual backup is performed, but the datafiles are read. NO indicates a normal backup is performed.
KEEPVARCHAR2(3)(YES/NO) Indicates whether or not this backup set has a retention policy that is different than the value for the configure retention policy
KEEP_UNTILDATEIf KEEP_UNTIL_TIME is specified, this is the date after which the backup becomes obsolete. If this column is null, then the backup never expires.
KEEP_OPTIONSVARCHAR2(10)Lists additional retention options for this backup set. Possible values are:
LOGS - The logs need to recover this backup are kept
NOLOGS - The logs needed to recover this backup will not be kept
BACKUP_LOGS - An archive log backup exists to support this backup set
MULTI_SECTIONVARCHAR2(3)Indicates whether or not this backup set is a multi-section backup. Valid values are YES andNO. A multi-section backup is a backup in which multiple backup pieces are produced independently in parallel by multiple channels.


该视图查看的信息与 RMAN 中命令 LIST BACKUP 类似,只不过表示形式不同。其中 BACKUP_TYPE 列标记该备份集中包含的文件类型,有下列几个值:

L:表示包含归档重做日志文件;

D:表示数据文件完全备份;

I:表示增量备份。


文章转载自楚枫默寒,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论