ITPub博客

首页 > 数据库 > 数据库开发技术 > 处于热备份模式下shutdown abort之后db的恢复

处于热备份模式下shutdown abort之后db的恢复

原创 数据库开发技术 作者:warehouse 时间:2012-12-16 16:03:59 0 删除 编辑

前几天群里的一个哥们说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博客 ” ,链接:https://blog.itpub.net/19602/viewspace-1059930/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-07

  • 博文量
    717
  • 访问量
    5366215