官方文档 恢复备份指南二 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代替. 本指南将向您描述如何使用 ...
随机推荐
- iOS11、iPhone X、Xcode9 适配指南
更新iOS11后,发现有些地方需要做适配,整理后按照优先级分为以下三类: 1.单纯升级iOS11后造成的变化: 2.Xcode9 打包后造成的变化: 3.iPhoneX的适配 一.单纯升级iOS11后 ...
- 为什么我们需要DTO?
最近在写代码时突然产生了这个疑惑,我们为什么需要DTO进行数据传输呢? 要了解DTO首先我们要知道什么是DAO,DAO就是数据库的一个数据模型,是一个类文件里面存储着数据库的字段及其getter&am ...
- MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述 # Time: :: # User@Host: **[**] @ [**] Id: ** # Killed: # Query_time: Rows_examined: Rows_affect ...
- Action与Func 用法
//vs2017 + framework4.6.2 //zip https://github.com/chxl800/ActionFuncDemo //源文件git https://gith ...
- 配置一个nginx+php-fpm的web服务器
一.基本信息 系统(L):CentOS 6.9 #下载地址:http://mirrors.sohu.com 反代&负载均衡(N):NGINX 1.14.0 #下载地址:http://nginx ...
- nginx 日志记录 自定义详解(分析上报用)
nginx 日志记录 自定义详解 1.log_format 普通格式 log_format main '$remote_addr - $remote_user [$time_local] $req ...
- Ruby中类的进阶(继承,private, public, protect)
类中的public,protect,private public method class Point def test end end 这样定义的test方法就是一个public方法可以在类内外使用 ...
- java语言描述 用递归打印字符串
public class Test{ static private int n; public static void main(String[] args) { Test.n=76234; if(n ...
- BAT-运行程序
@echo offrem copy C:\Users\Administrator\Desktop\0000\123.txt C:\Users\Administrator\Desktop\0000\45 ...
- CSS基础part2
CSS属性操作-文本 文本颜色 <head> <style> p{ /*color:#8B5742 ;色码表*/ color: RGBA(255,0,0,0.5); /*调色, ...