2011年7月9日土曜日

[备份恢复] RMAN CATALOG

1. 创建独立数据库, 在目录数据库中创建恢复目录所用的表空间
create tablespace ts_rman datafile 'd:\ts_rman.dbf' size 20M;

2. 在目录数据库中创建 RMAN 用户并授权
create user rman_user identified by rman_password default tablespace ts_rman temporary tablespace temp quota unlimited on ts_rman;
grant connect,resource,recovery_catalog_owner to rman_user;

3. 在目录数据库中创建恢复目录并指定表空间
rman catalog rman_user/rman_password
create catalog tablespace ts_rman

4. 注册目标数据库
rman catalog go/go@catdb target sys/admin@targetdb
register databse

unregister database

5. 查看相关信息
list backup
report schema

6. 查看注册的目标库
sqlplus rman_user/rman_password@catdb;
select dbid, name, resetlogs_time from rc_database;

7. 删除当前 CATALOG 并重新创建
# 需要执行两次
RMAN> drop catalog
RMAN> drop catalog

# 退出后再进入, 否刚可能会报错
RMAN> create catalog
RMAN> register database

8. 将目标数据库与恢复目录进行同步化
rman> resync catalog

0 件のコメント:

コメントを投稿