RMAN Recovery Catalog
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的更多相关文章
- rman 使用catalog备份的演示
介绍了如何使用catalog方式做RMAN备份,以及如何取消以catalog方式做备份. 第一步:创建RMAN CATALOG表空间及用户. [oracle@oel-01 ~]$ sqlplus / ...
- 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 ...
- RMAN RECOVERY
Data Recovery Advisor The health monitor and the ADR The capabilities and limitations of DRA using t ...
- oracle创建恢复编录(recovery catalog)
1.在要作为恢复编录的数据库创建用户 create user rman identified by oracle default tablespace system temporary TABLESP ...
- Oracle 10G如何从recovery catalog中Unregister目标数据库
从10g开始,RMAN简化了unregister目标数据库的步骤 方法1: $rman target system/oracle@test catalog rman/rman@catadb rman& ...
- RMAN恢复目录
是否使用RMAN恢复目录(Recovery Catalog 你可能从其他人或书上听过RMAN恢复目录(也有可能是其他名字,RMAN Recovery Catalog的翻译较多较杂,以下简称恢复目录), ...
- RMAN-使用catalog恢复目录进行备份与恢复
RMAN ArchitectureThe RMAN architecture, shown in Figure 7-3, includes a target database, repository, ...
- 官方文档 恢复备份指南四 Starting and Interacting with the RMAN Client
本章讲: Starting and Exiting RMAN Specifying the Location of RMAN Output ...
- 1Z0-053 争议题目解析
1Z0-053 争议题目解析 Summary 题目NO. 题目解析链接地址 题库答案 参考答案 考查知识点 24 http://www.cnblogs.com/jyzhao/p/5319220.ht ...
随机推荐
- CSS的outline属性
input标签的outline的三个属性: outline-color outline-style outline-width 当设置input的focus状态的时候可以使用. input:focus ...
- CentOS 6.9/7通过yum安装指定版本的JDK/Maven
说明:通过yum好处其实很多,环境变量不用配置,配置文件放在大家都熟悉的地方,通过rpm -ql xxx可以知道全部文件的地方等等. 一.安装JDK(Oracle JDK 1.8) # wget -- ...
- Spring Bean InitializingBean和DisposableBean实例
在Spring中,InitializingBean和DisposableBean是两个标记接口,为Spring执行时bean的初始化和销毁某些行为时的有用方法. 对于Bean实现 Initializi ...
- JAVA RMI调用实战学习
JAVA RMI 实战示例,参考网址: http://diaoge.iteye.com/blog/245170 这个示例很清楚地阐释了rmi的使用方法, 但示例都是放在一起的, 实际使用中我们可能会将 ...
- iTunes Connect App Bundles
App Bundles捆绑销售提交流程: 1. 在iTunes Connect左上「+」选「Create Bundle」到「New App Bundle」挑选已上线应用(最多可捆绑10个应用) 2. ...
- OpenCV特征点检测
特征点检测 目标 在本教程中,我们将涉及: 使用 FeatureDetector 接口来发现感兴趣点.特别地: 使用 SurfFeatureDetector 以及它的函数 detect 来实现检测过程 ...
- Linux下解决 id_rsa 权限不够
问题 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVAT ...
- ExtAspNet下通过文档路径实现文档的下载
<ext:Button ID="Button1" runat="server" Text="Button" OnClick=" ...
- linux CentOS6.5 yum安装mysql 5.6(转载&删改)
按:下面文章经过我一路测试没有问题,是篇好文,在此感谢作者 别踩我袈裟 .另因原文有些啰嗦,我自己有所删改,并尾后增加了一大段. 出处:https://www.cnblogs.com/renjido ...
- systemctl使用
systemctl start httpd.service 这会启动httpd服务,就我们而言,Apache HTTP服务器. 要停掉它,需要以root身份使用该命令: systemctl stop ...