ORA-00376:file x cannot be read at this time
Posted yunweiyipai
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORA-00376:file x cannot be read at this time相关的知识,希望对你有一定的参考价值。
问题背景:
客户数据库遭遇机房断电情况
之前出现过机房断电情况,重启数据库后发现出现ORA-00376的错误。
问题解决:
通过查询数据文件状态:
1 SQL> select file_id,online_status from dba_data_files order by 1; 2 3 FILE_ID ONLINE_STATUS 4 ---------- ------------- 5 1 SYSTEM 6 2 ONLINE 7 3 ONLINE 8 4 ONLINE 9 5 RECOVER 10 6 ONLINE 11 7 RECOVER 12 8 ONLINE 13 9 ONLINE 14 10 ONLINE 15 11 RECOVER 16 12 ONLINE 17 13 RECOVER 18 14 RECOVER 19 15 RECOVER 20 16 RECOVER
文件中出现了大量的recover的状态,需要进行介质恢复。
1 SQL> select file#, status, fuzzy, checkpoint_time, checkpoint_change#, 2 resetlogs_change#, resetlogs_time from v$datafile_header where file#=5; 3 4 FILE# STATUS FUZZY CHECKPOINT_TIME CHECKPOINT_CHANGE# RESETLOGS_CHANGE# RESETLOGS_TIME 5 ---------- ------- ----- --------------- ------------------ ----------------- -------------- 6 5 OFFLINE YES 2020-3-08 9:52: 38391683 940976 2020-3-08 19:1
当前的数据文件的SCN号为 38391683,需要寻找别这个高的archive log 或redo log。
1 SQL> Select sequence#,name,first_change#,next_change# from v$archived_log; 2 3 SEQUENCE# NAME FIRST_CHANGE# NEXT_CHANGE# 4 ---------- ------------------------------------------------ ------------- ------------ 5 465 xxxxxxx/ARC0000000465_0815512562.0001 36366097 36618224 6 466 xxxxxxx/ARC0000000466_0815512562.0001 36618224 36843775 7 467 xxxxxxx/ARC0000000467_0815512562.0001 36843775 37065721 8 468 xxxxxxx/ARC0000000468_0815512562.0001 37065721 37294978 9 469 xxxxxxx/ARC0000000469_0815512562.0001 37294978 37572830 10 470 xxxxxxx/ARC0000000470_0815512562.0001 37572830 37818186 11 471 xxxxxxx/ARC0000000471_0815512562.0001 37818186 38093499 12 472 xxxxxxx/ARC0000000472_0815512562.0001 38093499 38346397 13 473 xxxxxxx/ARC0000000473_0815512562.0001 38346397 38381157
很幸运,38391683大于473这个最大的archive log 的SCN,我不需archive log 的帮助。recover所需的信息在redo log 中。
例如:数据文件file_id为5的处于recover状态,执行
alter database recover datafile 5;
依次恢复状态为recover的数据文件。
再次查看online_status为offline状态,需要执行
Alter database datafile 5 online;
依次将处于offline的数据文件ONLINE。都online后数据库处于open状态了后,就可以用了。
如果数据库处于No Archive log 状态的时候,recover所需的信息只能从redo log 中获取,如果此时的redo log被overwrite了,将不能online数据文件,那只能想其他方法了。
Possible causes and solutions summary:
=====================================
A. Tablespace or Datafile offline.
B. Datafile does not exist at the OS level.
C. Datafile locked by Backup Software.
D. Incorrectly set ULIMIT on UNIX.
E. Rollback Segment with active transactions is unavailable
F. Possible Other Causes.
以上是关于ORA-00376:file x cannot be read at this time的主要内容,如果未能解决你的问题,请参考以下文章
启动报错:ORA-00376:file x cannot be read at this time
error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
运行 jcontrol 报 libXext.so.6: cannot open shared object file 错误
解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file(示例