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时,不能再查看到其它数据库的信息
更加安全了。
catalog,vpc
最新推荐文章于 2024-01-03 14:35:07 发布