catalog,vpc

1.准备环境
三个数据库
ORCL
OAEC
CATADB


ORCL和OAEC的CATALOG数据库是CATADB
在CATADB中,保存着ORCL和OAEC两个数据库恢复目录
[oracle@oel ~]$ rman catalog cata_user/oracle@catadb


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:54:09 2016


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


connected to recovery catalog database


RMAN> list db_unique_name all;




List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
399     ORCL     1437288826       PRIMARY          ORCL                
737     OAEC     2796250037       PRIMARY          OAEC     


2.在CATADB这个数据库,准备用户


确认当前的环境变量,要操作的是catadb数据库
[oracle@oel ~]$ echo $ORACLE_SID
catadb


创建用户
创建两个用户,分别对应两个使用catalog的数据库
此处创建orcl和oaec两个用户
进行授权
[oracle@oel ~]$ sqlplus / as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Tue May 24 16:42:17 2016


Copyright (c) 1982, 2009, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> create user orcl identified by oracle default tablespace cata_tbs;


User created.


SQL> create user oaec identified by oracle default tablespace cata_tbs;


User created.


SQL> grant resource,connect,recovery_catalog_owner to oaec,orcl;


Grant succeeded.






3.使用RMAN连接CATALOG
对新创建的两个用户分配CATALOG的权限
[oracle@oel ~]$ rman catalog cata_user/oracle@catadb


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:47:36 2016


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


connected to recovery catalog database


RMAN> grant catalog for database orcl to orcl;


Grant succeeded.


RMAN> grant catalog for database oaec to oaec;


Grant succeeded.


RMAN> grant register database to orcl;


Grant succeeded.


RMAN> grant register database to oaec;


Grant succeeded.


4.使用新创建好的两个用户,来为每个数据库创建VPC


ORCL数据库
[oracle@oel ~]$ rman target sys/oracle@orcl catalog orcl/oracle@catadb


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:50:03 2016


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


connected to target database: ORCL (DBID=1437288826)
connected to recovery catalog database


RMAN> create virtual catalog;


found eligible base catalog owned by CATA_USER
created virtual catalog against base catalog owned by CATA_USER


RMAN> list db_unique_name all;




List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
399     ORCL     1437288826       PRIMARY          ORCL       


OAEC数据库
[oracle@oel ~]$ rman target sys/oracle@oaec catalog oaec/oracle@catadb


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:50:25 2016


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


connected to target database: OAEC (DBID=2796250037)
connected to recovery catalog database


RMAN> create virtual catalog;


found eligible base catalog owned by CATA_USER
created virtual catalog against base catalog owned by CATA_USER


RMAN> list db_unique_name all;




List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
737     OAEC     2796250037       PRIMARY          OAEC                




可以发现,创建好VPC以后,每个数据库,都拥有独立的CATALOG用户,以及使用该用户访问CATALOG时,不能再查看到其它数据库的信息
更加安全了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值