PROD异机全备份恢复验证实施文档
PROD异机全备份恢复验证实施文档
******利用10月25日的全量备份、10月26日当天的归档日志及当前redo日志,恢复数据库到故障前数据库状态******
准备工作:
source 源库:
PROD数据库备份策略:每天全量备份
0 0 * * 0 /data/rmanfull.sh > /data/logs/rmanfull.log 2>&1
target 异地机器prod:
备份目录:/backup/PROD/rman_full20181025
备份文件如下
[oracle@prod ~]$ ll /backup/PROD/rman_full20181025
total 6221124
-rw-r----- 1 oracle oinstall 574902784 Oct 25 01:08 arc_20181025_lntggqia_1_1.arg
-rw-r----- 1 oracle oinstall 619688960 Oct 25 01:08 arc_20181025_lotggqia_1_1.arg
-rw-r----- 1 oracle oinstall 3584 Oct 25 01:08 arc_20181025_lptggqkb_1_1.arg
-rw-r----- 1 oracle oinstall 16547840 Oct 25 01:07 c-1016818008-20181025-00.ctl
-rw-r----- 1 oracle oinstall 16547840 Oct 25 01:08 c-1016818008-20181025-01.ctl
-rw-r----- 1 oracle oinstall 3151675392 Oct 25 01:07 fulllktggq4k_6836_1
-rw-r----- 1 oracle oinstall 1991057408 Oct 25 01:04 fulllltggq4k_6837_1
拷贝10月26日当天未备份的归档日志,到prod
[oracle@prod ~]$ ll /backup/prod/arch/
total 8651740
-rw-r----- 1 oracle oinstall 886358016 Oct 25 17:23 1_11540_918555866.dbf
-rw-r----- 1 oracle oinstall 882925568 Oct 25 17:23 1_11541_918555866.dbf
-rw-r----- 1 oracle oinstall 887519232 Oct 25 17:24 1_11542_918555866.dbf
-rw-r----- 1 oracle oinstall 854680064 Oct 25 17:24 1_11543_918555866.dbf
-rw-r----- 1 oracle oinstall 4065792 Oct 25 17:24 1_11544_918555866.dbf
-rw-r----- 1 oracle oinstall 1536 Oct 25 17:24 1_11545_918555866.dbf
-rw-r----- 1 oracle oinstall 889512448 Oct 25 17:24 1_11546_918555866.dbf
-rw-r----- 1 oracle oinstall 870745088 Oct 26 10:40 1_11547_918555866.dbf
-rw-r----- 1 oracle oinstall 2560 Oct 26 10:40 1_11548_918555866.dbf
-rw-r----- 1 oracle oinstall 888808448 Oct 26 10:40 1_11549_918555866.dbf
-rw-r----- 1 oracle oinstall 861337088 Oct 26 10:40 1_11550_918555866.dbf
-rw-r----- 1 oracle oinstall 1181696 Oct 26 10:40 1_11551_918555866.dbf
-rw-r----- 1 oracle oinstall 1024 Oct 26 10:40 1_11552_918555866.dbf
-rw-r----- 1 oracle oinstall 883601920 Oct 26 10:40 1_11553_918555866.dbf
-rw-r----- 1 oracle oinstall 910689280 Oct 26 10:41 1_11554_918555866.dbf
-rw-r----- 1 oracle oinstall 37829120 Oct 26 10:58 1_11555_918555866.dbf
-rw-r----- 1 oracle oinstall 30208 Oct 26 10:58 1_11556_918555866.dbf
-rw-r----- 1 oracle oinstall 49664 Oct 26 10:59 1_11557_918555866.dbf
源库的当前日志;
SYS@dhdb> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME CON_ID
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------------ ------------ ------------------ ----------
1 1 11556 1073741824 512 2 YES INACTIVE 5121113916 26-OCT-18 5121113978 26-OCT-18 0
2 1 11557 1073741824 512 2 YES INACTIVE 5121113978 26-OCT-18 5121114646 26-OCT-18 0
3 1 11558 1073741824 512 2 NO CURRENT 5121114646 26-OCT-18 2.8147E+14 0
拷贝10月26日 当前redo日志sequence 11558至异机恢复机器的目录/backup/prod/currentredolog/
安装与源库同版本的数据库软件,编辑环境变量$ORACLE_BASE $ORACLE_HOME等
实施流程:
1:在10月25日全量备份恢复初始化参数文件spfile
SQL> startup nomount force
RMAN>restore spfile from '/backup/PROD/rman_full20181025/c-1016818008-20181025-00.ctl'
SQL> shutdown immediate
SQL> startup nomount
SQL> create pfile from spfile
SQL> shutdown immediate
编辑pfile文件,补充源库的文件目录,调整SGA、PGA等内存设置等,用编辑好的pfile文件起库
SQL>startup nomount from '/data/app/oracle/product/12.1.0/db_1/dbs/initPROD.ora'
SQL>create spfile from pfile;
用spfile 起库
SQL>startup nomount force
2:恢复控制文件
RMAN>restore controlfile from '/backup/PROD/rman_full20181025/c-1016818008-20181025-00.ctl';
RMAN>alter database mount;
3:转储恢复数据库
RMAN>restore database;
RMAN>recover database;恢复数据库,应用归档日志
Starting recover at 26-OCT-18
using channel ORA_DISK_1
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=11544
channel ORA_DISK_1: reading from backup piece /backup/prod/rman_full20181025/arc_20181025_lotggqia_1_1.arg
channel ORA_DISK_1: piece handle=/backup/prod/rman_full20181025/arc_20181025_lotggqia_1_1.arg tag=TAG20181025T010722
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/data/app/oracle/arch/1_11544_918555866.dbf thread=1 sequence=11544
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=11545
channel ORA_DISK_1: reading from backup piece /backup/prod/rman_full20181025/arc_20181025_lptggqkb_1_1.arg
channel ORA_DISK_1: piece handle=/backup/prod/rman_full20181025/arc_20181025_lptggqkb_1_1.arg tag=TAG20181025T010722
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/data/app/oracle/arch/1_11545_918555866.dbf thread=1 sequence=11545
unable to find archived log
archived log thread=1 sequence=11546
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/26/2018 12:50:28
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 11546 and starting SCN of 5115041454
#提示恢复需要归档日志sequence 11546
RMAN>list backup of archivelog all;
#备份中的归档日志,截止到sequence 11545
RMAN> exit
注册归档日志目录
RMAN> catalog start with '/backup/prod/arch/';
RMAN> recover database; 利用26日当天的归档日志恢复数据库
Starting recover at 26-OCT-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1393 device type=DISK
starting media recovery
archived log for thread 1 with sequence 11546 is already on disk as file /backup/prod/arch/1_11546_918555866.dbf
archived log for thread 1 with sequence 11547 is already on disk as file /backup/prod/arch/1_11547_918555866.dbf
archived log for thread 1 with sequence 11548 is already on disk as file /backup/prod/arch/1_11548_918555866.dbf
archived log for thread 1 with sequence 11549 is already on disk as file /backup/prod/arch/1_11549_918555866.dbf
archived log for thread 1 with sequence 11550 is already on disk as file /backup/prod/arch/1_11550_918555866.dbf
archived log for thread 1 with sequence 11551 is already on disk as file /backup/prod/arch/1_11551_918555866.dbf
archived log for thread 1 with sequence 11552 is already on disk as file /backup/prod/arch/1_11552_918555866.dbf
archived log for thread 1 with sequence 11553 is already on disk as file /backup/prod/arch/1_11553_918555866.dbf
archived log for thread 1 with sequence 11554 is already on disk as file /backup/prod/arch/1_11554_918555866.dbf
archived log for thread 1 with sequence 11555 is already on disk as file /backup/prod/arch/1_11555_918555866.dbf
archived log for thread 1 with sequence 11556 is already on disk as file /backup/prod/arch/1_11556_918555866.dbf
archived log for thread 1 with sequence 11557 is already on disk as file /backup/prod/arch/1_11557_918555866.dbf
archived log file name=/backup/prod/arch/1_11546_918555866.dbf thread=1 sequence=11546
archived log file name=/backup/prod/arch/1_11547_918555866.dbf thread=1 sequence=11547
archived log file name=/backup/prod/arch/1_11548_918555866.dbf thread=1 sequence=11548
archived log file name=/backup/prod/arch/1_11549_918555866.dbf thread=1 sequence=11549
archived log file name=/backup/prod/arch/1_11550_918555866.dbf thread=1 sequence=11550
archived log file name=/backup/prod/arch/1_11551_918555866.dbf thread=1 sequence=11551
archived log file name=/backup/prod/arch/1_11552_918555866.dbf thread=1 sequence=11552
archived log file name=/backup/prod/arch/1_11553_918555866.dbf thread=1 sequence=11553
archived log file name=/backup/prod/arch/1_11554_918555866.dbf thread=1 sequence=11554
archived log file name=/backup/prod/arch/1_11555_918555866.dbf thread=1 sequence=11555
archived log file name=/backup/prod/arch/1_11556_918555866.dbf thread=1 sequence=11556
archived log file name=/backup/prod/arch/1_11557_918555866.dbf thread=1 sequence=11557
unable to find archived log
archived log thread=1 sequence=11558
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/26/2018 12:54:11
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 11558 and starting SCN of 5121114646
#提示恢复需要归档日志sequence 11558,而11558为源库此时的当前日志
#拷贝源库的当前sequence 11558至备份恢复机的目录/backup/prod/currentredolog/ ,利用当前日志组,恢复数据库
[oracle@standby05 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 26 12:57:41 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 5121114646 generated at 10/26/2018 10:57:08 needed for thread
1
ORA-00289: suggestion : /data/app/oracle/arch/1_11558_918555866.dbf
ORA-00280: change 5121114646 for thread 1 is in sequence #11558
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/backup/prod/currentredolog/redo03.log #从源库拷贝current redolog,到target库的/backup/prod/currentredolog/
Log applied.
Media recovery complete.
PROD异机全备份恢复验证实施文档的更多相关文章
- ORACLE异机增量备份恢复
PROD异机增量备份恢复验证实施文档 准备工作:source 源库:PROD数据库备份策略:周日0级RMAN备份,周一至周六1级差异增量备份0 4 * * 0 /data/rmanlev0.sh &g ...
- Oracle 11g 单实例到单实例OGG同步实施文档-RMAN 初始化
Oracle 11g 单实例到单实例OGG同步实施文档-RMAN 初始化 2018-06-07 13:455170原创GoldenGate 作者: leo 本文链接:https://www.cndba ...
- DATAGUARD实施文档
DATAGUARD实施文档 一.前期准备及备机安装: 通过获取到的主机信息规划备机数据库安装基础信息:(注:在安装备机时需要尽量保障与主机库信息一致,以下表格中的备机信息为根据主机信息规划的安装信息. ...
- Oracle 11g 单实例到单实例OGG同步实施文档-EXPDP初始化
Oracle 11g 单实例到单实例OGG同步实施文档-EXPDP初始化 2018-06-07 00:446470原创GoldenGate 作者: leo 本文链接:https://www.cndba ...
- DTD验证XML文档
DTD验证XML文档 1.DTD简介:DTD是Document Type Definition的缩写,即文档定义 1.1:DTD的内容包含: ...
- Oracle 11g 单实例到单实例OGG同步实施文档-OGG initial load
Oracle 11g 单实例到单实例OGG同步实施文档-OGG initial load 2018-06-07 00:514730原创GoldenGate 作者: leo 本文链接:https://w ...
- Oracle RAC备份异机单实例恢复演练
本文只节选了操作方案的部分章节: 3. 操作步骤 3.1. 异机单实例Oracle数据库软件安装 在异机上进行单实例Oracle数据库软件安装.该步骤过程不再本文中重复描述,如果对安装过程存在疑问 ...
- 较全的IT方面帮助文档
http://www.shouce.ren/post/d/id/108632 XSLT参考手册-新.CHMhttp://www.shouce.ren/post/d/id/108633 XSL-FO参考 ...
- MFC开发上位机到底用Dialog结构还是文档结构?
最近要跟着导师一起开发一款大型上位机.MFC新人在考虑用对话框结构还是文档结构. 虽然说书上说大型结构的软件都需要文档结构,但是目前来看,对话框可以实现功能,并且对话框的程序更小一些,节省资源加载速度 ...
随机推荐
- QButtonGroup
单选按钮和多选按钮,存放进QButtonGroup中 QButtonGroup方法来实现分组:将相同功能的按键,设为一个分组,然后可以进行 单选 或 多选 或 互斥单选 QAbstractButton ...
- Kotlin学习(5)类型系统
可空性(避免空指针异常) /* *这个函数的参数代表传入一个String类型变量的实例,这代表它不可以为空 */ fun a(str:String){ println(str) } //这样调用a() ...
- PHP批量导入excell表格到mysql数据库
PHP批量导入excell表格到mysql数据库,本人通过亲自测试,在这里分享给大家 1,下载 php excell类库 网上搜索可以下载,这里不写地址 2,建html文件 <form met ...
- 剑指offer-二维数组中的查找-数组-python
题目描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数 ...
- 修改admin中App的名称与表的名称
修改APP的名称: # coding:utf-8 from django.apps import AppConfig import os default_app_config = 'repositor ...
- 利用WebSocket和EventSource实现服务端推送
可能有很多的同学有用 setInterval 控制 ajax 不断向服务端请求最新数据的经历(轮询)看下面的代码: setInterval(function() { $.get('/get/data- ...
- sql中关闭自增,并插入数据
ET IDENTITY_INSERT 允许将显式值插入表的标识列中. 语法 SET IDENTITY_INSERT [ database.[ owner.] ] { table } { ON | OF ...
- Nginx cpu亲和性调整
意义 Nginx默认没有开启利用多核cpu,我们可以通过worker_processes指令来启动多个worker,但是worker最终运行在哪些cpu核上是系统层进行调度的:我们可以通过增加work ...
- httprunner
https://cn.httprunner.org/quickstart/ httprunner官方 https://testerhome.com/opensource_projects/httpru ...
- linux下实现web数据同步的四种方式(性能比较)
实现web数据同步的四种方式 ======================================= 1.nfs实现web数据共享2.rsync +inotify实现web数据同步3.rsyn ...