recovery catalog详解及实践步骤

本文详细介绍了如何创建和使用Oracle RMAN恢复目录,包括创建表空间、用户、授权,登记和验证目标数据库,以及恢复目录的实用操作如备份、删除和更新。恢复目录增强了RMAN的功能,确保了备份信息的安全并支持跨数据库管理。
摘要由CSDN通过智能技术生成

(recovery catalog详解)
   RMAN可以在没有恢复目录(NOCATALOG)下运行,这个时候备份信息保存在控制文件中。
保存在控制文件中的备份信息是很危险的,如果控制文件的破坏将导致备份信息的丢失与恢复目录的失败,
而且,没有恢复目录,很多RMAN的命令将不被支持。所以对于重要的数据库,建议创建恢复目录,
恢复目录也是一个数据库,只不过这个数据库用来保存备份信息,一个恢复目录可以用来备份多个数据库。
       创建RMAN目录,一下步骤说明了在一个数据库中创建RMAN目录的过程

1.连接数据库
 SQL> startup
 ORACLE 例程已经启动。
 
 Total System Global Area  135338868 bytes
 Fixed Size                   453492 bytes
 Variable Size             109051904 bytes
 Database Buffers           25165824 bytes
 Redo Buffers                 667648 bytes
 数据库装载完毕。
 数据库已经打开。
 SQL> show user;
 USER 为"SYS"
 SQL> create tablespace rman_ts datafile 'e:/oracle/oradata/test/gejun/rman_ts.db
 f' size 10M;
 
 表空间已创建。
 
 SQL> create user rman_ts identified by rman_ts default tablespace rman_ts tempor
 ary tablespace temp quota unlimited on rman_ts;
 
 用户已创建
 
 SQL> grant connect,resource,recovery_catalog_owner to rman_ts;
 
 授权成功。

2.在目录数据库中创建恢复目录
 C:/Documents and Settings/Administrator>rman catalog rman_ts/rman_ts
 
 恢复管理器: 版本9.2.0.1.0 - Production
 
 Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
 
 连接到恢复目录数据库
 未安装恢复目录
 
 RMAN> create catalog tablespace rman_ts;
 
 恢复目录已创建

3.登记目标数据库:
 说明:一个恢复目录可以注册多个目标数据库,注册目标数据库的命令为:
 
 C:/Documents and Settings/Administrator>rman catalog rman_ts/rman_ts target scot
 t/tiger@test
 
 恢复管理器: 版本9.2.0.1.0 - Production
 
 Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
 
 连接到目标数据库: TEST (DBID=1961217676)
 连接到恢复目录数据库
 
 RMAN> register database;

4.Verify that the registration was successful by running REPORT SCHEMA:
 C:/Documents and Settings/Administrator>rman target / catalog rman_ts/rman_ts@test
 恢复管理器: 版本9.2.0.1.0 - Production
 Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
 连接到目标数据库: TEST (DBID=1961217676)
 连接到恢复目录数据库
 
 RMAN> report schema;
 
 数据库方案报表
 文件 KB    表空间           RB segs 数据文件名称
 ---- ---------- -------------------- ------- -------------------
 1        419840 SYSTEM               YES     E:/ORACLE/ORADATA/TEST/SYSTEM01.DBF
 2        204800 UNDOTBS1             YES     E:/ORACLE/ORADATA/TEST/UNDOTBS01.DBF
 3         20480 CWMLITE              NO      E:/ORACLE/ORADATA/TEST/CWMLITE01.DBF
 4         20480 DRSYS                NO      E:/ORACLE/ORADATA/TEST/DRSYS01.DBF
 5        152960 EXAMPLE              NO      E:/ORACLE/ORADATA/TEST/EXAMPLE01.DBF
 6         25600 INDX                 NO      E:/ORACLE/ORADATA/TEST/INDX01.DBF
 7         20480 ODM                  NO      E:/ORACLE/ORADATA/TEST/ODM01.DBF
 8         10240 TOOLS                NO      E:/ORACLE/ORADATA/TEST/TOOLS01.DBF
 9         25600 USERS                NO      E:/ORACLE/ORADATA/TEST/USERS01.DBF
 10        39040 XDB                  NO      E:/ORACLE/ORADATA/TEST/XDB01.DBF
 11        10240 RMAN_TS              NO      E:/ORACLE/ORADATA/TEST/GEJUN/RMAN_TS.DBF
  If you have datafile copies, backup pieces or archive logs on disk, you can catalog them in the recovery catalog using
  the CATALOG command. When using a recovery catalog, cataloging older backups
  that have aged out of the control file lets RMAN use the older backups during restore operations.
  For example:(通过下面语句进行恢复)
   RMAN> CATALOG DATAFILECOPY '/disk1/old_datafiles/01

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值