在RMAN的备份中,可以通过Exclude命令排除某些不需要备份的表空间。
这样可以缩减备份的容量,对备份进行适当优化和调整。
排除某个表空间可以使用类似如下命令:
configure exclude for tablespace users;
其设置可以在RMAN中通过show exclude命令来查看。
如果将来想临时增加排除表空间的备份,可以通过以下命令实现:
backup database noexclude;
如果想取消排除设置则可以使用如下命令:
CONFIGURE EXCLUDE FOR TABLESPACE users CLEAR;
此外常用的排除备份命令还有:
BACKUP DATABASE SKIP READONLY, SKIP OFFLINE;
configure exclude for tablespace users;
configrue exclude clear; --清除设置
BACKUP DATABASE NOEXCLUDE; --会备份USERS表空间
此命令用于将指定的表空间不备份到备份集中。
RMAN> configure exclude for tablespace users;
using target database control file instead of recovery catalog
Tablespace USERS will be excluded from future whole database backups
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters for database with db_unique_name OCPLHR1 are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/bak/cf_%F.ctl';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
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 EXCLUDE FOR TABLESPACE 'USERS';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_OCPLHR1.f'; # default
RMAN> show exclude;
RMAN configuration parameters for database with db_unique_name OCPLHR1 are:
CONFIGURE EXCLUDE FOR TABLESPACE 'USERS';
RMAN>