RMAN用来存放数据库元数据的schema。

the catalog includes the following types of metadata:
-Data file and archived redo log backup sets and backup pieces
-Data file copies
-Archived redo logs and their copies
-Database structure (tablespaces and datafiles)
-Stored scripts, which are named user-created sequences of RMAN commands
-Persistent RMAN configuration settings

创建Recovery Catalog

1.配置Recovery Catalog数据库

2.创建Recovery Catalog的属主

不可以让sys用户成为Recovery Catalog的属主。

SQL> create user rman identified by password
temporary tablespace temp
default tablespace tools
quota unlimited on tools;
SQL> grant recovery_catalog_owner to rman;

3.执行create catalog命令

从rman客户端登陆到catalog所在的数据库

RMAN> connect catalog rman/oracle@catdb
RMAN> create catalog tablespace cat_tbs;

验证一下:

SQL> select table_name from user_tables;

注册数据库到Recovery Catalog

$ rman target / catalog rman/oracle@catdb

Recovery Manager: Release 11.2.0.4. - Production on Mon Sep  :: 

Copyright (c) , , Oracle and/or its affiliates.  All rights reserved.

connected to target database: DB11 (DBID=)
connected to recovery catalog database RMAN> register database; database registered in recovery catalog
starting full resync of recovery catalog
full resync complete RMAN> report schema; Report of database schema for database with db_unique_name DB11 List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
SYSTEM YES /u11/app/oracle/oradata/db11/system01.dbf
SYSAUX NO /u11/app/oracle/oradata/db11/sysaux01.dbf
UNDOTBS1 YES /u11/app/oracle/oradata/db11/undotbs01.dbf
USERS NO /u11/app/oracle/oradata/db11/users01.dbf
EXAMPLE NO /u11/app/oracle/oradata/db11/example01.dbf List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
TEMP /u11/app/oracle/oradata/db11/temp01.dbf

向Recovery Catalog中注册备份集

RMAN> catalog datafilecopy '/disk1/old_datafiles/01_01_2003/users01.dbf';
RMAN> catalog archivelog '/disk1/arch_logs/archive1_731.dbf', '/disk1/arch_logs/archive1_732.dbf';
RMAN> catalog backuppiece '/disk1/backups/backup_820.bkp';

也可以将备份文件放到一个目录下,将整个目录注册进去:

RMAN> catalog start with '/disk1/backups/';

下面两个语法是不同的:

RMAN> CATALOG START WITH '/disk1/backups';           #任何以backups开头的目录都被注册进去
RMAN> CATALOG START WITH '/disk1/backups/'; #只是注册backups目录

创建和管理Virtual Private Catalogs

recovery catalog的拥有者是catowner
注册的数据库有:prod1、prod2、prod3
创建数据库用户vpc1,并被授予访问prod1、prod2

1.创建数据库用户(VPC的拥有者)并授权

    登陆到recovery catalog所在的数据库
SQL> create user vpc1 identified by vpc1 default tablespace vpcusers quota unlimited on vpcusers;
SQL> grant recovery_catalog_owner to vpc1;
SQL> exit; 以base recovery catalog用户身份rman登陆到recovery catalog所在的数据库
$ rman
RMAN> connect catalog catowner@catdb;
RMAN> grant catalog for database prod1 to vpc1;
RMAN> grant catalog for database prod2 to vpc1;
RMAN> grant register database to vpc1;

2.创建VPC

    $ rman
RMAN> connect catalog vpc1@catdb;
RMAN> create virtual catalog;

3.收回Virtual Private Catalog Owner的权限

    以base recovery catalog用户身份rman登陆到recovery catalog所在的数据库
$ rman
RMAN> connect catalog catowner@catdb;
RMAN> revoke catalog for database prod1 from vpc1;
RMAN> revoke register database from vpc1;

4.删除Virtual Private Catalog

    $ rman
RMAN> connect catalog vpc1@catdb;
RMAN> drop catalog;

Stored Scripts
Stored Scripts有两种:本地的、全局的

创建Stored Scripts
本地stored scripts:

RMAN> create script full_backup{
backup database plus archivelog;
delete obsolete;
}

全局stored scripts:

RMAN> create global script global_full_backup
comment 'use only with archivelog mode databases'
{
backup database plus archivelog;
delete obsolete;
}

从其他文件读取创建stored scripts:

RMAN> create script full_backup
from file '/tmp/my_script_file.txt';

更新stored scripts

使用关键字replace:

RMAN> replace script full_backup {
backup database plus archivelog;
}

运行stored scripts

RMAN> run {
execute global script global_full_backup;
} RMAN> run {
execute script full_backup;
}

打印stored scripts
使用关键字print scripts

RMAN> print script full_backup;

RMAN Recovery Catalog的更多相关文章

  1. rman 使用catalog备份的演示

    介绍了如何使用catalog方式做RMAN备份,以及如何取消以catalog方式做备份. 第一步:创建RMAN CATALOG表空间及用户. [oracle@oel-01 ~]$ sqlplus / ...

  2. RMAN-20201: datafile not found in the recovery catalog

    oracle恢复报错如下: Recovery Manager: Release 10.2.0.4.0 - Production on Fri Aug 28 14:31:31 2015 Copyrigh ...

  3. RMAN RECOVERY

    Data Recovery Advisor The health monitor and the ADR The capabilities and limitations of DRA using t ...

  4. oracle创建恢复编录(recovery catalog)

    1.在要作为恢复编录的数据库创建用户 create user rman identified by oracle default tablespace system temporary TABLESP ...

  5. Oracle 10G如何从recovery catalog中Unregister目标数据库

    从10g开始,RMAN简化了unregister目标数据库的步骤 方法1: $rman target system/oracle@test catalog rman/rman@catadb rman& ...

  6. RMAN恢复目录

    是否使用RMAN恢复目录(Recovery Catalog 你可能从其他人或书上听过RMAN恢复目录(也有可能是其他名字,RMAN Recovery Catalog的翻译较多较杂,以下简称恢复目录), ...

  7. RMAN-使用catalog恢复目录进行备份与恢复

    RMAN ArchitectureThe RMAN architecture, shown in Figure 7-3, includes a target database, repository, ...

  8. 官方文档 恢复备份指南四 Starting and Interacting with the RMAN Client

    本章讲: Starting and Exiting RMAN Specifying the Location of RMAN Output                                ...

  9. 1Z0-053 争议题目解析

    1Z0-053 争议题目解析 Summary 题目NO. 题目解析链接地址 题库答案 参考答案 考查知识点  24 http://www.cnblogs.com/jyzhao/p/5319220.ht ...

随机推荐

  1. Java Http连接中(HttpURLConnection)中使用代理(Proxy)及其验证(Authentication)

    使用Java的HttpURLConnection类可以实现HttpClient的功能,而不需要依赖任何其他类库.所有有时候大家就直接使用它来完成一些简单(或复杂)的功能.但是你活在伟大的{print ...

  2. xcode的ios工程目录结构复习

    目录结构: a.supporting files: main.m和资源文件 xxx-info.plist:包含应用程序相关属性列表,如版本,程序名等 .pch文件:预编译头文件,相当于MFC里的std ...

  3. STN1110 Multiprotocol OBD to UART Interpreter

    http://www.obdsol.com/stn1110/ Safe, secure bootloader. Reflash the firmware in the field, even over ...

  4. ASP.NET Core 1.0 基础之配置

    来源https://docs.asp.net/en/latest/fundamentals/configuration.html ASP.NET Core 1.0支持不同的配置选项.应用配置数据可以是 ...

  5. SRM 212 Div II Level One: YahtzeeScore

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=1692&rd=5858 比较简单. 代码如下: #inc ...

  6. c++学习之多态(虚函数和纯虚函数)

    c++是面向对象语言,面向对象有个重要特点,就是继承和多态.继承之前学过了,就是一种重用类的设计方式.原有的类叫父类,或者基类,继承父类的类叫子类.在设计模式中,我们总是要避免继承,推荐用组合.因为继 ...

  7. Django安装和配置环境变量

    一.windows系统安装Django 1.先安装python2.x or 3.x软件.(记得勾选pip3和添加python自己的环境变量) 下载地址:http://www.python.org/ 2 ...

  8. 使用CSS3实现的player播放按钮

    完成的效果如下 查看效果并下载 Step 1:先了解border的原理: Step 2:HTML代码结构 <section class="playContainer"> ...

  9. Servlet学习笔记(三):HTTP请求与响应

    一.HTTP请求常用方法: Cookie[] getCookies()返回一个数组,包含客户端发送该请求的所有的 Cookie 对象. Enumeration getAttributeNames()返 ...

  10. (剑指Offer)面试题5:从尾到头打印链表

    题目: 输入一个链表的头结点,从尾到头反过来打印每个结点的值. 链表结点定义: struct ListNode{ int value; ListNode* pNext; }; 思路: 1.改变链表结构 ...