author:skate
time:2010/06/07
我的环境是由一台rman catalog数据库服务器,为了管理方便,我用这太rman catalog数据库备份所有的数据库,
备份的每个数据库在rman catalog数据库上都对应一个用户(出于管理方便),今天又有一个项目上线,搭建了
一个数据库,所以照规矩再创建一个catalog 用户。
在rman数据库上创建catalog
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
TBS_RMANTICKET
6 rows selected.
创建catalog用户
SQL> create user rmangp identified by passwd
2 default tablespace tbs_rmanticket;
User created.
给catalog目录授权
SQL> grant connect,resource,recovery_catalog_owner to rmangp;
Grant succeeded.
SQL> commit;
Commit complete.
SQL> quit
创建catalog目录
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@ticketb ~]$ rman catalog=rmangp/passwd
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Jun 7 18:12:23 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create catalog tablespace TBS_RMANTICKET;
recovery catalog created
RMAN>
使用RMAN 同时连接到数据库和恢复目录,把目标数据库注册到catalog目录中
[oracle@ticket-A ~]$ rman catalog rmangp/passwd@rmandb target sys/passwd@gpdb
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jun 7 18:26:23 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: GPDB (DBID=444338880)
connected to recovery catalog database
PL/SQL package RMANGP.DBMS_RCVCAT version 10.02.00.00 in RCVCAT database is not current
PL/SQL package RMANGP.DBMS_RCVMAN version 10.02.00.00 in RCVCAT database is not current
从上面的提示可以看到,遇到了些麻烦,提示版本不对,那就升级catalog目录
RMAN> upgrade catalog;
recovery catalog owner is RMANGP
enter UPGRADE CATALOG command again to confirm catalog upgrade
RMAN> upgrade catalog;
recovery catalog upgraded to version 10.02.00.04
DBMS_RCVMAN package upgraded to version 10.02.00.00
DBMS_RCVCAT package upgraded to version 10.02.00.00
RMAN> quit
Recovery Manager complete.
再重新使用RMAN 同时连接到数据库和恢复目录,这回就ok了
[oracle@ticket-A ~]$ rman catalog rmangp/passwd@rmandb target sys/passwd@gpdb
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Jun 7 18:28:56 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: GPDB (DBID=444338880)
connected to recovery catalog database
RMAN>
把目标数据库注册到catalog目录中
RMAN> Register database;
最后就是写备份脚本,还有常规的监控脚本,然后做好定时任务就ok了
-----end-----