Oracle数据库rman环境配置详解

1.配置自动通道

  配置自动通道并行度,RMAN自动分配2个通道:

  RMAN> configure device type disk parallelism 2; RMAN> configure device type sbt parallelism 2;

  配置所有通道的备份文件格式

  RMAN> configure channel device type disk 2> format '/oracle/10g/oracle/bakup/%d_%s_%p.bak';

  配置特定通道的备份文件格式,配置通道1备份文件格式:

  RMAN> configure channel 1 device type disk 2> format '/oracle/10g/oracle/bakup/%u.bak';

  配置默认存储设备

  RMAN> configure default device type to sbt; --磁带 RMAN> configure default device type to disk;--磁盘

  2.配置备份集与备份片的最大尺寸

  RMAN> configure maxsetsize to 1G; RMAN> configure channel device type disk maxpiecesize 500M;

  默认每个备份集只包含一个备份片文件,通过配置备份片的最大尺寸,可以将一个大的备份集分为几个相对小的备份片文件。

  3.配置备份优化

  备份优化用于在某些情况下跳过特定文件的备份。如果某个文件完全相同的备份已经存在,那么当激活备份优化时会跳过该文件。备份优化只适用于backup database,backup archivelog all/like和backup backupset all命令。激活备份优化:RMAN> configure backup optimization on;

  4.配置多重备份

  rman默认生成一个备份片副本,可以配置多重备份。示例:

  RMAN> configure datafile backup copies for device type disk to 3;

  5.配置免除表空间

  RMAN> configure exclude for tablespace testspc;

  6.配置备份冗余策略

  使用delete obsolete删除陈旧备份,配置备份冗余策略示例:

  RMAN> configure retention policy to redundancy 2;

  7.配置辅助例程的数据文件名

  用于rman执行表空间时间点恢复或复制数据库,示例:

  RMAN> configure auxname for datafile 2 to '/oracle/10g/data/df_2.dbf';

  8.配置快照控制文件名

  当重新同步恢复目录或备份控制文件时,rman需要建立快照控制文件。

  RMAN> show snapshot controlfile name; RMAN configuration parameters are: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife.f'; # default --默认 RMAN> configure snapshot controlfile name to '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f'; snapshot control file name set to: /oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f new RMAN configuration parameters are successfully stored RMAN> show snapshot controlfile name; RMAN configuration parameters are: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/10g/oracle/product/10.2.0/db_1/dbs/snapcf_oralife_test.f';

  9.显示rman配置

  显示所有rman环境配置:RMAN> show all;

  显示默认设备类型:RMAN> show default device type;

  显示自动通道配置:RMAN> show channel for device type disk/sbt;

  显示备份冗余策略:RMAN> show retention policy;

  显示备份优化:RMAN> show backup optimization;

  显示快照控制文件:RMAN> show snapshot controlfile name;

  显示备份集最大尺寸:RMAN> show maxsetsize;

  显示多重备份:

  RMAN> show datafile backup copies; --显示数据文件多重备份 RMAN> show archivelog backup copies;--显示归档日志多重备份

  10.清除rman配置

  使用clear选项清除rman配置,示例:

  RMAN> configure retention policy clear;

           old RMAN configuration parameters: CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

          RMAN configuration parameters are successfully reset to default value RMAN> show retention policy;

           RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

你可能感兴趣的:(oracle,rman)