设为首页 加入收藏

TOP

利用BBED恢复非归档模式下OFFLINE数据文件(七)
2015-07-24 11:04:46 来源: 作者: 【 】 浏览:5
Tags:利用 BBED 恢复 归档 模式 OFFLINE 数据 文件
3 01000000 l ?......?.3....


<16 bytes per line>


BBED> set file 7 block 1 --注意,这里必须再次指定一下file和block,刚才修改完以后默认file是8号
FILE# 7
BLOCK# 1


BBED> d /v offset 500 count 16
File: /u01/app/oracle/oradata/ora10g/zlm02.dbf (7)
Block: 1 Offsets: 500 to 515 Dba:0x01c00001
-------------------------------------------------------
0b000000 02000000 1000e1bf 02000000 l ..........峥....


<16 bytes per line>


BBED> m /x 0b dba 8,1 offset 500
File: /u01/app/oracle/oradata/ora10g/zlm_test01.dbf (8)
Block: 1 Offsets: 500 to 515 Dba:0x02000001
------------------------------------------------------------------------
0b000000 b90a0000 1000bf0e 02000000


<32 bytes per line>


BBED> sum
Check value for File 8, Block 1:
current = 0xf66e, required = 0xf7c8


BBED> sum apply -执行该命令才算是真正的修改完成
Check value for File 8, Block 1:
current = 0xf7c8, required = 0xf7c8


BBED> exit


[oracle@ora10g ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Sep 5 13:49:58 2014


Copyright (c) 1982, 2005, Oracle. All rights reserved.




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


SQL> select file#,checkpoint_change#,last_change# from v$datafile;


FILE# CHECKPOINT_CHANGE# LAST_CHANGE#
---------- ------------------ ------------
1 552911
2 552911
3 552911
4 552911
5 552911
6 552911
7 552911
8 552554 552828


SQL> select file#,checkpoint_change#,resetlogs_change# from v$datafile_header;


FILE# CHECKPOINT_CHANGE# RESETLOGS_CHANGE#
---------- ------------------ -----------------
1 552911547304
2 552911547304
3 552911547304
4 552911547304
5 552911547304
6 552911547304
7 552911547304
8 552911547304


虽然8号数据文件的checkpoint_change#,last_change#与其他文件还是不一致的,但是它的数据文件头中的信息已经一致了,也就是我们刚才改的内容


--recover数据文件并使其online
SQL> recover datafile 8
Media recovery complete.
QL> alter database datafile 8 online;


Database altered.


--再次查看
SQL> select file#,checkpoint_change#,last_change# from v$datafile;


FILE# CHECKPOINT_CHANGE# LAST_CHANGE#
---------- ------------------ ------------
1 552911
2 552911
3 552911
4 552911
5 552911
6 552911
7 552911
8 555977


SQL> select file#,checkpoint_change#,resetlogs_change# from v$datafile_header;


FILE# CHECKPOINT_CHANGE# RESETLOGS_CHANGE#
---------- ------------------ -----------------
1 552911 547304
2 552911 547304
3 552911 547304
4 552911 547304
5 552911 547304
6 552911 547304
7 552911 547304
8 555977 547304


SQL> select * from zlm1.offline_test;


ID NAME
---------- ----------
1 aaron8219


此时可以看到,虽然8号数据文件的checkpoint_change#仍然是不一致的,但是已经比其他文件newer了,说明是当前更改的文件,其实之前不能直接online,就是因为8号数据文件的checkpoint_change#=552554要比其他文件的checkpoint_change#552911要older所致。online的时候,控制文件中记录的信息过旧(因为之前文件是offline的,它的checkpoint信息自那一刻开始就不会再变化),需要用recover把它推送到其他文件的checkpoint之后的值(即比它们都要biger or newer)。经过recover以后,我们获得了8号文件新的checkpoint_change#=555977>552911,因此才能够重新将它online,即通过BBED,手工修改数据文件头中的checkpoint SCN,使其能够不依赖于online redo logfile和archive logfile,就能实现recover操作。

SQL> alter system checkpoint;


System altered.


SQL> select file#,checkpoint_change#,last_change# from v$datafile;


FILE# CHECKPOINT_CHANGE# LAST_CHANGE#
---------- ------------------ ------------
1 556048
2 556048
3 556048
4 556048
5 556048
6 556048
7 556048
8 556048


8 rows selected.


SQL> select fil
首页 上一页 4 5 6 7 下一页 尾页 7/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇intent对于电话和浏览器调用 下一篇java.util.date和java.sql.date在..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Redis 分布式锁全解 (2025-12-25 17:19:51)
·SpringBoot 整合 Red (2025-12-25 17:19:48)
·MongoDB 索引 - 菜鸟 (2025-12-25 17:19:45)
·What Is Linux (2025-12-25 16:57:17)
·Linux小白必备:超全 (2025-12-25 16:57:14)