(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