1. 准备目录数据库
2. 创建恢复管理器目录
3. 注册prod数据库
4. 为恢复目录同步控制文件
1. 准备目录数据库
create tablespace cattbs datafile 'C:oracleoradatatestdbcattbs01.dbf' size 50m
extent management local autoallocate;
create user rman901 identified by rman
temporary tablespace temp
default tablespace cattbs
quota unlimited on cattbs;
grant connect ,recovery_catlog_owner to rman901;
2. 创建恢复管理器目录
RMAN> connect catalog rman901/rman@testdb
connected to recovery catalog database
recovery catalog is not installed
RMAN> create catalog tablespace cattbs;
recovery catalog created
RMAN> connect target sys/oracle@prod
connected to target database: PROD (DBID=18926092)
3. 注册prod数据库
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
使用 list incarnation 命令查看已经注册的数据库
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 PROD 18926092 YES 183768 2006-11-21 11:29:19
使用report命令查看目录中prod数据库的注册信息
RMAN> report schema;
Report of database schema
File K-bytes Tablespace RB segs Datafile Name
---- ---------- -------------------- ------- -------------------
1 337920 SYSTEM YES C:ORACLEORADATAPRODSYSTEM01.DBF
2 204800 UNDOTBS1 YES C:ORACLEORADATAPRODUNDOTBS01.DBF
3 20480 DRSYS NO C:ORACLEORADATAPRODDRSYS01.DBF
4 149120 EXAMPLE NO C:ORACLEORADATAPRODEXAMPLE01.DBF
5 25600 INDX NO C:ORACLEORADATAPRODINDX01.DBF
6 20480 ODM NO C:ORACLEORADATAPRODODM01.DBF
7 10240 TOOLS NO C:ORACLEORADATAPRODTOOLS01.DBF
8 25600 USERS NO C:ORACLEORADATAPRODUSERS01.DBF
9 39040 XDB NO C:ORACLEORADATAPRODXDB01.DBF
10 51200 PROD_DATA NO C:ORACLEORADATAPRODPROD_DATA.ORA
4. 为恢复目录同步控制文件
目标控制文件的快照拷贝 linux:$ORACLE_HOME/dbs/snapcf_$ORACLE_SID
windows:%ORACLE_HOMEdatabaseSNCF%ORACLE_HOME%
使用resync catalog命令同步控制文件
RMAN> resync catalog;
starting full resync of recovery catalog
full resync complete
set snap命令可以在下次同步时转移控制文件快照
RMAN> set snapshot controlfile name to 'C:oracleoradataprodsnap_prod.ctl' ;
executing command: SET SNAPSHOT
snapshot controlfile name set to: C:oracleoradataprodsnap_prod.ctl
new RMAN configuration parameters are successfully stored
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/45259/viewspace-134911/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/45259/viewspace-134911/