标签云
asm恢复 bbed bootstrap$ dul kcbzib_kcrsds_1 kccpb_sanity_check_2 kcratr_nab_less_than_odr MySQL恢复 obet ORA-00312 ORA-00704 ORA-00742 ORA-01110 ORA-01200 ORA-01555 ORA-01578 ORA-01595 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-600 kcratr_nab_less_than_odr ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 ORACLE恢复 Oracle 恢复 ORACLE数据库恢复 oracle碎片 OSD-04016 YOUR FILES ARE ENCRYPTED 比特币加密文章分类
- MongoDB (1)
- MongoDB恢复 (1)
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (112)
- 数据库 (1,880)
- DB2 (22)
- MySQL (82)
- Oracle (1,705)
- Data Guard (53)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (168)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (72)
- Oracle Bug (8)
- Oracle RAC (56)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (29)
- Oracle备份恢复 (659)
- Oracle安装升级 (108)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (91)
- PostgreSQL (37)
- pdu工具 (7)
- PostgreSQL恢复 (13)
- SQL Server (34)
- SQL Server恢复 (14)
- TimesTen (7)
- 达梦数据库 (5)
- 达梦恢复 (3)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (51)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (34)
- MongoDB (1)
-
最近发表
- Firebird 损坏数据库数据抢救工具—firebirdext
- Oracle 19c 202610补丁(RUs+OJVM)-19.33
- 由于con$.con#值达到极限,触发数据库增加约束报ORA-600 12807错误
- MongoDB 离线提取工具—mongoext
- .bres勒索病毒加密数据库dmp文件可恢复
- ORA-600 krsm_mrp_rebuild_lf_list.lno_mismatch
- 记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复
- 不当数据库恢复操作导致一个月数据丢失
- obet快速修复oracle 位图损坏块
- 不太常见的10.2.0.1的oracle redo损坏恢复
- obet forcecopy功能抢救硬件故障中的数据文件
- kcratr_nab_less_than_odr和system坏块故障处理
- 通过obet 恢复system坏块,打开数据库
- obet dbv功能完整说明
- 分享一例运行在aix上的sap系统数据库恢复过程
- OBET-Oracle Block Editor Tool使用说明
- 几乎动用了所有手段的Oracle故障恢复
- Oracle Block Edit Tool (obet) 功能增强–2026.07
- Oracle 19c 202607补丁(RUs+OJVM)-19.32
- Patch_SCN快速修复ORA-01555数据库open故障
分类目录归档:Oracle备份恢复
file 1 block 128 corrupted/坏块恢复—system rollback坏块修复
有个数据库file 1 block 128 坏块导致数据库无法启动报错如下

该数据库版本是11.2.0.1,根据我们的经验该block是system rollback 的segment header,以下为我在正常哭查询结果
SQL> select file_id,block_id,blocks from dba_extents where segment_name='SYSTEM';
FILE_ID BLOCK_ID BLOCKS
---------- ---------- ----------
1 128 8
1 136 8
1 528 8
1 536 8
1 544 8
1 552 8
6 rows selected.
dump file 1 block 128 结果
Dump all the blocks in range: buffer tsn: 0 rdba: 0x00400080 (1/128) scn: 0x0000.00000000 seq: 0xff flg: 0x04 tail: 0x00000eff frmt: 0x02 chkval: 0x1387 type: 0x0e=KTU UNDO HEADER W/UNLIMITED EXTENTS Hex dump of block: st=0, typ_found=1
这里可以看到block scn为0×0000.00000000,而且数据块已经被标记为坏块
dbv检查坏块结果

从这里可以看出来主要错误是由于Controlscn: 0×0004.119fe191 greater than blockscn: 0×0000.00000000,拷贝system文件到本地,使用bbed修改
bbed修复坏块
H:\temp\SYSTEM01>bbed password=blockedit filename=system01.dbf blocksize=8192
BBED: Release 2.0.0.0.0 - Limited Production on Thu Mar 17 00:23:49 2016
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> show all
FILE# 0
BLOCK# 1
OFFSET 0
DBA 0x00000000 (0 0,1)
FILENAME system01.dbf
BIFILE bifile.bbd
LISTFILE
BLOCKSIZE 8192
MODE Browse
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED> set block 129
BLOCK# 129
BBED> map
File: system01.dbf (0)
Block: 129 Dba:0x00000000
------------------------------------------------------------
Unlimited Undo Segment Header
struct kcbh, 20 bytes @0
struct ktech, 72 bytes @20
struct ktemh, 16 bytes @92
struct ktetb[6], 48 bytes @108
struct ktuxc, 104 bytes @4148
struct ktuxe[204], 8160 bytes @4252
ub4 tailchk @8188
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x0e
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x00400080
ub4 bas_kcbh @8 0x00000000
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0xff
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x1387
ub2 spare3_kcbh @18 0x0000
BBED> set mode edit
MODE Edit
BBED> d offset 8188
File: system01.dbf (0)
Block: 129 Offsets: 8188 to 8191 Dba:0x00000000
------------------------------------------------------------------------
ff0e0000
<32 bytes per line>
BBED> m /x 01 offset 8188
File: system01.dbf (0)
Block: 129 Offsets: 8188 to 8191 Dba:0x00000000
------------------------------------------------------------------------
010e0000
<32 bytes per line>
BBED> verify
DBVERIFY - Verification starting
FILE = system01.dbf
BLOCK = 128
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
BBED> sum apply
Check value for File 0, Block 129:
current = 0x1387, required = 0x1387
BBED> verify
DBVERIFY - Verification starting
FILE = system01.dbf
BLOCK = 128
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
BBED> exit
H:\temp\SYSTEM01>dbv file=SYSTEM01.DBF
DBVERIFY: Release 12.1.0.2.0 - Production on 星期四 3月 17 00:26:26 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - 开始验证: FILE = H:\TEMP\SYSTEM01\SYSTEM01.DBF
Controlscn: 0x0004.119fe191 greater than blockscn: 0x0000.00000000
页 128 失败, 校验代码为 14509
页 128 失败, 校验代码为 14509
DBVERIFY - 验证完成
检查的页总数: 209920
处理的页总数 (数据): 132380
失败的页总数 (数据): 0
处理的页总数 (索引): 57168
失败的页总数 (索引): 0
处理的页总数 (其他): 3112
处理的总页数 (段) : 1
失败的总页数 (段) : 1
空的页总数: 17260
标记为损坏的总页数: 1
流入的页总数: 0
加密的总页数 : 0
最高块 SCN : 188826853 (5.188826853)
H:\temp\SYSTEM01>bbed password=blockedit filename=system01.dbf
BBED: Release 2.0.0.0.0 - Limited Production on Thu Mar 17 00:26:59 2016
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set blocksize 8192
BLOCKSIZE 8192
BBED> set block 129
BLOCK# 129
BBED> verify
DBVERIFY - Verification starting
FILE = system01.dbf
BLOCK = 128
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
BBED> map
File: system01.dbf (0)
Block: 129 Dba:0x00000000
------------------------------------------------------------
Unlimited Undo Segment Header
struct kcbh, 20 bytes @0
struct ktech, 72 bytes @20
struct ktemh, 16 bytes @92
struct ktetb[6], 48 bytes @108
struct ktuxc, 104 bytes @4148
struct ktuxe[204], 8160 bytes @4252
ub4 tailchk @8188
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x0e
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x00400080
ub4 bas_kcbh @8 0x00000000
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x01
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x1387
ub2 spare3_kcbh @18 0x0000
BBED> set mode edit
MODE Edit
BBED> m /x 0400 offset 12
File: system01.dbf (0)
Block: 129 Offsets: 12 to 523 Dba:0x00000000
------------------------------------------------------------------------
04000104 87130000 00000000 00000000 00000000 00000000 06000000 2f000000
20100000 05000000 05000000 08000000 2d024000 00000000 05000000 00000000
00000000 00000000 00000000 00000000 06000000 00000000 00000000 00000040
81004000 07000000 88004000 08000000 10024000 08000000 18024000 08000000
20024000 08000000 28024000 08000000 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 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 00000000 00000000
<32 bytes per line>
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x0e
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x00400080
ub4 bas_kcbh @8 0x00000000
ub2 wrp_kcbh @12 0x0004
ub1 seq_kcbh @14 0x01
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x1387
ub2 spare3_kcbh @18 0x0000
BBED> m /x 625a60d0 offset 8
File: system01.dbf (0)
Block: 129 Offsets: 8 to 519 Dba:0x00000000
------------------------------------------------------------------------
625a60d0 10000104 87130000 00000000 00000000 00000000 00000000 06000000
2f000000 20100000 05000000 05000000 08000000 2d024000 00000000 05000000
00000000 00000000 00000000 00000000 00000000 06000000 00000000 00000000
00000040 81004000 07000000 88004000 08000000 10024000 08000000 18024000
08000000 20024000 08000000 28024000 08000000 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 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 00000000
<32 bytes per line>
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x0e
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x00400080
ub4 bas_kcbh @8 0xd0605a62
ub2 wrp_kcbh @12 0x0010
ub1 seq_kcbh @14 0x01
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x1387
ub2 spare3_kcbh @18 0x0000
BBED> d offset 8188
File: system01.dbf (0)
Block: 129 Offsets: 8188 to 8191 Dba:0x00000000
------------------------------------------------------------------------
010e0000
<32 bytes per line>
BBED> m /x 010e625a
File: system01.dbf (0)
Block: 129 Offsets: 8188 to 8191 Dba:0x00000000
------------------------------------------------------------------------
010e625a
<32 bytes per line>
BBED> verify
DBVERIFY - Verification starting
FILE = system01.dbf
BLOCK = 128
Block 128 is corrupt
***
Corrupt block relative dba: 0x00400080 (file 0, block 128)
Bad check value found during verification
Data in bad block -
type: 14 format: 2 rdba: 0x00400080
last change scn: 0x0010.34605a62 seq: 0x1 flg: 0x04
consistency value in tail: 0x5a620e01
check value in block header: 0x1387, computed block checksum: 0x3470
spare1: 0x0, spare2: 0x0, spare3: 0x0
***
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 1
Total Blocks Influx : 0
BBED> sum apply
Check value for File 0, Block 129:
current = 0x27f7, required = 0x27f7
BBED> verify
DBVERIFY - Verification starting
FILE = system01.dbf
BLOCK = 128
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
BBED> exit
H:\temp\SYSTEM01>dbv file=SYSTEM01.DBF
DBVERIFY: Release 12.1.0.2.0 - Production on 星期四 3月 17 00:40:38 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
DBVERIFY - 开始验证: FILE = H:\TEMP\SYSTEM01\SYSTEM01.DBF
DBVERIFY - 验证完成
检查的页总数: 209920
处理的页总数 (数据): 132380
失败的页总数 (数据): 0
处理的页总数 (索引): 57168
失败的页总数 (索引): 0
处理的页总数 (其他): 3112
处理的总页数 (段) : 1
失败的总页数 (段) : 0
空的页总数: 17260
标记为损坏的总页数: 0
流入的页总数: 0
加密的总页数 : 0
最高块 SCN : 188826853 (5.188826853)
这里发现当我们bbed验证非坏块之时,使用dbv检测依旧报坏块,可以看出来dbv的验证比bbed更加严格
分区无法识别导致asm diskgroup无法mount
有客户咨询由于主机重启之后,导致四个磁盘组中的data2磁盘组无法mount(报ORA-15032,ORA-15017,ORA-15063),数据库无法open,让我们帮忙分析解决
Wed Mar 09 18:10:53 2016
NOTE: Assigning number (1,1) to disk (/dev/oracleasm/disks/VOL011)
Wed Mar 09 18:10:53 2016
ERROR: no read quorum in group: required 1, found 0 disks
NOTE: cache dismounting (clean) group 1/0xBD42B778 (DATA2)
NOTE: messaging CKPT to quiesce pins Unix process pid: 45093, image: oracle@BA (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 1/0xBD42B778 (DATA2)
NOTE: cache ending mount (fail) of group DATA2 number=1 incarn=0xbd42b778
NOTE: cache deleting context for group DATA2 1/0xbd42b778
GMON dismounting group 1 at 16 for pid 18, osid 45093
NOTE: Disk DATA2_0001 in mode 0x9 marked for de-assignment
ERROR: diskgroup DATA2 was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA2" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA2"
ERROR: ALTER DISKGROUP DATA2 MOUNT /* asm agent *//* {0:0:431} */
这里很明显由于缺少asm disk导致data2无法正常mount,进一步分析发现data2是有两块磁盘组成
Mon Sep 14 13:14:35 2015 SQL> create diskgroup data2 external redundancy disk '/dev/oracleasm/disks/VOL010','/dev/oracleasm/disks/VOL011' NOTE: Assigning number (4,0) to disk (/dev/oracleasm/disks/VOL010) NOTE: Assigning number (4,1) to disk (/dev/oracleasm/disks/VOL011) NOTE: initializing header on grp 4 disk DATA2_0000 NOTE: initializing header on grp 4 disk DATA2_0001 NOTE: initiating PST update: grp = 4 Mon Sep 14 13:14:35 2015 GMON updating group 4 at 29 for pid 26, osid 51535 NOTE: group DATA2: initial PST location: disk 0000 (PST copy 0) NOTE: PST update grp = 4 completed successfully NOTE: cache registered group DATA2 number=4 incarn=0xea085f62 NOTE: cache began mount (first) of group DATA2 number=4 incarn=0xea085f62 NOTE: cache opening disk 0 of grp 4: DATA2_0000 path:/dev/oracleasm/disks/VOL010 NOTE: cache opening disk 1 of grp 4: DATA2_0001 path:/dev/oracleasm/disks/VOL011 NOTE: cache creating group 4/0xEA085F62 (DATA2) NOTE: cache mounting group 4/0xEA085F62 (DATA2) succeeded NOTE: allocating F1X0 on grp 4 disk DATA2_0000 NOTE: diskgroup must now be re-mounted prior to first use NOTE: cache dismounting (clean) group 4/0xEA085F62 (DATA2) NOTE: messaging CKPT to quiesce pins Unix process pid: 51535, image: oracle@BA (TNS V1-V3) NOTE: lgwr not being msg'd to dismount NOTE: cache dismounted group 4/0xEA085F62 (DATA2) GMON dismounting group 4 at 30 for pid 26, osid 51535 GMON dismounting group 4 at 31 for pid 26, osid 51535 NOTE: Disk DATA2_0000 in mode 0x7e marked for de-assignment NOTE: Disk DATA2_0001 in mode 0x7e marked for de-assignment SUCCESS: diskgroup DATA2 was created
结合这部分信息,我们可以确定data2磁盘组是由两个磁盘组构成,分别为VOL010和VOL011,现在由于只发现了VOL011,因此data2磁盘组无法正常mount.观察发现该系统使用的是asmlib,通过oracleasm querydisk命令结合fdisk的盘符,

基本上可以确定VOL010丢失应该在mpathb盘(由于只有该盘和分区未被使用,其他盘和分区已经全部被现在可以查询到的asmlib使用作为asmdisk)之上
Disk /dev/mapper/mpathb: 3846.7 GB, 3846677987328 bytes
255 heads, 63 sectors/track, 467665 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/mapper/mpathbp1 1 267350 2147483647+ ee GPT
Disk /dev/mapper/mpathbp1: 3846.7 GB, 3846675890176 bytes
255 heads, 63 sectors/track, 467665 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb84bb99a
Device Boot Start End Blocks Id System
/dev/mapper/mpathbp1p1 1 200513 1610620641 83 Linux
/dev/mapper/mpathbp1p2 200514 267349 536860170 83 Linux
/dev/mapper/mpathbp1p3 267350 467665 1609038270 83 Linux
这里我们发现奇怪现象:mpathb盘先使用parted分为一个mapthbp1分区,然后又使用fdisk分了三个p1p1,p1p2,p1p3三个子分区.然后我们查看/dev/mapper/中的设备情况

发现没有p1p1,p1p2,p1p3这三个本该属于mapthb上的子分区.现在基本上明确,是由于对mapthb先使用了parted分区,然后再使用fdisk分区,在操作系统重启之后,无法正常识别相关子分区导致该问题.到此解决该问题的思路有三种.
1. 因为磁盘分区表信息是正常的,就是分区表信息没有同步到操作系统之上,想办法同步过去即可,os部分内容,此处忽略
2. 使用数据文件重组的方式直接对data2这两个asm disk进行重组,这里因为三个子分区未发现,直接对mapthbp1分区进行扫描即可,参考:asm disk header 彻底损坏恢复
3. 因为分区对于asm disk来说主要就是设置了磁盘的偏移量和大小,如果找到磁盘的偏移量,然后确定asm disk大小,直接通过dd命令把该部分dd到新的磁盘设备之上,然后直接mount磁盘组即可,这里重点讲解第三种方法恢复处理
使用dd出来mapthp1的磁盘头,然后使用bbed找出来偏移量,主要依据是第一次出现01820101信息的部分
BBED> d
File: bp1 (0)
Block: 64 Offsets: 0 to 63 Dba:0x00000000
------------------------------------------------------------------------
01820101 00000000 00000080 bc60223c 00000000 00000000 00000000 00000000
4f52434c 4449534b 564f4c30 31300000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> show all
FILE# 0
BLOCK# 64
OFFSET 0
DBA 0x00000000 (0 0,64)
FILENAME bp1
BIFILE bifile.bbd
LISTFILE
BLOCKSIZE 512
MODE Browse
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 64
LOGFILE log.bbd
SPOOL No
这里基本上可以定位到asm disk header对于mapthbp1的偏移量为32256,dd出来asm disk header分析

使用kfed查看磁盘头信息


现在基本上可以确定,asm disk大小为1572871M,磁盘的偏移量为32256,然后使用dd命令把这部分dd到新的磁盘设备上,然后oracleasm scandisks后



data2 mount成功,数据库正常open,此数据库完美恢复
如果您遇到此类情况,无法解决请联系我们,提供专业ORACLE数据库恢复技术支持
Phone:17813235971 Q Q:107644445
E-Mail:dba@xifenfei.com
Solaris rm datafile recovery—利用句柄误删除数据文件恢复
今天早上接到有客户恢复请求,他一不小心在solaris系统中使用rm -rf oradata命令把一个分区下面的所有数据文件全部删除了。现在不知道怎么办,请求我们给予支持.上去检查发现比较幸运,数据库没有crash,看来直接考虑使用句柄进行恢复
root@CNISORCLSVR # uname -a
SunOS CNISORCLSVR 5.9 Generic_112233-08 sun4u sparc SUNW,Sun-Fire-880
root@CNISORCLSVR # ps -ef|grep lgwr
oracle 597 1 0 Mar 05 ? 17:14 ora_lgwr_xifenfei
root 28069 28043 0 18:51:17 pts/2 0:00 grep lgwr
root@CNISORCLSVR # ls -ltr
total 189348454
-r--r--r-- 1 oracle dba 657920 Apr 26 2002 12
c--------- 1 root sys 13, 12 Mar 27 2004 8
c--------- 1 root sys 13, 12 Mar 27 2004 10
-rw-r----- 0 oracle dba 34359730176 Nov 12 2013 291
-rw-r----- 0 oracle dba 1073750016 Nov 13 2013 293
D--------- 1 root root 0 Mar 5 19:31 11
-rw-r----- 1 oracle dba 1758 Mar 5 22:04 9
-rw-rw---- 1 oracle dba 24 Mar 5 22:04 13
s--------- 0 root root 0 Mar 8 00:45 14
-rw-r----- 1 oracle dba 1887444992 Mar 12 03:27 289
-rw-r----- 1 oracle dba 943726592 Mar 12 11:17 290
-rw-r----- 0 oracle dba 4294975488 Mar 13 00:09 292
-rw-r----- 0 oracle dba 268443648 Mar 13 01:33 288
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 279
-rw-r----- 1 oracle dba 134225920 Mar 13 01:33 278
-rw-r----- 0 oracle dba 134225920 Mar 13 01:33 269
-rw-r----- 1 oracle dba 268443648 Mar 13 01:33 267
-rw-r----- 1 oracle dba 148119552 Mar 13 01:33 266
-rw-r----- 1 oracle dba 10493952 Mar 13 01:33 265
-rw-r----- 1 oracle dba 26222592 Mar 13 01:33 264
-rw-r----- 1 oracle dba 62922752 Mar 13 01:33 263
-rw-r----- 1 oracle dba 20979712 Mar 13 01:33 262
-rw-r----- 0 oracle dba 134225920 Mar 13 01:33 287
-rw-r----- 1 oracle dba 209723392 Mar 13 01:33 285
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 283
-rw-r----- 1 oracle dba 67117056 Mar 13 01:33 282
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 281
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 280
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 276
-rw-r----- 0 oracle dba 1073750016 Mar 13 01:33 275
-rw-r----- 0 oracle dba 2214600704 Mar 13 01:33 274
-rw-r----- 0 oracle dba 134225920 Mar 13 01:33 273
-rw-r----- 0 oracle dba 536879104 Mar 13 01:33 272
c--------- 1 root sys 13, 2 Mar 13 02:00 5
c--------- 1 root sys 13, 2 Mar 13 02:00 4
c--------- 1 root sys 13, 2 Mar 13 02:00 3
c--------- 1 root sys 13, 2 Mar 13 02:00 2
c--------- 1 root sys 13, 2 Mar 13 02:00 1
c--------- 1 root sys 13, 2 Mar 13 02:00 0
--w------- 1 oracle dba 4640842 Mar 13 04:43 7
--w------- 1 oracle dba 4640842 Mar 13 04:43 6
-rw-r----- 0 oracle dba 1207967744 Mar 13 18:21 271
-rw-r----- 0 oracle dba 15929974784 Mar 13 18:39 284
-rw-r----- 0 oracle dba 134225920 Mar 13 18:45 277
-rw-r----- 0 oracle dba 2122326016 Mar 13 18:46 286
-rw-r----- 0 oracle dba 9261031424 Mar 13 18:47 270
-rw-r----- 0 oracle dba 18253619200 Mar 13 18:47 268
-rw-r----- 1 oracle dba 134225920 Mar 13 18:51 261
-rw-r----- 1 oracle dba 524296192 Mar 13 18:51 260
-rw-r----- 1 oracle dba 104858112 Mar 13 18:52 259
-rw-r----- 1 oracle dba 1941504 Mar 13 18:52 258
-rw-r----- 1 oracle dba 1941504 Mar 13 18:52 257
-rw-r----- 1 oracle dba 1941504 Mar 13 18:52 256
SQL> select file#,name from v$datafile wehre name like '/disk%';
FILE# NAME
---------- --------------------------------------------------
9 /disk/oradata/xifenfei/xifenfei.dbf
10 /disk/oradata/xifenfei/CSSN.dbf
11 /disk/oradata/xifenfei/NCSSN.dbf
12 /disk/oradata/xifenfei/CSIC_RDS.dbf
13 /disk/oradata/xifenfei/CSIC_CSSN.dbf
14 /disk/oradata/xifenfei/CNIS_I.dbf
15 /disk/oradata/xifenfei/CNIS.dbf
16 /disk/oradata/xifenfei/TRSWCM6_CSSN.dbf
17 /disk/oradata/xifenfei/TRSWCM6_CSSN_PLUGINS.dbf
18 /disk/oradata/xifenfei/DIGIREF.dbf
20 /disk/oradata/xifenfei/TRSWCM.dbf
21 /disk/oradata/xifenfei/TRSWCM52_NSLC.dbf
22 /disk/oradata/xifenfei/TRSWCM52_PLUGINS_NSLC.dbf
24 /disk/oradata/xifenfei/TRSWCM_PLUGINS.dbf
25 /disk/oradata/xifenfei/CNIS_ALL.dbf
27 /disk/oradata/xifenfei/undotbs01.dbf
28 /disk/oradata/xifenfei/TRS_IDS02.dbf
29 /disk/oradata/xifenfei/xdb02.dbf
在solaris中比较郁闷,虽然进入了fd目录,但是无法知道哪些文件句柄是删除,哪些是正常的,因此没有办法,只能使用lsof进一步分析
root@CNISORCLSVR # pkgadd -d lsof-4.80-sol9-sparc-local
The following packages are available:
1 IBMlsof lsof
(sparc) 4.80
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: all
Processing package instance <IBMlsof> from </tmp/lsof-4.80-sol9-sparc-local>
lsof
(sparc) 4.80
Vic Abell
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
The following files are already installed on the system and are being
used by another package:
* /usr/local/bin <attribute change only>
* - conflict with a file which does not belong to any package.
Do you want to install these conflicting files [y,n,?,q] y
## Checking for setuid/setgid programs.
The following files are being installed with setuid and/or setgid
permissions:
/usr/local/bin/lsof <setgid sys>
/usr/local/bin/sparcv7/lsof <setgid sys>
/usr/local/bin/sparcv9/lsof <setgid sys>
Do you want to install these as setuid/setgid files [y,n,?,q] y
Installing lsof as <IBMlsof>
## Installing part 1 of 1.
/usr/local/bin/lsof
/usr/local/bin/sparcv7/lsof
/usr/local/bin/sparcv9/lsof
/usr/local/doc/lsof/00.README.FIRST
/usr/local/doc/lsof/00CREDITS
/usr/local/doc/lsof/00DCACHE
/usr/local/doc/lsof/00DIALECTS
/usr/local/doc/lsof/00DIST
/usr/local/doc/lsof/00FAQ
/usr/local/doc/lsof/00LSOF-L
/usr/local/doc/lsof/00MANIFEST
/usr/local/doc/lsof/00PORTING
/usr/local/doc/lsof/00QUICKSTART
/usr/local/doc/lsof/00README
/usr/local/doc/lsof/00TEST
/usr/local/doc/lsof/00XCONFIG
/usr/local/doc/lsof/lsof.man
/usr/local/man/man8/lsof.8
[ verifying class <none> ]
Installation of <IBMlsof> was successful.
root@CNISORCLSVR # ./lsof -p 597
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
oracle 597 oracle cwd VDIR 85,5 2048 106299 /export/home/oracle/app/product/9.2.0/dbs
oracle 597 oracle txt VREG 85,5 61272672 2332 /export/home/oracle/app/product/9.2.0/bin/oracle
…………
oracle 597 oracle 260u VREG 85,5 524296192 106517 /export/home/oracle/oradata/xifenfei/system01.dbf
oracle 597 oracle 261u VREG 85,5 134225920 106518 /export/home/oracle/oradata/xifenfei/undotbs01.dbf
…………
oracle 597 oracle 268u VREG 118,70 18253619200 109 /disk (/dev/dsk/c2t600A0B800029CEFA0000036C491B270Bd0s6)
oracle 597 oracle 269u VREG 118,70 134225920 110 /disk (/dev/dsk/c2t600A0B800029CEFA0000036C491B270Bd0s6)
oracle 597 oracle 270u VREG 118,70 9261031424 111 /disk (/dev/dsk/c2t600A0B800029CEFA0000036C491B270Bd0s6)
…………
oracle 597 oracle 293u VREG 118,70 1073750016 14 /disk (/dev/dsk/c2t600A0B800029CEFA0000036C491B270Bd0s6)
到这一步,基本上定位/disk部分是我们需要恢复的数据,从而可以定位到句柄,然后结合数据文件信息,直接使用cp命令恢复出来文件.然后数据库层面recover并且online.
cd /proc/597/fd cp 269 /disk/oradata/cnisora2/CSSN.dbf chown oracle:dba /disk/oradata/xifenfei/CSSN.dbf SQL> recover datafile 10; ORA-00283: 恢复会话因错误而取消 ORA-01124: 无法恢复数据文件 10 - 文件在使用中或在恢复中 ORA-01110: 数据文件 10: '/disk/oradata/xifenfei/CSSN.dbf' SQL> alter database datafile 10 offline; 数据库已更改。 SQL> recover datafile 10; 完成介质恢复。 SQL> alter database datafile 10 online; 数据库已更改。
至此基本上恢复完成,万幸是数据库没有crash,遇到此类问题,千万不要盲目关闭数据库.另外数据库备份重于一切

加我微信(17813235971)
加我QQ(107644445)

