创建恢复目录catalog并注册目标库

创建恢复目录,并注册目标数据库:
--目标库A库:ORA11GR2:target database: ORA11GR2 (DBID=238796283)   ----目标数据库
--客户端B库:OCMU:     target database: ORA11GR2 (DBID=238796283)   ----恢复目录所有者

--创建表空间:
SQL> create tablespace tscatalog datafile '/u01/app/oracle/oradata/ORCL/tscatalog.dbf' size 15m;
Tablespace created.

--创建恢复目录所有者并授权:
SQL> CREATE USER rcowner IDENTIFIED BY oracle
  2  TEMPORARY TABLESPACE temp
  3  DEFAULT TABLESPACE tscatalog
  4  QUOTA UNLIMITED ON tscatalog;
User created.

SQL> GRANT recovery_catalog_owner TO rcowner;
Grant succeeded.

--配置指向本库(目录所有者所在)的tns文件:
13 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.6)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORA11GR2)
    )
  )

--恢复目录所有者连接本库,创建恢复目录:
[oracle@enmo ~]$ rman catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:50:54 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
恢复目录创建成功。

--在恢复目录中注册目标数据库(oracle虚拟机上的ORA11GR2库  ,ORA11GR2:target database: ORA11GR2 (DBID=238796283))
rman target sys/skysky@11 catalog rcowner/oracle@13
[oracle@enmo ~]$ 
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 15:57:58 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database
RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
目标库A库注册成功。

--查看注册了的目标数据库:
[oracle@enmo ~]$ sqlplus rcowner/oracle@13
SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 16 16:01:35 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from RC_DATABASE;
    DB_KEY  DBINC_KEY       DBID NAME     RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
         1          2  238796283 ORA11GR2            925702 10-SEP-16

--取消注册目标库:
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@enmo ~]$ 
[oracle@enmo ~]$ 
[oracle@enmo ~]$ 
[oracle@enmo ~]$ rman target sys/skysky@11 catalog rcowner/oracle@13
Recovery Manager: Release 11.2.0.4.0 - Production on Sun Oct 16 16:04:59 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA11GR2 (DBID=238796283)
connected to recovery catalog database

RMAN> unregister database;
database name is "ORA11GR2" and DBID is 238796283
Do you really want to unregister the database (enter YES or NO)? y
database unregistered from the recovery catalog

SQL> select * from RC_DATABASE;
no rows selected
注销成功。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31392094/viewspace-2127106/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31392094/viewspace-2127106/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值