Oracle Recovery catalog

1、在target中创建用户

******************
创建用于recovery catalog的表空间
****************** SQL
> create tablespace rc_data datafile '/oracle/app/oracle/oradata/ocm1/rc_data01.dbf' size 100M autoextend off; Tablespace created.
********************
创建rcowner用户
******************** SQL
> create user rcowner identified by oracle temporary tablespace temp default tablespace rc_data quota unlimited on rc_data; User created. SQL> grant recovery_catalog_owner to rcowner; Grant succeeded.
********************
创建catalog,应该就是在rcowner下创建一些对象,例如表之类的
********************
[ocm1:oracle]:/home/oracle>rman catalog rcowner/oracle Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 21 18:06:03 2019 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to recovery catalog database RMAN> RMAN> create catalog; recovery catalog created
可以看到user_tables下已经有了很多表

TABLE_NAME
------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
SITE_DFATT
TF
SITE_TFATT
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
CCF
XCF
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
CONFIG
XAL
RSR
FB
GRSP
NRSP
VPC_USERS
VPC_DATABASES
CFS
BCR
ROUT
RCVER
TEMPRES
Recovery Manager complete. [ocm1:oracle]:/home/oracle>sqlplus rcowner/oracle SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 21 18:07:04 2019 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select object_type,count(*) from user_objects group by object_type; OBJECT_TYPE COUNT(*) ------------------- ---------- SEQUENCE 1 PACKAGE 2 PACKAGE BODY 2 TYPE BODY 1 TRIGGER 3 TABLE 44 INDEX 96 FUNCTION 2 VIEW 98 TYPE 3 10 rows selected.


 

 

2、在target端注册

[ocm:oracle]:/home/oracle>rman target sys/oracle catalog rcowner/oracle@192.168.8.101:1521/ocm1

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 21 18:14:59 2019

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

connected to target database: OCM (DBID=2393802673)
connected to recovery catalog database

RMAN> register database;            --将target数据库的相关备份信息注册到recovery catalog上

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

RMAN> 

RMAN> 

RMAN> resync catalog;          --重新同步

starting full resync of recovery catalog
full resync complete

RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
169     B  F  A DISK        20-JUN-19       1       1       NO         TAG20190620T152155
170     B  F  A DISK        20-JUN-19       1       1       NO         TAG20190620T152155
171     B  F  A DISK        20-JUN-19       1       1       YES        TAG20190620T152502
172     B  F  A DISK        20-JUN-19       1       1       YES        TAG20190620T152502

RMAN> report schema;

Report of database schema for database with db_unique_name OCM

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    700      SYSTEM               YES     /oracle/app/oracle/oradata/ocm/system01.dbf
2    600      SYSAUX               NO      /oracle/app/oracle/oradata/ocm/sysaux01.dbf
3    760      UNDOTBS1             YES     /oracle/app/oracle/oradata/ocm/undotbs01.dbf
4    5        USERS                NO      /rman/user01.dbf
5    100      FDA                  NO      /oracle/app/oracle/oradata/ocm/fda.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    68       TEMP                 32767       /oracle/app/oracle/oradata/ocm/temp01.dbf

************
可以在recovery catalog中看到其管理的数据库
************

SQL> select * from rcowner.db;

DB_KEY DB_ID CURR_DBINC_KEY
---------- ---------- --------------
2 1975110908 4

 

 2、如何去创建vpc1

SQL> cREATE USER vpc1 IDENTIFIED BY oracle DEFAULT TABLESPACE rc_data  QUOTA UNLIMITED ON rc_data;

User created.

SQL> GRANT recovery_catalog_owner TO vpc1;

Grant succeeded.


 

posted @ 2019-06-21 18:23  dayu.liu  阅读(494)  评论(0编辑  收藏  举报