FILE# CHECKPOINT_CHANGE# LAST_CHANGE#
---------- ------------------ ------------
1 879275
2 879275
3 879275
4 879275
5 879352
SQL> select file#,checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 879275
2 879275
3 879275
4 879275
5 879352
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
879275
明白了问题,修复就很容易了,果断结束热备份。
SQL> alter tablespace data end backup;
Tablespace altered.
SQL> select file#,checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 879275
2 879275
3 879275
4 879275
5 879352
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
879275
这个时候启动数据库就没有问题了。
SQL> alter database open;
Database altered.
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
899361
SQL> select file#,checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 899361
2 899361
3 899361
4 899361
5 899361
其实热备份的这个错误也可以这么来处理。
SQL> alter tablespace data begin backup;
Tablespace altered.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1261564 bytes
Variable Size 163577860 bytes
Database Buffers 142606336 bytes
Redo Buffers 7127040 bytes
Database mounted.
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/u02/oracle/oradata/data02.dbf'
SQL> recover datafile 5;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL> select *from v$backup;
FILE# STATUS CHANGE# TIME
---------- ------------------ ---------- ---------
1 NOT ACTIVE 0
2 NOT ACTIVE 0
3 NOT ACTIVE 0
4 NOT ACTIVE 0
5 NOT ACTIVE 899488 20-JUL-15
总之解决问题就行,SCN的部分着实是需要关注的一个重点,这也是备份恢复的基石。