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 TextView 显示HTML加图片
TextView显示网络图片,我用android2.3的系统,可以显示图片出来,并且如果图片比较大,应用会卡的现象,肯定是因为使用主线程去获取网络图片造成的,但如果我用android4.0以上的系统运 ...
- <摘录>CentOS怎么查看某个命令的源代码
安装yumdownloader工具: # yum install yum-utils 设置源: [base-src] name=CentOS-5.4 - Base src - baseurl=http ...
- Spring在bean配置文件中定义电子邮件模板
在上一篇Spring电子邮件教程,硬编码的所有电子邮件属性和消息的方法体中的内容,这是不实际的,应予以避免.应该考虑在Spring bean 配置文件中定义电子邮件模板. 1.Spring的邮件发件人 ...
- libgdx与Robovm绑定的坑
https://github.com/BlueRiverInteractive/robovm-ios-bindings
- Jquery实战——横纵向的菜单
横纵向的菜单效果,点击纵向菜单显示其子菜单.鼠标指向横菜单的时候.显示其子菜单,鼠标离开,子菜单隐藏. HTML代码: <span style="font-size:18px;&quo ...
- System.Threading.Tasks.Task 任务引起的IIS应用程序池崩溃
转载:http://www.cnblogs.com/aaa6818162/p/4421305.html 问题现象 IIS应用程序池崩溃(Crash)的特征如下: 1. 从客户端看,浏览器一直处于连接状 ...
- 阻止picker.js插件弹出键盘
<input id="focus" type="text" value="" placeholder="手机号" ...
- windows样式(style)参考
[WTL] 窗体Style的含义比较有用的设置:(1)WS_POPUP:弹出式窗体,没有标题栏!WS_BORDER:细的黑边框WS_OVERLAPPED:一般的有标题栏的窗体,见多了.WS_CHILD ...
- 使用BabeLua3.x在cocos2d-x中编辑和调试Lua
BabeLua是一款基于VS2012/2013的Lua集成开发环境,具有Lua语法高亮,语法检查,自动补全,快速搜索,注入宿主程序内对Lua脚本进行调试,设置断点观察变量值,查看堆栈信息等功能. 如何 ...
- 机器学习: 神经网络中的Error函数
利用神经网络做分类的时候,可以将神经网络看成一个mapping function,从输入到输出经过复杂的非线性变换.而输出的预测值与实际的目标值总是存在一定偏差的,一般利用这种偏差建立error 函数 ...