RMAN CATALOG数据库的配置
1、catalog database 的功能
1)集中存放rman的资料库(备份的元数据),并且可以和target database 的controlfile同步
2)存放rman的备份脚本
2、catalog database 的配置
1)需要建立一个单独的database
02:43:21 SQL> show parameter name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string catdb
db_unique_name string catdb
global_names boolean FALSE
instance_name string catdb
lock_name_space string
log_file_name_convert string
service_names string catdb
02:43:30 SQL>
2)建立存放rman 元数据的tablespace
02:44:12 SQL> create tablespace cattbs
02:44:24 2 datafile '/u01/app/oracle/oradata/catdb/cattbs01.dbf' size 100m;
Tablespace created.
3)建立user,用于管理rman,并授权
02:45:10 SQL> create user rman identified by rman default tablespace cattbs;
User created.
02:45:33 SQL> grant connect ,resource ,recovery_catalog_owner to rman;
Grant succeeded.
4)启动listener ,链接catalog database
[oracle@work admin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-AUG-2011 02:48:01
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=work)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 19-AUG-2011 02:47:31
Uptime 0 days 0 hr. 0 min. 29 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=work)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "prod" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
Service "prodXDB" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
Service "prod_XPT" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@work admin]$ rman catalog rman/rman@catdb
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Aug 19 02:49:05 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
5)建立catalog 的对象
RMAN> create catalog;
recovery catalog created
——建立以下对象,存储rman 元数据
02:45:54 SQL> conn rman/rman
Connected.
02:50:16 SQL>
02:50:16 SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
NODE TABLE
DB TABLE
CONF TABLE
DBINC TABLE
CKP TABLE
TS TABLE
TSATT TABLE
DF TABLE
DFATT TABLE
TF TABLE
TFATT TABLE
OFFR TABLE
RR TABLE
RT TABLE
ORL TABLE
RLH TABLE
AL TABLE
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BS TABLE
BP TABLE
BCF TABLE
CCF TABLE
XCF TABLE
BSF TABLE
BDF TABLE
CDF TABLE
XDF TABLE
BRL TABLE
BCB TABLE
CCB TABLE
SCR TABLE
SCRL TABLE
CONFIG TABLE
XAL TABLE
RSR TABLE
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
FB TABLE
RC_DATABASE VIEW
RC_DATABASE_INCARNATION VIEW
RC_RESYNC VIEW
RC_CHECKPOINT VIEW
RC_TABLESPACE VIEW
RC_DATAFILE VIEW
RC_TEMPFILE VIEW
RC_REDO_THREAD VIEW
RC_REDO_LOG VIEW
RC_LOG_HISTORY VIEW
RC_ARCHIVED_LOG VIEW
RC_BACKUP_SET VIEW
RC_BACKUP_PIECE VIEW
RC_BACKUP_DATAFILE VIEW
RC_BACKUP_CONTROLFILE VIEW
RC_BACKUP_SPFILE VIEW
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_DATAFILE_COPY VIEW
RC_CONTROLFILE_COPY VIEW
RC_BACKUP_REDOLOG VIEW
RC_BACKUP_CORRUPTION VIEW
RC_COPY_CORRUPTION VIEW
RC_OFFLINE_RANGE VIEW
RC_STORED_SCRIPT VIEW
RC_STORED_SCRIPT_LINE VIEW
RC_PROXY_DATAFILE VIEW
RC_PROXY_CONTROLFILE VIEW
RC_RMAN_CONFIGURATION VIEW
RC_DATABASE_BLOCK_CORRUPTION VIEW
RC_PROXY_ARCHIVEDLOG VIEW
RC_RMAN_STATUS VIEW
ROUT TABLE
RC_RMAN_OUTPUT VIEW
RCVER TABLE
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_FILES VIEW
RC_RMAN_BACKUP_SUBJOB_DETAILS VIEW
RC_RMAN_BACKUP_JOB_DETAILS VIEW
RC_BACKUP_SET_DETAILS VIEW
RC_BACKUP_PIECE_DETAILS VIEW
RC_BACKUP_COPY_DETAILS VIEW
RC_PROXY_COPY_DETAILS VIEW
RC_PROXY_ARCHIVELOG_DETAILS VIEW
RC_BACKUP_DATAFILE_DETAILS VIEW
RC_BACKUP_CONTROLFILE_DETAILS VIEW
RC_BACKUP_ARCHIVELOG_DETAILS VIEW
RC_BACKUP_SPFILE_DETAILS VIEW
RC_BACKUP_SET_SUMMARY VIEW
RC_BACKUP_DATAFILE_SUMMARY VIEW
RC_BACKUP_CONTROLFILE_SUMMARY VIEW
RC_BACKUP_ARCHIVELOG_SUMMARY VIEW
RC_BACKUP_SPFILE_SUMMARY VIEW
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_COPY_SUMMARY VIEW
RC_PROXY_COPY_SUMMARY VIEW
RC_PROXY_ARCHIVELOG_SUMMARY VIEW
RC_UNUSABLE_BACKUPFILE_DETAILS VIEW
RC_RMAN_BACKUP_TYPE VIEW
90 rows selected.
6)注册目标库
——注册目标库(将目标库controlfile的rman 元数据 同步到 catalog database)
[oracle@work admin]$ rman target / catalog rman/rman@catdb
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Aug 19 02:52:19 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: PROD (DBID=170319990)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
7)查看注册信息
02:50:19 SQL> desc rc_database;
Name Null? Type
----------------------------------------------------------------- -------- --------------------------------------------
DB_KEY NOT NULL NUMBER
DBINC_KEY NUMBER
DBID NOT NULL NUMBER
NAME NOT NULL VARCHAR2(8)
RESETLOGS_CHANGE# NOT NULL NUMBER
RESETLOGS_TIME NOT NULL DATE
02:54:28 SQL> select * from rc_database;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
1 2 170319990 PROD 1452590 19-AUG-11
oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html