使用catalog数据库,首先要确定一个数据库作为目录数据库。然后通过以下步骤完成。
(1)在选定作为catalog数据库的数据库中创建tablespace
SYS@MTH> create tablespace tbs_rman datafile '/oradat/MTH/tbs_rman.dbf' size 50M;
Tablespace created.
(2)创建管理用户,并赋予相应的权限
SYS@MTH> create user rman identified by rman default tablespace tbs_rman temporary tablespace temp quota unlimited on tbs_rman;
User created.
SYS@MTH> grant connect,resource,recovery_catalog_owner to rman;
Grant succeeded.
(3)进入RMAN,创建catalog
oracle@C01TEST03:/home/oracle>rman catalog rman/rman
Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 24 14:17:13 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
(4)验证
通过查询rman用户下是否存在对象,来确定catalog是否创建成功。
oracle@C01TEST03:/home/oracle>sqlplus rman/rman
SQL*Plus: Release 11.2.0.4.0 Production on Wed May 24 14:18:10 2017
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
RMAN@MTH> select table_name from user_tables;
TABLE_NAME
------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
......
至此,catalog数据库创建成功。
在使用catalog数据库进行数据库备份之前,应该先在catalog中注册target数据库。注册数据库需要同时连接到target数据库和catalog数据库。
oracle@C01TEST03:/home/oracle>rman target / catalog rman/rman@CATALOG
Recovery Manager: Release 11.2.0.4.0 - Production on Wed May 24 14:32:55 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: MTH (DBID=3150883311)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
在catalog中注销数据库:
RMAN> unregister database;
database name is "MTH" and DBID is 3150883311
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30776559/viewspace-2139791/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30776559/viewspace-2139791/