ORACLE 断电启动报 ORA-00600

由于服务器断电,启动 oracle 时报 ORA-00600 错误

查看 oracle trace 日志

  1. 执行 sqlplus 登录 oracle
1
sqlplus / as sysdba
  1. 启动,报错信息如下
1
2
3
4
5
6
7
8
9
10
11
SQL> startup
ORACLE instance started.

Total System Global Area 583008256 bytes
Fixed Size 2022504 bytes
Variable Size 184550296 bytes
Database Buffers 394264576 bytes
Redo Buffers 2170880 bytes
Database mounted.
ORA-00607: Internal error occurred while making a change to a data block
ORA-00600: internal error code, arguments: [4194], [22], [39], [], [], [], [],[]
  1. 找到 alert 日志
1
SQL> show parameter dump

红圈部分即为 oracle alert 日志路径

  1. 查看 alert 日志
1
2
cd /opt/oracle/app/diag/rdbms/orcl/orcl/trace/
less alert_orcl.log

大概报错信息如下:

  1. 挂载oracle
1
SQL> startup mount
  1. 设置undo表空间的管理方式为:手工,缺省undotbs 为空,实际上使用了 system 回滚段。
1
2
3
4
5
6
7
8
9
10
11
12
13
SQL> alter system set undo_management = manual scope=spfile;
System altered.
SQL> alter system set undo_tablespace='' scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 583008256 bytes
Fixed Size 2022504 bytes
Variable Size 184550296 bytes
Database Buffers 394264576 bytes
Redo Buffers 2170880 bytes
Database mounted.
Database opened.
  1. 查询原始 undo 表空间路径
1
SQL> select file_name, tablespace_name from dba_data_files;
  1. 创建新的undo表空间
1
SQL> create undo tablespace undotbs1 datafile 'E:\app\Administrator\oradata\RIS\undotbs01.dbf' size 100M;
  1. 设置undo管理方式为 ’自动‘:
1
2
3
SQL> alter system set undo_management =auto scope=spfile;

System altered.
  1. 设置undotbs 为新建的undotbs2:
1
2
3
SQL> alter system set undo_tablespace = undotbs2 scope=spfile;

System altered.
  1. 删除原来损坏的undo表空间 :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
SQL> drop tablespace undotbs02 including contents and datafiles;

Tablespace dropped.

SQL> startup force;
ORACLE instance started.

Total System Global Area 583008256 bytes
Fixed Size 2022504 bytes
Variable Size 234881944 bytes
Database Buffers 343932928 bytes
Redo Buffers 2170880 bytes
Database mounted.
Database opened.

shutdown immediate

如果这时程序查询或者保时报错:ORA-00600 [kdsgrp1]ORA-00600 [6002] 大概率是表的索引出问题了,需要重新创建索引来修复。

ORA-600的3020错误

最近遇到一则ORA-600的3020错误,数据库在故障恢复中,应用归档日志时遇到3020错误:

1
2
3
4
5
6
7
8
9
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement:
alter database recover logfile '/arch/prod1_2711_681480148.arc'
ORA-00283: recovery session canceled due to errors
ORA-12801: error signaled in parallel query server P011, instance hpdb1:PROD1 (1)
ORA-00600: internal error code, arguments: [3020], [37], [94633], [2], [3659], [604], [16], []
ORA-10567: Redo is inconsistent with data block (file# 37, block# 94633)
ORA-10564: tablespace APPS_UNDOTS2
ORA-01110: data file 37

出现这个错误后,恢复中断,无法继续,3020错误在Metalink上的解释,主要原因是:

1
2
3
This is called a 'STUCK RECOVERY'.
There is an inconsistency between the information stored in the redo
and the information stored in a database block being recovered.

也就是说,在恢复时发现Redo里面记录的信息和被恢复的数据块信息不一致,导致恢复无法继续。比如Update Some record from 3 to 2,结果发现该记录根本不是3,恢复无法继续。

这个错误可能是由于写Redo的某个操作丢失,这可能是由于异常宕机或存储故障导致的。

This error can be reported if any of these updates are lost for some reason.

出现这个错误,如果没有备份,数据也不是特别重要,则可以通过一些隐含参数或强制手段来打开数据库,不过不可避免的会出现数据损失,Olive做过一次这样的尝试 。
经过验证的可实践方式是使用:

recover database using backup controlfile allow 1 corruption;

将不一致的块标记为损坏,然后可以执行进一步的恢复尝试。

这次处理这个案例,最后选择了不完全恢复,可以多执行几次。

原文作者: dgb8901,yinxing

原文链接: https://www.itwork.club/2022/10/11/oracle-rudo/

版权声明: 转载请注明出处

为您推荐

体验小程序「简易记账」

关注公众号「特想学英语」

CAP 理论与BASE 理论