Oracle11gR2创建虚拟专用恢复目录
Author: Bo Tang
1. 结构原理:
这一项功能使得rman的恢复目录实现分级管理。基本原理是:catalog owner创建一个传统的恢复目录,并grant
recover_catalog_owner权限给虚拟专用catalog用户,虚拟专用catalog用户还需要被授予注册数据库权限。之后使用该虚拟专用catalog用户去注册特定的数据库。该虚拟专用catalog用户只能访问他自己注册的数据库,而原catalog
owner可以看到所有虚拟专用catalog用户注册的数据库。打个比方:一分多,各自寻查,中央集中的意思。
2. 实验过程:
创建虚拟专用catalog用户v90:
[oracle@station90 ~]$ . oraenv
ORACLE_SID = [orcl] ? rcat
The Oracle base for
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is
/u01/app/oracle
[oracle@station90 ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 23 11:24:04
2013
Copyright (c) 1982, 2009, Oracle. All rights
reserved.
SQL> conn / as sysdba
Connected.
SQL> create user v90 identified by oracle_4U default
tablespace rcat quota unlimited on rcat;
SQL> grant recovery_catalog_owner to v90;
Grant succeeded. |
虚拟专用catalog用户还需要被授予注册数据库权限:
[oracle@station90 ~]$ . oraenv
ORACLE_SID = [rcat] ? orcl
The Oracle base for
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is
/u01/app/oracle
[oracle@station90 ~]$ rman target / catalog
u90/oracle_4U@rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 23
11:28:23 2013
Copyright (c) 1982, 2009, Oracle and/or its
affiliates. All rights reserved.
connected to target database: ORCL (DBID=1343950367)
connected to recovery catalog database
RMAN> grant register database to v90;
Grant succeeded.
RMAN> |
之后使用该虚拟专用catalog用户去注册特定的数据库:[oracle@station90 ~]$ rman target / catalog
v90/oracle_4U@rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 23
14:57:40 2013
Copyright (c) 1982, 2009, Oracle and/or its
affiliates. All rights reserved.
connected to target database: ORCL (DBID=1343950367)
connected to recovery catalog database
RMAN> create virtual catalog;
found eligible base catalog owned by U90
created virtual catalog against base catalog owned by U90
注意最后两句很能说明:“一分多”的原理。
|
rman target / catalog v90/oracle_4U@rcat
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 23
15:00:33 2013
Copyright (c) 1982, 2009, Oracle and/or its
affiliates. All rights reserved.
connected to target database: ORCL (DBID=1343950367)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
|
以下直接连入原catalog查询,就是最好的关于“一分多”的说明: SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 23 15:36:52
2013
Copyright (c) 1982, 2009, Oracle. All rights
reserved.
SQL> conn u90/oracle_4U@rcat
Connected.
SQL> select * from db;
DB_KEY DB_ID
CURR_DBINC_KEY
---------- ---------- --------------
1429
1351590015
1430
1691
1351850322
1692
3380
1357065699
3381
2203
1346041480
2204
3210
1350950903
3211
2394
1353146236
2395
3882
1343950367
3883
7 rows selected.
SQL> conn v90/oracle_4U@rcat
Connected.
SQL> select * from db;
DB_KEY DB_ID
CURR_DBINC_KEY
---------- ---------- --------------
3882
1343950367
3883
SQL> |
|