配置RMAN RECOVERY CATALOG
Oracle的RMAN配置資訊預設存放在target資料庫的控制檔案中,也可以配置一個recovery catalog伺服器來儲存這些資訊,下面是控制檔案和恢複的特性比較
Control file:
– Simpler administration
– Default
Recovery catalog:
– Replicates control file data
– Has room for more data
– Can service many targets
– Can store RMAN scripts
RMAN repository data is always stored in the control file of the target database. But it can also be stored in a separate database, called a recovery catalog.
A recovery catalog preserves backup information in a separate database, which is useful in the event of a lost control file. This allows you to store a longer history of backups than what is possible with a control file–based repository. A single recovery catalog is able to store information for multiple target databases. The recovery catalog can also hold RMAN stored scripts, which are sequences of RMAN commands for common backup tasks. Centralized storage of scripts in the recovery catalog can be more convenient than working with command files.
Usage of a separate recovery catalog database is not recommended for small installations where administration of a separate recovery catalog database would be burdenso
下面來示範下恢複目錄的配置,其中jy為catalog資料庫,test資料庫為測試資料庫
1.建立使用者/資料表空間與授權(我這裡使用users資料表空間沒有建立資料表空間)
SQL> create user rman identified by "rman"
2 default tablespace users
3 temporary tablespace temp
4 quota unlimited on users;
User created.
SQL> grant recovery_catalog_owner to rman;
Grant succeeded.
SQL> conn rman/rman
Connected.
SQL> select count (*) from user_objects;
COUNT(*)
----------
0
2:建立恢複目錄
[oracle@jingyong1 admin]$ rman catalog rman/rman@jy
Recovery Manager: Release 10.2.0.5.0 - Production on Sun Feb 1 21:22:31 2015
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create catalog;
recovery catalog created
SQL> conn rman/rman
Connected.
SQL> select count (*) from user_objects;
COUNT(*)
----------
194
可以看出在rman使用者下的對象個數為194個
3:增加tns服務名
[oracle@oracle11g admin]$ vi tnsnames.ora
jy =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.56.11)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = jy)
)
)
4:註冊目標資料庫,同步catalog和控制檔案
[oracle@oracle11g admin]$ rman target sys/zzh_2046@test catalog rman/rman@jy
Recovery Manager: Release 10.2.0.5.0 - Production on Sun Feb 1 21:25:25 2015
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: TEST (DBID=2155613261)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> resync catalog;
starting full resync of recovery catalog
full resync complete
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 10 TEST 2155613261 PARENT 1 30-JUN-05
1 11 TEST 2155613261 PARENT 446075 05-SEP-14
1 12 TEST 2155613261 PARENT 2849317 27-JAN-15
1 13 TEST 2155613261 PARENT 2880152 27-JAN-15
1 2 TEST 2155613261 CURRENT 3017109 01-FEB-15
--------------------------------------推薦閱讀 --------------------------------------
RMAN 配置歸檔日誌刪除策略
Oracle基礎教程之通過RMAN複製資料庫
RMAN備份策略制定參考內容
RMAN備份學習筆記
OracleDatabase Backup加密 RMAN加密
--------------------------------------分割線 --------------------------------------