[Oracle] oracle报错ora01113,ORA-01110尝试恢复数据库,又报错ORA-00279,ORA-00289,ORA-00280


本文总阅读量

1、数据库服务器异常宕机,之后重启数据库出现如下报错

1
2
3
4
5
6
7
8
9
10
11
16:55:28 SYS@ boston> startup;
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size 2253664 bytes
Variable Size 587205792 bytes
Database Buffers 1006632960 bytes
Redo Buffers 7319552 bytes
Database mounted.
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/home/oracle/test11101.dbf'

2、先将数据文件offline

1
2
3
16:55:42 SYS@ boston> alter database datafile '/home/oracle/test11101.dbf' offline;
Database altered.
Elapsed: 00:00:00.11

3、尝试恢复数据文件,报错

1
2
3
4
5
6
7
8
16:57:47 SYS@ boston> alter database recover datafile '/home/oracle/test11101.dbf';
alter database recover datafile '/home/oracle/test11101.dbf'
*
ERROR at line 1:
ORA-00279: change 55845310493 generated at 06/25/2019 11:00:37 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc
ORA-00280: change 55845310493 for thread 1 is in sequence #491
Elapsed: 00:00:00.20

4、根据提示,使用logfile文件修复数据库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
17:04:09 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc'
*
ERROR at line 1:
ORA-00279: change 55845334483 generated at 07/02/2019 15:46:11 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc
ORA-00280: change 55845334483 for thread 1 is in sequence #492

Elapsed: 00:00:00.14
17:11:25 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc'
*
ERROR at line 1:
ORA-00279: change 55845337765 generated at 07/02/2019 16:16:14 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc
ORA-00280: change 55845337765 for thread 1 is in sequence #493

Elapsed: 00:00:00.23
17:12:04 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc';
ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc'
*
ERROR at line 1:
ORA-00279: change 55845337802 generated at 07/02/2019 16:16:19 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc
ORA-00280: change 55845337802 for thread 1 is in sequence #494

Elapsed: 00:00:00.21
17:14:50 SYS@ boston> ALTER DATABASE RECOVER LOGFILE '/data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc';

Database altered.

Elapsed: 00:00:00.47
17:15:13 SYS@ boston> alter database datafile '/home/oracle/test11101.dbf' online;

Database altered.

5、至此test11101.dbf数据文件修复完成,尝试打开数据库

1
2
3
4
5
6
7
8

17:15:43 SYS@ boston> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 7 needs media recovery
ORA-01110: data file 7: '/home/oracle/zeven01.dbf'
Elapsed: 00:00:00.16

6、提示另一个数据文件也需要恢复

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
17:15:52 SYS@ boston> recover databases;
ORA-00905: missing keyword

17:16:05 SYS@ boston> recover database;(这里选择让auto修复数据库)
ORA-00279: change 55845310493 generated at 06/25/2019 11:00:37 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_491_gkp2y4ok_.arc
ORA-00280: change 55845310493 for thread 1 is in sequence #491

17:19:35 Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 55845334483 generated at 07/02/2019 15:46:11 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_492_gkp4ph5t_.arc
ORA-00280: change 55845334483 for thread 1 is in sequence #492

ORA-00279: change 55845337765 generated at 07/02/2019 16:16:14 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_493_gkp4pn61_.arc
ORA-00280: change 55845337765 for thread 1 is in sequence #493

ORA-00279: change 55845337802 generated at 07/02/2019 16:16:19 needed for thread 1
ORA-00289: suggestion : /data/u01/app/oracle/fast_recovery_area/BOSTON/archivelog/2019_07_02/o1_mf_1_494_gkp4q3b5_.arc
ORA-00280: change 55845337802 for thread 1 is in sequence #494

Log applied.
Media recovery complete.
oracle修复数据库完成,打开数据库
17:20:02 SYS@ boston> alter database open;

Database altered.

7、查看数据文件和表空间均已正常

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
17:21:57 SYS@ boston> select file_name,status from dba_data_files;
FILE_NAME STATUS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------
/data/u01/app/oracle/oradata/boston/users01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/undotbs01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/sysaux01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/system01.dbf AVAILABLE
/data/u01/app/oracle/oradata/boston/test001.dbf AVAILABLE
/home/oracle/test11101.dbf AVAILABLE
/home/oracle/zeven01.dbf AVAILABLE
7 rows selected.
Elapsed: 00:00:00.04

17:22:21 SYS@ boston> select tablespace_name,status from dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------ ---------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
USERS ONLINE
TEST ONLINE
TEST11 ONLINE
ZEVEN ONLINE
8 rows selected.
Elapsed: 00:00:00.03
17:22:59 SYS@ boston>
目录
  1. 1. 1、数据库服务器异常宕机,之后重启数据库出现如下报错
  2. 2. 2、先将数据文件offline
  3. 3. 3、尝试恢复数据文件,报错
  4. 4. 4、根据提示,使用logfile文件修复数据库
  5. 5. 5、至此test11101.dbf数据文件修复完成,尝试打开数据库
  6. 6. 6、提示另一个数据文件也需要恢复
  7. 7. 7、查看数据文件和表空间均已正常

Proudly powered by Hexo and Theme by Lap
本站访客数人次
© 2020 zeven0707's blog