1在recovery catalog 資料庫中建立使用者
CREATE USER rman IDENTIFIED BY cat
TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE tools
QUOTA UNLIMITED ON tools;
2分發角色
SQL> GRANT RECOVERY_CATALOG_OWNER TO rman;
3建立recovery catalog
a RMAN> CONNECT CATALOG rman/[email protected]
b運作create catalog;
4檢查是否建立了
SQL> SELECT TABLE_NAME FROM USER_TABLES;
在recovery catalog中注冊資料庫
1rman target_database / catalog rman/[email protected]
2RMAN>startup mount
3RMAN>register database;
使用report schema确認成功的注冊了
在recover catalog中登出資料庫
1 rman target /catalog rman/[email protected]
2list backup summary檢查下
3ungregister database;
在recovery catalog中重置資料庫incarnation
1 list incarnation of database orcl
2RESET DATABASE TO INCARNATION 2;
3如果前面incarnation的控制檔案可用并且mount了,跳到步驟6上去,否則關閉資料庫,并mout
shutdown immediate
start nomount
4恢複控制檔案
RUN
{
SET UNTIL 'SYSDATE-45';
RESTORE CONTROLFILE; # only if current control file is not available
}
5alter database mount
6
Run
RESTORE
and
RECOVER
commands to restore and recover the database files from the prior incarnation, then open the database with the
RESETLOGS
option. For example, enter:
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
同步recovery catalog
當同步的時候,rman做下面的操作
1建立一個控制檔案快照
2對比recovery catalog與控制檔案
3用丢失或改變的額資訊更新recovery catalo
RMAN>RESYNC CATALOG;