11g リカバリ・カタログの管理
1. リカバリ・カタログの作成及びデータベースの登録
10gとほぼ同じなので、リカバリ・カタログの作成及びデータベースの登録を参照下さい。
リカバリ・カタログの表領域及びユーザーの作成
OMR(SYS)> create tablespace cat_tbs datafile '/u01/app/oracle/oradata/OMR/cat_tbs01.dbf' size 10M autoextend on next 10M maxsize 2G;
Tablespace created.
OMR(SYS)> create user rman identified by oracle temporary tablespace temp default tablespace cat_tbs quota unlimited on cat_tbs;
User created.
OMR(SYS)> grant recovery_catalog_owner to rman;
Grant succeeded.
OMR(SYS)>
リカバリ・カタログの作成
[work oracle(OMR)] rman catalog rman/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 17:18:15 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
RMAN>
リカバリ・カタログへPRODデータベースを登録
[admin oracle(PROD)] rman target / catalog rman/oracle@OMR
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 17:22:10 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PROD (DBID=113838107)
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 for database with db_unique_name PROD
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 250 SYSTEM YES /u01/app/oracle/oradata/PROD/system01.dbf
2 145 SYSAUX NO /u01/app/oracle/oradata/PROD/sysaux01.dbf
3 200 UNDOTBS YES /u01/app/oracle/oradata/PROD/undotbs01.dbf
4 10 USERS NO /u01/app/oracle/oradata/PROD/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 2048 /u01/app/oracle/oradata/PROD/temp01.dbf
RMAN>
2. 仮想プライベート・カタログの作成および管理 11g新機能
2.1 仮想プライベート・カタログの概念
仮想プライベート・カタログは、ベース・リカバリ・カタログを参照するシノニムおよびビューのセットである。
2.2 仮想プライベート・カタログの作成
仮想プライベート・カタログ所有者を作成
OMR(SYS)> create tablespace vpcusers datafile '/u01/app/oracle/oradata/OMR/vpcusers01.dbf' size 10M autoextend on next 10M maxsize 2G;
Tablespace created.
OMR(SYS)> create user vpcuser1 identified by oracle default tablespace vpcusers quota unlimited on vpcusers;
User created.
OMR(SYS)>
仮想カタログを所有するデータベース・ユーザーに権限を付与
OMR(SYS)> grant recovery_catalog_owner to vpcuser1;
Grant succeeded.
OMR(SYS)>
... カタログオーナーでRMANへ接続する。
[work oracle(OMR)] rman catalog rman/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 18:23:08 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> grant catalog for database prod to vpcuser1;
Grant succeeded.
RMAN> grant register database to vpcuser1; --# 新しいデータベースを登録する権限を付与
Grant succeeded.
RMAN>
想プライベート・カタログを作成
[work oracle(OMR)] rman catalog vpcuser1/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 18:27:59 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create virtual catalog;
found eligible base catalog owned by RMAN
created virtual catalog against base catalog owned by RMAN
RMAN>
2.3 仮想プライベート・カタログの管理
仮想プライベート・カタログ所有者から権限を取り消す
[work oracle(OMR)] rman catalog rman/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 18:58:09 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> revoke catalog for database prod from vpcuser1;
Revoke succeeded.
RMAN> revoke register database from vpcuser1;
Revoke succeeded.
RMAN>
仮想プライベート・カタログを削除する
[work oracle(PRODSTB)] rman catalog vpcuser1/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 19:01:57 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
recovery catalog is not installed
RMAN> drop catalog;
recovery catalog owner is VPCUSER1
enter DROP CATALOG command again to confirm catalog removal
RMAN> drop catalog;
virtual catalog dropped
RMAN>
3. リカバリ・カタログのインポート 11g新機能
3.1 リカバリ・カタログのインポート機能の概要と制限
3.2 リカバリ・カタログのインポート
宛先カタログスキーマの作成
OMR(SYS)> create user rman1 identified by oracle default tablespace cat_tbs quota unlimited on cat_tbs;
User created.
OMR(SYS)> grant recovery_catalog_owner to rman1;
Grant succeeded.
OMR(SYS)>
--# RMANでrman1のカタログを作成
[work oracle(OMR)] rman catalog rman1/oracle@omr
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 19:34:23 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
RMAN>
rmanからrman1へカタログをインポート
[work oracle(OMR)] rman
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 19:36:41 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
RMAN> connect catalog rman1/oracle@omr --# 宛先カタログに接続
connected to recovery catalog database
RMAN> import catalog rman/oracle@omr db_name=PROD; --# ソースカタログのPRODデータベースを宛先にインポートする
Starting import catalog at 21-DEC-09
connected to source recovery catalog database
import validation complete
database unregistered from the source recovery catalog
Finished import catalog at 21-DEC-09
RMAN>
インポート後の確認
--################# ソースカタログに接続 #################
[work oracle(PROD)] rman target / catalog rman/oracle@omr;
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 19:39:35 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PROD (DBID=113838107)
connected to recovery catalog database
RMAN> report schema; --# ターゲットDBがもう存在しない。
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of report command at 12/21/2009 19:39:45
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
RMAN>
--################# 宛先カタログに接続 #################
[work oracle(PROD)] rman target / catalog rman1/oracle@omr;
Recovery Manager: Release 11.1.0.7.0 - Production on Mon Dec 21 19:42:02 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PROD (DBID=113838107)
connected to recovery catalog database
RMAN> report schema; --# インポートされた。
Report of database schema for database with db_unique_name PROD
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 250 SYSTEM YES /u01/app/oracle/oradata/PROD/system01.dbf
2 145 SYSAUX NO /u01/app/oracle/oradata/PROD/sysaux01.dbf
3 200 UNDOTBS YES /u01/app/oracle/oradata/PROD/undotbs01.dbf
4 10 USERS NO /u01/app/oracle/oradata/PROD/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 2048 /u01/app/oracle/oradata/PROD/temp01.dbf
RMAN>
- IMPORT CATALOG …にDB_NAMEやDB_IDを指定しなければ、デフォルトではソース・リカバリ・カタログに登録されているすべてのターゲット・データベースのメタデータをインポートする。
- IMPORT CATALOG …にNO UNREGISTERオプションを指定してデータベースがソースカタログから登録解除されないように指定することもできる。
page revision: 34, last edited: 14 Dec 2012 07:33