BBED跳过归档
通过BBED 跳过归档,以当前数据库 8号文件为例:
SQL> select * from v$dbfile where file#=8;
FILE# NAME
---------- --------------------------------------------------
8 /u01/app/oracle/oradata/orcl/d4k01.dbf 1、rman 备份 8号文件
RMAN> backup datafile '/u01/app/oracle/oradata/orcl/d4k01.dbf' format '/home/oracle/back/d4k01_%U.bak';
Starting backup at 03-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00008 name=/u01/app/oracle/oradata/orcl/d4k01.dbf
channel ORA_DISK_1: starting piece 1 at 03-SEP-16
channel ORA_DISK_1: finished piece 1 at 03-SEP-16
piece handle=/home/oracle/back/d4k01_03reraaj_1_1.bak tag=TAG20160903T004403 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 03-SEP-16 2、进行多次日志切换(用于产生多个日志归档)
SQL> alter system switch logfile; 3、将 8 号数据文件脱机,并删除
SQL> alter database datafile '/u01/app/oracle/oradata/orcl/d4k01.dbf' offline;
rm -rf /u01/app/oracle/oradata/orcl/d4k01.dbf 4、rman还原 8 号文件
RMAN> restore datafile '/u01/app/oracle/oradata/orcl/d4k01.dbf';
Starting restore at 03-SEP-16
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/orcl/d4k01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/back/d4k01_03reraaj_1_1.bak
channel ORA_DISK_1: piece handle=/home/oracle/back/d4k01_03reraaj_1_1.bak tag=TAG20160903T004403
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 03-SEP-16 5、联机 8号数据文件,提示需要介质恢复
因为在rman备份的数据文件,写入数据文件头的检查点(V$DATAFILE_HEADER 视图的 CHECKPOINT_CHANGE#) 是备份时候的检查点编号,
切换多次日志后,在控制文件(V$DATAFILE 视图的 CHECKPOINT_CHANGE#) 里的是当前数据库检查点编号,这两个编号不一致,
所以需要介质恢复,也就是读取备份之后,所产生的redo日志。 6、介质恢复的起点,记录在数据文件头,分两部分(检查点和rba) 7、dump数据文件头
SQL> alter system set events 'immediate trace name file_hdrs level 10'; 8、在dump文件中找到 8 号数据文件对应的内容
DATA FILE #8:
name #28: /u01/app/oracle/oradata/orcl/d4k01.dbf
creation size=12800 block size=8192 status=0x1c head=28 tail=28 dup=1
tablespace 11, index=9 krfil=8 prev_file=0
unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
Checkpoint cnt:92 scn: 0x0000.004218e6 09/03/2016 00:45:06
Stop scn: 0x0000.00421998 09/03/2016 00:52:57
Creation Checkpointed at scn: 0x0000.00325a8a 06/15/2016 18:20:45
thread:1 rba:(0x30.992c.10)
--------------------------------------------------------------------------
Tablespace #11 - D4K rel_fn:8
Creation at scn: 0x0000.00325a8a 06/15/2016 18:20:45
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
reset logs count:0x3661a1e6 scn: 0x0000.002387eb
prev reset logs count:0x361abe00 scn: 0x0000.000e6c20
recovered at 09/03/2016 01:00:43
status:0x0 root dba:0x00000000 chkpt cnt: 77 ctl cnt:76
begin-hot-backup file size: 0
Checkpointed at scn: 0x0000.00421867 09/03/2016 00:44:03
thread:1 rba:(0x69.1056d.10) 在dump文件里面8号文件有两大部分:
1、data file 8# (这部分来着控制文件,是当前日志的检查点),
2、Tablespace #11 - D4K rel_fn:8 (这是8号文件对应的表空间,这部分数据来自数据文件头,是需要修改的部分) 9、修改 rba和 checkpoint at scn ,将其修改到指定的归档日志开始恢复(归档日志的序列号和检查点)
通过计算如下rba 的到 从 105 号归档的 66925号块开始恢复 (16进制69为10进制105...)
Checkpointed at scn: 0x0000.00421867 09/03/2016 00:44:03
thread:1 rba:(0x69.1056d.10) 查询归档日志视图(V$archived_log),获取序列号和检查点信息
SQL> select sequence#,first_change# from v$archived_log;
SEQUENCE# FIRST_CHANGE#
---------- -------------
103 4299914
104 4300188
105 4324652
.................
120 4331692
121 4331695
122 4331698
123 4331701
124 4331704
125 4331707
126 4331710
127 4331713
128 4331716
129 4331719 10、通过BBED,修改rba和检查点,将其改到第120号归档
BBED> show all;
FILE# 8
BLOCK# 1
OFFSET 0
DBA 0x02000001 (33554433 8,1)
FILENAME /u01/app/oracle/oradata/orcl/d4k01.dbf
BIFILE bifile.bbd
LISTFILE /home/oracle/bbed.lit
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No BBED> dump
File: /u01/app/oracle/oradata/orcl/d4k01.dbf (8)
Block: 1 Offsets: 0 to 511 Dba:0x02000001
------------------------------------------------------------------------
0ba20000 01000002 00000000 00000104 86390000 00000000 0000200b 7e099055
4f52434c 00000000 b39a0000 00960000 00200000 08000300 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 8a5a3200 00000000 7dd78336 e6a16136 eb872300 00000000 00000000
00000000 00000000 00000000 4d000000 3baded36 4c000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 0b000000 03004434 4b000000 00000000 00000000
00000000 00000000 00000000 00000000 08000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00be1a36 206c0e00 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 67184200 00006f6c 53a9ed36 01000000 69000000 6d050100 1000ffff
<32 bytes per line> 在bbed的dump中查找 rba的日志块号(1056d)和检查点(421867),在bbed中是反的,即为:6d0501 和 671842
使用find命令:
BBED> find /x 6d0501
File: /u01/app/oracle/oradata/orcl/d4k01.dbf (8)
Block: 1 Offsets: 504 to 1015 Dba:0x02000001
BBED> find /x 67184200
File: /u01/app/oracle/oradata/orcl/d4k01.dbf (8)
Block: 1 Offsets: 484 to 995 Dba:0x02000001 将检查点修改为120号归档的检查点(4331692),转换为16进制为(4218AC),反过来为(AC1842)
BBED> modify /x AC1842 offset 484 将rba的日志序列号改为(120),转换16进制为(78)
BBED> modify /x 78 offset 500 将rba中的日志块号改小一点,改为从第三号块开始
BBED> modify /x 110000 offset 504 改完dump结果如下:
BBED> dump
File: /u01/app/oracle/oradata/orcl/d4k01.dbf (8)
Block: 1 Offsets: 0 to 511 Dba:0x02000001
------------------------------------------------------------------------
0ba20000 01000002 00000000 00000104 213c0000 00000000 0000200b 7e099055
4f52434c 00000000 b39a0000 00960000 00200000 08000300 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 8a5a3200 00000000 7dd78336 e6a16136 eb872300 00000000 00000000
00000000 00000000 00000000 4d000000 3baded36 4c000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 0b000000 03004434 4b000000 00000000 00000000
00000000 00000000 00000000 00000000 08000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00be1a36 206c0e00 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 ac184200 00006f6c 53a9ed36 01000000 78000000 11000000 1000ffff
<32 bytes per line> 重新计算校验和
BBED> sum apply
Check value for File 8, Block 1:
current = 0x3c21, required = 0x3c21 11、恢复8号文件
SQL> recover datafile '/u01/app/oracle/oradata/orcl/d4k01.dbf';
ORA-00279: change 4331692 generated at 09/03/2016 00:44:03 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/oradata/archive/1_120_912368102.dbf
ORA-00280: change 4331692 for thread 1 is in sequence #120
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00279: change 4331695 generated at 09/03/2016 00:45:02 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/oradata/archive/1_121_912368102.dbf
ORA-00280: change 4331695 for thread 1 is in sequence #121
BBED跳过归档的更多相关文章
- 使用BBED跳过归档进行恢复
https: 使用BBED跳过归档进行恢复 数据库启动异常,提示6号文件丢失 SQL> startup ORACLE instance started. Total System Global ...
- 05 使用bbed跳过归档恢复数据文件
5 使用BBED跳过归档 在归档模式下,缺失了一部分的归档日志文件,对数据文件进行恢复 1 开启归档 --shutdown immediate --startup mount --alter data ...
- 【Oracle】使用BBED跳过丢失的归档
在recover datafile的过程其中假设丢失了须要的归档将使得recover无法进行.使用bbed工具能够跳过丢失的归档进行recover datafile. 实验步骤例如以下: SYS@OR ...
- Oracle特殊恢复原理与实战(DSI系列)
1.深入浅出Oracle(DSI系列Ⅰ) 2.Oracle特殊恢复原理与实战(DSI系列Ⅱ) 3.Oracle SQL Tuning(DSI系列Ⅲ)即将开设 4.Oracle DB Performan ...
- oracle dis系列课程总结
oracle dis系列课程总结 1 bbed安装和介绍 --1 bbed的安装--(Oracle Block Brower and EDitor Tool) 2 controlfile 丢失的恢复 ...
- Oracle--RMAN Recover 缺失的归档操作
一,环境简介 Oracle RMAN 备份的恢复分2个步骤:RESTRE 和 RECOVER.在这里回复的时候是依赖者归档文件的,当周一完成数据全备,保留归档的情况下,后期数据有问题,恢复的时候发现少 ...
- KingbaseES R3 集群主库归档失败案例
案例说明: 本案例用于KingbaseES R3集群归档进程归档日志失败的处理,对于一线的生产环境具有 一定的参考意义. 数据库版本: TEST=# select version(); VERSION ...
- 无归档情况下使用BBED处理ORA-01113错误
在丢失归档情况下,恢复时常会遇到ora-01113错误,以下实验模拟表空间offline,然后在丢失归档文件的情况下使用BBED修改文件头信息,最后恢复数据文件: 数据库版本: SQL> sel ...
- Oracle11gr2_ADG管理之跳归档恢复dg实战
模拟故障 关闭备库 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut dow ...
随机推荐
- [ios2] 开发技巧【转】
1.NSCalendar用法 -(NSString *) getWeek:(NSDate *)d { NSCalendar *calendar = [[NSCalendar alloc] initWi ...
- 一个简单的使用restc demo
最近不经意间看到饿了么团队开发的restc,接口调试工具(类似postman),其实调试接口都没用过工具,每次都只是运行起项目直接调接口.闲来无事,看到restc,就决定试试,后面觉得挺不错的,就分享 ...
- elasticsearch基本概念
NRT(近实时搜索) Elasticsearch是一个NRT平台.这意味着当你索引一个文件时,在细微的延迟(通常1s)之后,该文件才能被搜索到. Cluster(集群) cluster是在所有节点中保 ...
- My Eclipse Security Alert
SECURITY ALERT: INTEGRITY CHECK ERROR This product did not pass the MyEclipse integrity check. This ...
- Chapter 21_5 替换
gsub函数的第三个参数不仅是一个字符串,还可以是一个函数或table. 如果是函数,gsub会在每次找到匹配时调用该函数.调用时的参数是捕获到的内容,该函数的返回值作为要替换的字符串. 如果是tab ...
- linux服务器没网情况下手动安装软件几个方法
1,找到一个有网的服务器,使用yumdownloader gcc,获取需要的rmp包: 2,在http://pkgs.org 下下载所需要的rpm包
- DB2导入导出 学习笔记
db2pd -osinfodb2mtrk -i -d (for aix)db2 get dbm cfg show detaildb2 get db cfg show detaildb2 get sna ...
- 关于ajax的短轮询问题
利用前台的ajax不断向后台服务器请求,后台服务器不断查看数据库里的信息是否变化.若变化将信息返回前台,并执行一些操作 前台ajax代码 注意要加上cache这一项,如果是post请求的化,可以免了. ...
- jquery轻松实现li标签上下滚动的原理
在网站上我们常看到有滚动的文字或者图片,比如消息提醒,新闻列表,等等.那么这些效果是怎么形成的呢?经过查阅,找到一种十分方便的写法,经过改良,得出我自己的终极版滚动效果. 我先写个布局吧 <di ...
- Jquery几秒自动跳转
$(document).ready(function() { function jump(count) { window.setTimeout(function(){ count--; if(coun ...