一. RMAN 的一些理论知识
RMAN Catalog 和 Nocatalog 的区别
RMAN 系列(一)---- RMAN 体系结构概述
RMAN 系列(二) ---- RMAN 设置和配置
RMAN 系列(三) ---- 介质管理问题
RMAN 系列(四) ---- RMAN 备份
RMAN 系列(五) ---- RMAN 还原 与 恢复
RMAN 系列(六) ---- RMAN 高级恢复
RMAN 系列(七) ---- RMAN 维护
RMAN 系列(八) ---- RMAN List和report 命令
RMAN 系列(九) ---- 调整RMAN备份与恢复操作的性能
Linux 平台下 RMAN 全备 和 增量备份 shell 脚本
可以用如下命令查看RMAN 的默认参数配置:
db_unique_name 为 ORCL 的数据库的 RMAN 配置参数为:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
# default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT 'F:/backup/orcl_%U.bak';
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 LOA
D TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:/APP/ADMINISTRATOR/PRODUCT/11.2.0/DBHO
ME_1/DATABASE/SNCFORCL.ORA'; # default
注意,controlfile autobackup 这个参数默认是OFF的,即默认不自动备份,我们把这个参数改成自动备份:
旧的 RMAN 配置参数:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
新的 RMAN 配置参数:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
已成功存储新的 RMAN 配置参数
改成自动以后,在数据文件有变化,或者备份数据库的时候,都会自动的备份控制文件和spfile文件。
如:CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
官网对这个参数的解释:
Configures the number of automatic channels of the specified device type allocated for RMAN jobs. By default, PARALLELISM is set to 1.
Suppose you set PARALLELISM for disk backups to 2 (see Example 2-42). If you set the default device type as disk, then RMAN allocates two disk channels when you run BACKUP DATABASE at the RMAN prompt. RMAN always allocates the number of channels set by PARALLELISM, although it may use only a subset of these channels.
To change the parallelism for a device type to n, run a new CONFIGURE DEVICE TYPE ... PARALLELISM n command. For example, you can change configure PARALLELISM to 3 for sbt and then change it to 2 as follows:
http://download.Oracle.com/docs/cd/E11882_01/backup.112/e10643/rcmsynta010.htm#RCMRF113