本文共 5426 字,大约阅读时间需要 18 分钟。
[20170302]fuzzy保存在那里.txt
--参考链接:
--提到fuzzy表示某种状态,正常关闭是NO. --从访问的视图看v$datafile_header,应该这个信息保存在数据文件头,找找具体的位置在那里.1.环境:
SYS@book> @ &r/ver BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production--//从冷备份拷贝回来,我这个冷备份是异常关机的.利用异常恢复scn到那里3介绍的方法:
--//链接:recover database until change 13276911100;
recover database ;--//这样2中恢复方式,fuzzy前者是yes,后者是no.通过对比是否可以确定问题.
2.测试1:
SYS@book> recover database until change 13276911100; ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/mnt/ramdisk/book/system01.dbf'SYS@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header where file#=1; FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME ----- ------------------ ------------------- ---------------- ----------------- ---------- ---------------- --- -------------------------------------------------- ------------------------------ 1 13276911100 2017-02-28 14:42:35 7 925702 ONLINE 838 YES /mnt/ramdisk/book/system01.dbf SYSTEM
SYS@book> shutdown immediate ;
ORA-01109: database not open Database dismounted. ORACLE instance shut down.$ cp /mnt/ramdisk/book/tea01.dbf /u01/backup/fuzzy/tea01.dbf_yes
3.测试2:
SYS@book> recover database ; Media recovery complete. SYS@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header where file#=1; FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME ----- ------------------ ------------------- ---------------- ----------------- ---------- ---------------- --- -------------------------------------------------- ------------------------------ 1 13276931100 2017-02-28 14:42:35 7 925702 ONLINE 839 NO /mnt/ramdisk/book/system01.dbf SYSTEM --//关闭数据库分析.$ cp /mnt/ramdisk/book/tea01.dbf /u01/backup/fuzzy/tea01.dbf_no
4.对比:
$ dd if=tea01.dbf_yes of=yes.dd bs=8192 skip=1 count=1 1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 0.000102445 seconds, 80.0 MB/s$ dd if=tea01.dbf_no of=no.dd bs=8192 skip=1 count=1
1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 9.2346e-05 seconds, 88.7 MB/s$ xxd -c 16 yes.dd > yes.txt
$ xxd -c 16 no.dd > no.txt$ diff yes.txt no.txt
2c2 < 0000010: d5ce 0000 0000 0000 0004 200b 6e21 b74f 瘴........ .n!.O --- > 0000010: 8693 0000 0000 0000 0004 200b 6e21 b74f .......... .n!.O 9,10c9,10 < 0000080: 0000 0000 0000 0000 0000 0400 d400 0000 ............?.. < 0000090: 4974 e237 d300 0000 0000 0000 0000 0000 It??.......... --- > 0000080: 0000 0000 0000 0000 0000 0000 d500 0000 ............?.. > 0000090: dc74 e237 d400 0000 0000 0000 0000 0000 躷??.......... 24c24 < 0000170: 0600 0000 0000 0000 0000 0000 0000 0000 ................ --- > 0000170: 0600 0000 0000 0000 0000 0000 fe1b da37 ............?? 31c31 < 00001e0: 0000 0000 fc95 5d17 0300 0000 dbbb db37 ....?].....?? --- > 00001e0: 0000 0000 1ce4 5d17 0300 0000 dbbb db37 .....鋆.....??--通过bbed观察:
--ub2 chkval_kcbh @16 0x9386 -->检查和 --ub4 kcvfhcpc @140 0x000000d5 => d5 = 213 检查记数 --ub4 kcvfhrts @144 0x37e274dc --ub4 kcvfhrft @380 0x37da1bfe--//猜测这个可能性最大:
BBED> p kcvfhsta ub2 kcvfhsta @138 0x0000 (NONE)BBED> assign kcvfhsta=0x0040 Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y ub2 kcvfhsta @138 0x0040 (NONE)
BBED> sum apply
Check value for File 6, Block 1: current = 0x93c6, required = 0x93c6SYS@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header;
FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME ----- ------------------ ------------------- ---------------- ----------------- ---------- ---------------- --- -------------------------------- --------------- 1 13276931100 2017-02-28 14:42:35 7 925702 ONLINE 839 NO /mnt/ramdisk/book/system01.dbf SYSTEM 2 13276931100 2017-02-28 14:42:35 1834 925702 ONLINE 828 NO /mnt/ramdisk/book/sysaux01.dbf SYSAUX 3 13276931100 2017-02-28 14:42:35 923328 925702 ONLINE 749 NO /mnt/ramdisk/book/undotbs01.dbf UNDOTBS1 4 13276931100 2017-02-28 14:42:35 16143 925702 ONLINE 834 NO /mnt/ramdisk/book/users01.dbf USERS 5 13276931100 2017-02-28 14:42:35 952916 925702 ONLINE 745 NO /mnt/ramdisk/book/example01.dbf EXAMPLE 6 13276931100 2017-02-28 14:42:35 13276257767 925702 ONLINE 213 YES /mnt/ramdisk/book/tea01.dbf TEA 6 rows selected.--猜测正确. file#=6 FUZ=YES.
SYS@book> alter database open ;
alter database open * ERROR at line 1: ORA-00600: internal error code, arguments: [3648], [6], [64], [], [], [], [], [], [], [], [], [] --猜测一下[6]估计指数据文件6.--//修改回来.
BBED> set dba 6,1 DBA 0x01800001 (25165825 6,1)BBED> assign kcvfhsta=0x0
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y ub2 kcvfhsta @138 0x0000 (NONE)BBED> sum apply
Check value for File 6, Block 1: current = 0x9386, required = 0x9386SYS@book> select open_mode from v$database ;
OPEN_MODE -------------------- MOUNTEDSYS@book> alter database open ;
Database altered.转载地址:http://efmxo.baihongyu.com/