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