前几天群里的一个哥们说db在处于begin backup模式shutdown之后起不来了,今天讲备份恢复顺道测试了一下,发现还是可以起来的,但是生产环境的话还是要注意,最好不要这么做。
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>
本文URL地址:http://www.bianceng.cn/database/Oracle/201410/45567.htm
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>