合并catalog

1.准备环境
三个数据库
ORCL:普通用户的数据库,该数据库的恢复目录数据库就是它本身
OAEC:普通用户的数据库,该数据库的恢复目录数据库就是它本身
CATADB:准备用来合并CATALOG的CATALOG数据库


Oracle network
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


OAEC =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oaec)
    )
  )


catadb =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = catadb)
    )
  )




2.准备ORCL和OAEC各自的CATALOG


ORCL数据库


创建CATALOG表空间
SQL> create tablespace cata_tbs datafile '/u01/app/oracle/oradata/orcl/cata_tbs01.dbf' size 100m;


Tablespace created.


创建用户
SQL> create user cata_user identified by oracle default tablespace cata_tbs;


User created.


授权
SQL> grant connect,resource,recovery_catalog_owner to cata_user;


Grant succeeded.


创建CATALOG
[oracle@oel ~]$ rman catalog cata_user/oracle@orcl


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:05:55 2016


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


connected to recovery catalog database


RMAN> create catalog;


recovery catalog created


RMAN> exit




Recovery Manager complete.


注册数据库
[oracle@oel ~]$ rman target sys/oracle@orcl catalog cata_user/oracle@orcl


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:06:40 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> register database;


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


RMAN> list db_unique_name all;




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


OAEC数据库CATALOG的准备工作与ORCL相同,此处省略
在OAEC的CATALOG创建成功后,
在RMAN中查询CATALOG信息
[oracle@oel ~]$ rman target sys/oracle@oaec catalog cata_user/oracle@oaec(环境变量能确认的话可以rman target /)


Recovery Manager: Release 11.2.0.1.0 - Production on Tue May 24 16:10:11 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> register database;


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


RMAN> list db_unique_name all;


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




3.准备CATADB数据库
关于创建用户
表空间
授权
以及创建CATALOG与第二步相同,此处省略
创建好CATALOG后,查询CATALOG信息
RMAN> list db_unique_name all;
结果为空


导入ORCL的CATALOG信息
RMAN> import catalog cata_user/oracle@orcl;


Starting import catalog at 24-MAY-16
connected to source recovery catalog database
import validation complete
database unregistered from the source recovery catalog
Finished import catalog at 24-MAY-16


RMAN> list db_unique_name all;




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




导入OAEC的CATALOG信息
RMAN> import catalog cata_user/oracle@oaec;


Starting import catalog at 24-MAY-16
connected to source recovery catalog database
import validation complete
database unregistered from the source recovery catalog
Finished import catalog at 24-MAY-16


RMAN> list db_unique_name all;




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




RMAN> create script t1 {
2> backup current controlfile;}


created script t1


RMAN> list script names;


List of Stored Scripts in Recovery Catalog




    Scripts of Target Database ORCL


       Script Name
       Description
       -----------------------------------------------------------------------
       t1


RMAN> create global script t_1 {
2> backup current controlfile;}


created global script t_1


RMAN> list script names;


List of Stored Scripts in Recovery Catalog




    Scripts of Target Database ORCL


       Script Name
       Description
       -----------------------------------------------------------------------
       t1




    Global Scripts




       Script Name
       Description
       -----------------------------------------------------------------------
       t_1
















              

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值