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 ...
随机推荐
- Android中MVC模型(复合模式)
mvc是model,view,controller的缩写,mvc包括三个部分: 1.模型(model)对象:是应用程序的主体部分,全部的业务逻辑都应该写在该层. 2.视图(view)对象:是应用程序中 ...
- CMoLineMgr
#ifndef __E3GLOGOBJECTDB_H__ #define __E3GLOGOBJECTDB_H__ #include "PubCommon\Singleton.h" ...
- Turn any Linux computer into SOCKS5 proxy in one command
src: http://www.catonmat.net/blog/linux-socks5-proxy/ I thought I'd do a shorter article on catonmat ...
- jdbcTemplate:包含占位符的SQL无法打印参数信息
网上的解决方案是在log4j设置以下参数:(如:http://my.oschina.net/wamdy/blog/468491) log4j.logger.org.springframework.jd ...
- 解决win8/8.1系统安装.net framework 3.5出现0x800F0906代码错误
解决方案一. 首先打开windows更新,检查是否有系统更新要安装,因为这个问题可能是导致.net 3.5无法安装的罪魁祸首,要检查windows更新,可以右键“这台电脑”点击“属性”,打开后,点击左 ...
- thymleaf th:if标签
1.概念 <table> <tr> <th>NAME</th> <th>PRICE</th> <th>IN STOC ...
- 使用Vue.js制作仿Metronic高级表格(一)静态设计
Metronic高级表格是Metonic框架中自行实现的表格,其底层是Datatables.本教程将主要使用Vue实现交互部分,使用Bootstrap做样式库.jQuery做部分用户交互(弹窗). 使 ...
- windows服务的安装和卸载方法
安装 创建“安装.bat”文件,用记事本打开此文件,内容为 c:\windows\microsoft.net\framework\v4.0.30319\InstallUtil.exe E:\progr ...
- [Todo]很不错的Java面试题类型整理,要看
http://www.importnew.com/21445.html 1. 问,以下,会返回什么. public int func() { int ret = 0; try{ throw new E ...
- win7 64位的 svchost.exe 占用内存过大的问题
svchost.exe 是用来启动系统服务的,所以某个 svchost.exe 占用内存过大,可能就是它启动的那个服务占用内存过大,所以只要停止并禁用那个服务就行了. 一般来说占用内存最大的服务是 S ...