官方文档 恢复备份指南二 Getting Started with RMAN
1.Overview of the RMAN Environment
2.Starting RMAN and Connecting to a Database
RMAN> CONNECT TARGET SYS@prod
RMAN)
RMAN> STARTUP FORCE DBA;
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
RMAN> BACKUP DATABASE;或者RMAN> BACKUP AS COPY DATABASE;
RMAN> ALTER DATABASE OPEN;
Option | Description | Example |
---|---|---|
|
Specifies a location and name for backup pieces and copies. You must use substitution variables to generate unique file names. The most common substitution variable is 指定备份集搁置和名称格式.默认的名称格式是%U.%d表示DB_NAME,%t表示备份时的时间戳,%s设置备份集序号,p%设置备份片序号 |
BACKUP
FORMAT 'AL_%d/%t/%s/%p'
ARCHIVELOG LIKE '%arc_dest%';
|
|
Specifies a user-defined string as a label for the backup. If you do not specify a tag , then RMAN assigns a default tag with the date and time. Tags are always stored in the RMAN repository in uppercase. 为本次备份设置一个别名,以便恢复时使用 |
BACKUP
TAG 'weekly_full_db_bkup'
DATABASE MAXSETSIZE 10M;
|
8.Making Incremental Backups 增量备份
1.首先执行镜像备份,指定一个tag
BACKUP Option | Description | Example |
---|---|---|
|
Use If no level 0 data file copy with the specified tag exists in either the current or parent database incarnation, then RMAN creates a level 0 data file copy with the specified tag. 指定tag,然后RMAN会自动合并镜像.如果没有执行过镜像备份,则RMAN创建镜像备份 |
BACKUP
INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
WITH TAG 'incr_update'
DATABASE;
|
|
Specifies where RMAN creates the data file copy if a copy does not exist. If you add a new data file to the database, then you do not need to change your script, because RMAN automatically creates the level 0 copy required by the incremental backup routine. 备份数据文件镜像. |
BACKUP
INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
DATAFILECOPY FORMAT
'/disk2/df1.cpy'
DATABASE;
|
如:
FOR RECOVER OF COPY WITH TAG 'incr_update'
DATABASE;
VALIDATE
验证数据文件是否存在,是否有错误.CHECK LOGICAL 命令验证数据文件是否有逻辑错误.DATABASE ARCHIVELOG ALL;
CONNECT TARGET /
BACKUP DATABASE PLUS ARCHIVELOG;
LIST BACKUP;
EXIT;
RMAN> @/my_dir/my_command_file.txt # runs specified command file
或者
% rman @/my_dir/my_command_file.txt
list backup:
Option | Example | Explanation |
---|---|---|
|
|
Organizes the output by backup set. This is the default mode of presentation. |
|
|
Lists the backups according to which file was backed up. |
|
|
Displays summary output. |
Option | Example | Explanation |
---|---|---|
|
|
Lists backups that are recorded in the RMAN repository but that were not present at the expected location on disk or tape during the last |
|
|
Lists data file backups or copies that have status |
LIST BACKUP ;
LIST BACKUPSET ;
Option | Example | Explanation |
---|---|---|
|
在当前的保留策略下需要备份的文件 |
Shows which files need backing up under current retention policy. Use optional |
|
报告过期的备份 |
Lists backups that are obsolete under the configured backup retention policy. Use the optional |
|
|
Reports the tablespaces and data files in the database at the current time (default) or a different time. |
|
|
Lists all data files for which an unrecoverable operation has been performed against an object in the data file since the last backup of the data file. |
CATALOG
, CHANGE
, CROSSCHECK
, DELETE
.CROSSCHECK COPY;
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID 设备类型 月 D:\APP\WJ\PRODUCT\..\DB_1\RDBMS\ARC00059_0817241642.
存档日志 月 D:\APP\WJ\PRODUCT\..\DB_1\RDBMS\ARC00060_0817241642.
存档日志 月 D:\APP\WJ\PRODUCT\..\DB_1\RDBMS\ARC00061_0817241642.
存档日志 月 D:\APP\WJ\FLASH_RECOVERY_AREA\ARC00075_0817241642.
存档日志 月 D:\APP\WJ\FLASH_RECOVERY_AREA\ARC00076_0817241642.
存档日志 月 D:\APP\WJ\FLASH_RECOVERY_AREA\ARC00077_0817241642.
存档日志 月 D:\APP\WJ\FLASH_RECOVERY_AREA\ARC00078_0817241642.
存档日志 月 D:\APP\WJ\FLASH_RECOVERY_AREA\ARC00079_0817241642.
是否确定要删除以上对象 (输入 YES 或 NO)? no
CRITICAL
, HIGH
, or LOW
和
OPEN
or CLOSED.
Strategy: The repair includes complete media recovery with no data loss
Repair script: /disk1/oracle/log/diag/rdbms/prod/prod/hm/reco_660500184.hm
FLASHBACK ::00','DD-MON-YYYY HH24:MI:SS');
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID device B F A DISK B F A DISK A
Recovery must be done beyond SCN
RMAN> STARTUP FORCE MOUNT;
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN;
RESTORE
TABLESPACE
和
RECOVER
TABLESPACE
用来还原和恢复单个表空间,可以在数据库打开的情况下执行.首先,要把表空间脱机,然后执行restore再执行recover,再把表空间联机onlineRUN
{
SET NEWNAME FOR DATAFILE '/disk1/oradata/prod/users01.dbf'
TO '/disk2/users01.dbf';
RESTORE TABLESPACE users;
SWITCH DATAFILE ALL; # update control file with new file names
RECOVER TABLESPACE users;
}
RMAN> SQL 'ALTER TABLESPACE users ONLINE';
官方文档 恢复备份指南二 Getting Started with RMAN的更多相关文章
- 官方文档 恢复备份指南三 Recovery Manager Architecture
本节讨论以下问题: About the RMAN Environment 关于RMAN环境 RMAN Command-Line Client ...
- 官方文档 恢复备份指南一 Introduction to Backup and Recovery
1.备份分为:物理备份和逻辑备份 物理备份:备份数据文件 控制文件 归档日志文件 逻辑备份:EXP EXPDP备份等 物理备份为主,逻辑做补充 2.错误的类型 ...
- 官方文档 恢复备份指南五 Configuring the RMAN Environment
本章内容: Configuring the Environment for RMAN Backups 配置RMAN环境 Configuring RMAN to Make Backups to a ...
- 官方文档 恢复备份指南八 RMAN Backup Concepts
本章内容 Consistent and Inconsistent RMAN Backups Online Backups and Backup Mode Backup Sets Image Copie ...
- 官方文档 恢复备份指南六 Configuring the RMAN Environment: Advanced Topics
RMAN高级设置. 本章内容: Configuring Advanced Channel Options 高级通道选项 Configuring Advanced Backup Options 高级备 ...
- 官方文档 恢复备份指南七 Using Flashback Database and Restore Points
本章内容: Understanding Flashback Database, Restore Points and Guaranteed Restore Points Logging for Fla ...
- 官方文档 恢复备份指南四 Starting and Interacting with the RMAN Client
本章讲: Starting and Exiting RMAN Specifying the Location of RMAN Output ...
- 《KAFKA官方文档》入门指南(转)
1.入门指南 1.1简介 Apache的Kafka™是一个分布式流平台(a distributed streaming platform).这到底意味着什么? 我们认为,一个流处理平台应该具有三个关键 ...
- Protocol Buffers(Protobuf) 官方文档--Protobuf语言指南
Protocol Buffers(Protobuf) 官方文档--Protobuf语言指南 约定:为方便书写,ProtocolBuffers在下文中将已Protobuf代替. 本指南将向您描述如何使用 ...
随机推荐
- L2-001 紧急救援(dijkstra算法)
题目: 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图.在地图上显示有多个分散的城市和一些连接城市的快速道路.每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上.当其他城市 ...
- MySQL数据库安装配置步骤详解
MYSQL的安装 1.打开下载的mysql安装文件mysql-5.5.27-win32.zip,双击解压缩,运行“setup.exe”. 2.选择安装类型,有“Typical(默认)”.“Comple ...
- linux 第十天学习
一.RAID 1.常见RAID (RAID 0.RAID1.RAID5.RAID10) 2.RAID 10 阵列添加 2.1.添加硬盘 2.2.查看系统加载 2.3.mdadm 命令添加RAID阵列 ...
- 【读书笔记 - Effective Java】01. 考虑用静态工厂方法代替构造器
获取类的实例有两种方法: 1. 提供一个公有的构造器(最常用). 2. 提供一个公有的静态工厂方法(static factory method). // 静态工厂方法示例 public static ...
- css中三种隐藏方式
1.overflow 溢出隐藏 overflow:hidden 2.display 隐藏不占据原来的文档,即会让出空间 display:black 显示 display:none 隐藏 3.vis ...
- django模板的变量,标签,过滤器和自定义过滤器,注释
模板的作用是计算并输出: {{ 变量}} 当模版引擎遇到点如book.title,会按照下列顺序解析: 1.字典book['title'] 2.先属性后方法,将book当作对象,查找属性title,如 ...
- Leecode刷题之旅-C语言/python-141环形链表
/* * @lc app=leetcode.cn id=141 lang=c * * [141] 环形链表 * * https://leetcode-cn.com/problems/linked-li ...
- 分布式专题(二)——Zookeeper的ZAB协议介绍
- SpaceVim 语言模块 erlang
原文连接: https://spacevim.org/cn/layers/lang/erlang/ 模块简介 功能特性 启用模块 快捷键 语言专属快捷键 交互式编程 模块简介 这一模块为 SpaceV ...
- 成都Uber优步司机奖励政策(3月29日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...