官方文档 恢复备份指南二 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代替. 本指南将向您描述如何使用 ...
随机推荐
- html中的居中问题
1.表格居中:<table>标签的align属性 <table align="center">...... </table> 2.表格内容居中; ...
- python类的反射使用方法
曾经,博主的房东养了只金毛叫奶茶,今天就拿它当议题好了. 博主写本文时正在被广州的蚊子围攻. #反射练习 class animal(object): def __init__(self,name,fo ...
- python函数调用时传参方式
位置参数 位置参数需与形参一一对应 def test(a,b) #a,b就是位置参数 print(a) print(b) test(1,2) 关键字参数 与形参顺序无关 def test(x,y) ...
- 【2018 ICPC亚洲区域赛徐州站 A】Rikka with Minimum Spanning Trees(求最小生成树个数与总权值的乘积)
Hello everyone! I am your old friend Rikka. Welcome to Xuzhou. This is the first problem, which is a ...
- SQL优化例子
如下SQL的优化: select count(*) from ( select id,name,col1,col2 from t1 where name='xxxx' union select id ...
- 获取DOM
<template> <div> <header-vue :msg="msg" ref="header">heheh< ...
- vue使用axios调用豆瓣API跨域问题
最近做了一个vue小demo,使用了豆瓣开源的API,通过ajax请求时需要跨域才能使用. 封面.jpg 一.以下是豆瓣常用的开源接口: 正在热映 :https://api.douban.com/ ...
- php源码建博客2--实现单入口MVC结构
主要: MVC目录结构 数据库工具类制作 创建公共模型类和公共控制器类 --------------文件结构:-------------------------------------- blog├─ ...
- day 25 模块与包
一.模块 模块就是一个包含了python定义和申明的文件,文件名就是模块的名字加上.py的后缀/ 模块的分类: 1.使用python编写的py文件 2.已被编译位共享库或者DLL或 ...
- Linux内核调用SPI平台级驱动_实现OLED的显示功能
Linux内核调用SPI驱动_实现OLED显示功能 0. 导语 进入Linux的世界,发现真的是无比的有趣,也发现搞Linux驱动从底层嵌入式搞起真的是很有益处.我们在单片机.DSP这些无操作系统的裸 ...