リカバリ・カタログの作成

1.リカバリ・カタログのユーザーの作成

1.1 rman ユーザー作成

CREATE USER rman IDENTIFIED BY oracle
  TEMPORARY TABLESPACE temp
  DEFAULT TABLESPACE RCVCAT
  QUOTA UNLIMITED ON RCVCAT;

1.2 RMAN ユーザーにRECOVERY_CATALOG_OWNERロールを付与

GRANT RECOVERY_CATALOG_OWNER TO rman;

2.リカバリ・カタログの作成

2.1 RMANでカタログDBへ接続

[oracle@db-node01 ~]$ rman catalog rman/oracle@OMR
 
Recovery Manager: Release 10.2.0.2.0 - Production on324 02:15:23 2009
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to recovery catalog database
 
RMAN>

2.2 CREATE CATALOGの実行

デフォルト表領域にインストールする場合:CREATE CATALOG
インストール先表領域を指定する場合:CREATE CATALOG TABLESPACE tbs_name;

RMAN> create catalog;
 
recovery catalog created
 
RMAN>

3.リカバリ・カタログへのデータベースの登録

RMANでターゲットDBとカタログDBへ同時に接続し、REGISTER DATABASEコマンドでターゲットDBを登録する。

[oracle@db-node01 ~]$ echo $ORACLE_SID
PROD
[oracle@db-node01 ~]$ rman target / catalog rman/oracle@OMR
 
Recovery Manager: Release 10.2.0.2.0 - Production on324 02:26:59 2009
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: PROD (DBID=93443355)
connected to recovery catalog database
 
RMAN> register database;
 
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
 
RMAN> report schema;
 
Report of database schema
 
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    300      SYSTEM               YES     /u01/app/oracle/oradata/PROD/system01.dbf
2    128      UNDOTBS              YES     /u01/app/oracle/oradata/PROD/undotbs01.dbf
3    250      SYSAUX               NO      /u01/app/oracle/oradata/PROD/sysaux01.dbf
4    64       USERS                NO      /u01/app/oracle/oradata/PROD/users01.dbf
 
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    100      TEMP                 2048        /u01/app/oracle/oradata/PROD/temp01.dbf
 
RMAN>

重複したDBIDを持たない複数のデータベースを1つのリカバリ・カタログに登録できる。
RMANのDUPLICATEまたはCREATE DATABASE文を使用する場合、一意DBIDが割り当てられるが、コピーされたDBにDBNEWIDユーティリティを使って新DBIDを発番できる。

4.リカバリ・カタログからのターゲットDBの登録の解除

4.1 RMANを起動してターゲットDBとカタログに接続

[oracle@db-node01 ~]$ rman target / catalog rman/oracle@OMR
 
Recovery Manager: Release 10.2.0.2.0 - Production on325 00:26:11 2009
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: PROD (DBID=93443355)
connected to recovery catalog database
 
RMAN>

4.2 LIST BACKUP SUMMARYで既存バックアップを確認

RMAN> list backup summary;
 
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
58      B  F  A DISK        09-03-15        1       1       NO         TAG20090315T231124
59      B  A  A DISK        09-03-15        1       1       NO         TAG20090315T231132
60      B  F  A DISK        09-03-15        1       1       NO         TAG20090315T231134
 
RMAN>

4.3 DELETE BACKUP

RMAN> delete backup device type disk;
 
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=334 devtype=DISK
 
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
61      58      1   1   AVAILABLE   DISK        /u04/app/oracle/oradata/PROD/rman/0aka0vgt_1_1
62      59      1   1   AVAILABLE   DISK        /u04/app/oracle/oradata/PROD/rman/0bka0vh4_1_1
63      60      1   1   AVAILABLE   DISK        /u04/app/oracle/oradata/PROD/rman/c-93443355-20090315-02
 
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u04/app/oracle/oradata/PROD/rman/0aka0vgt_1_1 recid=10 stamp=681606685
deleted backup piece
backup piece handle=/u04/app/oracle/oradata/PROD/rman/0bka0vh4_1_1 recid=11 stamp=681606693
deleted backup piece
backup piece handle=/u04/app/oracle/oradata/PROD/rman/c-93443355-20090315-02 recid=12 stamp=681606694
Deleted 3 objects
 
RMAN> list backup summary;
 
RMAN>

4.4 リカバリ・カタログからDBの登録を解除

RMAN> unregister database;
 
database name is "PROD" and DBID is 93443355
 
Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog
 
RMAN>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License