由于服务器断电Oracle数据库启动报错:ORA-00333: 重做日志读取块 2758 计数 7366 出错
【环境介绍】
该报错信息解释为数据库正在启动或者数据库关闭状态
[oracle@alllinux ~]$ oerr ora 01033
01033, 00000, "ORACLE initialization or shutdown in progress"
// *Cause: An attempt was made to log on while Oracle is being started up
// or shutdown.
// *Action: Wait a few minutes. Then retry the operation.
【问题处理】
根据无法连接数据库,登录数据库查看数据库是否异常,查看open_mode状态为mount的状态,尝试使用alter database open,尝试打开数据库,报错信息为:
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-00333: 重做日志读取块 2758 计数 7366 出错
报错描述为磁盘IO损坏导致读取日志文件时报错,当前数据库是没有开启归档,建议是进行restore方法或者拷贝其他的备份文件,当前数据库没有进行备份;
查询资料对于这个报错可以修改隐含参数_allow_resetlogs_corruption=TRUE 尝试强制重启
[oracle@oslatm ~]$ oerr ora 00333
00333, 00000, "redo log read error block %s count %s"
// *Cause: An IO error occurred while reading the log described in the
// accompanying error.
// *Action: Restore accessibility to file, or get another copy of the file.
[oracle@oslatm ~]$
由于没有备份,建议当前对数据库进行shutdown冷备,这里直接对数据文件拷贝操作,不然后续出现问题无法进行恢复到最初的状态;
冷备好数据库后进行修改参数操作:
*.undo_management='MANUAL'
*.rollback_segments='SYSTEM'
ORACLE 例程已经启动。
Fixed Size 2256464 bytes
Variable Size 1207959984 bytes
Database Buffers 738197504 bytes
Redo Buffers 5746688 bytes
数据库装载完毕。
ORA-00279: 更改 11817660 (在 02/26/2020 11:06:42 生成) 对于线程 1 是必需的
ORA-00289: 建议:
D:\APP\ADMINISTRATOR\FAST_RECOVERY_AREA\HISDB\ARCHIVELOG\2020_02_26\O1_MF_1
_389_%U_.ARC
ORA-00280: 更改 11817660 (用于线程 1) 在序列 #389 中
指定日志: {<RET>=suggested | filename | AUTO | CANCEL}
ORA-00308: 无法打开归档日志
'D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\RDBMS\ARC0000002478_0975754895.000
1'
ORA-27041: 无法打开文件
OSD-04002: 无法打开文件
O/S-Error: (OS 2) 系统找不到指定的文件。
ORA-01547: 警告: RECOVER 成功但 OPEN RESETLOGS 将出现如下错误
ORA-01194: 文件 1 需要更多的恢复来保持一致性
ORA-01110: 数据文件 1: 'E:\FSZYYDATA\HISDB\SYSTEM01.DBF'
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [2662], [2888], [676729259], [2888],
[676735192], [12583040], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [2662], [2888], [676729258], [2888],
[676735192], [12583040], [], [], [], [], [], []
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [2662], [2888], [676729256], [2888],
[676735192], [12583040], [], [], [], [], [], []
进程 ID: 1092
会话 ID: 1144 序列号: 5
尝试使用resetlogs方式打开数据库时候出现报错:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [2662], [2888], [676729259], [2888],
[oracle@oslatm ~]$ oerr ORA 00603
00603, 00000, "ORACLE server session terminated by fatal error"
// *Cause: An Oracle server session was in an unrecoverable state.
// *Action: Log in to Oracle again so a new server session will be created
// automatically. Examine the session trace file for more
// information.
[oracle@oslatm ~]$
查询资料建议添加参数*._corrupted_rollback_segments=true undo回滚段损坏参数
ORACLE 例程已经启动。
Fixed Size 2257952 bytes
Variable Size 1342180320 bytes
Database Buffers 1207959552 bytes
Redo Buffers 19746816 bytes
数据库装载完毕。
数据库已经打开。
SQL>
--------------------
READ WRITE
------------------------------------ ----------- ------------------------------
spfile string
SQL>
SQL> create spfile='D:\app\Administrator\product\11.2.0\dbhome_1\database\SPFILEHISDB.ORA' from pfile='E:\backup\PFILEHISDB.ora';
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL>
SQL> startup
ORACLE 例程已经启动。
Fixed Size 2260320 bytes
Variable Size 1811940000 bytes
Database Buffers 1728053248 bytes
Redo Buffers 15331328 bytes
数据库装载完毕。
数据库已经打开。
SQL>
SQL> select open_mode from v$database;
--------------------
READ WRITE
ORA-01552: 非系统表空间 'HTHIS' 不能使用系统回退段
01552, 00000, "cannot use system rollback segment for non-system tablespace '%s'"
// *Cause: Tried to use the system rollback segment for operations involving
// non-system tablespace. If this is a clone database then this will
// happen when attempting any data modification outside of the system
// tablespace. Only the system rollback segment can be online in a
// clone database.
// *Action: Create one or more private/public segment(s), shutdown and then
// startup again. May need to modify the INIT.ORA parameter
// rollback_segments to acquire private rollback segment. If this is
// a clone database being used for tablspace point in time recovery
// then this operation is not allowed. If the non-system tablespace
// has AUTO segment space management, then create an undo tablespace.
[oracle@oslatm ~]$
------------------------------------ ----------- ------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> col file_name for a100
SQL> select file_name,bytes/1024/1024 from dba_data_files where TABLESPACE_NAME like'%UNDO%';
---------------------------------------------------------------------------------------------------- ---------------
E:\TESTDBDATA\HISDB\UNDOTBS01.DBF 2048
SQL>
SQL> alter system set undo_tablespace=undotbs2 scope=spfile;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL>
SQL> startup
ORACLE 例程已经启动。
Fixed Size 2256464 bytes
Variable Size 1207959984 bytes
Database Buffers 738197504 bytes
Redo Buffers 5746688 bytes
数据库装载完毕。
数据库已经打开。
SQL> show parameter undo
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS2
------------------------------------ ----------- ------------------------------
spfile string D:\APP\ADMINISTRATOR\PRODUCT\1
1.2.0\DBHOME_1\DATABASE\SPFILE
HISDB.ORA
SQL>
SQL> col description for a66
SQL> col value for a30
SQL> SELECT i.ksppinm name,
2 i.ksppdesc description,
3 CV.ksppstvl VALUE
4 FROM sys.x$ksppi i, sys.x$ksppcv CV
5 WHERE i.inst_id = USERENV ('Instance')
6 AND CV.inst_id = USERENV ('Instance')
7 AND i.indx = CV.indx
8 AND i.ksppinm LIKE '%&keyword%'
9 ORDER BY 1;
Enter value for keyword: allow_resetlog
old 8: AND i.ksppinm LIKE '%&keyword%'
new 8: AND i.ksppinm LIKE '%allow_resetlog%'
----------------------------------- ------------------------------------------------------------------ ------------------------------
_allow_resetlogs_corruption allow resetlogs even if it will cause corruption FALSE
【总结】
1,在数据库异常修复时,建议进行备份操作;
2,建议对数据库开启归档操作;
3,建议定期对数据库进行备份操作。