ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【RMAN】【CATALOG】恢复目录管理(2)--建立恢复目录

【RMAN】【CATALOG】恢复目录管理(2)--建立恢复目录

原创 Linux操作系统 作者:chicheng_cn421 时间:2011-10-06 05:33:29 0 删除 编辑
建立恢复目录(CATALOG)   ※恢复目录是一个独立的数据库,这一点请特别注意。
步骤:
1、建立恢复目录表空间
2、建立恢复目录所有者
3、授予恢复目录所有者角色
4、建立恢复目录
5、注册目标数据库
 

SQL> conn system/catdb@catdb
已连接。
SQL> create tablespace rman_tbs datafile '%oracle_base%/oradata/catdb/rman.dbf'
size 15M;

表空间已创建。

SQL> create user rman identified by rman default tablespace rman_tbs;

用户已创建。

SQL> grant connect,resource,recovery_catalog_owner to rman;

授权成功。

C:/>rman catalog rman/rman@catdb

恢复管理器: Release 10.2.0.1.0 - Production on 星期五 11月 7 22:41:59 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

连接到恢复目录数据库

RMAN> create catalog;

RMAN> connect target sys/demo@demo

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06004: 恢复目录数据库发生 ORACLE 错误: RMAN-20001: target database not found
in recovery catalog

RMAN> register database;

注册在恢复目录中的数据库
正在启动全部恢复目录的 resync
完成全部 resync

RMAN> report schema;

数据库方案报表

永久数据文件列表
===========================
文件大小 (MB) 表空间           回退段数据文件名称
---- -------- -------------------- ------- ------------------------
1    490      SYSTEM               YES     D:/DEMO/SYSTEM01.DBF
2    120      UNDOTBS1             YES     D:/DEMO/UNDOTBS01.DBF
3    270      SYSAUX               NO      D:/DEMO/SYSAUX01.DBF
4    241      USERS                NO      C:/DEMO/USERS01.DBF
5    1000     USER07               NO      E:/USER07.DBF

临时文件列表
=======================
文件大小 (MB) 表空间           最大大小 (MB) 临时文件名称
---- -------- -------------------- ----------- --------------------
1    50       TEMP                 50          D:/DEMO/TEMP01.DBF


如果想看一下Rman生成的恢复目录,可以像下面这样
-----------------------------------------------------------------------------
RMAN> host;

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\>sqlplus rman/rman@catdb

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 10月 5 20:47:31 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> set linesize 800
SQL> set pagesize 800
SQL> set feedback on;
SQL> select object_type, count(object_type) obj_cnt
  2    from user_objects
  3   group by object_type
  4   order by object_type;

OBJECT_TYPE            OBJ_CNT
------------------- ----------
INDEX                       95
TABLE                       37

已选择2行。

SQL>
------------------------------------------------------------------------------

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20335819/viewspace-708675/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-05

  • 博文量
    261
  • 访问量
    417491