http://www.cnenn.cn/html/jiuxingrengeceshi/
a ----》 恢復目錄所在的庫 (存儲別的庫的備份信息)
b ----》 需要備份的庫
首先在a庫創建好恢復目錄,和使用恢復目錄的用戶,及恢復目錄所在表空間
a庫需要的動作
1. a庫首先為恢復目錄創建單獨的一個表空間
create tablelspace rman_catalog datafile '/u01/product/oradata/a/rman_catalog.dbf' size 50M;
2. 創建使用恢復目錄的用戶
create user rman identified by rman default tablespace rman_catalog temporary tablespace temp;
3. 為rman用戶授權
grant connect ,resource ,recovery_catalog_owner to rman;
4. 打開rman
rman
connect catalog rman/rman
5. 創建恢復目錄
create catalog tablespace rman_catalog;
b庫需要的動作
1. b庫要使用恢復目錄 則首先得連接到a庫上註冊,使用a庫的rman用戶
rman target internal/rman catalog rman/rman@a
register database;--->註冊完成
rman的管理命令:
1. list backup ---->列出所有的備份記錄
2. report obsolete --->列出過時的備份信息
3. crosscheck backup ---> 刪除過時的備份信息之前的動作
4. delete expired backup; ---->刪除過時的備份信息
歸檔方面:
crosscheck archivelog all;
crosscheck backupset;
全庫備份腳本:
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full tag 'dbfull' format '/backup/full%u_%s_%p' database
include current controfile;
sql 'alter system archive log current';
backup fileaperset 3 format 'backup/arch%u_%s_%p'
archivelog all delete input;
release channel c1;
release channel c2;
release channel c3;
}
零級備份
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup incremental level 0 tag 'db0' format 'backup/db0%u_%s_%p'
database skip readonly;
sql 'alter system archive log current';
backup fileaperset 3 format '/backup/arch%u_%s_%p'
archivelog all delete input;
release channle c1;
release channel c2;
release channel c3;
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25072296/viewspace-697072/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25072296/viewspace-697072/