欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

catalog方式的rman備份與恢復(fù)示例

 更新時間:2014年03月14日 16:11:57   作者:  
這篇文章主要介紹了catalog方式的rman備份與恢復(fù),需要的朋友可以參考下

注:catalog目錄需要專門創(chuàng)建一個用于恢復(fù)的數(shù)據(jù)庫

一、catalog備份
1、創(chuàng)建表空間

復(fù)制代碼 代碼如下:

SQL>create tablespace rman datafile 'C:\oracle\product\10.2.0\oradata\orcl\rman01.dbf' size 50M
extent management local uniform size 128K;

2、創(chuàng)建用戶
復(fù)制代碼 代碼如下:

SQL>create user rman identified by rman
default tablespace rman
temporary tablespace temp  #臨時表空間
quota unlimited on rman;

3、授權(quán)
復(fù)制代碼 代碼如下:

SQL>grant connect,resource,recovery_catalog_owner to rman;

4、創(chuàng)建恢復(fù)目錄
復(fù)制代碼 代碼如下:

C:\>rman catalog rman/rman
RMAN>create catalog;

5、注冊需要備份的數(shù)據(jù)庫【注冊數(shù)據(jù)庫需要同時連接到目標(biāo)(target)數(shù)據(jù)庫和目錄(catalog)數(shù)據(jù)庫】
復(fù)制代碼 代碼如下:

C:\>rman catalog rman/rman target sys/orcl
RMAN>register database;

注銷已注冊的數(shù)據(jù)庫:
復(fù)制代碼 代碼如下:

RMAN>unregister database;

6、使用catalog數(shù)據(jù)庫對目標(biāo)數(shù)據(jù)庫進(jìn)行備份
復(fù)制代碼 代碼如下:

C:\>rman catalog rman/rman target sys/orcl
RMAN>create script fullbk{      #創(chuàng)建備份腳本
backup full tag 'sys' database
include current controlfile
format 'c:\backup\sysfull_%d_%T_%s'
plus archivelog
format 'c:\backup\sysarch_%d_T_%s'
delete all input;
}
RMAN>run{execute script fullbk;}  #調(diào)用腳本

刪除腳本:
復(fù)制代碼 代碼如下:

RMAN>delete script fullbk;

二、catalog恢復(fù)
1、

復(fù)制代碼 代碼如下:

C:\>rman catalog rman/rman target sys/orcl

2、接下來參考本博文“rman恢復(fù)方案和異機恢復(fù)”

三、catalog和nocatalog區(qū)別
1、nocatalog方式:用control file作為catalog,每一次備份都要往控制文件里面寫好多備份信息,控制文件里面會有越來越多的備份信息,即RMAN的備份信息寫在本地控制文件里面。
2、catalog方式:必須要首先要創(chuàng)建目錄備份數(shù)據(jù)庫(catalog,也稱知識庫),建立恢復(fù)目錄,即數(shù)據(jù)庫的備份信息寫到恢復(fù)目錄里面。
3、當(dāng)通過rman nocatalog方式備份Oracle數(shù)據(jù)庫,Oracle使用controlfile存放RMAN的備份信息。因此,當(dāng)使用Rman nocatalog方式備份數(shù)據(jù)庫時,一定要記得備份controlfile。
初始化參數(shù)control_file__record_keep_time設(shè)置備份信息保存時間,到規(guī)定時間就自動清除以前的備份信息:
SQL> alter sysem set control_file_record_keep_time=7 scope=spfile;

相關(guān)文章

最新評論