官方文档 恢复备份指南二 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代替. 本指南将向您描述如何使用 ...
随机推荐
- GPUImage源码解读之GPUImageFramebuffer
简介 OpenGL ES的FrameBuffer是渲染发生的地方,普通的2D图形的渲染默认发生在屏幕上:而三维的图形渲染则除了包括像素点的颜色,还有Depth Buffer,Stencil Buffe ...
- SQL 存储过程生成
use workflow; GO /****** 对象: StoredProcedure [dbo].[pro_GenerateProGet] 脚本日期: 08/03/2012 11:26:43 ** ...
- mount/umount命令
挂载及卸载指定的文件系统 mount [选项] [-L<标签>] [-o<选项>] [-t<文件系统类型>] [设备名] [挂载点] umount [挂载点] -a ...
- 持续集成(CI – Continuous Integration)
持续集成(CI – Continuous Integration) 在传统的软件开发中,整合过程通常在每个人完成工作之后.在项目结束阶段进行.整合过程通常需要数周乃至数月的时间,可能会非常痛苦.持续集 ...
- Spring Boot 2.0 设置网站默认首页
Spring Boot设置默认首页,方法实验OK如下 附上Application启动代码 /** * @ClassName Application * @Description Spring-Boot ...
- 验证XML文档的范例代码
如果想变成自己的,就把这里的xml文档名替换成自己xml文档名 var xmlDoc = new ActiveXObject("Microsoft.XMLDOM") xmlDoc. ...
- ethereum(以太坊)(实例)--"安全的远程购买"
pragma solidity ^0.4.10; contract Safebuy{ uint public price; address public seller; address public ...
- 一分钟完成pip安装
很多实用Python的小伙伴都需要使用pip安装相应的包,对于初学者而已,检查遇到pip安装不成功的情况,如以下典型错误: Traceback (most recent call last): Fil ...
- delphi 2010以上 安装 第三方控件
delphi-“can't be installed because it is not a design time package. 一定要先装 dcl*.dpk ----------------- ...
- 使用TryParse()来执行数值转换
static void Main() { var ageText = "25"; if (int.TryParse(ageText,out int age)) { Console. ...