揭祕ORACLE備份之----RMAN之一(引數配置)

wailon發表於2013-11-16

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章