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. TJU 2248. Channel Design 最小树形图

    最小树形图,測模版.... 2248.   Channel Design Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 2199 ...

  2. It's a Buck; It's a Boost, No! It's a Switcher!

    It's a Buck; It's a Boost, No! It's a Switcher! Sanjaya Maniktala, National Semiconductor Corp., San ...

  3. IDA IDC Tutorials: Additional Auto-Commenting

    https://www.hex-rays.com/products/ida/support/tutorials/idc/autocomment.shtml This program creates a ...

  4. Unity3D协程介绍 以及 使用

    作者ChevyRay ,2013年9月28日,snaker7译  原文地址:http://unitypatterns.com/introduction-to-coroutines/ 在Unity中,协 ...

  5. javascript转换日期字符串为Date对象

    把一个日期字符串如“2007-2-28 10:18:30”转换为Date对象: 1: var strArray=str.split(" "); var strDate=strArr ...

  6. xml布局内容总结(一)--Android

    关于安卓项目中xml的使用非常多.为了达到一些好的UI效果.须要对xml比較熟练.会使用非常多的小技巧,本人准备对这些小技巧进行整理和总结,希望进行分享和交流. 关于weight的使用,因为weigh ...

  7. Android RadioButton设置选中时文字和背景颜色同时改变

    主要应用在购物车,像淘宝的那样,点击以后弹出一个选择种类颜色这样的popuwindow以后,然后这个选择种类的地方要用到类似这个玩意儿. 搜了一下,效果和这个文章一致.转了. 原文地址:http:// ...

  8. Git使用教程(转载)

    Git使用教程 一:Git是什么? Git是目前世界上最先进的分布式版本控制系统. 二:SVN与Git的最主要的区别? SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是 ...

  9. VB开发ActiveX控件的一些记录

    注意,下面很多语句的用法,不能放在Private Sub UserControl_Initialize()里使用,要放在Private Sub UserControl_InitProperties() ...

  10. Error: Finish can only be called once

    Android studio 启动或者新建项目:报错“Error: Finish can only be called once” gradle缓存问题: 默认的额缓存路径在: on windows ...