oracle断电后,数据库无法启动 ora 00354 00353 00312错误

本文详细记录了在Linux环境下,因主机断电导致Oracle数据库无法启动的问题解决过程。通过清理坏的日志、设置参数允许数据库恢复、进行不完全恢复、重建undo表空间等步骤,最终成功启动数据库。

测试机数据库装在linux虚拟机上,主机断电导致数据库无法启动

先启动监听

./lsnrctl start

登陆sqlplus

./sqlplus /nolog

SQL> conn / as sysdba

SQL> starup

默认方式启动数据库,报如下错误

ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 21176 change 5503243 time 09/20/2018
00:49:58
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/orcl/redo03.log'

首先清理坏的日志

SQL> alter database clear unarchived logfile group 3 ;

报错如下

alter database clear unarchived logfile group 3
*
ERROR 位于第 1 行:
ORA-01624: 线程3的紧急恢复需要日志1
ORA-00312: 联机日志 3 线程 1: 'D:ORACLEORADATARMANREDO03.LOG'

无法完全恢复,只有执行不完全恢复

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

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

SQL> shutdown abort ;

SQL>startup

SQL> recover database until cancel;

cancel

SQL> recover database until cancel;

auto

不完全恢复完毕,报错ora 00600还是无法启动

到目前位置,争取以牺牲部分数据作为代价,保证数据库能正常启动,采取重建undo表空间的策略

------------------------------------------------------------------------------------------------------------------------------------------------------------

SQL>startup mount;

ORACLE instance started.

Total System Global Area 5010685952 bytes
Fixed Size                  2691904 bytes
Variable Size            1090522304 bytes
Database Buffers         3909091328 bytes
Redo Buffers                8380416 bytes
Database mounted.
SQL> show parameter undo;

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
temp_undo_enabled                    boolean
FALSE
undo_management                      string
AUTO
undo_retention                       integer
900
undo_tablespace                      string
UNDOTBS1
SQL> alter system set undo_management=manual scope=spfile;

System altered.

SQL> shutdown immediate;

SQL> startup
ORACLE instance started.

Total System Global Area 5010685952 bytes
Fixed Size                  2691904 bytes
Variable Size            1090522304 bytes
Database Buffers         3909091328 bytes
Redo Buffers                8380416 bytes
Database mounted.
Database opened.
SQL>  create undo tablespace undotbs2 datafile '/u01/app/oracle/oradata/orcl/undotbs02.dbf' size 100m autoextend on maxsize 2g;

Tablespace created.

SQL> alter system set undo_tablespace=undotbs2 scope=spfile;

System altered.

SQL> drop tablespace undotbs1 including contents and datafiles;

Tablespace dropped.

SQL> create undo tablespace undotbs1 datafile '/u01/app/oracle/oradata/orcl/undotbs01.dbf' size 100m autoextend on maxsize 2g;

Tablespace created.

SQL> alter system set undo_tablespace=undotbs1 scope=spfile;

System altered.

SQL> drop tablespace undotbs2 including contents and datafiles;

Tablespace dropped.

SQL> show parameter undo;

NAME                                 TYPE
------------------------------------ ----------------------
VALUE
------------------------------
temp_undo_enabled                    boolean
FALSE
undo_management                      string
MANUAL
undo_retention                       integer
900
undo_tablespace                      string
UNDOTBS1
SQL> alter system set undo_management=auto scope=spfile;

System altered.

SQL> shutdown immediate

SQL> exit
Disconnected
[oracle@localhost bin]$ ./lsnrctl stop

[oracle@localhost bin]$ ./lsnrctl start

[oracle@localhost bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Thu Sep 20 10:38:51 2018

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

SQL> conn / as sysdba
Connected to an idle instance.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 5010685952 bytes
Fixed Size                  2691904 bytes
Variable Size            1090522304 bytes
Database Buffers         3909091328 bytes
Redo Buffers                8380416 bytes
Database mounted.
Database opened.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值