RMAN的configure配置

來源:互聯網
上載者:User

1 show all; 顯示當前配置資訊

2 select * from v$rman_configuration;  查詢RMAN中的非預設值

3 configure常用選項

3.1 保持策略

configure retention policy to recovery window of 7 days;  超過最近7天以外的備份都被標記為obsolete

configure retention policy to redundancy 5;  保持可恢複的最新5個備份,超過這個最新5個的備份被標記為redundancy

configure retention policy clear;  恢複預設的保持策略

configure retention policy to none;  使備份保持策略失效

3.2 備份最佳化,預設關閉,若開啟,將對備份檔案及歸檔檔案進行最佳化

backup optimization

configure backup optimization on;

configure backup optimization off;

configure backup optimization clear;

3.3  預設裝置,預設是磁碟

configure default device type to disk;

configure default device type to stb;

configure default device type clear;

3.4  控制檔案

configure controlfile autobackup on(off);

configure controlfile autobackup format for device type disk to '/backupset/conf_%F';

configure controlfile autobackup clear;

configure controlfile autobackup format for device type disk clear;

configure snapshot controlfile name to '/backup/scontrollfile.snp';  控制檔案的快照存放路徑及名稱,備份期間產生,用於控制檔案的讀一致性

configure snapshot controlfile name clear; 

3.5  並行度(通道數)device type diskstb pallelism n

configure device type diskstb parallelism 2;

configure device type diskstb clear;

configure channel device type disk format '路徑/rmanback_%U';

configure channel device type disk maxpiecesize 100m;

configure channel device type disk rate 1200K;

configure channel 1 device type disk format '路徑/:rmanback_%U';

configure channel 2 device type disk format '路徑/:rmanback_%U';

configure channel 1 device type disk maxpiecesize 100m;

 3.6 產生備份副本

configure datafile backup copies for device type diskstb to 3;

configure archivelog backup copies for device type diskstb to 3;

configure datafile | archivelog backup copies for device type diskstb clear;  設定DB的檔案的備份的存放裝置類型

backup device type disk database format '路徑1/%U','路徑2/%U','路徑3/%U';  配置DB的每次備份的copy數量,即每一次備份完有個多份相同的copy

3.7 排除選項 exclude

configure exclude for tablespace 'users';  指定users資料表空間不備份到備份組中,對唯讀資料表空間很有用

configure clear;

3.8 設定備份組大小maxsetsize

configure maxsetsize to 1G | 1000M | 1000000K | unlimited;

configure maxsetsize clear;

3.9 其他選項auxiliary

configure auxname for datafile 1 to ‘路徑/aux_1.f’;

configure auxname for datafile 2 to ‘路徑/aux_2.f’;

configure auxname for datafile 3 to ‘路徑/aux_3.f’;

configure auxname for datafile 4 to ‘路徑/aux_4.f’;

configure auxname for datafile 1 clear;

configure auxname for datafile 2 clear;

configure auxname for datafile 3 clear;

configure auxname for datafile 4 clear;

 

format格式中的%

%c 備份片的copy數

%d 資料庫名稱

%D 位於該月中的第幾天

%M 位於該年中的第幾月

%F 基於DBID唯一的名稱

例: c-IIIIIIIIII-YYYYMMDD-QQ

IIIIIIIIII 為庫的DBID

QQ 1-256的序列

%n 資料庫名稱

%u 8個字元的名稱代表備份組與建立時間

%p 備份組的備份片號

%U 一個唯一的檔案名稱,即%u_%p_%c

%s 備份組的號

%t  備份組的時間戳記

%T 年月日格式YYYYMMDD

推薦閱讀:

RMAN 配置歸檔日誌刪除策略

Oracle基礎教程之通過RMAN複製資料庫

RMAN備份策略制定參考內容

RMAN備份學習筆記

OracleDatabase Backup加密 RMAN加密

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.