【RMAN】catalog資料庫

TaihangMeng發表於2017-05-24

使用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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章