在网上看到一个案例UNDO tablespace被误删除,并且shutdown abort数据库.然后再启动数据库都会报下面的错:

Undo initialization finished serial:0 start:161968634 end:161968684 diff:50 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is UTF8
Errors in file /u01/app/diag/rdbms/primary/primary/trace/primary_ora_13747.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: ‘/u01/app/oradata/undotbs1.dbf’
Errors in file /u01/app/diag/rdbms/primary/primary/trace/primary_ora_13747.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: ‘/u01/app/oradata/undotbs1.dbf’
Error 604 happened during db open, shutting down database
USER (ospid: 13747): terminating the instance due to error 604
Instance terminated by USER, pid = 13747
ORA-1092 signalled during: alter database open…
opiodr aborting process unknown ospid (13747) as a result of ORA-1092
Wed Jul 31 18:06:08 2013
ORA-1092 : opitsk aborting process

下面是尝试解决方法:

1.发现在执行recursive SQL level 1的时候报错,所以我们需要通过10046看看在执行什么sql报错的

alter session set events  ’10046 trace name context forever,level 12′;
alter session set db_file_multiblock_read_count=1;

alter database open;然后会生成一个tracefile

2.tracefile内容

PARSING IN CURSOR #47510118633584 len=102 dep=1 uid=0 oct=3 lid=0 tim=1375265166576545 hv=3967354608 ad=’687e34d8′ sqlid=’axmdf8vq7k1rh’
select increment$$,minvalue,maxvalue,cycle#,order$$,cache,highwater,audit$$,flags from seq$$ where obj#=:1
END OF STMT
PARSE #47510118633584:c=8999,e=8834,p=2,cr=27,cu=0,mis=1,r=0,dep=1,og=4,plh=0,tim=1375265166576543
BINDS #47510118633584:
Bind#0
 oacdty=02 mxl=22(22) mxlc=00 mal=00 scl=00 pre=00
 oacflg=00 fl2=0001 frm=00 csi=00 siz=24 off=0
 kxsbbbfp=2b35cfbe7b78  bln=22  avl=03  flg=05
 value=1172
EXEC #47510118633584:c=1000,e=1213,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=4,plh=2203911306,tim=1375265166577898
WAIT #47510118633584: nam=’db file sequential read’ ela= 134 file#=1 block#=705 blocks=1 obj#=79 tim=1375265166578720
WAIT #47510118633584: nam=’db file sequential read’ ela= 20 file#=1 block#=665 blocks=1 obj#=74 tim=1375265166579003
WAIT #47510118633584: nam=’control file sequential read’ ela= 45 file#=0 block#=1 blocks=1 obj#=74 tim=1375265166579478
WAIT #47510118633584: nam=’control file sequential read’ ela= 134 file#=0 block#=16 blocks=1 obj#=74 tim=1375265166579747
WAIT #47510118633584: nam=’control file sequential read’ ela= 93 file#=0 block#=18 blocks=1 obj#=74 tim=1375265166579921
WAIT #47510118633584: nam=’control file sequential read’ ela= 10 file#=0 block#=23 blocks=1 obj#=74 tim=1375265166580002
WAIT #47510118633584: nam=’control file sequential read’ ela= 8 file#=0 block#=1 blocks=1 obj#=74 tim=1375265166580171
WAIT #47510118633584: nam=’control file sequential read’ ela= 6 file#=0 block#=16 blocks=1 obj#=74 tim=1375265166580215
WAIT #47510118633584: nam=’control file sequential read’ ela= 7 file#=0 block#=18 blocks=1 obj#=74 tim=1375265166580235
WAIT #47510118633584: nam=’control file sequential read’ ela= 9 file#=0 block#=32 blocks=1 obj#=74 tim=1375265166580257
DDE rules only execution for: ORA 1110
—– START Event Driven Actions Dump —-
—- END Event Driven Actions Dump —-
—– START DDE Actions Dump —–
Executing SYNC actions
—– START DDE Action: ‘DB_STRUCTURE_INTEGRITY_CHECK’ (Async) —–
Successfully dispatched
—– END DDE Action: ‘DB_STRUCTURE_INTEGRITY_CHECK’ (SUCCESS, 1 csec) —–
Executing ASYNC actions
—– END DDE Actions Dump (total 1 csec) —–
FETCH #47510118633584:c=2999,e=11520,p=2,cr=2,cu=0,mis=0,r=0,dep=1,og=4,plh=2203911306,tim=1375265166589486
STAT #47510118633584 id=1 cnt=0 pid=0 pos=1 obj=74 op=’TABLE ACCESS BY INDEX ROWID SEQ$$ (cr=0 pr=0 pw=0 time=153 us)’
STAT #47510118633584 id=2 cnt=1 pid=1 pos=1 obj=79 op=’INDEX UNIQUE SCAN I_SEQ1 (cr=1 pr=1 pw=0 time=579 us)’
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: ‘/u01/app/oradata/undotbs1.dbf’
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 3 cannot be read at this time
ORA-01110: data file 3: ‘/u01/app/oradata/undotbs1.dbf’

在上面你可以看到在读到file1,block 705,665的时候报错,应该是里面有未提交的事物,下面就可以通过bbed来简单的修复

3.通过bbed来修复,需先找一个原datafile 1的文件

BBED> info
File#  Name                                                        Size(blks)
—–  —-                                                        ———-
    1  /u01/app/oradata/system.dbf                                      64000
    2  /u01/app/oradatabak/system.dbf                                   64000

BBED> copy dba 2,665 to dba 1,665
File: /u01/app/oradata/system.dbf (1)
Block: 665              Offsets:    0 to  511           Dba:0×00400299
————————————————————————
06a20000 99024000 0c8f0600 00000106 64710000 01000000 4a000000 0a8f0600
00000000 02000200 00000000 02000900 e7000000 9400c000 57000e00 01200000
0b8f0600 04000d00 e2000000 a804c000 3f001b00 01200000 0c8f0600 00016200
ffffd600 e6015103 51030000 6200571f 191fd11e 8f1ee903 041eb81d 6c1d2c04
211dd71c 8d1c431c 021cc11b 7f1b351b ea1aa91a 681a1f1a d6198d19 4319f918
b0186618 1c18d317 91174b17 0b17c516 7b163116 e7159d15 51151015 cf148414
3914ee13 a3136113 1713cd12 82123712 ed11a211 58110e11 c4107a10 3010e60f
9c0f5b0f 1a0fd90e 980e570e 160ee601 870d7302 f30ca90c 5f0cbe02 0903820b
390bef0a a90a680a 270ae609 a1095809 0e09c408 7a083008 e6079c07 52070807
be067406 2a06e005 96054c05 0205b704 6c040000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 0000002c 000a03c2
333102c1 0202c102 0fce6464 64646464 64646464 64646464 01800180 02c20203
c2020220 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d
2d2d2d2d 01802c00 0a03c233 2f02c102 02c1020f ce646464 64646464 64646464
64646401 80018002 c20203c2 0202202d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d
2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d01 802c000a 03c2332e 02c10202 c1020fce

<32 bytes per line>

BBED> copy dba 2,705 to dba 1,705
File: /u01/app/oradata/system.dbf (1)
Block: 705              Offsets:    0 to  511           Dba:0x004002c1
————————————————————————
06a20000 c1024000 cf6e0500 00000106 12b40000 02000000 4f000000 ce6e0500
00000000 02000200 00000000 00000000 00000000 00000000 00000000 00000000
00000000 07001100 d2000000 6a23c000 38000500 01200000 cf6e0500 00008001
00000000 86003001 fd18cd17 00000000 00000000 00000000 06000000 601f0000
551f491f 3d1f311f 251f191f 0d1f011f f51ee91e dd1ed11e c51eb91e ad1ea11e
951e891e 7d1e711e 651e591e 4d1e411e 351e291e 1d1e111e 051ef91d ed1de11d
d51dc91d bd1db11d a51d991d 8d1d811d 751d691d 5d1d511d 451d391d 2d1d211d
151d091d fd1cf11c e51cd91c cd1cc11c b51ca91c 9d1c911c 851c791c 6d1c611c
551c491c 3d1c311c 251c191c 0d1c011c f51be91b dd1bd11b c51bb91b ad1ba11b
951b891b 7d1b711b 651b591b 4d1b411b 351b291b 1d1b111b 051bf91a ed1ae11a
d51ac91a bd1ab11a a51a991a 8d1a811a 751a691a 5c1a4f1a 421a351a 281a1b1a
0e1a011a f419e719 da19cd19 c019b319 a6199919 8c197f19 72196519 58194b19
3e193119 24191719 0a19fd18 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> sum apply;
Check value for File 1, Block 705:
current = 0xb412, required = 0xb412

BBED> verify
DBVERIFY – Verification starting
FILE = /u01/app/oradata/system.dbf
BLOCK = 705
DBVERIFY – Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 1
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0
Message 531 not found;  product=RDBMS; facility=BBED
BBED> copy dba 2,665 to dba 1,665
File: /u01/app/oradata/system.dbf (1)
Block: 665              Offsets:    0 to  511           Dba:0×00400299
————————————————————————
06a20000 99024000 0c8f0600 00000106 64710000 01000000 4a000000 0a8f0600
00000000 02000200 00000000 02000900 e7000000 9400c000 57000e00 01200000
0b8f0600 04000d00 e2000000 a804c000 3f001b00 01200000 0c8f0600 00016200
ffffd600 e6015103 51030000 6200571f 191fd11e 8f1ee903 041eb81d 6c1d2c04
211dd71c 8d1c431c 021cc11b 7f1b351b ea1aa91a 681a1f1a d6198d19 4319f918
b0186618 1c18d317 91174b17 0b17c516 7b163116 e7159d15 51151015 cf148414
3914ee13 a3136113 1713cd12 82123712 ed11a211 58110e11 c4107a10 3010e60f
9c0f5b0f 1a0fd90e 980e570e 160ee601 870d7302 f30ca90c 5f0cbe02 0903820b
390bef0a a90a680a 270ae609 a1095809 0e09c408 7a083008 e6079c07 52070807
be067406 2a06e005 96054c05 0205b704 6c040000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 0000002c 000a03c2
333102c1 0202c102 0fce6464 64646464 64646464 64646464 01800180 02c20203
c2020220 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d
2d2d2d2d 01802c00 0a03c233 2f02c102 02c1020f ce646464 64646464 64646464
64646401 80018002 c20203c2 0202202d 2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d2d
2d2d2d2d 2d2d2d2d 2d2d2d2d 2d2d2d01 802c000a 03c2332e 02c10202 c1020fce

<32 bytes per line>

BBED> sum apply
Check value for File 1, Block 665:
current = 0×7164, required = 0×7164

BBED> verify
DBVERIFY – Verification starting
FILE = /u01/app/oradata/system.dbf
BLOCK = 665
DBVERIFY – Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 1
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
Message 531 not found;  product=RDBMS; facility=BBED
BBED> exit

[oracle@dg1 lib]$$ sqlplus ‘/as sysdba’;

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 31 18:31:11 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2225064 bytes
Variable Size             159386712 bytes
Database Buffers           50331648 bytes
Redo Buffers                5214208 bytes
Database mounted.
Database opened.
SQL>

修改后就可以直接打开,你也可以dump出来去修改itl的信息.

转载于:https://blog.51cto.com/vicry21/1329953

BBED修复DB启动问题相关推荐

  1. 04 bbed修复system文件头损坏

    04 bbed修复system文件头损坏 1 启动数据库,查看trace,在mount到open, SQL> startup mount; ORACLE instance started.Tot ...

  2. PostgreSQL 恢复大法 - 恢复部分数据库、跳过坏块、修复无法启动的数据库

    标签 PostgreSQL , 恢复部分数据库 , 跳过坏块 , 修复无法启动的数据库 , 时间点恢复 , 逻辑备份 , 连续备份 背景 一个较大的数据库,如何只恢复一部分数据(例如只恢复某个DB). ...

  3. 当年修复Linux启动菜单的笔记

    2019独角兽企业重金招聘Python工程师标准>>> window跟ubuntu双系统,安装window丢失Linuxgrub引导,用刻有ubuntu的光盘或者U盘进入终端修复Li ...

  4. 重装windows后 用live cd修复ubuntu启动gurb

    一般安装windows 和 linux双系统, 都是先安装windows, 然后安装linux, 那么linux的grub安装会加入windows启动的选项, 开机时就能选择启动进入哪个系统了. 但是 ...

  5. grub引导项修复详解_重新安装win7后,修复Grub启动项

    重新安装win7后,修复Grub启动项 发布时间:2010-09-14 22:14:00来源:红联作者:null925 [i=s] 本帖最后由 null925 于 2010-9-14 22:18 编辑 ...

  6. 修复win10启动项

    使用bcdboot修复win10启动项 修复前计算机状态: 只有win10系统分区,没有EFI分区 步骤: 1.使用DiskGenius创建一个100MB的EFI分区. 2.关闭计算机,插入系统盘,并 ...

  7. 台式电脑计算机无法启动 启动修复,Win10启动修复无法修复你的电脑解决方法

    方法一: 关闭安全启动看能否进系统,进入BIOS内Security选项卡中Secure Boot从Enabled更改为Disabled,具体操作如下: 以联想电脑为例: 1.lenovo笔记本按&qu ...

  8. linux修复uefi启动文件,uefi-gpt-linux修复grub rescue

    搜了点网上的资料.发现都是修复MBR分区的.我的电脑是GPT分区+UEFI.虽然不同.但也大同小异. 出现grub rescue模式一般是硬盘分区出现变动.导致旧的grub找不到启动文件而出现的. 错 ...

  9. centos光盘修复引导_CentOs7 修复 引导启动

    一.修复MBR: MBR(Master Boot Record主引导记录): 硬盘的0柱面.0磁头.1扇区称为主引导扇区.其中446Byte是bootloader,64Byte为Partition t ...

最新文章

  1. c语言 北京时间转换utc时间_mysql之unix时间戳和正常时间格式之间的转换
  2. python代码大全o-Python实现的一个自动售饮料程序代码分享
  3. 使用 icon 字体图标出现小方块问题
  4. CAN总线基础(二)
  5. [转](传输层)UDP协议
  6. php 定义函数和访问,PHP-预定义函数访问数据库
  7. 计算机基础:存储系统知识笔记(二)
  8. 使用 ale.js 制作一个小而美的表格编辑器(1)
  9. 【操作系统】—内存的基本知识
  10. 4. mac xdebug
  11. Docker入门之安装与卸载
  12. jQuery的文档操作
  13. BT种子结构及bencoding编码解析
  14. 小甲鱼python飞机大战素材_用Python做飞机大战(含素材)
  15. 【labelme】数据标注工具
  16. [024] 欢迎大家关注我的微信公众帐号小q机器人(xiaoqrobot)
  17. C语言真的很难吗?那是你没看这张图,化整为零轻松学习C语言。
  18. 查看电脑可支持最大内存容量的方法
  19. 公博评级06代表什么_钱币公博评级上72(05)什么意思?
  20. WPS Excel表格日期转文本 为数字问题

热门文章

  1. PHP实现将任意尺寸的图片裁剪后等比缩放到任意尺寸的透明图片上,并实现图片翻转...
  2. MVC (ModelBinder等)技巧
  3. Lintcode363 Trapping Rain Water solution 题解
  4. 视频监控为校园安全插上“隐形的翅膀”
  5. 用margin还是用padding
  6. 动效设计的物理法则:动画的一切皆在于时间点和空间幅度(转)
  7. java连接sqlserver 2005执行存储过程的几种情况
  8. 两台电脑之间用网线之间传文件
  9. Android 获取keystore SHA1方法
  10. mysql和redis的区别