注:catalog目錄需要專門創(chuàng)建一個(gè)用于恢復(fù)的數(shù)據(jù)庫(kù)
一、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 #臨時(shí)表空間
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、注冊(cè)需要備份的數(shù)據(jù)庫(kù)【注冊(cè)數(shù)據(jù)庫(kù)需要同時(shí)連接到目標(biāo)(target)數(shù)據(jù)庫(kù)和目錄(catalog)數(shù)據(jù)庫(kù)】
復(fù)制代碼 代碼如下:
C:\&;rman catalog rman/rman target sys/orcl
RMAN>register database;
注銷已注冊(cè)的數(shù)據(jù)庫(kù):
復(fù)制代碼 代碼如下:
RMAN>unregister database;
6、使用catalog數(shù)據(jù)庫(kù)對(duì)目標(biāo)數(shù)據(jù)庫(kù)進(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、接下來(lái)參考本博文“rman恢復(fù)方案和異機(jī)恢復(fù)”
三、catalog和nocatalog區(qū)別
1、nocatalog方式:用control file作為catalog,每一次備份都要往控制文件里面寫好多備份信息,控制文件里面會(huì)有越來(lái)越多的備份信息,即RMAN的備份信息寫在本地控制文件里面。
2、catalog方式:必須要首先要?jiǎng)?chuàng)建目錄備份數(shù)據(jù)庫(kù)(catalog,也稱知識(shí)庫(kù)),建立恢復(fù)目錄,即數(shù)據(jù)庫(kù)的備份信息寫到恢復(fù)目錄里面。
3、當(dāng)通過(guò)rman nocatalog方式備份Oracle數(shù)據(jù)庫(kù),Oracle使用controlfile存放RMAN的備份信息。因此,當(dāng)使用Rman nocatalog方式備份數(shù)據(jù)庫(kù)時(shí),一定要記得備份controlfile。
初始化參數(shù)control_file__record_keep_time設(shè)置備份信息保存時(shí)間,到規(guī)定時(shí)間就自動(dòng)清除以前的備份信息:
SQL> alter sysem set control_file_record_keep_time=7 scope=spfile;
您可能感興趣的文章:- rman備份腳本和rman增量備份腳本分享
- win平臺(tái)oracle rman備份和刪除dg備庫(kù)歸檔日志腳本
- ORACLE 數(shù)據(jù)庫(kù)RMAN備份恢復(fù)
- rman配置及rman常用命令操作
- rman恢復(fù)方案和oracle異機(jī)恢復(fù)
- .NET性能調(diào)優(yōu)之一:ANTS Performance Profiler的使用介紹
- High Performance JavaScript(高性能JavaScript)讀書筆記分析
- Oracle RMAN快速入門指南
- JDBCTM 指南:入門3 - DriverManager
- linux自動(dòng)運(yùn)行rman增量備份腳本