由於服務器斷電Oracle數據庫啟動報錯:ORA-00333: 重做日志讀取塊 2758 計數 7366 出錯


【環境介紹】

系統環境:windows + Oracle 11GR2 + 單機 +notarhive
 
【背景描述】
業務反饋Oracle數據庫連接不上,報錯信息為ORA-01033錯誤,反饋數據庫登錄不上,咨詢服務器工程師前面出現數據庫斷電然后重啟情況:

該報錯信息解釋為數據庫正在啟動或者數據庫關閉狀態 

[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冷備,這里直接對數據文件拷貝操作,不然后續出現問題無法進行恢復到最初的狀態;

冷備好數據庫后進行修改參數操作:

SQL> create pfile='E:\backup\PFILEHISDB.ora' from spfile;
文件已創建。
對pfile文件添加參數
_allow_resetlogs_corruption=TRUE
*.undo_management='MANUAL'
*.rollback_segments='SYSTEM'
同時修改undo參數,通常事情是redo出問題了,那就意味着有事務沒提交完,那undo必然不一致,所以干脆把undo也改了
 
嘗試啟動數據庫,同時進行recover操作
SQL> startup mount pfile='E:\backup\PFILEHISDB.ora'
ORACLE 例程已經啟動。
Total System Global Area 1954160640 bytes
Fixed Size                  2256464 bytes
Variable Size            1207959984 bytes
Database Buffers          738197504 bytes
Redo Buffers                5746688 bytes
數據庫裝載完畢。
SQL> RECOVER DATABASE until cancel; >>>進行自動recover到時間點
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回滾段損壞參數

C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on 星期三 2月 26 17:29:47 2020
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
已連接到空閑例程。
SQL> startup pfile='E:\backup\PFILEHISDB.ora'
ORACLE 例程已經啟動。
Total System Global Area 2572144640 bytes
Fixed Size                  2257952 bytes
Variable Size            1342180320 bytes
Database Buffers         1207959552 bytes
Redo Buffers               19746816 bytes
數據庫裝載完畢。
數據庫已經打開。
SQL>
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL>
 
現在已經正常啟動,當期是使用品file啟動數據庫,生成spfile文件啟動:
SQL> show parameter pfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
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>
SQL> shutdown immediate
數據庫已經關閉。
已經卸載數據庫。
ORACLE 例程已經關閉。
SQL>
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 3557584896 bytes
Fixed Size                  2260320 bytes
Variable Size            1811940000 bytes
Database Buffers         1728053248 bytes
Redo Buffers               15331328 bytes
數據庫裝載完畢。
數據庫已經打開。
SQL>
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL>
至此數據庫啟動正常,業務測試連接正常。
 
查看數據庫日志信息發現存在報錯:
ORA-12012: 自動執行作業 4 出錯
ORA-01552: 非系統表空間 'HTHIS' 不能使用系統回退段
 
[oracle@oslatm ~]$ oerr ora 01552
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表空間進行重建及修改為undo自動管理模式: 
SQL> show parameter undo
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      MANUAL
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1
SQL> set linesize 200
SQL> col file_name for a100
SQL> select file_name,bytes/1024/1024 from dba_data_files where TABLESPACE_NAME like'%UNDO%';
FILE_NAME                                                                                            BYTES/1024/1024
---------------------------------------------------------------------------------------------------- ---------------
E:\TESTDBDATA\HISDB\UNDOTBS01.DBF                                                                    2048
SQL>create undo tablespace undotbs2 datafile 'E:\FSZYYDATA\HISDB\UNDOTBS02.DBF' size 2G;
表空間已創建。
SQL>
SQL> alter system set undo_tablespace=undotbs2 scope=spfile;
系統已更改。
SQL> alter system set undo_management=auto scope=spfile;
系統已更改。
SQL> shutdown immediate
數據庫已經關閉。
已經卸載數據庫。
ORACLE 例程已經關閉。
SQL>
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 1954160640 bytes
Fixed Size                  2256464 bytes
Variable Size            1207959984 bytes
Database Buffers          738197504 bytes
Redo Buffers                5746688 bytes
數據庫裝載完畢。
數據庫已經打開。
SQL> show parameter undo
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS2
SQL> show parameter spfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      D:\APP\ADMINISTRATOR\PRODUCT\1
                                                 1.2.0\DBHOME_1\DATABASE\SPFILE
                                                 HISDB.ORA
SQL>
 
查看隱含參數信息
SQL> col name for a35
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%'
NAME                                DESCRIPTION                                                        VALUE
----------------------------------- ------------------------------------------------------------------ ------------------------------
_allow_resetlogs_corruption         allow resetlogs even if it will cause corruption                   FALSE
SQL>
 
 

 【總結】

1,在數據庫異常修復時,建議進行備份操作;

2,建議對數據庫開啟歸檔操作;

3,建議定期對數據庫進行備份操作。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM