建立rman catalog

1.创建表空间

SQL> create tablespace rc_data datafile '/orcl_backup/rc_dbf/rc_data01.dbf' size 50M;

2.创建一个用户,

SQL> create user rc_admin identified by rc_admin default tablespace rc_data;

User created.

3.设置权限

SQL> grant connect,resource,recovery_catalog_owner to rc_admin;

Grant succeeded.

4.连接到catalog,创建catalog

[oracle@evancao ~]$ rman catalog rc_admin/rc_admin

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 29 17:20:11 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

6.连接到目标库,进行注册

RMAN> connect target sys/a123456

connected to target database: ORCL (DBID=1389657672)

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete


手工同步

RMAN> resync catalog;

starting full resync of recovery catalog
full resync complete


删除数据

UNREGISTER DATABASE;

更新Recovery Catalog


RMAN> UPGRADE CATALOG;

recovery catalog upgraded to version 11.02.00.03
DBMS_RCVMAN package upgraded to version 11.02.00.03
DBMS_RCVCAT package upgraded to version 11.02.00.03


查list incarnation

RMAN> list incarnation
2> ;


List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 16 ORCL 1389657672 PARENT 1 17-SEP-11
1 368 UNKNOWN 1389657672 ORPHAN 947455 16-OCT-14
1 2 ORCL 1389657672 CURRENT 995548 25-OCT-14


CATALOG的新特性:虚拟专用恢复目录(在10g及之前版本没办法控制catalog的权限)

1.新建表空间
SQL> create tablespace virtual_tp datafile '/orcl_backup/rc_dbf/virtual01.dbf' size 50m;

Tablespace created.

 

2.用基于恢复目录给v_user1用户授权

SQL> create user v_user1 identified by v_user1 default tablespace virtual_tp;

User created.

SQL> grant recovery_catalog_owner to v_user1;

Grant succeeded.

3.创建虚拟目录

[oracle@evancao ~]$ rman catalog rc_admin/rc_admin;

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 29 18:35:03 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to recovery catalog database

RMAN> grant catalog for database orcl to v_user1;

Grant succeeded.


[oracle@evancao ~]$ rman catalog v_user1/v_user1
create virtual catalog;

posted @ 2014-12-30 10:39  修行从29开始  阅读(243)  评论(0编辑  收藏  举报