ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 揭秘ORACLE备份之----RMAN之一(参数配置)

揭秘ORACLE备份之----RMAN之一(参数配置)

原创 Linux操作系统 作者:wailon 时间:2013-11-16 19:54:49 0 删除 编辑

RMAN配置参数说明
[oracle@rhel5 admin]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Sep 5 03:49:25 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: WAILON (DBID=2747751647)


--查看RMAN所有配置信息

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/flash_recovery_area/%F.bkp';
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 MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_wailon.f'; # default


RMAN> --控制文件是否自动备份
RMAN> show controlfile autobackup;

using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> configure controlfile autobackup off;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN> show controlfile autobackup;

RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;

RMAN> --使用clear恢复默认设置
RMAN> configure controlfile autobackup clear;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
RMAN configuration parameters are successfully reset to default value

RMAN> show controlfile autobackup;

RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default

RMAN> --配置控制文件自动备份位置,否则有可能保存到$ORACLE_HOME/dbs或flash recovery area
  RMAN> configure controlfile autobackup format for device type disk to '/u01/app/flash_recovery_area/%F.bkp';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/flash_recovery_area/%F.bkp';
new RMAN configuration parameters are successfully stored
 

rman备份片格式:
格式          说明
%a            数据库活动id
%c            备份片拷贝数
%d            库名
%D            天(DD)
%e            归档序列号
%F            c-iiiiiiiiii-YYYYMMDD-QQ ,iiiiiiiiii是数据库id号,QQ是1-256的序列
%I            dbid
%p            备份集中的备份片号
%s            备份集号
%t            时间戳
%T            YYYYMMDD
%u            8符表示的备份集创建时间(此值唯一)
%U %u_%p_%c

RMAN> --配置备份类型为copy
RMAN> configure device type disk backup type to copy;

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;
new RMAN configuration parameters are successfully stored

RMAN> show device type;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;

RMAN> show default device type;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

RMAN> --配置备份类型为backupset
RMAN> configure device type disk backup type to compressed backupset;

old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY PARALLELISM 1;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
new RMAN configuration parameters are successfully stored

 

RMAN> show device type;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name WAILON are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

 

RMAN> --配置备份channel

RMAN> configure channel 1 device type disk format '/u01/app/flash_recovery_area/%U.bkp';

new RMAN configuration parameters:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT   '/u01/app/flash_recovery_area/%U.bkp';
new RMAN configuration parameters are successfully stored

 

RMAN> show channel;

RMAN configuration parameters for database with db_unique_name WAILON are:
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT   '/u01/app/flash_recovery_area/%U.bkp';

RMAN> --配置备份保留策略,保留7天内的备份信息
  RMAN> configure retention policy to recovery window of 7 days;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored

 

RMAN> show retention policy;

RMAN configuration parameters for database with db_unique_name WAILON are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

RMAN> --配置每个备份文件最多保留2份
RMAN> configure retention policy to redundancy 2;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored


RMAN> show retention policy;

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

RMAN> --显示过期备份文件
RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           1      13-JUN-13         
Backup Piece       1      13-JUN-13          /u01/app/flash_recovery_area/WAILON/autobackup/2013_06_13/o1_mf_s_817975331_8vl0o6lb_.bkp

RMAN> --配置备份保留策略为NONE

RMAN> configure retention policy to none;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO NONE;
new RMAN configuration parameters are successfully stored

RMAN> report obsolete;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of report command at 09/05/2013 04:04:10
RMAN-06525: RMAN retention policy is set to none


RMAN> --配置归档文件删除策略,standby应用后删除

RMAN> configure archivelog deletion policy to applied on standby;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters are successfully stored
RMAN-08591: WARNING: invalid archivelog deletion policy

RMAN> show archivelog deletion policy;

RMAN configuration parameters are:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

RMAN> --清除归档文件删除策略配置

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
new RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
new RMAN configuration parameters are successfully stored

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY clear;

old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
RMAN configuration parameters are successfully reset to default value


RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO NONE;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/flash_recovery_area/%F.bkp';
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
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   '/u01/app/flash_recovery_area/%U.bkp';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_wailon.f'; # default

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/429786/viewspace-776763/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-08

  • 博文量
    51
  • 访问量
    290594