1 show all; 显示当前配置信息
2 select * from v$rman_configuration; 查询RMAN中的非默认值
3 configure常用选项
3.1 保持策略
configure retention policy to recovery window of 7 days; 超过最近7天以外的备份都被标记为obsolete
configure retention policy to redundancy 5; 保持可恢复的最新5个备份,超过这个最新5个的备份被标记为redundancy
configure retention policy clear; 恢复默认的保持策略
configure retention policy to none; 使备份保持策略失效
3.2 备份优化,默认关闭,若打开,将对备份文件及归档文件进行优化
backup optimization
configure backup optimization on;
configure backup optimization off;
configure backup optimization clear;
3.3 默认设备,默认是磁盘
configure default device type to disk;
configure default device type to stb;
configure default device type clear;
3.4 控制文件
configure controlfile autobackup on(off);
configure controlfile autobackup format for device type disk to '/backupset/conf_%F';
configure controlfile autobackup clear;
configure controlfile autobackup format for device type disk clear;
configure snapshot controlfile name to '/backup/scontrollfile.snp'; 控制文件的快照存放路径及名称,备份期间产生,用于控制文件的读一致性
configure snapshot controlfile name clear;
3.5 并行度(通道数)device type diskstb pallelism n
configure device type diskstb parallelism 2;
configure device type diskstb clear;
configure channel device type disk format '路径/rmanback_%U';
configure channel device type disk maxpiecesize 100m;
configure channel device type disk rate 1200K;
configure channel 1 device type disk format '路径/:rmanback_%U';
configure channel 2 device type disk format '路径/:rmanback_%U';
configure channel 1 device type disk maxpiecesize 100m;
3.6 生成备份副本
configure datafile backup copies for device type diskstb to 3;
configure archivelog backup copies for device type diskstb to 3;
configure datafile | archivelog backup copies for device type diskstb clear; 设置DB的文件的备份的存放设备类型
backup device type disk database format '路径1/%U','路径2/%U','路径3/%U'; 配置DB的每次备份的copy数量,即每一次备份完有个多份相同的copy
3.7 排除选项 exclude
configure exclude for tablespace 'users'; 指定users表空间不备份到备份集中,对只读表空间很有用
configure clear;
3.8 设置备份集大小maxsetsize
configure maxsetsize to 1G | 1000M | 1000000K | unlimited;
configure maxsetsize clear;
3.9 其他选项auxiliary
configure auxname for datafile 1 to ‘路径/aux_1.f’;
configure auxname for datafile 2 to ‘路径/aux_2.f’;
configure auxname for datafile 3 to ‘路径/aux_3.f’;
configure auxname for datafile 4 to ‘路径/aux_4.f’;
configure auxname for datafile 1 clear;
configure auxname for datafile 2 clear;
configure auxname for datafile 3 clear;
configure auxname for datafile 4 clear;
format格式中的%
%c 备份片的copy数
%d 数据库名称
%D 位于该月中的第几天
%M 位于该年中的第几月
%F 基于DBID唯一的名称
例: c-IIIIIIIIII-YYYYMMDD-QQ
IIIIIIIIII 为库的DBID
QQ 1-256的序列
%n 数据库名称
%u 8个字符的名称代表备份集与创建时间
%p 备份集的备份片号
%U 一个唯一的文件名,即%u_%p_%c
%s 备份集的号
%t 备份集的时间戳
%T 年月日格式YYYYMMDD