Chinaunix首页 | 论坛 | 博客
  • 博客访问: 137384
  • 博文数量: 25
  • 博客积分: 460
  • 博客等级: 下士
  • 技术积分: 252
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-11 10:48
个人简介

努力学习,谦虚请教,不断提升!

文章分类

全部博文(25)

文章存档

2015年(3)

2014年(4)

2013年(3)

2012年(9)

2011年(6)

我的朋友

分类: Oracle

2014-08-28 10:36:30

公司一台数据库服务器长时间没用,今天准备要用时却发现启动数据库时报错,整个解决过程如下:

[oracle@ipmp130 ~]$ sqlplus '/as sysdba'


SQL*Plus: Release 11.2.0.1.0 Production on Thu Aug 28 09:31:34 2014


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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> startup
ORACLE instance started.


Total System Global Area 2137886720 bytes
Fixed Size                  2215064 bytes
Variable Size            1610613608 bytes
Database Buffers          520093696 bytes
Redo Buffers                4964352 bytes
Database mounted.
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 17688 change 94518137 time 02/18/2014
14:31:28
ORA-00312: online log 3 thread 1:
'/home/oracle/oracle/oradata/ora11g/redo03.log'


执行清楚损坏的日志文件,但结果失败;
SQL> alter database clear unarchived logfile group 3 ;
alter database clear unarchived logfile group 3
*
ERROR at line 1:
ORA-01624: log 3 needed for crash recovery of instance ora11g (thread 1)
ORA-00312: online log 3 thread 1:
'/home/oracle/oracle/oradata/ora11g/redo03.log'


然后采用【不完全恢复】
先加入隐含参数
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile ;


System altered.


SQL> alter system set "_allow_terminal_recovery_corruption"=true scope=spfile ;


System altered.


这两个参数,如果忘了或者记不全,也不要紧,可以从固定表X$KSPPI中查到:


SQL> select  ksppinm,ksppdesc from x$ksppi where ksppinm like '\_allow%' escape '\';


KSPPINM
--------------------------------------------------------------------------------
KSPPDESC
--------------------------------------------------------------------------------
_allow_error_simulation
Allow error simulation for testing


_allow_resetlogs_corruption
allow resetlogs even if it will cause corruption


_allow_terminal_recovery_corruption
Finish terminal recovery even if it may cause corruption




KSPPINM
--------------------------------------------------------------------------------
KSPPDESC
--------------------------------------------------------------------------------
_allow_read_only_corruption
allow read-only open even if database is corrupt


_allow_drop_snapshot_standby_grsp
Allow dropping snapshot standby guaranteed restore point


_allow_commutativity
allow for commutativity of +, * when comparing expressions




KSPPINM
--------------------------------------------------------------------------------
KSPPDESC
--------------------------------------------------------------------------------
_allow_level_without_connect_by
allow level without connect by


_allow_cell_smart_scan_attr
Allow checking smart_scan_capable Attr


8 rows selected.


开始进行不完全恢复:
SQL>  recover database until cancel;
ORA-00279: change 94515320 generated at 02/18/2014 14:31:03 needed for thread 1
ORA-00289: suggestion :
/home/oracle/oracle/flash_recovery_area/ORA11G/archivelog/2014_08_28/o1_mf_1_180
3_%u_.arc
ORA-00280: change 94515320 for thread 1 is in sequence #1803




Specify log: {=suggested | filename | AUTO | CANCEL}


ORA-00308: cannot open archived log
'/home/oracle/oracle/flash_recovery_area/ORA11G/archivelog/2014_08_28/o1_mf_1_18
03_%u_.arc'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3




ORA-10879: error signaled in parallel recovery slave
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: '/home/oracle/oracle/oradata/ora11g/system01.dbf'




SQL> recover database until cancel;
ORA-00275: media recovery has already been started


恢复完成之后,再用resetlogs打开数据库:
SQL> alter database open resetlogs ;


Database altered.


SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.


Total System Global Area 2137886720 bytes
Fixed Size                  2215064 bytes
Variable Size            1610613608 bytes
Database Buffers          520093696 bytes
Redo Buffers                4964352 bytes
Database mounted.
Database opened.


参考文章:http://www.itpub.net/thread-363335-1-1.html
阅读(1307) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~