處於熱備份模式下shutdown abort之後db的恢復

warehouse發表於2012-12-16

前幾天群裡的一個哥們說db在處於begin backup模式shutdown之後起不來了,今天講備份恢復順道測試了一下,發現還是可以起來的,但是生產環境的話還是要注意,最好不要這麼做。

[@more@]

SQL> alter tablespace users begin backup;

Tablespace altered.

SQL> shutdown immediate
ORA-01149: cannot shutdown - file 4 has online backup set
ORA-01110: data file 4: 'E:ORACLEORADATATESTUSERS01.DBF'
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size 1379384 bytes
Variable Size 901776328 bytes
Database Buffers 163577856 bytes
Redo Buffers 4599808 bytes
Database mounted.
ORA-10873: file 4 needs to be either taken out of backup mode or media
recovered
ORA-01110: data file 4: 'E:ORACLEORADATATESTUSERS01.DBF'


SQL> select status from v$instance;

STATUS
------------------------
MOUNTED

SQL> select file#,checkpoint_change# from v$datafile;

FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 6277229
2 6277229
4 6277333
5 6277229

SQL>
SQL> select file#,checkpoint_change# from v$datafile_header;

FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 6277229
2 6277229
4 6277333
5 6277229

--這裡的狀態是UNKNOWN ERROR

SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME
---------- ------------------------------------ ---------- ------------
1 UNKNOWN ERROR 6277229 16-DEC-12
2 UNKNOWN ERROR 6277229 16-DEC-12
4 ACTIVE 6277333 16-DEC-12
5 NOT ACTIVE 6277229 16-DEC-12

SQL> alter tablespace users end backup;

Tablespace altered.

SQL> select status from v$instance;

STATUS
------------------------
MOUNTED

SQL> select * from v$backup;

FILE# STATUS CHANGE# TIME
---------- ------------------------------------ ---------- ------------
1 NOT ACTIVE 6277229 16-DEC-12
2 NOT ACTIVE 6277229 16-DEC-12
4 NOT ACTIVE 6277333 16-DEC-12
5 NOT ACTIVE 6277229 16-DEC-12

SQL> select file#,checkpoint_change# from v$datafile;

FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 6277229
2 6277229
4 6277333
5 6277229

SQL> select file#,checkpoint_change# from v$datafile_header;

FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 6277229
2 6277229
4 6277333
5 6277229

SQL> alter database open;

Database altered.

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1059930/,如需轉載,請註明出處,否則將追究法律責任。

相關文章